From cd8d4d141ccbee5ee81f764e4ebe466f94044bef Mon Sep 17 00:00:00 2001 From: Adrian Dobrita Date: Mon, 20 Jan 2025 13:52:46 +0200 Subject: [PATCH 1/4] add is start of epoch flag on proof --- data/block/blockV2.pb.go | 154 +++++++++++++++++++++++++-------------- data/block/blockV2.proto | 1 + data/interface.go | 1 + 3 files changed, 103 insertions(+), 53 deletions(-) diff --git a/data/block/blockV2.pb.go b/data/block/blockV2.pb.go index 47a98846..a6bb28f7 100644 --- a/data/block/blockV2.pb.go +++ b/data/block/blockV2.pb.go @@ -243,6 +243,7 @@ type HeaderProof struct { HeaderNonce uint64 `protobuf:"varint,5,opt,name=HeaderNonce,proto3" json:"headerNonce"` HeaderShardId uint32 `protobuf:"varint,6,opt,name=HeaderShardId,proto3" json:"headerShardId"` HeaderRound uint64 `protobuf:"varint,7,opt,name=HeaderRound,proto3" json:"headerRound"` + IsStartOfEpoch bool `protobuf:"varint,8,opt,name=IsStartOfEpoch,proto3" json:"startOfEpoch"` } func (m *HeaderProof) Reset() { *m = HeaderProof{} } @@ -322,6 +323,13 @@ func (m *HeaderProof) GetHeaderRound() uint64 { return 0 } +func (m *HeaderProof) GetIsStartOfEpoch() bool { + if m != nil { + return m.IsStartOfEpoch + } + return false +} + func init() { proto.RegisterType((*HeaderV2)(nil), "proto.HeaderV2") proto.RegisterType((*MiniBlockReserved)(nil), "proto.MiniBlockReserved") @@ -332,58 +340,60 @@ func init() { func init() { proto.RegisterFile("blockV2.proto", fileDescriptor_17a3844aa051366e) } var fileDescriptor_17a3844aa051366e = []byte{ - // 814 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcb, 0x6e, 0xdb, 0x46, - 0x14, 0x15, 0x13, 0xcb, 0x4d, 0xc7, 0x51, 0x1a, 0x8f, 0x1f, 0x62, 0x1d, 0x80, 0x14, 0xb4, 0xf2, - 0xa2, 0x92, 0x50,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xb8, 0xca, 0x2c, - 0xe3, 0xbf, 0xcc, 0x32, 0xfe, 0xcf, 0xac, 0xca, 0xdb, 0xcc, 0x32, 0x7e, 0xbd, 0xb1, 0x2a, 0x97, - 0x37, 0x56, 0xe5, 0xea, 0xc6, 0xaa, 0xfc, 0x50, 0x55, 0x3f, 0x87, 0xc3, 0x5d, 0xd5, 0xa9, 0x9f, - 0xbd, 0x0b, 0x00, 0x00, 0xff, 0xff, 0xe9, 0xe9, 0xee, 0xbf, 0x63, 0x07, 0x00, 0x00, + // 839 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x6e, 0x23, 0x35, + 0x18, 0xcf, 0xec, 0x36, 0xa5, 0xb8, 0x4d, 0x69, 0xdd, 0x7f, 0xa1, 0x2b, 0x8d, 0xab, 0x9c, 0x7a, + 0xa0, 0x89, 0x28, 0x12, 0x20, 0xed, 0x01, 0x76, 0xa0, 0xcb, 0x46, 0xec, 0x6e, 0x23, 0xa7, 0xec, + 0x01, 0x89, 0x83, 0x33, 0xe3, 0xcc, 0x58, 0x64, 0xc6, 0x91, 0xed, 0x89, 0x52, 0x4e, 0x3c, 0x02, + 0x2f, 0xb1, 0x12, 0x82, 0x17, 0xe0, 0x11, 0x38, 0x80, 0xd4, 0x63, 0x4f, 0x03, 0x9d, 0x5e, 0xd0, + 0x9c, 0xf6, 0x11, 0xd0, 0xd8, 0x69, 0x32, 0x69, 0x26, 0xc7, 0x9e, 0x62, 0x7f, 0xbf, 0xdf, 0xef, + 0xf3, 0xcf, 0x5f, 0xbe, 0xcf, 0x03, 0x6a, 0xbd, 0x01, 0x77, 0x7f, 0x7c, 0x73, 0xda, 0x1c, 0x0a, + 0xae, 0x38, 0xac, 0xea, 0x9f, 0xc3, 0x13, 0x9f, 0xa9, 0x20, 0xee, 0x35, 0x5d, 0x1e, 0xb6, 0x7c, + 0xee, 0xf3, 0x96,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74, 0x44, 0x07, 0x7c, 0x48, 0x85, 0xf6, 0xba, + 0xa2, 0xbd, 0x86, 0x59, 0x82, 0x8e, 0x64, 0x29, 0xe3, 0x21, 0x9c, 0x2e, 0x31, 0x03, 0x5f, 0x82, + 0xdd, 0x29, 0xf2, 0x0d, 0x91, 0x1d, 0xc1, 0x47, 0xcc, 0xa3, 0x5e, 0xbd, 0x7a, 0x64, 0x1d, 0xaf, + 0x38, 0xf5, 0x2c, 0x41, 0xbb, 0xb2, 0x04, 0xc7, 0xa5, 0x2a, 0x78, 0x0e, 0xf6, 0xe6, 0xe2, 0x34, + 0x22, 0x03, 0xf6, 0x13, 0xf5, 0xea, 0xab, 0x3a, 0xdd, 0x87, 0x59, 0x82, 0xf6, 0x64, 0x19, 0x01, + 0x97, 0xeb, 0xee, 0xdb, 0xc3, 0xb4, 0x1f, 0x47, 0xb9, 0xbd, 0xf7, 0xca, 0xed, 0xdd, 0xe1, 0xb8, + 0x54, 0x05, 0x7f, 0x00, 0x3b, 0x1d, 0x41, 0x47, 0x8c, 0xc7, 0xd2, 0xf4, 0x68, 0x47, 0x70, 0xde, + 0xaf, 0xaf, 0xe9, 0xde, 0x86, 0x73, 0xbd, 0xad, 0x11, 0xe7, 0x20, 0x4b, 0xd0, 0xce, 0x70, 0x51, + 0x82, 0xcb, 0xf2, 0x34, 0xde, 0x5a, 0x60, 0xfb, 0x15, 0x8b, 0x98, 0x93, 0x8f, 0x13, 0xa6, 0x92, + 0x8a, 0x11, 0xf5, 0xe0, 0x6b, 0x50, 0x3b, 0x1b, 0x53, 0x37, 0x56, 0x8c, 0x47, 0x17, 0x97, 0x43, + 0xaa, 0x47, 0x69, 0xf3, 0x74, 0x6f, 0x72, 0x5c, 0x47, 0x70, 0x97, 0x4a, 0xc9, 0x22, 0x3f, 0x07, + 0x9d, 0xed, 0x2c, 0x41, 0x35, 0x5a, 0xe4, 0xe3, 0x79, 0x39, 0xfc, 0x12, 0x6c, 0x5d, 0x08, 0x12, + 0x49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e4, 0x6e, 0xa0, 0x8b, 0x51, 0x73, 0x3e, 0xc8, 0x12, 0xb4, 0x1e, + 0xcc, 0xc2, 0xb8, 0xc8, 0x99, 0x49, 0x5e, 0xf3, 0xc8, 0xa5, 0x93, 0x07, 0xa3, 0x20, 0xd1, 0x61, + 0x5c, 0xe4, 0xe4, 0x95, 0x31, 0xdb, 0x6e, 0x40, 0x84, 0xd7, 0x36, 0xcf, 0x42, 0xcd, 0x54, 0x26, + 0x28, 0x02, 0x78, 0x9e, 0x37, 0x3b, 0x0b, 0xf3, 0x38, 0xba, 0x9b, 0xfe, 0xc2, 0x59, 0x3a, 0x8c, + 0x8b, 0x1c, 0xf8, 0x39, 0xd8, 0x6c, 0xcb, 0xae, 0x22, 0x42, 0x9d, 0xf7, 0xcd, 0xa5, 0xf2, 0x31, + 0x5f, 0x73, 0xb6, 0xb2, 0x04, 0x6d, 0xc8, 0x42, 0x1c, 0xdf, 0xe3, 0x39, 0x5f, 0x5c, 0xdd, 0xd8, + 0x95, 0xeb, 0x1b, 0xbb, 0xf2, 0xee, 0xc6, 0xb6, 0x7e, 0x4e, 0x6d, 0xeb, 0xd7, 0xd4, 0xb6, 0xfe, + 0x4c, 0x6d, 0xeb, 0x2a, 0xb5, 0xad, 0xeb, 0xd4, 0xb6, 0xfe, 0x4d, 0x6d, 0xeb, 0xbf, 0xd4, 0xae, + 0xbc, 0x4b, 0x6d, 0xeb, 0x97, 0x5b, 0xbb, 0x72, 0x75, 0x6b, 0x57, 0xae, 0x6f, 0xed, 0xca, 0xf7, + 0x55, 0xfd, 0x21, 0xed, 0xad, 0xea, 0x1e, 0xff, 0xe4, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0xca, + 0x21, 0x04, 0x2d, 0x9d, 0x07, 0x00, 0x00, } func (this *HeaderV2) Equal(that interface{}) bool { @@ -537,6 +547,9 @@ func (this *HeaderProof) Equal(that interface{}) bool { if this.HeaderRound != that1.HeaderRound { return false } + if this.IsStartOfEpoch != that1.IsStartOfEpoch { + return false + } return true } func (this *HeaderV2) GoString() string { @@ -588,7 +601,7 @@ func (this *HeaderProof) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 11) + s := make([]string, 0, 12) s = append(s, "&block.HeaderProof{") s = append(s, "PubKeysBitmap: "+fmt.Sprintf("%#v", this.PubKeysBitmap)+",\n") s = append(s, "AggregatedSignature: "+fmt.Sprintf("%#v", this.AggregatedSignature)+",\n") @@ -597,6 +610,7 @@ func (this *HeaderProof) GoString() string { s = append(s, "HeaderNonce: "+fmt.Sprintf("%#v", this.HeaderNonce)+",\n") s = append(s, "HeaderShardId: "+fmt.Sprintf("%#v", this.HeaderShardId)+",\n") s = append(s, "HeaderRound: "+fmt.Sprintf("%#v", this.HeaderRound)+",\n") + s = append(s, "IsStartOfEpoch: "+fmt.Sprintf("%#v", this.IsStartOfEpoch)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -797,6 +811,16 @@ func (m *HeaderProof) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.IsStartOfEpoch { + i-- + if m.IsStartOfEpoch { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } if m.HeaderRound != 0 { i = encodeVarintBlockV2(dAtA, i, uint64(m.HeaderRound)) i-- @@ -959,6 +983,9 @@ func (m *HeaderProof) Size() (n int) { if m.HeaderRound != 0 { n += 1 + sovBlockV2(uint64(m.HeaderRound)) } + if m.IsStartOfEpoch { + n += 2 + } return n } @@ -1021,6 +1048,7 @@ func (this *HeaderProof) String() string { `HeaderNonce:` + fmt.Sprintf("%v", this.HeaderNonce) + `,`, `HeaderShardId:` + fmt.Sprintf("%v", this.HeaderShardId) + `,`, `HeaderRound:` + fmt.Sprintf("%v", this.HeaderRound) + `,`, + `IsStartOfEpoch:` + fmt.Sprintf("%v", this.IsStartOfEpoch) + `,`, `}`, }, "") return s @@ -1767,6 +1795,26 @@ func (m *HeaderProof) Unmarshal(dAtA []byte) error { break } } + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsStartOfEpoch", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockV2 + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsStartOfEpoch = bool(v != 0) default: iNdEx = preIndex skippy, err := skipBlockV2(dAtA[iNdEx:]) diff --git a/data/block/blockV2.proto b/data/block/blockV2.proto index b9831636..9e966241 100644 --- a/data/block/blockV2.proto +++ b/data/block/blockV2.proto @@ -42,4 +42,5 @@ message HeaderProof { uint64 HeaderNonce = 5 [(gogoproto.jsontag) = "headerNonce"]; uint32 HeaderShardId = 6 [(gogoproto.jsontag) = "headerShardId"]; uint64 HeaderRound = 7 [(gogoproto.jsontag) = "headerRound"]; + bool IsStartOfEpoch = 8 [(gogoproto.jsontag) = "startOfEpoch"]; } diff --git a/data/interface.go b/data/interface.go index 5120dc9c..f6b09d32 100644 --- a/data/interface.go +++ b/data/interface.go @@ -97,6 +97,7 @@ type HeaderProofHandler interface { GetHeaderNonce() uint64 GetHeaderShardId() uint32 GetHeaderRound() uint64 + GetIsStartOfEpoch() bool } // ShardHeaderHandler defines getters and setters for the shard block header From 6f987e7619792372707dc604127ea8199d714365 Mon Sep 17 00:00:00 2001 From: Adrian Dobrita Date: Mon, 20 Jan 2025 13:54:27 +0200 Subject: [PATCH 2/4] update json tag --- data/block/blockV2.pb.go | 108 +++++++++++++++++++-------------------- data/block/blockV2.proto | 2 +- 2 files changed, 55 insertions(+), 55 deletions(-) diff --git a/data/block/blockV2.pb.go b/data/block/blockV2.pb.go index a6bb28f7..2efc8177 100644 --- a/data/block/blockV2.pb.go +++ b/data/block/blockV2.pb.go @@ -243,7 +243,7 @@ type HeaderProof struct { HeaderNonce uint64 `protobuf:"varint,5,opt,name=HeaderNonce,proto3" json:"headerNonce"` HeaderShardId uint32 `protobuf:"varint,6,opt,name=HeaderShardId,proto3" json:"headerShardId"` HeaderRound uint64 `protobuf:"varint,7,opt,name=HeaderRound,proto3" json:"headerRound"` - IsStartOfEpoch bool `protobuf:"varint,8,opt,name=IsStartOfEpoch,proto3" json:"startOfEpoch"` + IsStartOfEpoch bool `protobuf:"varint,8,opt,name=IsStartOfEpoch,proto3" json:"isStartOfEpoch"` } func (m *HeaderProof) Reset() { *m = HeaderProof{} } @@ -341,59 +341,59 @@ func init() { proto.RegisterFile("blockV2.proto", fileDescriptor_17a3844aa051366 var fileDescriptor_17a3844aa051366e = []byte{ // 839 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0xcf, 0x6e, 0x23, 0x35, - 0x18, 0xcf, 0xec, 0x36, 0xa5, 0xb8, 0x4d, 0x69, 0xdd, 0x7f, 0xa1, 0x2b, 0x8d, 0xab, 0x9c, 0x7a, - 0xa0, 0x89, 0x28, 0x12, 0x20, 0xed, 0x01, 0x76, 0xa0, 0xcb, 0x46, 0xec, 0x6e, 0x23, 0xa7, 0xec, - 0x01, 0x89, 0x83, 0x33, 0xe3, 0xcc, 0x58, 0x64, 0xc6, 0x91, 0xed, 0x89, 0x52, 0x4e, 0x3c, 0x02, - 0x2f, 0xb1, 0x12, 0x82, 0x17, 0xe0, 0x11, 0x38, 0x80, 0xd4, 0x63, 0x4f, 0x03, 0x9d, 0x5e, 0xd0, - 0x9c, 0xf6, 0x11, 0xd0, 0xd8, 0x69, 0x32, 0x69, 0x26, 0xc7, 0x9e, 0x62, 0x7f, 0xbf, 0xdf, 0xef, - 0xf3, 0xcf, 0x5f, 0xbe, 0xcf, 0x03, 0x6a, 0xbd, 0x01, 0x77, 0x7f, 0x7c, 0x73, 0xda, 0x1c, 0x0a, - 0xae, 0x38, 0xac, 0xea, 0x9f, 0xc3, 0x13, 0x9f, 0xa9, 0x20, 0xee, 0x35, 0x5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 0xad, 0x05, 0xf6, 0xa7, 0xe0, 0xd7, 0x74, 0x44, 0x07, 0x7c, 0x48, 0x85, 0xf6, 0xba, - 0xa2, 0xbd, 0x86, 0x59, 0x82, 0x8e, 0x64, 0x29, 0xe3, 0x21, 0x9c, 0x2e, 0x31, 0x03, 0x5f, 0x82, - 0xdd, 0x29, 0xf2, 0x0d, 0x91, 0x1d, 0xc1, 0x47, 0xcc, 0xa3, 0x5e, 0xbd, 0x7a, 0x64, 0x1d, 0xaf, - 0x38, 0xf5, 0x2c, 0x41, 0xbb, 0xb2, 0x04, 0xc7, 0xa5, 0x2a, 0x78, 0x0e, 0xf6, 0xe6, 0xe2, 0x34, - 0x22, 0x03, 0xf6, 0x13, 0xf5, 0xea, 0xab, 0x3a, 0xdd, 0x87, 0x59, 0x82, 0xf6, 0x64, 0x19, 0x01, - 0x97, 0xeb, 0xee, 0xdb, 0xc3, 0xb4, 0x1f, 0x47, 0xb9, 0xbd, 0xf7, 0xca, 0xed, 0xdd, 0xe1, 0xb8, - 0x54, 0x05, 0x7f, 0x00, 0x3b, 0x1d, 0x41, 0x47, 0x8c, 0xc7, 0xd2, 0xf4, 0x68, 0x47, 0x70, 0xde, - 0xaf, 0xaf, 0xe9, 0xde, 0x86, 0x73, 0xbd, 0xad, 0x11, 0xe7, 0x20, 0x4b, 0xd0, 0xce, 0x70, 0x51, - 0x82, 0xcb, 0xf2, 0x34, 0xde, 0x5a, 0x60, 0xfb, 0x15, 0x8b, 0x98, 0x93, 0x8f, 0x13, 0xa6, 0x92, - 0x8a, 0x11, 0xf5, 0xe0, 0x6b, 0x50, 0x3b, 0x1b, 0x53, 0x37, 0x56, 0x8c, 0x47, 0x17, 0x97, 0x43, - 0xaa, 0x47, 0x69, 0xf3, 0x74, 0x6f, 0x72, 0x5c, 0x47, 0x70, 0x97, 0x4a, 0xc9, 0x22, 0x3f, 0x07, - 0x9d, 0xed, 0x2c, 0x41, 0x35, 0x5a, 0xe4, 0xe3, 0x79, 0x39, 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36, 0xfb, 0x6e, 0x40, 0xbd, 0x64, 0x44, 0x3d, 0xcc, 0xb9, 0x7a, 0x41, 0x64, 0xd0, 0x7c, + 0x70, 0x60, 0x1d, 0x3e, 0x72, 0x50, 0x9e, 0xa2, 0x27, 0xf2, 0x36, 0x58, 0xca, 0x71, 0x57, 0x09, + 0x7f, 0xb7, 0x40, 0x73, 0x16, 0x7d, 0xe6, 0xba, 0x49, 0x98, 0x8c, 0x88, 0xa2, 0xde, 0x73, 0x4a, + 0x65, 0xf3, 0xa1, 0x4e, 0xcb, 0xf3, 0x14, 0xb5, 0xe4, 0x12, 0xce, 0x3c, 0xfb, 0x6f, 0xff, 0xa0, + 0x93, 0x90, 0xa8, 0xa0, 0x33, 0x60, 0x7e, 0xbb, 0x1b, 0xa9, 0xa7, 0xa5, 0x72, 0x85, 0xc9, 0x48, + 0xb1, 0x31, 0x15, 0x72, 0xd2, 0x09, 0x27, 0x47, 0x6e, 0x40, 0x58, 0x74, 0xe4, 0x72, 0x41, 0x8f, + 0x7c, 0xde, 0xf1, 0x88, 0x22, 0x6d, 0x87, 0xf9, 0xdd, 0x48, 0x7d, 0x45, 0xa4, 0xa2, 0x02, 0x2f, + 0x35, 0x04, 0xdf, 0x5a, 0x60, 0x77, 0x06, 0x7e, 0x4d, 0xc7, 0x74, 0xc4, 0x63, 0x2a, 0xb4, 0xd7, + 0x15, 0xed, 0x35, 0xcc, 0x53, 0x74, 0x20, 0x2b, 0x19, 0xf7, 0xe1, 0x74, 0x89, 0x19, 0xf8, 0x12, + 0x6c, 0xcf, 0x90, 0x6f, 0x88, 0xec, 0x09, 0x3e, 0x66, 0x1e, 0xf5, 0x9a, 0xf5, 0x03, 0xeb, 0x70, + 0xc5, 0x69, 0xe6, 0x29, 0xda, 0x96, 0x15, 0x38, 0xae, 0x54, 0xc1, 0x53, 0xb0, 0xb3, 0x10, 0xa7, + 0x11, 0x19, 0xb1, 0x9f, 0xa8, 0xd7, 0x5c, 0xd5, 0xe9, 0x3e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0x57, 0xf6, 0x15, 0x11, 0xea, 0x74, 0x68, 0x2e, 0x55, 0x8c, + 0xf9, 0x9a, 0x03, 0xf3, 0x14, 0x6d, 0xb0, 0x05, 0x04, 0xdf, 0x62, 0x3a, 0x5f, 0x5c, 0x5c, 0xd9, + 0xb5, 0xcb, 0x2b, 0xbb, 0xf6, 0xee, 0xca, 0xb6, 0x7e, 0xce, 0x6c, 0xeb, 0xd7, 0xcc, 0xb6, 0xfe, + 0xcc, 0x6c, 0xeb, 0x22, 0xb3, 0xad, 0xcb, 0xcc, 0xb6, 0xfe, 0xcd, 0x6c, 0xeb, 0xbf, 0xcc, 0xae, + 0xbd, 0xcb, 0x6c, 0xeb, 0x97, 0x6b, 0xbb, 0x76, 0x71, 0x6d, 0xd7, 0x2e, 0xaf, 0xed, 0xda, 0xf7, + 0x75, 0xfd, 0x29, 0x1d, 0xac, 0xea, 0x2e, 0xff, 0xe4, 0xff, 0x00, 0x00, 0x00, 0xff, 0xff, 0x3d, + 0x2a, 0x16, 0x93, 0x9f, 0x07, 0x00, 0x00, } func (this *HeaderV2) Equal(that interface{}) bool { diff --git a/data/block/blockV2.proto b/data/block/blockV2.proto index 9e966241..0c00edff 100644 --- a/data/block/blockV2.proto +++ b/data/block/blockV2.proto @@ -42,5 +42,5 @@ message HeaderProof { uint64 HeaderNonce = 5 [(gogoproto.jsontag) = "headerNonce"]; uint32 HeaderShardId = 6 [(gogoproto.jsontag) = "headerShardId"]; uint64 HeaderRound = 7 [(gogoproto.jsontag) = "headerRound"]; - bool IsStartOfEpoch = 8 [(gogoproto.jsontag) = "startOfEpoch"]; + bool IsStartOfEpoch = 8 [(gogoproto.jsontag) = "isStartOfEpoch"]; } From a5fdb010d9ac77567935d6690a9d3102cc46ec77 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Tue, 21 Jan 2025 18:26:39 +0200 Subject: [PATCH 3/4] fix missing round set causing proof invalidation --- data/block/blockV2.go | 1 + 1 file changed, 1 insertion(+) diff --git a/data/block/blockV2.go b/data/block/blockV2.go index 727c296d..9f3a9e88 100644 --- a/data/block/blockV2.go +++ b/data/block/blockV2.go @@ -679,5 +679,6 @@ func (hv2 *HeaderV2) SetPreviousProof(proof data.HeaderProofHandler) { HeaderEpoch: proof.GetHeaderEpoch(), HeaderNonce: proof.GetHeaderNonce(), HeaderShardId: proof.GetHeaderShardId(), + HeaderRound: proof.GetHeaderRound(), } } From aa923d708278c1cb0e871620cca2615e585bae47 Mon Sep 17 00:00:00 2001 From: Sorin Stanculeanu Date: Wed, 22 Jan 2025 11:47:23 +0200 Subject: [PATCH 4/4] fix IsStartOfEpoch copying --- data/block/blockV2.go | 1 + data/block/metaBlock.go | 1 + data/block/metaBlock_test.go | 2 ++ data/block/shardDataHandler.go | 1 + 4 files changed, 5 insertions(+) diff --git a/data/block/blockV2.go b/data/block/blockV2.go index 9f3a9e88..2f688147 100644 --- a/data/block/blockV2.go +++ b/data/block/blockV2.go @@ -680,5 +680,6 @@ func (hv2 *HeaderV2) SetPreviousProof(proof data.HeaderProofHandler) { HeaderNonce: proof.GetHeaderNonce(), HeaderShardId: proof.GetHeaderShardId(), HeaderRound: proof.GetHeaderRound(), + IsStartOfEpoch: proof.GetIsStartOfEpoch(), } } diff --git a/data/block/metaBlock.go b/data/block/metaBlock.go index 86a02293..ed7531b2 100644 --- a/data/block/metaBlock.go +++ b/data/block/metaBlock.go @@ -582,5 +582,6 @@ func (m *MetaBlock) SetPreviousProof(proof data.HeaderProofHandler) { HeaderNonce: proof.GetHeaderNonce(), HeaderShardId: proof.GetHeaderShardId(), HeaderRound: proof.GetHeaderRound(), + IsStartOfEpoch: proof.GetIsStartOfEpoch(), } } diff --git a/data/block/metaBlock_test.go b/data/block/metaBlock_test.go index f362bfa6..7bf32edf 100644 --- a/data/block/metaBlock_test.go +++ b/data/block/metaBlock_test.go @@ -418,6 +418,7 @@ func TestMetaBlock2_GetPreviousProof(t *testing.T) { HeaderNonce: 234, HeaderShardId: 0, HeaderRound: 345, + IsStartOfEpoch: true, } metaBlock.SetPreviousProof(previousProof) @@ -430,4 +431,5 @@ func TestMetaBlock2_GetPreviousProof(t *testing.T) { require.Equal(t, previousProof.HeaderNonce, proof.GetHeaderNonce()) require.Equal(t, previousProof.HeaderShardId, proof.GetHeaderShardId()) require.Equal(t, previousProof.HeaderRound, proof.GetHeaderRound()) + require.Equal(t, previousProof.IsStartOfEpoch, proof.GetIsStartOfEpoch()) } diff --git a/data/block/shardDataHandler.go b/data/block/shardDataHandler.go index 8ff670dc..0ccdad0f 100644 --- a/data/block/shardDataHandler.go +++ b/data/block/shardDataHandler.go @@ -227,6 +227,7 @@ func (sd *ShardData) SetPreviousProof(proof data.HeaderProofHandler) error { HeaderNonce: proof.GetHeaderNonce(), HeaderShardId: proof.GetHeaderShardId(), HeaderRound: proof.GetHeaderRound(), + IsStartOfEpoch: proof.GetIsStartOfEpoch(), } return nil