diff --git a/block/consensus.go b/block/consensus.go new file mode 100644 index 000000000..1078fa1ee --- /dev/null +++ b/block/consensus.go @@ -0,0 +1,9 @@ +package block + +import ( + "github.com/gogo/protobuf/proto" +) + +type ConsensusMessagesStream interface { + GetConsensusMessages() ([]proto.Message, error) +} diff --git a/block/executor.go b/block/executor.go index 28e0fcec4..b5484c040 100644 --- a/block/executor.go +++ b/block/executor.go @@ -4,6 +4,9 @@ import ( "errors" "time" + proto2 "github.com/gogo/protobuf/proto" + proto "github.com/gogo/protobuf/types" + abci "github.com/tendermint/tendermint/abci/types" tmcrypto "github.com/tendermint/tendermint/crypto/encoding" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" @@ -21,11 +24,12 @@ const minBlockMaxBytes = 10000 // Executor creates and applies blocks and maintains state. type Executor struct { - localAddress []byte - chainID string - proxyAppConsensusConn proxy.AppConnConsensus - proxyAppQueryConn proxy.AppConnQuery - mempool mempool.Mempool + localAddress []byte + chainID string + proxyAppConsensusConn proxy.AppConnConsensus + proxyAppQueryConn proxy.AppConnQuery + mempool mempool.Mempool + consensusMessagesStream ConsensusMessagesStream eventBus *tmtypes.EventBus @@ -34,15 +38,24 @@ type Executor struct { // NewExecutor creates new instance of BlockExecutor. // localAddress will be used in sequencer mode only. -func NewExecutor(localAddress []byte, chainID string, mempool mempool.Mempool, proxyApp proxy.AppConns, eventBus *tmtypes.EventBus, logger types.Logger) (*Executor, error) { +func NewExecutor( + localAddress []byte, + chainID string, + mempool mempool.Mempool, + proxyApp proxy.AppConns, + eventBus *tmtypes.EventBus, + consensusMessagesStream ConsensusMessagesStream, + logger types.Logger, +) (*Executor, error) { be := Executor{ - localAddress: localAddress, - chainID: chainID, - proxyAppConsensusConn: proxyApp.Consensus(), - proxyAppQueryConn: proxyApp.Query(), - mempool: mempool, - eventBus: eventBus, - logger: logger, + localAddress: localAddress, + chainID: chainID, + proxyAppConsensusConn: proxyApp.Consensus(), + proxyAppQueryConn: proxyApp.Query(), + mempool: mempool, + eventBus: eventBus, + consensusMessagesStream: consensusMessagesStream, + logger: logger, } return &be, nil } @@ -92,10 +105,26 @@ func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, valset []*tmtypes.Vali } // CreateBlock reaps transactions from mempool and builds a block. -func (e *Executor) CreateBlock(height uint64, lastCommit *types.Commit, lastHeaderHash, nextSeqHash [32]byte, state *types.State, maxBlockDataSizeBytes uint64) *types.Block { +func (e *Executor) CreateBlock( + height uint64, + lastCommit *types.Commit, + lastHeaderHash, nextSeqHash [32]byte, + state *types.State, + maxBlockDataSizeBytes uint64, +) *types.Block { maxBlockDataSizeBytes = min(maxBlockDataSizeBytes, uint64(max(minBlockMaxBytes, state.ConsensusParams.Block.MaxBytes))) mempoolTxs := e.mempool.ReapMaxBytesMaxGas(int64(maxBlockDataSizeBytes), state.ConsensusParams.Block.MaxGas) + var consensusAnyMessages []*proto.Any + if e.consensusMessagesStream != nil { + consensusMessages, err := e.consensusMessagesStream.GetConsensusMessages() + if err != nil { + e.logger.Error("Failed to get consensus messages", "error", err) + } + + consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) + } + block := &types.Block{ Header: types.Header{ Version: types.Version{ @@ -116,6 +145,7 @@ func (e *Executor) CreateBlock(height uint64, lastCommit *types.Commit, lastHead Txs: toDymintTxs(mempoolTxs), IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, Evidence: types.EvidenceData{Evidence: nil}, + ConsensusMessages: consensusAnyMessages, }, LastCommit: *lastCommit, } @@ -209,6 +239,7 @@ func (e *Executor) ExecuteBlock(state *types.State, block *types.Block) (*tmstat Votes: nil, }, ByzantineValidators: nil, + ConsensusMessages: block.Data.ConsensusMessages, }) if err != nil { return nil, err @@ -284,3 +315,23 @@ func fromDymintTxs(optiTxs types.Txs) tmtypes.Txs { } return txs } + +func fromProtoMsgToAny(msg proto2.Message) *proto.Any { + theType, err := proto2.Marshal(msg) + if err != nil { + return nil + } + + return &proto.Any{ + TypeUrl: proto2.MessageName(msg), + Value: theType, + } +} + +func fromProtoMsgSliceToAnySlice(msgs []proto2.Message) []*proto.Any { + result := make([]*proto.Any, len(msgs)) + for i, msg := range msgs { + result[i] = fromProtoMsgToAny(msg) + } + return result +} diff --git a/block/executor_test.go b/block/executor_test.go index ffe22754c..e7888576e 100644 --- a/block/executor_test.go +++ b/block/executor_test.go @@ -6,6 +6,10 @@ import ( "testing" "time" + "github.com/gogo/protobuf/proto" + prototypes "github.com/gogo/protobuf/types" + "github.com/golang/groupcache/testpb" + "github.com/dymensionxyz/dymint/block" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -47,7 +51,7 @@ func TestCreateBlock(t *testing.T) { require.NotNil(abciClient) mpool := mempoolv1.NewTxMempool(logger, cfg.DefaultMempoolConfig(), proxy.NewAppConnMempool(abciClient), 0) - executor, err := block.NewExecutor([]byte("test address"), "test", mpool, proxy.NewAppConns(clientCreator), nil, logger) + executor, err := block.NewExecutor([]byte("test address"), "test", mpool, proxy.NewAppConns(clientCreator), nil, nil, logger) assert.NoError(err) maxBytes := uint64(100) @@ -86,6 +90,93 @@ func TestCreateBlock(t *testing.T) { assert.Len(block.Data.Txs, 2) } +func TestCreateBlockWithConsensusMessages(t *testing.T) { + assert := assert.New(t) + require := require.New(t) + logger := log.TestingLogger() + app := &tmmocks.MockApplication{} + app.On("CheckTx", mock.Anything).Return(abci.ResponseCheckTx{}) + clientCreator := proxy.NewLocalClientCreator(app) + abciClient, err := clientCreator.NewABCIClient() + require.NoError(err) + require.NotNil(clientCreator) + require.NotNil(abciClient) + mpool := mempoolv1.NewTxMempool(logger, cfg.DefaultMempoolConfig(), proxy.NewAppConnMempool(abciClient), 0) + + name, city := "test1", "" + theMsg1 := &testpb.TestMessage{ + Name: &name, + City: &city, + } + + name, city = "test2", "" + theMsg2 := &testpb.TestMessage{ + Name: &name, + City: &city, + } + + // Create a mock ConsensusMessagesStream + mockStream := &MockConsensusMessagesStream{} + mockStream.On("GetConsensusMessages").Return([]proto.Message{ + theMsg1, + theMsg2, + }, nil) + + executor, err := block.NewExecutor([]byte("test address"), "test", mpool, proxy.NewAppConns(clientCreator), nil, mockStream, logger) + assert.NoError(err) + + maxBytes := uint64(1000) + proposerKey := ed25519.GenPrivKey() + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(proposerKey.PubKey()) + require.NoError(err) + + state := &types.State{} + state.Sequencers.SetProposer(types.NewSequencerFromValidator(*tmtypes.NewValidator(tmPubKey, 1))) + state.ConsensusParams.Block.MaxBytes = int64(maxBytes) + state.ConsensusParams.Block.MaxGas = 100000 + + block := executor.CreateBlock(1, &types.Commit{}, [32]byte{}, [32]byte(state.Sequencers.ProposerHash()[:]), state, maxBytes) + + require.NotNil(block) + assert.Empty(block.Data.Txs) + assert.Equal(uint64(1), block.Header.Height) + assert.Len(block.Data.ConsensusMessages, 2) + + // Verify the content of ConsensusMessages + theType, err := proto.Marshal(theMsg1) + require.NoError(err) + + anyMsg1 := &prototypes.Any{ + TypeUrl: proto.MessageName(theMsg1), + Value: theType, + } + require.NoError(err) + + theType, err = proto.Marshal(theMsg2) + require.NoError(err) + + anyMsg2 := &prototypes.Any{ + TypeUrl: proto.MessageName(theMsg2), + Value: theType, + } + require.NoError(err) + + assert.True(proto.Equal(anyMsg1, block.Data.ConsensusMessages[0])) + assert.True(proto.Equal(anyMsg2, block.Data.ConsensusMessages[1])) + + mockStream.AssertExpectations(t) +} + +// MockConsensusMessagesStream is a mock implementation of ConsensusMessagesStream +type MockConsensusMessagesStream struct { + mock.Mock +} + +func (m *MockConsensusMessagesStream) GetConsensusMessages() ([]proto.Message, error) { + args := m.Called() + return args.Get(0).([]proto.Message), args.Error(1) +} + func TestApplyBlock(t *testing.T) { assert := assert.New(t) require := require.New(t) @@ -138,7 +229,7 @@ func TestApplyBlock(t *testing.T) { appConns := &tmmocksproxy.MockAppConns{} appConns.On("Consensus").Return(abciClient) appConns.On("Query").Return(abciClient) - executor, err := block.NewExecutor([]byte("test address"), chainID, mpool, appConns, eventBus, logger) + executor, err := block.NewExecutor([]byte("test address"), chainID, mpool, appConns, eventBus, nil, logger) assert.NoError(err) // Subscribe to tx events diff --git a/block/manager.go b/block/manager.go index 978632ce0..89ee16df0 100644 --- a/block/manager.go +++ b/block/manager.go @@ -106,7 +106,15 @@ func NewManager( if err != nil { return nil, err } - exec, err := NewExecutor(localAddress, genesis.ChainID, mempool, proxyApp, eventBus, logger) + exec, err := NewExecutor( + localAddress, + genesis.ChainID, + mempool, + proxyApp, + eventBus, + nil, // TODO add ConsensusMessagesStream + logger, + ) if err != nil { return nil, fmt.Errorf("create block executor: %w", err) } diff --git a/buf.gen.yaml b/buf.gen.yaml index 8aa0891d8..251111a36 100644 --- a/buf.gen.yaml +++ b/buf.gen.yaml @@ -7,4 +7,5 @@ plugins: # The relative output directory. out: proto/pb # Any options to provide to the plugin. - opt: plugins=grpc,paths=source_relative + opt: plugins=grpc,Mgoogle/protobuf/any.proto=github.com/gogo/protobuf/types,paths=source_relative + diff --git a/go.mod b/go.mod index 29e6460cd..c342ffd4b 100644 --- a/go.mod +++ b/go.mod @@ -156,7 +156,7 @@ require ( github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 // indirect github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect - github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect + github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da github.com/golang/protobuf v1.5.4 github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect @@ -301,7 +301,7 @@ replace ( github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.3 github.com/gogo/protobuf => github.com/regen-network/protobuf v1.3.2-alpha.regen.4 github.com/gorilla/rpc => github.com/dymensionxyz/rpc v1.3.1 - github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e + github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f ) replace github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2 diff --git a/go.sum b/go.sum index c09250776..cba754ced 100644 --- a/go.sum +++ b/go.sum @@ -457,8 +457,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e h1:A5FIvuFPvdxShuf9mSHfDUEL7I/oKVcSr1AtSlmgskA= -github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= +github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f h1:CclWJWRydsd8D4/R1IegIkcWtL4wqTA3MWtXrx1a6y4= +github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.3 h1:vmAdUGUc4rTIiO3Phezr7vGq+0uPDVKSA4WAe8+yl6w= diff --git a/p2p/validator_test.go b/p2p/validator_test.go index 9c684eb74..3533926b7 100644 --- a/p2p/validator_test.go +++ b/p2p/validator_test.go @@ -125,7 +125,7 @@ func TestValidator_BlockValidator(t *testing.T) { require.NotNil(t, clientCreator) require.NotNil(t, abciClient) mpool := mempoolv1.NewTxMempool(logger, cfg.DefaultMempoolConfig(), proxy.NewAppConnMempool(abciClient), 0) - executor, err := block.NewExecutor([]byte("test address"), "test", mpool, proxy.NewAppConns(clientCreator), nil, logger) + executor, err := block.NewExecutor([]byte("test address"), "test", mpool, proxy.NewAppConns(clientCreator), nil, nil, logger) assert.NoError(t, err) // Create state diff --git a/proto/types/dymint/dymint.proto b/proto/types/dymint/dymint.proto index e741491ad..dd6e051f7 100755 --- a/proto/types/dymint/dymint.proto +++ b/proto/types/dymint/dymint.proto @@ -4,6 +4,7 @@ option go_package = "github.com/dymensionxyz/dymint/types/pb/dymint"; import "types/tendermint/abci/types.proto"; import "types/tendermint/types/types.proto"; import "types/tendermint/types/validator.proto"; +import "google/protobuf/any.proto"; // Version captures the consensus rules for processing a block in the blockchain, // including all blockchain data structures and the rules of the application's @@ -74,6 +75,7 @@ message Data { repeated bytes txs = 1; repeated bytes intermediate_state_roots = 2; repeated tendermint.abci.Evidence evidence = 3; + repeated google.protobuf.Any consensus_messages = 4; } message Block { diff --git a/proto/types/tendermint/abci/types.proto b/proto/types/tendermint/abci/types.proto index aa78e5f48..9b546969f 100755 --- a/proto/types/tendermint/abci/types.proto +++ b/proto/types/tendermint/abci/types.proto @@ -11,6 +11,7 @@ import "types/tendermint/crypto/keys.proto"; import "types/tendermint/types/params.proto"; import "google/protobuf/timestamp.proto"; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; // This file is copied from http://github.com/tendermint/abci // NOTE: When using custom types, mind the warnings. @@ -79,6 +80,8 @@ message RequestBeginBlock { tendermint.types.Header header = 2 [(gogoproto.nullable) = false]; LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; + + google.protobuf.Any consensus_messages = 5; } enum CheckTxType { @@ -200,6 +203,16 @@ message ResponseQuery { message ResponseBeginBlock { repeated Event events = 1 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "events,omitempty"]; + + // Defines responses for consensus messages in order. + repeated ConsensusMessageResponse consensus_messages_responses = 2; +} + +message ConsensusMessageResponse { + oneof response { + string error = 1; // Error message if execution fails. + google.protobuf.Any ok = 2; // Success response. + } } message ResponseCheckTx { diff --git a/proto/types/tendermint/types/types.proto b/proto/types/tendermint/types/types.proto index 820a934e2..5bf0e10fa 100755 --- a/proto/types/tendermint/types/types.proto +++ b/proto/types/tendermint/types/types.proto @@ -4,6 +4,7 @@ package tendermint.types; option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; +import "google/protobuf/any.proto"; import "google/protobuf/timestamp.proto"; import "types/tendermint/crypto/proof.proto"; import "types/tendermint/version/types.proto"; @@ -87,6 +88,8 @@ message Data { // NOTE: not all txs here are valid. We're just agreeing on the order first. // This means that block.AppHash does not include these txs. repeated bytes txs = 1; + + repeated google.protobuf.Any consensus_messages = 2; } // Vote represents a prevote, precommit, or commit vote from validators for diff --git a/types/block.go b/types/block.go index cc63f55db..060a7445f 100644 --- a/types/block.go +++ b/types/block.go @@ -4,6 +4,7 @@ import ( "encoding" "time" + proto "github.com/gogo/protobuf/types" tmtypes "github.com/tendermint/tendermint/types" ) @@ -83,6 +84,7 @@ type Data struct { Txs Txs IntermediateStateRoots IntermediateStateRoots Evidence EvidenceData + ConsensusMessages []*proto.Any } // EvidenceData defines how evidence is stored in block. diff --git a/types/pb/dymint/dymint.pb.go b/types/pb/dymint/dymint.pb.go index 45b8ad00c..eb1bb5942 100644 --- a/types/pb/dymint/dymint.pb.go +++ b/types/pb/dymint/dymint.pb.go @@ -6,6 +6,7 @@ package dymint import ( fmt "fmt" proto "github.com/gogo/protobuf/proto" + types2 "github.com/gogo/protobuf/types" types1 "github.com/tendermint/tendermint/abci/types" types "github.com/tendermint/tendermint/proto/tendermint/types" io "io" @@ -322,6 +323,7 @@ type Data struct { Txs [][]byte `protobuf:"bytes,1,rep,name=txs,proto3" json:"txs,omitempty"` IntermediateStateRoots [][]byte `protobuf:"bytes,2,rep,name=intermediate_state_roots,json=intermediateStateRoots,proto3" json:"intermediate_state_roots,omitempty"` Evidence []*types1.Evidence `protobuf:"bytes,3,rep,name=evidence,proto3" json:"evidence,omitempty"` + ConsensusMessages []*types2.Any `protobuf:"bytes,4,rep,name=consensus_messages,json=consensusMessages,proto3" json:"consensus_messages,omitempty"` } func (m *Data) Reset() { *m = Data{} } @@ -378,6 +380,13 @@ func (m *Data) GetEvidence() []*types1.Evidence { return nil } +func (m *Data) GetConsensusMessages() []*types2.Any { + if m != nil { + return m.ConsensusMessages + } + return nil +} + type Block struct { Header *Header `protobuf:"bytes,1,opt,name=header,proto3" json:"header,omitempty"` Data *Data `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"` @@ -669,59 +678,61 @@ func init() { func init() { proto.RegisterFile("types/dymint/dymint.proto", fileDescriptor_fe69c538ded4b87f) } var fileDescriptor_fe69c538ded4b87f = []byte{ - // 819 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x95, 0xbf, 0x6f, 0xdb, 0x46, - 0x14, 0xc7, 0x4d, 0x4b, 0xd6, 0x8f, 0x47, 0x59, 0xb1, 0xae, 0x45, 0x40, 0x25, 0xa8, 0xa2, 0x10, - 0x70, 0xa0, 0x14, 0x08, 0x8d, 0xa8, 0x28, 0xd0, 0x2e, 0x05, 0xea, 0x36, 0x80, 0x82, 0x6e, 0x27, - 0x20, 0x43, 0x17, 0xe1, 0x44, 0x3e, 0x88, 0x44, 0xc4, 0x23, 0xcb, 0x3b, 0x09, 0x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, 0xe1, 0xd7, 0xea, 0x17, 0xc5, 0xde, 0xf1, 0xf9, 0xba, 0x5c, 0xaf, - 0x3b, 0x74, 0xc9, 0x7f, 0xf5, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xf7, 0x34, 0x75, 0x40, 0x78, - 0x06, 0x00, 0x00, + // 864 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x95, 0xcf, 0x6f, 0xdb, 0x36, + 0x14, 0xc7, 0xa3, 0xc4, 0xf1, 0x8f, 0x27, 0x27, 0x8d, 0xb9, 0xa2, 0x90, 0x5b, 0xcc, 0x4d, 0x05, + 0xa4, 0x48, 0x07, 0x54, 0x46, 0x3d, 0x0c, 0xd8, 0x2e, 0x03, 0x9a, 0xae, 0x40, 0x8a, 0x61, 0x17, + 0x19, 0xe8, 0x61, 0x17, 0x83, 0x96, 0xde, 0x2c, 0xa1, 0x16, 0xa5, 0x89, 0x74, 0x10, 0xef, 0xd8, + 0xbf, 0x60, 0xe7, 0xdd, 0xf6, 0xdf, 0xec, 0x34, 0xf4, 0xb8, 0xe3, 0x90, 0xfc, 0x23, 0x03, 0x1f, + 0x49, 0x59, 0xed, 0xd2, 0x4b, 0x22, 0x7e, 0xbf, 0x1f, 0x91, 0xcf, 0xef, 0x07, 0x05, 0x63, 0xb5, + 0xad, 0x50, 0x4e, 0xd3, 0x6d, 0x91, 0x0b, 0x65, 0xff, 0x45, 0x55, 0x5d, 0xaa, 0x92, 0x75, 0xcd, + 0xea, 0xe1, 0x13, 0x83, 0x28, 0x14, 0x29, 0xd6, 0x84, 0xf1, 0x65, 0x92, 0x4f, 0x49, 0x35, 0xe8, + 0xc3, 0xf0, 0x7f, 0x88, 0x15, 0x5a, 0xcc, 0xd3, 0xcf, 0x30, 0x57, 0x7c, 0x9d, 0xa7, 0x5c, 0x95, + 0xb5, 0xe5, 0xc6, 0xab, 0xb2, 0x5c, 0xad, 0x71, 0x4a, 0xab, 0xe5, 0xe6, 0x97, 0x29, 0x17, 0x5b, + 0x63, 0x85, 0x2f, 0xa0, 0xf7, 0x16, 0x6b, 0x99, 0x97, 0x82, 0xdd, 0x87, 0xc3, 0xe5, 0xba, 0x4c, + 0xde, 0x05, 0xde, 0xa9, 0x77, 0xde, 0x89, 0xcd, 0x82, 0x9d, 0xc0, 0x01, 0xaf, 0xaa, 0x60, 0x9f, + 0x34, 0xfd, 0x18, 0xbe, 0xef, 0x40, 0xf7, 0x12, 0x79, 0x8a, 0x35, 0x7b, 0x06, 0xbd, 0x2b, 0xf3, + 0x36, 0xbd, 0xe4, 0xcf, 0xee, 0x45, 0xf6, 0xf7, 0xda, 0x4d, 0x63, 0xe7, 0xb3, 0x33, 0x18, 0x0a, + 0x5e, 0xa0, 0xac, 0x78, 0x82, 0x8b, 0x3c, 0xa5, 0x0d, 0x87, 0x17, 0xfb, 0x81, 0x17, 0xfb, 0x8d, + 0xfe, 0x26, 0x65, 0x0f, 0xa0, 0x9b, 0x61, 0xbe, 0xca, 0x54, 0x70, 0x40, 0x27, 0xda, 0x15, 0x63, + 0xd0, 0x51, 0x79, 0x81, 0x41, 0x87, 0x54, 0x7a, 0x66, 0xe7, 0x70, 0xb2, 0xe6, 0x52, 0x2d, 0x32, + 0x0a, 0x66, 0x91, 0x71, 0x99, 0x05, 0x87, 0x7a, 0xdb, 0xf8, 0x58, 0xeb, 0x26, 0xc6, 0x4b, 0x2e, + 0xb3, 0x86, 0x4c, 0xca, 0xa2, 0xc8, 0x95, 0x21, 0xbb, 0x3b, 0xf2, 0x15, 0xc9, 0x44, 0x3e, 0x82, + 0x41, 0xca, 0x15, 0x37, 0x48, 0x8f, 0x90, 0xbe, 0x16, 0xc8, 0x3c, 0x83, 0xe3, 0xa4, 0x14, 0x12, + 0x85, 0xdc, 0x48, 0x43, 0xf4, 0x89, 0x38, 0x6a, 0x54, 0xc2, 0xc6, 0xd0, 0xe7, 0x55, 0x65, 0x80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9f, 0xb3, 0xc3, 0x0d, 0x0c, + 0x9a, 0x16, 0x66, 0xcf, 0x81, 0x49, 0x54, 0x6a, 0x8d, 0x05, 0x0a, 0xd5, 0x8c, 0x90, 0x47, 0x8d, + 0x3c, 0xda, 0x39, 0x6e, 0x88, 0xbe, 0x83, 0x41, 0x73, 0x71, 0xda, 0x84, 0xdd, 0xd1, 0x6b, 0x6f, + 0x1d, 0x12, 0xef, 0xe8, 0xb0, 0x82, 0x61, 0x73, 0xec, 0x1c, 0x15, 0x7b, 0x01, 0xd0, 0xcc, 0x98, + 0xe9, 0x3b, 0x7f, 0x36, 0x72, 0x31, 0x37, 0x64, 0xdc, 0x82, 0xd8, 0x73, 0xe8, 0xbb, 0xa9, 0xb6, + 0x87, 0xdf, 0xf1, 0x42, 0x83, 0x84, 0x8f, 0x61, 0xf0, 0xfa, 0x0a, 0x85, 0xfa, 0x11, 0xb7, 0x52, + 0x5f, 0x8e, 0xef, 0x70, 0xeb, 0x1a, 0x9c, 0x9e, 0x2f, 0x2e, 0xff, 0xba, 0x99, 0x78, 0x1f, 0x6e, + 0x26, 0xde, 0xbf, 0x37, 0x13, 0xef, 0xf7, 0xdb, 0xc9, 0xde, 0x87, 0xdb, 0xc9, 0xde, 0x3f, 0xb7, + 0x93, 0xbd, 0x9f, 0xa3, 0x55, 0xae, 0xb2, 0xcd, 0x32, 0x4a, 0xca, 0x42, 0x7f, 0x9d, 0x50, 0xe8, + 0xfb, 0xf9, 0x7a, 0xfb, 0x9b, 0xfb, 0x62, 0x99, 0x6f, 0x48, 0xb5, 0xb4, 0xeb, 0x65, 0x97, 0xda, + 0xf2, 0xeb, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0xce, 0x06, 0xf3, 0x18, 0xd8, 0x06, 0x00, 0x00, } func (m *Version) Marshal() (dAtA []byte, err error) { @@ -955,6 +966,20 @@ func (m *Data) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.ConsensusMessages) > 0 { + for iNdEx := len(m.ConsensusMessages) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.ConsensusMessages[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDymint(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } if len(m.Evidence) > 0 { for iNdEx := len(m.Evidence) - 1; iNdEx >= 0; iNdEx-- { { @@ -1372,6 +1397,12 @@ func (m *Data) Size() (n int) { n += 1 + l + sovDymint(uint64(l)) } } + if len(m.ConsensusMessages) > 0 { + for _, e := range m.ConsensusMessages { + l = e.Size() + n += 1 + l + sovDymint(uint64(l)) + } + } return n } @@ -2362,6 +2393,40 @@ func (m *Data) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsensusMessages", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDymint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthDymint + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthDymint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ConsensusMessages = append(m.ConsensusMessages, &types2.Any{}) + if err := m.ConsensusMessages[len(m.ConsensusMessages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDymint(dAtA[iNdEx:]) diff --git a/types/pb/dymint/state.pb.go b/types/pb/dymint/state.pb.go index 4b318b849..1cb1dfca9 100644 --- a/types/pb/dymint/state.pb.go +++ b/types/pb/dymint/state.pb.go @@ -195,7 +195,7 @@ func (m *State) GetRollappParams() RollappParams { return RollappParams{} } -// rollapp params defined in genesis and updated via gov proposal +//rollapp params defined in genesis and updated via gov proposal type RollappParams struct { //data availability type (e.g. celestia) used in the rollapp Da string `protobuf:"bytes,1,opt,name=da,proto3" json:"da,omitempty"`