Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend block structure #354

Merged
merged 6 commits into from
Feb 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions data/api/apiBlock.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,20 @@ type Block struct {
EpochStartInfo *EpochStartInfo `json:"epochStartInfo,omitempty"`
EpochStartShardsData []*EpochStartShardData `json:"epochStartShardsData,omitempty"`
ScheduledData *ScheduledData `json:"scheduledData,omitempty"`
PreviousHeaderProof *HeaderProof `json:"previousHeaderProof,omitempty"`
Proof *HeaderProof `json:"proof,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how current proof will be used? when it will be set?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current proof will be set on the indexer block

}

// HeaderProof is a structure that hold information about header proof
type HeaderProof struct {
PubKeysBitmap string `json:"pubKeysBitmap,omitempty"`
AggregatedSignature string `json:"aggregatedSignature,omitempty"`
HeaderHash string `json:"headerHash,omitempty"`
HeaderEpoch uint32 `json:"headerEpoch,omitempty"`
HeaderNonce uint64 `json:"headerNonce,omitempty"`
HeaderShardId uint32 `json:"headerShardId,omitempty"`
HeaderRound uint64 `json:"headerRound,omitempty"`
IsStartOfEpoch bool `json:"isStartOfEpoch,omitempty"`
}

// ScheduledData is a structure that hold information about scheduled events
Expand Down
636 changes: 44 additions & 592 deletions data/block/blockV2.pb.go

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions data/block/blockV2.proto
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ option (gogoproto.stable_marshaler_all) = true;

import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "block.proto";
import "headerProof.proto";

// HeaderV2 extends the Header structure with extra fields for version 2
message HeaderV2 {
Expand All @@ -33,14 +34,3 @@ message MiniBlockHeaderReserved {
int32 IndexOfLastTxProcessed = 4 [(gogoproto.jsontag) = "indexOfLastTxProcessed"];
}

// HeaderProof defines a proof for a specific header
message HeaderProof {
bytes PubKeysBitmap = 1 [(gogoproto.jsontag) = "pubKeysBitmap"];
bytes AggregatedSignature = 2 [(gogoproto.jsontag) = "aggregatedSignature"];
bytes HeaderHash = 3 [(gogoproto.jsontag) = "headerHash"];
uint32 HeaderEpoch = 4 [(gogoproto.jsontag) = "headerEpoch"];
uint64 HeaderNonce = 5 [(gogoproto.jsontag) = "headerNonce"];
uint32 HeaderShardId = 6 [(gogoproto.jsontag) = "headerShardId"];
uint64 HeaderRound = 7 [(gogoproto.jsontag) = "headerRound"];
bool IsStartOfEpoch = 8 [(gogoproto.jsontag) = "isStartOfEpoch"];
}
2 changes: 2 additions & 0 deletions data/block/headerProof.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//go:generate protoc -I=. -I=$GOPATH/src -I=$GOPATH/src/github.com/multiversx/protobuf/protobuf --gogoslick_out=. headerProof.proto
package block
Loading