Skip to content

Commit

Permalink
Add denunciations in block header
Browse files Browse the repository at this point in the history
  • Loading branch information
sydhds committed Apr 29, 2024
1 parent 20972cd commit fde0452
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
3 changes: 3 additions & 0 deletions proto/commons/massa/model/v1/block.proto
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package massa.model.v1;
import "google/protobuf/wrappers.proto";
import "massa/model/v1/endorsement.proto";
import "massa/model/v1/operation.proto";
import "massa/model/v1/denunciation.proto";
import "massa/model/v1/slot.proto";

option csharp_namespace = "Com.Massa.Model.v1";
Expand Down Expand Up @@ -48,6 +49,8 @@ message BlockHeader {
string operations_hash = 5;
// Signed endorsements
repeated SignedEndorsement endorsements = 6;
// Denunciations
repeated Denunciation denunciations = 7;
}

// Filled Operation Tuple
Expand Down
44 changes: 43 additions & 1 deletion proto/commons/massa/model/v1/denunciation.proto
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,48 @@ option php_namespace = "Com\\Massa\\Model\\V1";
option ruby_package = "Com::Massa::Model::V1";
option swift_prefix = "MMODEL";

message Denunciation {
// BlockHeaderDenunciation or EndorsementDenunciation
oneof entry {
// Denunciation block header
BlockHeaderDenunciation block_header = 1;
// Denunciation endorsement
EndorsementDenunciation endorsement = 2;
}
}

message BlockHeaderDenunciation {
// Denunciation public key
string public_key = 1;
// Denunciation slot
massa.model.v1.Slot slot = 2;
// Denunciation hash 1
string hash_1 = 3;
// Denunciation hash 2
string hash_2 = 4;
// Denunciation sig 1
string signature_1 = 5;
// Denunciation sig 2
string signature_2 = 6;
}

message EndorsementDenunciation {
// Denunciation public key
string public_key = 1;
// Denunciation slot
massa.model.v1.Slot slot = 2;
// Denunciation index
uint32 index = 3;
// Denunciation hash 1
string hash_1 = 4;
// Denunciation hash 2
string hash_2 = 5;
// Denunciation sig 1
string signature_1 = 6;
// Denunciation sig 2
string signature_2 = 7;
}

// Index for Denunciations in collections (e.g. like a HashMap...)
message DenunciationIndex {
// DenunciationBlockHeader or DenunciationEndorsement
Expand All @@ -28,7 +70,7 @@ message DenunciationIndex {

// Variant for Block header denunciation index
message DenunciationBlockHeader {
// Denounciation slot
// Denunciation slot
massa.model.v1.Slot slot = 1;
}

Expand Down

0 comments on commit fde0452

Please sign in to comment.