diff --git a/data/block/sovereignChainHeader.go b/data/block/sovereignChainHeader.go index 3887490c..a6b7d3c3 100644 --- a/data/block/sovereignChainHeader.go +++ b/data/block/sovereignChainHeader.go @@ -6,7 +6,6 @@ import ( "math/big" "github.com/multiversx/mx-chain-core-go/core" - "github.com/multiversx/mx-chain-core-go/core/check" "github.com/multiversx/mx-chain-core-go/data" "github.com/multiversx/mx-chain-core-go/data/headerVersionData" ) @@ -42,9 +41,9 @@ func (sch *SovereignChainHeader) ShallowClone() data.HeaderHandler { headerCopy := *sch headerCopy.Header = &internalHeaderCopy - if !check.IfNil(sch.OutGoingMiniBlockHeader) { - internalOutGoingMbHeader := *sch.OutGoingMiniBlockHeader - headerCopy.OutGoingMiniBlockHeader = &internalOutGoingMbHeader + if len(sch.OutGoingMiniBlockHeader) != 0 { + headerCopy.OutGoingMiniBlockHeader = make([]OutGoingMiniBlockHeader, len(sch.OutGoingMiniBlockHeader)) + copy(headerCopy.OutGoingMiniBlockHeader, sch.OutGoingMiniBlockHeader) } return &headerCopy @@ -549,33 +548,45 @@ func (sch *SovereignChainHeader) CheckFieldsForNil() error { return nil } -// GetOutGoingMiniBlockHeaderHandler returns the outgoing mini block header -func (sch *SovereignChainHeader) GetOutGoingMiniBlockHeaderHandler() data.OutGoingMiniBlockHeaderHandler { +// GetOutGoingMiniBlockHeaderHandlers returns the outgoing mini block headers +func (sch *SovereignChainHeader) GetOutGoingMiniBlockHeaderHandlers() []data.OutGoingMiniBlockHeaderHandler { if sch == nil { return nil } - return sch.GetOutGoingMiniBlockHeader() + mbHeaders := sch.GetOutGoingMiniBlockHeader() + mbHeaderHandlers := make([]data.OutGoingMiniBlockHeaderHandler, len(mbHeaders)) + + for i := range mbHeaders { + mbHeaderHandlers[i] = &mbHeaders[i] + } + + return mbHeaderHandlers } -// SetOutGoingMiniBlockHeaderHandler returns the outgoing mini block header -func (sch *SovereignChainHeader) SetOutGoingMiniBlockHeaderHandler(mbHeader data.OutGoingMiniBlockHeaderHandler) error { +// SetOutGoingMiniBlockHeaderHandlers returns the outgoing mini block headers +func (sch *SovereignChainHeader) SetOutGoingMiniBlockHeaderHandlers(mbHeaders []data.OutGoingMiniBlockHeaderHandler) error { if sch == nil { return data.ErrNilPointerReceiver } - if check.IfNil(mbHeader) { + if len(mbHeaders) == 0 { sch.OutGoingMiniBlockHeader = nil return nil } - sch.OutGoingMiniBlockHeader = &OutGoingMiniBlockHeader{ - Hash: mbHeader.GetHash(), - OutGoingOperationsHash: mbHeader.GetOutGoingOperationsHash(), - AggregatedSignatureOutGoingOperations: mbHeader.GetAggregatedSignatureOutGoingOperations(), - LeaderSignatureOutGoingOperations: mbHeader.GetLeaderSignatureOutGoingOperations(), + miniBlockHeaders := make([]OutGoingMiniBlockHeader, len(mbHeaders)) + for i, mbHeaderHandler := range mbHeaders { + miniBlockHeaders[i] = OutGoingMiniBlockHeader{ + OutGoingMBType: OutGoingMBType(mbHeaderHandler.GetOutGoingMBTypeInt32()), + Hash: mbHeaderHandler.GetHash(), + OutGoingOperationsHash: mbHeaderHandler.GetOutGoingOperationsHash(), + AggregatedSignatureOutGoingOperations: mbHeaderHandler.GetAggregatedSignatureOutGoingOperations(), + LeaderSignatureOutGoingOperations: mbHeaderHandler.GetLeaderSignatureOutGoingOperations(), + } } + sch.OutGoingMiniBlockHeader = miniBlockHeaders return nil } @@ -725,6 +736,24 @@ func (omb *OutGoingMiniBlockHeader) SetAggregatedSignatureOutGoingOperations(sig return nil } +func (omb *OutGoingMiniBlockHeader) GetOutGoingMBTypeInt32() int32 { + if omb == nil { + return 0 + } + + return int32(omb.OutGoingMBType) +} + +// SetOutGoingMBTypeInt32 sets the mb type +func (omb *OutGoingMiniBlockHeader) SetOutGoingMBTypeInt32(mbType int32) error { + if omb == nil { + return data.ErrNilPointerReceiver + } + + omb.OutGoingMBType = OutGoingMBType(mbType) + return nil +} + // IsInterfaceNil checks if the underlying interface is nil func (omb *OutGoingMiniBlockHeader) IsInterfaceNil() bool { return omb == nil diff --git a/data/block/sovereignChainHeader.pb.go b/data/block/sovereignChainHeader.pb.go index e282df49..1ab91dd4 100644 --- a/data/block/sovereignChainHeader.pb.go +++ b/data/block/sovereignChainHeader.pb.go @@ -14,6 +14,7 @@ import ( math_big "math/big" math_bits "math/bits" reflect "reflect" + strconv "strconv" strings "strings" ) @@ -28,6 +29,27 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +type OutGoingMBType int32 + +const ( + OutGoingTxMB OutGoingMBType = 0 + ChangeValidatorSetMB OutGoingMBType = 30 +) + +var OutGoingMBType_name = map[int32]string{ + 0: "OutGoingTxMB", + 30: "ChangeValidatorSetMB", +} + +var OutGoingMBType_value = map[string]int32{ + "OutGoingTxMB": 0, + "ChangeValidatorSetMB": 30, +} + +func (OutGoingMBType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_b9b8ff297a820152, []int{0} +} + // EpochStart holds the block information for end-of-epoch type EpochStartSovereign struct { Economics Economics `protobuf:"bytes,1,opt,name=Economics,proto3" json:"economics"` @@ -150,14 +172,14 @@ func (m *EpochStartCrossChainData) GetHeaderHash() []byte { // SovereignChainHeader extends the Header structure with extra fields needed by sovereign chain type SovereignChainHeader struct { - Header *Header `protobuf:"bytes,1,opt,name=Header,proto3" json:"header"` - ValidatorStatsRootHash []byte `protobuf:"bytes,2,opt,name=ValidatorStatsRootHash,proto3" json:"validatorStatsRootHash"` - ExtendedShardHeaderHashes [][]byte `protobuf:"bytes,3,rep,name=ExtendedShardHeaderHashes,proto3" json:"extendedShardHeaderHashes,omitempty"` - OutGoingMiniBlockHeader *OutGoingMiniBlockHeader `protobuf:"bytes,4,opt,name=OutGoingMiniBlockHeader,proto3" json:"outGoingOperations,omitempty"` - IsStartOfEpoch bool `protobuf:"varint,5,opt,name=IsStartOfEpoch,proto3" json:"isStartOfEpoch,omitempty"` - AccumulatedFeesInEpoch *math_big.Int `protobuf:"bytes,6,opt,name=AccumulatedFeesInEpoch,proto3,casttypewith=math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster" json:"accumulatedFeesInEpoch,omitempty"` - DevFeesInEpoch *math_big.Int `protobuf:"bytes,7,opt,name=DevFeesInEpoch,proto3,casttypewith=math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster" json:"devFeesInEpoch,omitempty"` - EpochStart EpochStartSovereign `protobuf:"bytes,8,opt,name=EpochStart,proto3" json:"epochStart,omitempty"` + Header *Header `protobuf:"bytes,1,opt,name=Header,proto3" json:"header"` + ValidatorStatsRootHash []byte `protobuf:"bytes,2,opt,name=ValidatorStatsRootHash,proto3" json:"validatorStatsRootHash"` + ExtendedShardHeaderHashes [][]byte `protobuf:"bytes,3,rep,name=ExtendedShardHeaderHashes,proto3" json:"extendedShardHeaderHashes,omitempty"` + OutGoingMiniBlockHeader []OutGoingMiniBlockHeader `protobuf:"bytes,4,rep,name=OutGoingMiniBlockHeader,proto3" json:"outGoingOperations,omitempty"` + IsStartOfEpoch bool `protobuf:"varint,5,opt,name=IsStartOfEpoch,proto3" json:"isStartOfEpoch,omitempty"` + AccumulatedFeesInEpoch *math_big.Int `protobuf:"bytes,6,opt,name=AccumulatedFeesInEpoch,proto3,casttypewith=math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster" json:"accumulatedFeesInEpoch,omitempty"` + DevFeesInEpoch *math_big.Int `protobuf:"bytes,7,opt,name=DevFeesInEpoch,proto3,casttypewith=math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster" json:"devFeesInEpoch,omitempty"` + EpochStart EpochStartSovereign `protobuf:"bytes,8,opt,name=EpochStart,proto3" json:"epochStart,omitempty"` } func (m *SovereignChainHeader) Reset() { *m = SovereignChainHeader{} } @@ -209,7 +231,7 @@ func (m *SovereignChainHeader) GetExtendedShardHeaderHashes() [][]byte { return nil } -func (m *SovereignChainHeader) GetOutGoingMiniBlockHeader() *OutGoingMiniBlockHeader { +func (m *SovereignChainHeader) GetOutGoingMiniBlockHeader() []OutGoingMiniBlockHeader { if m != nil { return m.OutGoingMiniBlockHeader } @@ -245,10 +267,11 @@ func (m *SovereignChainHeader) GetEpochStart() EpochStartSovereign { } type OutGoingMiniBlockHeader struct { - Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"hash,omitempty"` - OutGoingOperationsHash []byte `protobuf:"bytes,2,opt,name=OutGoingOperationsHash,proto3" json:"outGoingOperationsHash,omitempty"` - AggregatedSignatureOutGoingOperations []byte `protobuf:"bytes,3,opt,name=AggregatedSignatureOutGoingOperations,proto3" json:"aggregatedSignatureOutGoingOperations,omitempty"` - LeaderSignatureOutGoingOperations []byte `protobuf:"bytes,4,opt,name=LeaderSignatureOutGoingOperations,proto3" json:"leaderSignatureOutGoingOperations,omitempty"` + Hash []byte `protobuf:"bytes,1,opt,name=Hash,proto3" json:"hash,omitempty"` + OutGoingOperationsHash []byte `protobuf:"bytes,2,opt,name=OutGoingOperationsHash,proto3" json:"outGoingOperationsHash,omitempty"` + AggregatedSignatureOutGoingOperations []byte `protobuf:"bytes,3,opt,name=AggregatedSignatureOutGoingOperations,proto3" json:"aggregatedSignatureOutGoingOperations,omitempty"` + LeaderSignatureOutGoingOperations []byte `protobuf:"bytes,4,opt,name=LeaderSignatureOutGoingOperations,proto3" json:"leaderSignatureOutGoingOperations,omitempty"` + OutGoingMBType OutGoingMBType `protobuf:"varint,5,opt,name=OutGoingMBType,proto3,enum=proto.OutGoingMBType" json:"outGoingMBType,omitempty"` } func (m *OutGoingMiniBlockHeader) Reset() { *m = OutGoingMiniBlockHeader{} } @@ -307,7 +330,15 @@ func (m *OutGoingMiniBlockHeader) GetLeaderSignatureOutGoingOperations() []byte return nil } +func (m *OutGoingMiniBlockHeader) GetOutGoingMBType() OutGoingMBType { + if m != nil { + return m.OutGoingMBType + } + return OutGoingTxMB +} + func init() { + proto.RegisterEnum("proto.OutGoingMBType", OutGoingMBType_name, OutGoingMBType_value) proto.RegisterType((*EpochStartSovereign)(nil), "proto.EpochStartSovereign") proto.RegisterType((*EpochStartCrossChainData)(nil), "proto.EpochStartCrossChainData") proto.RegisterType((*SovereignChainHeader)(nil), "proto.SovereignChainHeader") @@ -317,61 +348,72 @@ func init() { func init() { proto.RegisterFile("sovereignChainHeader.proto", fileDescriptor_b9b8ff297a820152) } var fileDescriptor_b9b8ff297a820152 = []byte{ - // 821 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x4f, 0x8f, 0xdb, 0x44, - 0x14, 0xcf, 0xb0, 0x9b, 0xa4, 0x99, 0xb4, 0x0b, 0x0c, 0xab, 0x60, 0xa2, 0xad, 0x27, 0x04, 0x16, - 0x22, 0x41, 0x12, 0xd1, 0x5e, 0x90, 0x38, 0xa0, 0xf5, 0x26, 0xa5, 0x91, 0x0a, 0x91, 0x1c, 0x09, - 0x21, 0xc4, 0x65, 0x62, 0x4f, 0xed, 0x11, 0xb1, 0x27, 0xb2, 0xc7, 0xd1, 0x52, 0x09, 0x89, 0x2b, - 0x12, 0x48, 0x7c, 0x09, 0x24, 0xd4, 0x4f, 0xd2, 0xe3, 0x1e, 0x73, 0x32, 0xac, 0xf7, 0x00, 0xf2, - 0xa9, 0x1f, 0x01, 0x79, 0xec, 0xc4, 0xde, 0x6e, 0xbc, 0xed, 0xa5, 0xa7, 0x64, 0x7e, 0xef, 0xf7, - 0x7e, 0xef, 0xcf, 0xbc, 0x37, 0x86, 0x6d, 0x9f, 0xaf, 0xa8, 0x47, 0x99, 0xe5, 0x9e, 0xda, 0x84, - 0xb9, 0x0f, 0x29, 0x31, 0xa9, 0x37, 0x58, 0x7a, 0x5c, 0x70, 0x54, 0x95, 0x3f, 0xed, 0xbe, 0xc5, - 0x84, 0x1d, 0xcc, 0x07, 0x06, 0x77, 0x86, 0x16, 0xb7, 0xf8, 0x50, 0xc2, 0xf3, 0xe0, 0xb1, 0x3c, - 0xc9, 0x83, 0xfc, 0x97,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xf0, 0xf8, 0xc4, 0xb2, 0x3c, 0x6a, 0x25, 0xb7, 0x34, 0x63, 0x96, 0x4b, 0x44, - 0xe0, 0xd1, 0xeb, 0x6c, 0x65, 0x4f, 0x46, 0xbb, 0x1f, 0x87, 0x78, 0x48, 0x5e, 0xc5, 0xa1, 0x10, - 0xfc, 0xd5, 0x22, 0xa0, 0x9f, 0xe1, 0xfb, 0x8f, 0x64, 0x6f, 0x6e, 0x4a, 0x63, 0x5f, 0xa6, 0x31, - 0x8c, 0x43, 0xfc, 0xc9, 0xe2, 0x65, 0xe4, 0x42, 0x0a, 0x2f, 0x57, 0xd6, 0xbe, 0x3c, 0xbf, 0x50, - 0x2b, 0xeb, 0x0b, 0xb5, 0xf2, 0xfc, 0x42, 0x05, 0xbf, 0x44, 0x2a, 0xf8, 0x2b, 0x52, 0xc1, 0xb3, - 0x48, 0x05, 0xe7, 0x91, 0x0a, 0xd6, 0x91, 0x0a, 0xfe, 0x89, 0x54, 0xf0, 0x5f, 0xa4, 0x56, 0x9e, - 0x47, 0x2a, 0xf8, 0xe3, 0x52, 0xad, 0x9c, 0x5f, 0xaa, 0x95, 0xf5, 0xa5, 0x5a, 0xf9, 0xbe, 0x2a, - 0x3f, 0x95, 0xf3, 0x9a, 0x1c, 0x99, 0xfb, 0xff, 0x07, 0x00, 0x00, 0xff, 0xff, 0x70, 0xb9, 0xae, - 0xb8, 0x8c, 0x07, 0x00, 0x00, + // 886 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x55, 0x41, 0x6f, 0xe3, 0x44, + 0x14, 0xce, 0xd0, 0x24, 0xdd, 0x4e, 0xba, 0xa1, 0x0c, 0xa5, 0x98, 0xa8, 0xeb, 0x09, 0x65, 0x0b, + 0x11, 0xd0, 0x44, 0x74, 0x2f, 0x48, 0x20, 0xa1, 0xba, 0xed, 0xb2, 0x91, 0xb6, 0x54, 0x72, 0x56, +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xac, 0xb8, 0x9b, 0xf3, 0xec, 0x77, 0x3f, + 0xbe, 0x2a, 0x8e, 0xd6, 0xe0, 0xea, 0x14, 0x79, 0x74, 0x7a, 0x64, 0xac, 0x55, 0x90, 0x06, 0xd7, + 0xf7, 0x5d, 0xc2, 0x1d, 0x9a, 0x3f, 0x86, 0x54, 0x1e, 0x19, 0x6b, 0xba, 0xf1, 0xc9, 0xd9, 0x85, + 0x5e, 0x39, 0xbf, 0xd0, 0x2b, 0xcf, 0x2e, 0x74, 0xf0, 0x43, 0xa4, 0x83, 0xdf, 0x23, 0x1d, 0x3c, + 0x8d, 0x74, 0x70, 0x16, 0xe9, 0xe0, 0x3c, 0xd2, 0xc1, 0xdf, 0x91, 0x0e, 0xfe, 0x8d, 0xf4, 0xca, + 0xb3, 0x48, 0x07, 0xbf, 0x5e, 0xea, 0x95, 0xb3, 0x4b, 0xbd, 0x72, 0x7e, 0xa9, 0x57, 0xbe, 0xac, + 0xa9, 0x5f, 0xf2, 0x61, 0x5d, 0x95, 0x70, 0xef, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x66, 0x78, + 0xb4, 0x99, 0x2b, 0x08, 0x00, 0x00, +} + +func (x OutGoingMBType) String() string { + s, ok := OutGoingMBType_name[int32(x)] + if ok { + return s + } + return strconv.Itoa(int(x)) } - func (this *EpochStartSovereign) Equal(that interface{}) bool { if that == nil { return this == nil @@ -468,9 +510,14 @@ func (this *SovereignChainHeader) Equal(that interface{}) bool { return false } } - if !this.OutGoingMiniBlockHeader.Equal(that1.OutGoingMiniBlockHeader) { + if len(this.OutGoingMiniBlockHeader) != len(that1.OutGoingMiniBlockHeader) { return false } + for i := range this.OutGoingMiniBlockHeader { + if !this.OutGoingMiniBlockHeader[i].Equal(&that1.OutGoingMiniBlockHeader[i]) { + return false + } + } if this.IsStartOfEpoch != that1.IsStartOfEpoch { return false } @@ -522,6 +569,9 @@ func (this *OutGoingMiniBlockHeader) Equal(that interface{}) bool { if !bytes.Equal(this.LeaderSignatureOutGoingOperations, that1.LeaderSignatureOutGoingOperations) { return false } + if this.OutGoingMBType != that1.OutGoingMBType { + return false + } return true } func (this *EpochStartSovereign) GoString() string { @@ -561,7 +611,11 @@ func (this *SovereignChainHeader) GoString() string { s = append(s, "ValidatorStatsRootHash: "+fmt.Sprintf("%#v", this.ValidatorStatsRootHash)+",\n") s = append(s, "ExtendedShardHeaderHashes: "+fmt.Sprintf("%#v", this.ExtendedShardHeaderHashes)+",\n") if this.OutGoingMiniBlockHeader != nil { - s = append(s, "OutGoingMiniBlockHeader: "+fmt.Sprintf("%#v", this.OutGoingMiniBlockHeader)+",\n") + vs := make([]OutGoingMiniBlockHeader, len(this.OutGoingMiniBlockHeader)) + for i := range vs { + vs[i] = this.OutGoingMiniBlockHeader[i] + } + s = append(s, "OutGoingMiniBlockHeader: "+fmt.Sprintf("%#v", vs)+",\n") } s = append(s, "IsStartOfEpoch: "+fmt.Sprintf("%#v", this.IsStartOfEpoch)+",\n") s = append(s, "AccumulatedFeesInEpoch: "+fmt.Sprintf("%#v", this.AccumulatedFeesInEpoch)+",\n") @@ -574,12 +628,13 @@ func (this *OutGoingMiniBlockHeader) GoString() string { if this == nil { return "nil" } - s := make([]string, 0, 8) + s := make([]string, 0, 9) s = append(s, "&block.OutGoingMiniBlockHeader{") s = append(s, "Hash: "+fmt.Sprintf("%#v", this.Hash)+",\n") s = append(s, "OutGoingOperationsHash: "+fmt.Sprintf("%#v", this.OutGoingOperationsHash)+",\n") s = append(s, "AggregatedSignatureOutGoingOperations: "+fmt.Sprintf("%#v", this.AggregatedSignatureOutGoingOperations)+",\n") s = append(s, "LeaderSignatureOutGoingOperations: "+fmt.Sprintf("%#v", this.LeaderSignatureOutGoingOperations)+",\n") + s = append(s, "OutGoingMBType: "+fmt.Sprintf("%#v", this.OutGoingMBType)+",\n") s = append(s, "}") return strings.Join(s, "") } @@ -746,17 +801,19 @@ func (m *SovereignChainHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x28 } - if m.OutGoingMiniBlockHeader != nil { - { - size, err := m.OutGoingMiniBlockHeader.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err + if len(m.OutGoingMiniBlockHeader) > 0 { + for iNdEx := len(m.OutGoingMiniBlockHeader) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.OutGoingMiniBlockHeader[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSovereignChainHeader(dAtA, i, uint64(size)) } - i -= size - i = encodeVarintSovereignChainHeader(dAtA, i, uint64(size)) + i-- + dAtA[i] = 0x22 } - i-- - dAtA[i] = 0x22 } if len(m.ExtendedShardHeaderHashes) > 0 { for iNdEx := len(m.ExtendedShardHeaderHashes) - 1; iNdEx >= 0; iNdEx-- { @@ -809,6 +866,11 @@ func (m *OutGoingMiniBlockHeader) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l + if m.OutGoingMBType != 0 { + i = encodeVarintSovereignChainHeader(dAtA, i, uint64(m.OutGoingMBType)) + i-- + dAtA[i] = 0x28 + } if len(m.LeaderSignatureOutGoingOperations) > 0 { i -= len(m.LeaderSignatureOutGoingOperations) copy(dAtA[i:], m.LeaderSignatureOutGoingOperations) @@ -909,9 +971,11 @@ func (m *SovereignChainHeader) Size() (n int) { n += 1 + l + sovSovereignChainHeader(uint64(l)) } } - if m.OutGoingMiniBlockHeader != nil { - l = m.OutGoingMiniBlockHeader.Size() - n += 1 + l + sovSovereignChainHeader(uint64(l)) + if len(m.OutGoingMiniBlockHeader) > 0 { + for _, e := range m.OutGoingMiniBlockHeader { + l = e.Size() + n += 1 + l + sovSovereignChainHeader(uint64(l)) + } } if m.IsStartOfEpoch { n += 2 @@ -953,6 +1017,9 @@ func (m *OutGoingMiniBlockHeader) Size() (n int) { if l > 0 { n += 1 + l + sovSovereignChainHeader(uint64(l)) } + if m.OutGoingMBType != 0 { + n += 1 + sovSovereignChainHeader(uint64(m.OutGoingMBType)) + } return n } @@ -991,11 +1058,16 @@ func (this *SovereignChainHeader) String() string { if this == nil { return "nil" } + repeatedStringForOutGoingMiniBlockHeader := "[]OutGoingMiniBlockHeader{" + for _, f := range this.OutGoingMiniBlockHeader { + repeatedStringForOutGoingMiniBlockHeader += strings.Replace(strings.Replace(f.String(), "OutGoingMiniBlockHeader", "OutGoingMiniBlockHeader", 1), `&`, ``, 1) + "," + } + repeatedStringForOutGoingMiniBlockHeader += "}" s := strings.Join([]string{`&SovereignChainHeader{`, `Header:` + strings.Replace(fmt.Sprintf("%v", this.Header), "Header", "Header", 1) + `,`, `ValidatorStatsRootHash:` + fmt.Sprintf("%v", this.ValidatorStatsRootHash) + `,`, `ExtendedShardHeaderHashes:` + fmt.Sprintf("%v", this.ExtendedShardHeaderHashes) + `,`, - `OutGoingMiniBlockHeader:` + strings.Replace(this.OutGoingMiniBlockHeader.String(), "OutGoingMiniBlockHeader", "OutGoingMiniBlockHeader", 1) + `,`, + `OutGoingMiniBlockHeader:` + repeatedStringForOutGoingMiniBlockHeader + `,`, `IsStartOfEpoch:` + fmt.Sprintf("%v", this.IsStartOfEpoch) + `,`, `AccumulatedFeesInEpoch:` + fmt.Sprintf("%v", this.AccumulatedFeesInEpoch) + `,`, `DevFeesInEpoch:` + fmt.Sprintf("%v", this.DevFeesInEpoch) + `,`, @@ -1013,6 +1085,7 @@ func (this *OutGoingMiniBlockHeader) String() string { `OutGoingOperationsHash:` + fmt.Sprintf("%v", this.OutGoingOperationsHash) + `,`, `AggregatedSignatureOutGoingOperations:` + fmt.Sprintf("%v", this.AggregatedSignatureOutGoingOperations) + `,`, `LeaderSignatureOutGoingOperations:` + fmt.Sprintf("%v", this.LeaderSignatureOutGoingOperations) + `,`, + `OutGoingMBType:` + fmt.Sprintf("%v", this.OutGoingMBType) + `,`, `}`, }, "") return s @@ -1467,10 +1540,8 @@ func (m *SovereignChainHeader) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.OutGoingMiniBlockHeader == nil { - m.OutGoingMiniBlockHeader = &OutGoingMiniBlockHeader{} - } - if err := m.OutGoingMiniBlockHeader.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + m.OutGoingMiniBlockHeader = append(m.OutGoingMiniBlockHeader, OutGoingMiniBlockHeader{}) + if err := m.OutGoingMiniBlockHeader[len(m.OutGoingMiniBlockHeader)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } iNdEx = postIndex @@ -1792,6 +1863,25 @@ func (m *OutGoingMiniBlockHeader) Unmarshal(dAtA []byte) error { m.LeaderSignatureOutGoingOperations = []byte{} } iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field OutGoingMBType", wireType) + } + m.OutGoingMBType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSovereignChainHeader + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.OutGoingMBType |= OutGoingMBType(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipSovereignChainHeader(dAtA[iNdEx:]) diff --git a/data/block/sovereignChainHeader.proto b/data/block/sovereignChainHeader.proto index ad63cf56..4dd9fea5 100644 --- a/data/block/sovereignChainHeader.proto +++ b/data/block/sovereignChainHeader.proto @@ -27,19 +27,25 @@ message EpochStartCrossChainData { // SovereignChainHeader extends the Header structure with extra fields needed by sovereign chain message SovereignChainHeader { - Header Header = 1 [(gogoproto.jsontag) = "header"]; - bytes ValidatorStatsRootHash = 2 [(gogoproto.jsontag) = "validatorStatsRootHash"]; - repeated bytes ExtendedShardHeaderHashes = 3 [(gogoproto.jsontag) = "extendedShardHeaderHashes,omitempty"]; - OutGoingMiniBlockHeader OutGoingMiniBlockHeader = 4 [(gogoproto.jsontag) = "outGoingOperations,omitempty"]; - bool IsStartOfEpoch = 5 [(gogoproto.jsontag) = "isStartOfEpoch,omitempty"]; - bytes AccumulatedFeesInEpoch = 6 [(gogoproto.jsontag) = "accumulatedFeesInEpoch,omitempty", (gogoproto.casttypewith) = "math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster"]; - bytes DevFeesInEpoch = 7 [(gogoproto.jsontag) = "devFeesInEpoch,omitempty", (gogoproto.casttypewith) = "math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster"]; - EpochStartSovereign EpochStart = 8 [(gogoproto.jsontag) = "epochStart,omitempty", (gogoproto.nullable) = false]; + Header Header = 1 [(gogoproto.jsontag) = "header"]; + bytes ValidatorStatsRootHash = 2 [(gogoproto.jsontag) = "validatorStatsRootHash"]; + repeated bytes ExtendedShardHeaderHashes = 3 [(gogoproto.jsontag) = "extendedShardHeaderHashes,omitempty"]; + repeated OutGoingMiniBlockHeader OutGoingMiniBlockHeaders = 4 [(gogoproto.jsontag) = "outGoingOperations,omitempty", (gogoproto.nullable) = false]; + bool IsStartOfEpoch = 5 [(gogoproto.jsontag) = "isStartOfEpoch,omitempty"]; + bytes AccumulatedFeesInEpoch = 6 [(gogoproto.jsontag) = "accumulatedFeesInEpoch,omitempty", (gogoproto.casttypewith) = "math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster"]; + bytes DevFeesInEpoch = 7 [(gogoproto.jsontag) = "devFeesInEpoch,omitempty", (gogoproto.casttypewith) = "math/big.Int;github.com/multiversx/mx-chain-core-go/data.BigIntCaster"]; + EpochStartSovereign EpochStart = 8 [(gogoproto.jsontag) = "epochStart,omitempty", (gogoproto.nullable) = false]; } +enum OutGoingMBType { + OutGoingTxMB = 0; + ChangeValidatorSetMB = 30; +}; + message OutGoingMiniBlockHeader { - bytes Hash = 1 [(gogoproto.jsontag) = "hash,omitempty"]; - bytes OutGoingOperationsHash = 2 [(gogoproto.jsontag) = "outGoingOperationsHash,omitempty"]; - bytes AggregatedSignatureOutGoingOperations = 3 [(gogoproto.jsontag) = "aggregatedSignatureOutGoingOperations,omitempty"]; - bytes LeaderSignatureOutGoingOperations = 4 [(gogoproto.jsontag) = "leaderSignatureOutGoingOperations,omitempty"]; + bytes Hash = 1 [(gogoproto.jsontag) = "hash,omitempty"]; + bytes OutGoingOperationsHash = 2 [(gogoproto.jsontag) = "outGoingOperationsHash,omitempty"]; + bytes AggregatedSignatureOutGoingOperations = 3 [(gogoproto.jsontag) = "aggregatedSignatureOutGoingOperations,omitempty"]; + bytes LeaderSignatureOutGoingOperations = 4 [(gogoproto.jsontag) = "leaderSignatureOutGoingOperations,omitempty"]; + OutGoingMBType OutGoingMBType = 5 [(gogoproto.jsontag) = "outGoingMBType,omitempty"]; } diff --git a/data/interface.go b/data/interface.go index 8ad08d52..e4468884 100644 --- a/data/interface.go +++ b/data/interface.go @@ -104,8 +104,8 @@ type SovereignChainHeaderHandler interface { GetValidatorStatsRootHash() []byte SetExtendedShardHeaderHashes(hdrHashes [][]byte) error GetExtendedShardHeaderHashes() [][]byte - GetOutGoingMiniBlockHeaderHandler() OutGoingMiniBlockHeaderHandler - SetOutGoingMiniBlockHeaderHandler(mbHeader OutGoingMiniBlockHeaderHandler) error + GetOutGoingMiniBlockHeaderHandlers() []OutGoingMiniBlockHeaderHandler + SetOutGoingMiniBlockHeaderHandlers(mbHeader []OutGoingMiniBlockHeaderHandler) error GetDevFeesInEpoch() *big.Int SetDevFeesInEpoch(value *big.Int) error GetAccumulatedFeesInEpoch() *big.Int @@ -124,11 +124,13 @@ type OutGoingMiniBlockHeaderHandler interface { GetOutGoingOperationsHash() []byte GetAggregatedSignatureOutGoingOperations() []byte GetLeaderSignatureOutGoingOperations() []byte + GetOutGoingMBTypeInt32() int32 SetHash(hash []byte) error SetOutGoingOperationsHash(hash []byte) error SetLeaderSignatureOutGoingOperations(sig []byte) error SetAggregatedSignatureOutGoingOperations(sig []byte) error + SetOutGoingMBTypeInt32(mbType int32) error IsInterfaceNil() bool }