From ca7a5a41cfbc4be758dcfef11caa2cda969bffb7 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Thu, 19 Sep 2024 16:08:14 +0200 Subject: [PATCH 01/27] temp commit --- block/executor.go | 8 +++++++- go.mod | 5 ++++- proto/types/tendermint/abci/types.proto | 4 ++++ proto/types/tendermint/types/types.proto | 4 ++++ types/block.go | 2 ++ 5 files changed, 21 insertions(+), 2 deletions(-) diff --git a/block/executor.go b/block/executor.go index 28e0fcec4..e857e5720 100644 --- a/block/executor.go +++ b/block/executor.go @@ -92,7 +92,13 @@ 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) diff --git a/go.mod b/go.mod index 351ed8cd8..06fdd3af6 100644 --- a/go.mod +++ b/go.mod @@ -301,7 +301,10 @@ 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.20240906143736-1e3959c2826e + github.com/tendermint/tendermint => ../cometbft ) replace github.com/osmosis-labs/osmosis/v15 => github.com/dymensionxyz/osmosis/v15 v15.2.0-dymension-v1.1.2 + + diff --git a/proto/types/tendermint/abci/types.proto b/proto/types/tendermint/abci/types.proto index aa78e5f48..239cf4726 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,9 @@ 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]; + + // New addition: defines any wrapped consensus messages. + google.protobuf.Any consensus_messages = 5; } enum CheckTxType { diff --git a/proto/types/tendermint/types/types.proto b/proto/types/tendermint/types/types.proto index 820a934e2..e8881c815 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,9 @@ 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; + + // NEW: Consensus messages are included as raw Protobuf Any types. + 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..5b722e41f 100644 --- a/types/block.go +++ b/types/block.go @@ -2,6 +2,7 @@ package types import ( "encoding" + "github.com/gogo/protobuf/types" "time" tmtypes "github.com/tendermint/tendermint/types" @@ -83,6 +84,7 @@ type Data struct { Txs Txs IntermediateStateRoots IntermediateStateRoots Evidence EvidenceData + ConsensusMessages []*types.Any } // EvidenceData defines how evidence is stored in block. From e3828464e50eaca5131539eb66ccd2941f1cfd3c Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Mon, 23 Sep 2024 10:08:03 +0200 Subject: [PATCH 02/27] temp commit --- block/consensus.go | 7 ++ block/executor.go | 17 +++- proto/types/dymint/dymint.proto | 2 + types/pb/dymint/dymint.pb.go | 168 ++++++++++++++++++++++---------- 4 files changed, 138 insertions(+), 56 deletions(-) create mode 100644 block/consensus.go diff --git a/block/consensus.go b/block/consensus.go new file mode 100644 index 000000000..d7d640a1f --- /dev/null +++ b/block/consensus.go @@ -0,0 +1,7 @@ +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 e857e5720..4716458e0 100644 --- a/block/executor.go +++ b/block/executor.go @@ -21,11 +21,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 @@ -102,6 +103,11 @@ func (e *Executor) CreateBlock( maxBlockDataSizeBytes = min(maxBlockDataSizeBytes, uint64(max(minBlockMaxBytes, state.ConsensusParams.Block.MaxBytes))) mempoolTxs := e.mempool.ReapMaxBytesMaxGas(int64(maxBlockDataSizeBytes), state.ConsensusParams.Block.MaxGas) + consensusMessages, err := e.consensusMessagesStream.GetConsensusMessages() + if err != nil { + e.logger.Error("Failed to get consensus messages", "error", err) + } + block := &types.Block{ Header: types.Header{ Version: types.Version{ @@ -122,6 +128,7 @@ func (e *Executor) CreateBlock( Txs: toDymintTxs(mempoolTxs), IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, Evidence: types.EvidenceData{Evidence: nil}, + ConsensusMessages: consensusMessages, }, LastCommit: *lastCommit, } diff --git a/proto/types/dymint/dymint.proto b/proto/types/dymint/dymint.proto index 80e733097..4e8191158 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/types/pb/dymint/dymint.pb.go b/types/pb/dymint/dymint.pb.go index f3894f5d5..c47e04a5a 100644 --- a/types/pb/dymint/dymint.pb.go +++ b/types/pb/dymint/dymint.pb.go @@ -8,6 +8,7 @@ import ( proto "github.com/gogo/protobuf/proto" types1 "github.com/tendermint/tendermint/abci/types" types "github.com/tendermint/tendermint/proto/tendermint/types" + anypb "google.golang.org/protobuf/types/known/anypb" io "io" math "math" math_bits "math/bits" @@ -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 []*anypb.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() []*anypb.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"` @@ -624,57 +633,60 @@ func init() { func init() { proto.RegisterFile("types/dymint/dymint.proto", fileDescriptor_fe69c538ded4b87f) } var fileDescriptor_fe69c538ded4b87f = []byte{ - // 797 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x95, 0x4d, 0x4f, 0xdb, 0x48, - 0x18, 0xc7, 0x31, 0x09, 0x79, 0x79, 0x1c, 0x02, 0x99, 0x5d, 0x21, 0x07, 0xb4, 0xd9, 0x60, 0x09, - 0x14, 0x56, 0xc2, 0x88, 0xac, 0x56, 0xda, 0xbd, 0xac, 0xb4, 0x6c, 0x2b, 0x85, 0xeb, 0x44, 0xe2, - 0xd0, 0x4b, 0x34, 0xb1, 0x47, 0xb1, 0xd5, 0xf8, 0xa5, 0x9e, 0x09, 0x82, 0x1e, 0xb9, 0xf5, 0xd6, - 0x73, 0x6f, 0xfd, 0x36, 0x3d, 0x72, 0xec, 0xb1, 0x82, 0x2f, 0x52, 0xcd, 0x33, 0x63, 0xc7, 0x50, - 0x7a, 0x01, 0xcf, 0xff, 0xff, 0xf3, 0xcc, 0xe3, 0xe7, 0x65, 0x02, 0x7d, 0x79, 0x9b, 0x71, 0x71, - 0x16, 0xdc, 0xc6, 0x51, 0x22, 0xcd, 0x3f, 0x2f, 0xcb, 0x53, 0x99, 0x92, 0x86, 0x5e, 0xed, 0x1f, - 0x6a, 0x44, 0xf2, 0x24, 0xe0, 0x39, 0x62, 0x6c, 0xee, 0x47, 0x67, 0xa8, 0x6a, 0x74, 0xdf, 0xfd, - 0x01, 0x31, 0x42, 0x85, 0x39, 0xfe, 0x09, 0x73, 0xcd, 0x96, 0x51, 0xc0, 0x64, 0x9a, 0x6b, 0xce, - 0x3d, 0x87, 0xe6, 0x15, 0xcf, 0x45, 0x94, 0x26, 0xe4, 0x57, 0xd8, 0x9a, 0x2f, 0x53, 0xff, 0xad, - 0x63, 0x0d, 0xad, 0x51, 0x9d, 0xea, 0x05, 0xd9, 0x85, 0x1a, 0xcb, 0x32, 0x67, 0x13, 0x35, 0xf5, - 0xe8, 0xde, 0xd5, 0xa1, 0x31, 0xe1, 0x2c, 0xe0, 0x39, 0x39, 0x81, 0xe6, 0xb5, 0x7e, 0x1b, 0x5f, - 0xb2, 0xc7, 0x3b, 0x9e, 0xf9, 0x28, 0xb3, 0x29, 0x2d, 0x7c, 0x72, 0x04, 0x9d, 0x84, 0xc5, 0x5c, - 0x64, 0xcc, 0xe7, 0xb3, 0x28, 0xc0, 0x0d, 0x3b, 0x17, 0x9b, 0x8e, 0x45, 0xed, 0x52, 0xbf, 0x0c, - 0xc8, 0x1e, 0x34, 0x42, 0x1e, 0x2d, 0x42, 0xe9, 0xd4, 0xf0, 0x44, 0xb3, 0x22, 0x04, 0xea, 0x32, - 0x8a, 0xb9, 0x53, 0x47, 0x15, 0x9f, 0xc9, 0x08, 0x76, 0x97, 0x4c, 0xc8, 0x59, 0x88, 0xc1, 0xcc, - 0x42, 0x26, 0x42, 0x67, 0x4b, 0x6d, 0x4b, 0xbb, 0x4a, 0xd7, 0x31, 0x4e, 0x98, 0x08, 0x4b, 0xd2, - 0x4f, 0xe3, 0x38, 0x92, 0x9a, 0x6c, 0xac, 0xc9, 0xff, 0x51, 0x46, 0xf2, 0x00, 0xda, 0x01, 0x93, - 0x4c, 0x23, 0x4d, 0x44, 0x5a, 0x4a, 0x40, 0xf3, 0x08, 0xba, 0x7e, 0x9a, 0x08, 0x9e, 0x88, 0x95, - 0xd0, 0x44, 0x0b, 0x89, 0xed, 0x52, 0x45, 0xac, 0x0f, 0x2d, 0x96, 0x65, 0x1a, 0x68, 0x23, 0xd0, - 0x64, 0x59, 0x86, 0xd6, 0x1f, 0xd0, 0xc3, 0x40, 0x72, 0x2e, 0x56, 0x4b, 0x69, 0x36, 0x01, 0x64, - 0x76, 0x94, 0x41, 0xb5, 0x8e, 0xec, 0x09, 0xec, 0x66, 0x79, 0x9a, 0xa5, 0x82, 0xe7, 0x33, 0x16, - 0x04, 0x39, 0x17, 0xc2, 0xb1, 0x35, 0x5a, 0xe8, 0xff, 0x69, 0x59, 0x05, 0x26, 0xf8, 0xbb, 0x15, - 0x4f, 0xfc, 0x22, 0x0f, 0x1d, 0x1d, 0x58, 0xa9, 0xe2, 0x8e, 0x1e, 0xfc, 0x92, 0xf0, 0x1b, 0x39, - 0x7b, 0xc6, 0x76, 0x91, 0xed, 0x29, 0x6b, 0xfa, 0x84, 0xef, 0x43, 0xcb, 0x0f, 0x59, 0x94, 0xa8, - 0x7a, 0x6d, 0x0f, 0xad, 0x51, 0x9b, 0x36, 0x71, 0x7d, 0x19, 0xb8, 0x9f, 0x2d, 0x68, 0xe8, 0xb4, - 0x55, 0x4a, 0x66, 0x3d, 0x29, 0xd9, 0xef, 0x60, 0x57, 0x2b, 0x83, 0x05, 0xa7, 0x10, 0xae, 0xab, - 0x32, 0x00, 0x10, 0xd1, 0x22, 0x61, 0x72, 0x95, 0x73, 0xe1, 0xd4, 0x86, 0x35, 0xe5, 0xaf, 0x15, - 0xf2, 0x2f, 0x74, 0x64, 0x3c, 0x2b, 0x05, 0xac, 0xbd, 0x3d, 0x3e, 0xf0, 0xd6, 0x4d, 0xed, 0xe9, - 0x96, 0xd7, 0x81, 0x4c, 0xa3, 0x05, 0xb5, 0x65, 0x3c, 0x2d, 0x78, 0xf7, 0x83, 0x05, 0xf5, 0x57, - 0x4c, 0x32, 0xd5, 0xc3, 0xf2, 0x46, 0x38, 0x16, 0x9e, 0xa0, 0x1e, 0xc9, 0xdf, 0xe0, 0x44, 0x89, - 0xe4, 0x79, 0xcc, 0x83, 0x88, 0x49, 0x3e, 0x13, 0x52, 0xfd, 0xcd, 0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aa, 0x40, 0xe8, 0x9a, 0x76, 0x33, 0xe8, 0x94, 0xc7, 0x4e, 0xb9, 0x24, 0xe7, 0x00, 0xe5, 0x78, - 0xe8, 0x96, 0xb1, 0xc7, 0xbd, 0x22, 0xe6, 0x92, 0xa4, 0x15, 0x88, 0x9c, 0x42, 0xab, 0x18, 0x48, - 0x73, 0xf8, 0x0b, 0x2f, 0x94, 0xc8, 0xc5, 0xe4, 0xcb, 0xc3, 0xc0, 0xba, 0x7f, 0x18, 0x58, 0xdf, - 0x1e, 0x06, 0xd6, 0xc7, 0xc7, 0xc1, 0xc6, 0xfd, 0xe3, 0x60, 0xe3, 0xeb, 0xe3, 0x60, 0xe3, 0x8d, - 0xb7, 0x88, 0x64, 0xb8, 0x9a, 0x7b, 0x7e, 0x1a, 0xab, 0x1f, 0x07, 0x9e, 0xa8, 0x9b, 0xf3, 0xe6, - 0xf6, 0x7d, 0xf1, 0x83, 0xa1, 0xaf, 0xf0, 0x6c, 0x6e, 0xd6, 0xf3, 0x06, 0xde, 0xe1, 0x7f, 0x7e, - 0x0f, 0x00, 0x00, 0xff, 0xff, 0xc4, 0xde, 0x10, 0x30, 0x57, 0x06, 0x00, 0x00, + // 845 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, 0x4b, 0x05, + 0xa4, 0x48, 0x07, 0x54, 0x46, 0x3d, 0x0c, 0xd8, 0x2e, 0x03, 0x9a, 0x6e, 0x80, 0x7b, 0xd8, 0x85, + 0x06, 0x7a, 0xd8, 0xc5, 0xa0, 0xa5, 0x37, 0x4b, 0x98, 0x45, 0x69, 0x22, 0x1d, 0xc4, 0x3b, 0xf6, + 0x2f, 0xd8, 0x79, 0xb7, 0xfd, 0x37, 0x3b, 0x0d, 0x3d, 0xee, 0x38, 0x24, 0xff, 0xc8, 0xc0, 0x47, + 0x4a, 0x56, 0xbb, 0xf4, 0x92, 0x88, 0xdf, 0xef, 0x47, 0xe4, 0xf3, 0xfb, 0x41, 0xc1, 0x58, 0xef, + 0x4a, 0x54, 0xd3, 0x64, 0x97, 0x67, 0x52, 0xbb, 0x7f, 0x51, 0x59, 0x15, 0xba, 0x60, 0x5d, 0xbb, + 0x7a, 0xfc, 0xd4, 0x22, 0x1a, 0x65, 0x82, 0x15, 0x61, 0x62, 0x15, 0x67, 0x53, 0x52, 0x2d, 0xfa, + 0x38, 0xfc, 0x1f, 0xe2, 0x84, 0x16, 0xf3, 0xec, 0x13, 0xcc, 0xb5, 0xd8, 0x64, 0x89, 0xd0, 0x45, + 0xe5, 0xb8, 0xf1, 0xba, 0x28, 0xd6, 0x1b, 0x9c, 0xd2, 0x6a, 0xb5, 0xfd, 0x79, 0x2a, 0xe4, 0xce, + 0x5a, 0xe1, 0x4b, 0xe8, 0xbd, 0xc5, 0x4a, 0x65, 0x85, 0x64, 0x0f, 0xe1, 0x78, 0xb5, 0x29, 0xe2, + 0x5f, 0x02, 0xef, 0xdc, 0xbb, 0xec, 0x70, 0xbb, 0x60, 0x67, 0x70, 0x24, 0xca, 0x32, 0x38, 0x24, + 0xcd, 0x3c, 0x86, 0xef, 0x3a, 0xd0, 0x9d, 0xa3, 0x48, 0xb0, 0x62, 0xcf, 0xa1, 0x77, 0x6d, 0xdf, + 0xa6, 0x97, 0xfc, 0xd9, 0x83, 0xc8, 0xfd, 0x5e, 0xb7, 0x29, 0xaf, 0x7d, 0x76, 0x01, 0x43, 0x29, + 0x72, 0x54, 0xa5, 0x88, 0x71, 0x99, 0x25, 0xb4, 0xe1, 0xf0, 0xea, 0x30, 0xf0, 0xb8, 0xdf, 0xe8, + 0x6f, 0x12, 0xf6, 0x08, 0xba, 0x29, 0x66, 0xeb, 0x54, 0x07, 0x47, 0x74, 0xa2, 0x5b, 0x31, 0x06, + 0x1d, 0x9d, 0xe5, 0x18, 0x74, 0x48, 0xa5, 0x67, 0x76, 0x09, 0x67, 0x1b, 0xa1, 0xf4, 0x32, 0xa5, + 0x60, 0x96, 0xa9, 0x50, 0x69, 0x70, 0x6c, 0xb6, 0xe5, 0xa7, 0x46, 0xb7, 0x31, 0xce, 0x85, 0x4a, + 0x1b, 0x32, 0x2e, 0xf2, 0x3c, 0xd3, 0x96, 0xec, 0xee, 0xc9, 0xd7, 0x24, 0x13, 0xf9, 0x04, 0x06, + 0x89, 0xd0, 0xc2, 0x22, 0x3d, 0x42, 0xfa, 0x46, 0x20, 0xf3, 0x02, 0x4e, 0xe3, 0x42, 0x2a, 0x94, + 0x6a, 0xab, 0x2c, 0xd1, 0x27, 0xe2, 0xa4, 0x51, 0x09, 0x1b, 0x43, 0x5f, 0x94, 0xa5, 0x05, 0x06, + 0x04, 0xf4, 0x44, 0x59, 0x92, 0xf5, 0x25, 0x8c, 0x28, 0x90, 0x0a, 0xd5, 0x76, 0xa3, 0xdd, 0x26, + 0x40, 0xcc, 0x03, 0x63, 0x70, 0xab, 0x13, 0xfb, 0x1c, 0xce, 0xca, 0xaa, 0x28, 0x0b, 0x85, 0xd5, + 0x52, 0x24, 0x49, 0x85, 0x4a, 0x05, 0xbe, 0x45, 0x6b, 0xfd, 0x95, 0x95, 0x4d, 0x60, 0x0a, 0x7f, + 0xdd, 0xa2, 0x8c, 0xeb, 0x3c, 0x0c, 0x6d, 0x60, 0x8d, 0x4a, 0x3b, 0x46, 0xf0, 0x99, 0xc4, 0x1b, + 0xbd, 0xfc, 0x88, 0x3d, 0x25, 0x76, 0x64, 0xac, 0xc5, 0x07, 0xfc, 0x18, 0xfa, 0x71, 0x2a, 0x32, + 0x69, 0xea, 0x75, 0x72, 0xee, 0x5d, 0x0e, 0x78, 0x8f, 0xd6, 0x6f, 0x92, 0xf0, 0x4f, 0x0f, 0xba, + 0x36, 0x6d, 0xad, 0x92, 0x79, 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0x5a, 0x67, 0x3a, 0xdd, 0xae, 0xa2, 0xb8, 0xc8, 0xcd, 0xc7, 0x07, 0xa5, 0xb9, 0x7e, 0x6f, 0x76, + 0xbf, 0xd5, 0x1f, 0x24, 0xfb, 0x89, 0x28, 0x57, 0x6e, 0xbd, 0xea, 0x52, 0xd7, 0x7d, 0xf5, 0x5f, + 0x00, 0x00, 0x00, 0xff, 0xff, 0x74, 0x19, 0x14, 0x49, 0xb7, 0x06, 0x00, 0x00, } func (m *Version) Marshal() (dAtA []byte, err error) { @@ -908,6 +920,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-- { { @@ -1293,6 +1319,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 } @@ -2268,6 +2300,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, &anypb.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:]) From c6639e7e42ff58b42dbf4721dd156b35437fb51f Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Mon, 23 Sep 2024 10:32:26 +0200 Subject: [PATCH 03/27] add consensus messages to the block data --- block/consensus.go | 2 +- block/executor.go | 23 ++++++++++++++++++++++- types/block.go | 4 ++-- 3 files changed, 25 insertions(+), 4 deletions(-) diff --git a/block/consensus.go b/block/consensus.go index d7d640a1f..23843e84a 100644 --- a/block/consensus.go +++ b/block/consensus.go @@ -1,6 +1,6 @@ package block -import "github.com/gogo/protobuf/proto" +import "google.golang.org/protobuf/proto" type ConsensusMessagesStream interface { GetConsensusMessages() ([]proto.Message, error) diff --git a/block/executor.go b/block/executor.go index 4716458e0..7108209a4 100644 --- a/block/executor.go +++ b/block/executor.go @@ -2,6 +2,8 @@ package block import ( "errors" + proto "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" "time" abci "github.com/tendermint/tendermint/abci/types" @@ -108,6 +110,8 @@ func (e *Executor) CreateBlock( e.logger.Error("Failed to get consensus messages", "error", err) } + consensusAnyMessages := fromProtoMsgSliceToAnySlice(consensusMessages) + block := &types.Block{ Header: types.Header{ Version: types.Version{ @@ -128,7 +132,7 @@ func (e *Executor) CreateBlock( Txs: toDymintTxs(mempoolTxs), IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, Evidence: types.EvidenceData{Evidence: nil}, - ConsensusMessages: consensusMessages, + ConsensusMessages: consensusAnyMessages, }, LastCommit: *lastCommit, } @@ -297,3 +301,20 @@ func fromDymintTxs(optiTxs types.Txs) tmtypes.Txs { } return txs } + +func fromProtoMsgToAny(msg proto.Message) *anypb.Any { + anyType, err := anypb.New(msg) + if err != nil { + panic(err) + } + + return anyType +} + +func fromProtoMsgSliceToAnySlice(msgs []proto.Message) []*anypb.Any { + result := make([]*anypb.Any, len(msgs)) + for i, msg := range msgs { + result[i] = fromProtoMsgToAny(msg) + } + return result +} diff --git a/types/block.go b/types/block.go index 5b722e41f..d6d6b8935 100644 --- a/types/block.go +++ b/types/block.go @@ -2,7 +2,7 @@ package types import ( "encoding" - "github.com/gogo/protobuf/types" + "google.golang.org/protobuf/types/known/anypb" "time" tmtypes "github.com/tendermint/tendermint/types" @@ -84,7 +84,7 @@ type Data struct { Txs Txs IntermediateStateRoots IntermediateStateRoots Evidence EvidenceData - ConsensusMessages []*types.Any + ConsensusMessages []*anypb.Any } // EvidenceData defines how evidence is stored in block. From 336e3ca12d20b4cadf9a776a2e41d4ce44436e5d Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Mon, 23 Sep 2024 10:47:17 +0200 Subject: [PATCH 04/27] Execute block --- block/executor.go | 1 + 1 file changed, 1 insertion(+) diff --git a/block/executor.go b/block/executor.go index 7108209a4..22358619d 100644 --- a/block/executor.go +++ b/block/executor.go @@ -226,6 +226,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 From 9209ab6c8658c013e2fc6e1c563af97c4fe40940 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Mon, 23 Sep 2024 13:02:56 +0200 Subject: [PATCH 05/27] previous proto gen --- block/executor_test.go | 90 ++++++++++++++++++++++++++++++++++++ buf.gen.yaml | 3 +- go.mod | 4 +- go.sum | 2 - types/pb/dymint/dymint.pb.go | 8 ++-- 5 files changed, 97 insertions(+), 10 deletions(-) diff --git a/block/executor_test.go b/block/executor_test.go index ffe22754c..98b35b2ca 100644 --- a/block/executor_test.go +++ b/block/executor_test.go @@ -3,6 +3,9 @@ package block_test import ( "context" "crypto/rand" + "github.com/golang/groupcache/testpb" + "github.com/golang/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" "testing" "time" @@ -86,6 +89,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, 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 := anypb.Any{ + TypeUrl: proto.MessageName(theMsg1), + Value: theType, + } + require.NoError(err) + + theType, err = proto.Marshal(theMsg2) + require.NoError(err) + + anyMsg2 := anypb.Any{ + TypeUrl: proto.MessageName(theMsg2), + Value: theType, + } + require.NoError(err) + + assert.Equal(anyMsg1, block.Data.ConsensusMessages[0]) + assert.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) 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 06fdd3af6..a1910b717 100644 --- a/go.mod +++ b/go.mod @@ -155,7 +155,7 @@ require ( github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/golang/glog v1.2.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 @@ -306,5 +306,3 @@ replace ( ) 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 b4f585883..69952cc0c 100644 --- a/go.sum +++ b/go.sum @@ -305,8 +305,6 @@ 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/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/dymension/v3 v3.1.0-rc03.0.20240411195658-f7cd96f53b56 h1:cmpJYdRviuUfmlJdHrcAND8Jd6JIY4rp63bWAQzPr54= diff --git a/types/pb/dymint/dymint.pb.go b/types/pb/dymint/dymint.pb.go index c47e04a5a..3fbb84df3 100644 --- a/types/pb/dymint/dymint.pb.go +++ b/types/pb/dymint/dymint.pb.go @@ -6,9 +6,9 @@ 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" - anypb "google.golang.org/protobuf/types/known/anypb" io "io" math "math" math_bits "math/bits" @@ -323,7 +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 []*anypb.Any `protobuf:"bytes,4,rep,name=consensus_messages,json=consensusMessages,proto3" json:"consensus_messages,omitempty"` + ConsensusMessages []*types2.Any `protobuf:"bytes,4,rep,name=consensus_messages,json=consensusMessages,proto3" json:"consensus_messages,omitempty"` } func (m *Data) Reset() { *m = Data{} } @@ -380,7 +380,7 @@ func (m *Data) GetEvidence() []*types1.Evidence { return nil } -func (m *Data) GetConsensusMessages() []*anypb.Any { +func (m *Data) GetConsensusMessages() []*types2.Any { if m != nil { return m.ConsensusMessages } @@ -2329,7 +2329,7 @@ func (m *Data) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.ConsensusMessages = append(m.ConsensusMessages, &anypb.Any{}) + m.ConsensusMessages = append(m.ConsensusMessages, &types2.Any{}) if err := m.ConsensusMessages[len(m.ConsensusMessages)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err } From d08e81bcbfd5f9dd735bb1ff450f35ce8307a7c5 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Tue, 24 Sep 2024 08:20:16 +0200 Subject: [PATCH 06/27] add consensus messages stream --- block/consensus.go | 4 ++- block/executor.go | 57 ++++++++++++++++++++++++++---------------- block/executor_test.go | 18 ++++++------- block/manager.go | 4 +-- p2p/validator_test.go | 2 +- types/block.go | 4 +-- 6 files changed, 53 insertions(+), 36 deletions(-) diff --git a/block/consensus.go b/block/consensus.go index 23843e84a..1078fa1ee 100644 --- a/block/consensus.go +++ b/block/consensus.go @@ -1,6 +1,8 @@ package block -import "google.golang.org/protobuf/proto" +import ( + "github.com/gogo/protobuf/proto" +) type ConsensusMessagesStream interface { GetConsensusMessages() ([]proto.Message, error) diff --git a/block/executor.go b/block/executor.go index 22358619d..590b7133e 100644 --- a/block/executor.go +++ b/block/executor.go @@ -2,8 +2,8 @@ package block import ( "errors" - proto "google.golang.org/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" + proto2 "github.com/gogo/protobuf/proto" + proto "github.com/gogo/protobuf/types" "time" abci "github.com/tendermint/tendermint/abci/types" @@ -37,15 +37,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 } @@ -105,12 +114,15 @@ func (e *Executor) CreateBlock( maxBlockDataSizeBytes = min(maxBlockDataSizeBytes, uint64(max(minBlockMaxBytes, state.ConsensusParams.Block.MaxBytes))) mempoolTxs := e.mempool.ReapMaxBytesMaxGas(int64(maxBlockDataSizeBytes), state.ConsensusParams.Block.MaxGas) - consensusMessages, err := e.consensusMessagesStream.GetConsensusMessages() - if err != nil { - e.logger.Error("Failed to get consensus messages", "error", err) - } + 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) + consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) + } block := &types.Block{ Header: types.Header{ @@ -303,17 +315,20 @@ func fromDymintTxs(optiTxs types.Txs) tmtypes.Txs { return txs } -func fromProtoMsgToAny(msg proto.Message) *anypb.Any { - anyType, err := anypb.New(msg) +func fromProtoMsgToAny(msg proto2.Message) *proto.Any { + theType, err := proto2.Marshal(msg) if err != nil { - panic(err) + return nil } - return anyType + return &proto.Any{ + TypeUrl: proto2.MessageName(msg), + Value: theType, + } } -func fromProtoMsgSliceToAnySlice(msgs []proto.Message) []*anypb.Any { - result := make([]*anypb.Any, len(msgs)) +func fromProtoMsgSliceToAnySlice(msgs []proto2.Message) []*proto.Any { + result := make([]*proto.Any, len(msgs)) for i, msg := range msgs { result[i] = fromProtoMsgToAny(msg) } diff --git a/block/executor_test.go b/block/executor_test.go index 98b35b2ca..1938a8fa5 100644 --- a/block/executor_test.go +++ b/block/executor_test.go @@ -3,9 +3,9 @@ package block_test import ( "context" "crypto/rand" + "github.com/gogo/protobuf/proto" + prototypes "github.com/gogo/protobuf/types" "github.com/golang/groupcache/testpb" - "github.com/golang/protobuf/proto" - "google.golang.org/protobuf/types/known/anypb" "testing" "time" @@ -50,7 +50,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) @@ -121,7 +121,7 @@ func TestCreateBlockWithConsensusMessages(t *testing.T) { theMsg2, }, nil) - 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, mockStream, logger) assert.NoError(err) maxBytes := uint64(1000) @@ -145,7 +145,7 @@ func TestCreateBlockWithConsensusMessages(t *testing.T) { theType, err := proto.Marshal(theMsg1) require.NoError(err) - anyMsg1 := anypb.Any{ + anyMsg1 := &prototypes.Any{ TypeUrl: proto.MessageName(theMsg1), Value: theType, } @@ -154,14 +154,14 @@ func TestCreateBlockWithConsensusMessages(t *testing.T) { theType, err = proto.Marshal(theMsg2) require.NoError(err) - anyMsg2 := anypb.Any{ + anyMsg2 := &prototypes.Any{ TypeUrl: proto.MessageName(theMsg2), Value: theType, } require.NoError(err) - assert.Equal(anyMsg1, block.Data.ConsensusMessages[0]) - assert.Equal(anyMsg2, block.Data.ConsensusMessages[1]) + assert.True(proto.Equal(anyMsg1, block.Data.ConsensusMessages[0])) + assert.True(proto.Equal(anyMsg2, block.Data.ConsensusMessages[1])) mockStream.AssertExpectations(t) } @@ -228,7 +228,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 cc17905df..746db023c 100644 --- a/block/manager.go +++ b/block/manager.go @@ -98,7 +98,7 @@ 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, logger) // TODO add ConsensusMessagesStream if err != nil { return nil, fmt.Errorf("create block executor: %w", err) } @@ -177,7 +177,7 @@ func (m *Manager) Start(ctx context.Context) error { } /* ----------------------------- sequencer mode ----------------------------- */ - // Subscribe to batch events, to update last submitted height in case batch confirmation was lost. This could happen if the sequencer crash/restarted just after submitting a batch to the settelement and by the time we query the last batch, this batch wasn't accepted yet. + // Subscribe to batch events, to update last submitted height in case batch confirmation was lost. This could happen if the sequencer crash/restarted just after submitting a batch to the settelement and by the time we query the last batch, this batch wasn't accepted yet. go uevent.MustSubscribe(ctx, m.Pubsub, "updateSubmittedHeightLoop", settlement.EventQueryNewSettlementBatchAccepted, m.UpdateLastSubmittedHeight, m.logger) // Sequencer must wait till DA is synced to start submitting blobs 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/types/block.go b/types/block.go index d6d6b8935..060a7445f 100644 --- a/types/block.go +++ b/types/block.go @@ -2,9 +2,9 @@ package types import ( "encoding" - "google.golang.org/protobuf/types/known/anypb" "time" + proto "github.com/gogo/protobuf/types" tmtypes "github.com/tendermint/tendermint/types" ) @@ -84,7 +84,7 @@ type Data struct { Txs Txs IntermediateStateRoots IntermediateStateRoots Evidence EvidenceData - ConsensusMessages []*anypb.Any + ConsensusMessages []*proto.Any } // EvidenceData defines how evidence is stored in block. From 45164f1056bf51d7d21a4a6f45d87a8491e9e33e Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Thu, 26 Sep 2024 19:00:41 +0200 Subject: [PATCH 07/27] add some fixes --- block/executor.go | 4 +++- block/manager.go | 10 +++++++++- proto/types/tendermint/abci/types.proto | 10 ++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/block/executor.go b/block/executor.go index 590b7133e..a54844494 100644 --- a/block/executor.go +++ b/block/executor.go @@ -121,7 +121,9 @@ func (e *Executor) CreateBlock( e.logger.Error("Failed to get consensus messages", "error", err) } - consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) + if consensusMessages != nil { + consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) + } } block := &types.Block{ diff --git a/block/manager.go b/block/manager.go index 746db023c..7a6e4b19b 100644 --- a/block/manager.go +++ b/block/manager.go @@ -98,7 +98,15 @@ func NewManager( if err != nil { return nil, err } - exec, err := NewExecutor(localAddress, genesis.ChainID, mempool, proxyApp, eventBus, nil, logger) // TODO add ConsensusMessagesStream + 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/proto/types/tendermint/abci/types.proto b/proto/types/tendermint/abci/types.proto index 239cf4726..48056e387 100755 --- a/proto/types/tendermint/abci/types.proto +++ b/proto/types/tendermint/abci/types.proto @@ -204,6 +204,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 { From adb695cead25550353b383ed4769379d9700a1f7 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:39:43 +0200 Subject: [PATCH 08/27] goimports --- block/executor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/executor.go b/block/executor.go index a54844494..570fc8470 100644 --- a/block/executor.go +++ b/block/executor.go @@ -2,9 +2,10 @@ package block import ( "errors" + "time" + proto2 "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/types" - "time" abci "github.com/tendermint/tendermint/abci/types" tmcrypto "github.com/tendermint/tendermint/crypto/encoding" From f24ea2f167b411c53a180457c3d82a1b43193085 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:43:59 +0200 Subject: [PATCH 09/27] remove nil check --- block/executor.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/block/executor.go b/block/executor.go index 570fc8470..b5484c040 100644 --- a/block/executor.go +++ b/block/executor.go @@ -122,9 +122,7 @@ func (e *Executor) CreateBlock( e.logger.Error("Failed to get consensus messages", "error", err) } - if consensusMessages != nil { - consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) - } + consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) } block := &types.Block{ From 0fa4c8d38e4a8d8e3fe9771abd02efb1fd1dc6ac Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:44:38 +0200 Subject: [PATCH 10/27] goimports --- block/executor_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/block/executor_test.go b/block/executor_test.go index 1938a8fa5..e7888576e 100644 --- a/block/executor_test.go +++ b/block/executor_test.go @@ -3,11 +3,12 @@ package block_test import ( "context" "crypto/rand" + "testing" + "time" + "github.com/gogo/protobuf/proto" prototypes "github.com/gogo/protobuf/types" "github.com/golang/groupcache/testpb" - "testing" - "time" "github.com/dymensionxyz/dymint/block" From 4b061ecaf7d2ef806fe138008ba94635b197026f Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:45:46 +0200 Subject: [PATCH 11/27] remove line from proto --- proto/types/tendermint/abci/types.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/proto/types/tendermint/abci/types.proto b/proto/types/tendermint/abci/types.proto index 48056e387..9b546969f 100755 --- a/proto/types/tendermint/abci/types.proto +++ b/proto/types/tendermint/abci/types.proto @@ -81,7 +81,6 @@ message RequestBeginBlock { LastCommitInfo last_commit_info = 3 [(gogoproto.nullable) = false]; repeated Evidence byzantine_validators = 4 [(gogoproto.nullable) = false]; - // New addition: defines any wrapped consensus messages. google.protobuf.Any consensus_messages = 5; } From 038a2a32d3b648055a88540f0fdb1badeb0d59d6 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:48:29 +0200 Subject: [PATCH 12/27] remove proto comment --- proto/types/tendermint/types/types.proto | 1 - 1 file changed, 1 deletion(-) diff --git a/proto/types/tendermint/types/types.proto b/proto/types/tendermint/types/types.proto index e8881c815..5bf0e10fa 100755 --- a/proto/types/tendermint/types/types.proto +++ b/proto/types/tendermint/types/types.proto @@ -89,7 +89,6 @@ message Data { // This means that block.AppHash does not include these txs. repeated bytes txs = 1; - // NEW: Consensus messages are included as raw Protobuf Any types. repeated google.protobuf.Any consensus_messages = 2; } From 102fa8e0d8ad4b1591f2a7ff3570b17ffbe63a40 Mon Sep 17 00:00:00 2001 From: keruch Date: Fri, 4 Oct 2024 09:27:42 +0200 Subject: [PATCH 13/27] merge commit --- go.mod | 1 - types/pb/dymint/dymint.pb.go | 171 ++++++++++++++++++++++++----------- types/pb/dymint/state.pb.go | 2 +- 3 files changed, 119 insertions(+), 55 deletions(-) diff --git a/go.mod b/go.mod index 3be5713d9..903f622d9 100644 --- a/go.mod +++ b/go.mod @@ -156,7 +156,6 @@ 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/glog v1.2.0 // 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 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, 0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- 0xdf, 0x77, 0x93, 0x93, 0x9f, 0x83, 0x4d, 0xa2, 0xe3, 0xdd, 0x3a, 0x08, 0xb3, 0xd4, 0xfc, 0x7a, - 0xa0, 0x34, 0x57, 0xeb, 0xcd, 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,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x06, 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"` From dc2cafe1b4db241887321f69972820ffd6504d40 Mon Sep 17 00:00:00 2001 From: keruch Date: Fri, 4 Oct 2024 19:42:43 +0200 Subject: [PATCH 14/27] feat(executor): added MsgUpsertSequencer consensus message --- block/executor.go | 29 +- proto/protoc.sh | 1 + proto/types/rollapp/sequencers/tx.proto | 45 + settlement/dymension/events.go | 4 +- types/pb/rollapp/sequencers/tx.pb.go | 1314 +++++++++++++++++++++++ 5 files changed, 1390 insertions(+), 3 deletions(-) create mode 100644 proto/types/rollapp/sequencers/tx.proto create mode 100644 types/pb/rollapp/sequencers/tx.pb.go diff --git a/block/executor.go b/block/executor.go index b5484c040..dcdf60fa6 100644 --- a/block/executor.go +++ b/block/executor.go @@ -4,6 +4,8 @@ import ( "errors" "time" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/bech32" proto2 "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/types" @@ -17,6 +19,7 @@ import ( "github.com/dymensionxyz/dymint/mempool" "github.com/dymensionxyz/dymint/types" + "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers" ) // default minimum block max size allowed. not specific reason to set it to 10K, but we need to avoid no transactions can be included in a block. @@ -122,7 +125,29 @@ func (e *Executor) CreateBlock( e.logger.Error("Failed to get consensus messages", "error", err) } - consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages) + consensusAnyMessages = fromProtoMsgSliceToAnySlice(consensusMessages...) + } + // Set the initial sequencer reward address on the very first block after the genesis + const rotationBlock = false + if state.LastBlockHeight.Load() == 1 { + val, _ := state.Sequencers.Proposer.TMValidator() + tmPubKey, err := tmcrypto.PubKeyToProto(val.PubKey) + if err != nil { + return nil + } + anyTmPubKey, err := codectypes.NewAnyWithValue(&tmPubKey) + if err != nil { + return nil + } + _, addrBytes, err := bech32.DecodeAndConvert(state.Sequencers.Proposer.SettlementAddress) + if err != nil { + return nil + } + consensusAnyMessages = append(consensusAnyMessages, fromProtoMsgSliceToAnySlice(&sequencers.MsgUpsertSequencer{ + Operator: val.Address.String(), // ?? + ConsPubKey: anyTmPubKey, + RewardAddrBytes: addrBytes, + })...) } block := &types.Block{ @@ -328,7 +353,7 @@ func fromProtoMsgToAny(msg proto2.Message) *proto.Any { } } -func fromProtoMsgSliceToAnySlice(msgs []proto2.Message) []*proto.Any { +func fromProtoMsgSliceToAnySlice(msgs ...proto2.Message) []*proto.Any { result := make([]*proto.Any, len(msgs)) for i, msg := range msgs { result[i] = fromProtoMsgToAny(msg) diff --git a/proto/protoc.sh b/proto/protoc.sh index 4b23b9743..2937453b7 100755 --- a/proto/protoc.sh +++ b/proto/protoc.sh @@ -7,6 +7,7 @@ buf generate --path="./proto/types/dalc" --template="buf.gen.yaml" --config="buf buf generate --path="./proto/types/dymint" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/interchain_da" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/dymensionxyz" --template="buf.gen.yaml" --config="buf.yaml" +buf generate --path="./proto/types/rollapp" --template="buf.gen.yaml" --config="buf.yaml" # Generate the `test` proto files buf generate --path="./proto/test" --template="buf.gen.yaml" --config="buf.yaml" diff --git a/proto/types/rollapp/sequencers/tx.proto b/proto/types/rollapp/sequencers/tx.proto new file mode 100644 index 000000000..2db0f029d --- /dev/null +++ b/proto/types/rollapp/sequencers/tx.proto @@ -0,0 +1,45 @@ +// This file is a modified copy of the dymension-rdk/sequencers module proto contract. Source: +// https://github.com/dymensionxyz/dymension-rdk/blob/28628bcb329ac7b4cdd6d19f1c43f26d03410f84/proto/sequencers/tx.proto. +// It contains only message definitions but without the Msg service. +syntax = "proto3"; +package rollapp.sequencers.types; + +import "gogoproto/gogo.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers"; + +message MsgCreateSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // PubKey is a tendermint consensus pub key + google.protobuf.Any pub_key = 2; + // Signature is operator signed with the private key of pub_key + bytes signature = 3; +} + +message MsgCreateSequencerResponse {} + +message MsgUpsertSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // ConsPubKey is a tendermint consensus pub key + google.protobuf.Any cons_pub_key = 2; + // RewardAddrBytes is the bytes representation of the sequencer's reward account + bytes reward_addr_bytes = 3; +} + +message MsgUpsertSequencerResponse {} + +message MsgUpdateSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 3; +} + +message MsgUpdateSequencerResponse {} diff --git a/settlement/dymension/events.go b/settlement/dymension/events.go index 18f53cdef..abe8ee2c3 100644 --- a/settlement/dymension/events.go +++ b/settlement/dymension/events.go @@ -158,5 +158,7 @@ func convertToRotationStartedEvent(rawEventData ctypes.ResultEvent) (*settlement rotationStartedEvent := &settlement.EventDataRotationStarted{ NextSeqAddr: nextProposer, } - return rotationStartedEvent, nil + return &settlement.EventDataRotationStarted{ + NextSeqAddr: nextProposer, + }, nil } diff --git a/types/pb/rollapp/sequencers/tx.pb.go b/types/pb/rollapp/sequencers/tx.pb.go new file mode 100644 index 000000000..60210f738 --- /dev/null +++ b/types/pb/rollapp/sequencers/tx.pb.go @@ -0,0 +1,1314 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/rollapp/sequencers/tx.proto + +package sequencers + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // PubKey is a tendermint consensus pub key + PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + // Signature is operator signed with the private key of pub_key + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } +func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSequencer) ProtoMessage() {} +func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_30467481bc397351, []int{0} +} +func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSequencer.Merge(m, src) +} +func (m *MsgCreateSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSequencer proto.InternalMessageInfo + +func (m *MsgCreateSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgCreateSequencer) GetPubKey() *types.Any { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *MsgCreateSequencer) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type MsgCreateSequencerResponse struct { +} + +func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerResponse{} } +func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSequencerResponse) ProtoMessage() {} +func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_30467481bc397351, []int{1} +} +func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSequencerResponse.Merge(m, src) +} +func (m *MsgCreateSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo + +type MsgUpsertSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // ConsPubKey is a tendermint consensus pub key + ConsPubKey *types.Any `protobuf:"bytes,2,opt,name=cons_pub_key,json=consPubKey,proto3" json:"cons_pub_key,omitempty"` + // RewardAddrBytes is the bytes representation of the sequencer's reward account + RewardAddrBytes []byte `protobuf:"bytes,3,opt,name=reward_addr_bytes,json=rewardAddrBytes,proto3" json:"reward_addr_bytes,omitempty"` +} + +func (m *MsgUpsertSequencer) Reset() { *m = MsgUpsertSequencer{} } +func (m *MsgUpsertSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgUpsertSequencer) ProtoMessage() {} +func (*MsgUpsertSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_30467481bc397351, []int{2} +} +func (m *MsgUpsertSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpsertSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpsertSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpsertSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpsertSequencer.Merge(m, src) +} +func (m *MsgUpsertSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgUpsertSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpsertSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpsertSequencer proto.InternalMessageInfo + +func (m *MsgUpsertSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgUpsertSequencer) GetConsPubKey() *types.Any { + if m != nil { + return m.ConsPubKey + } + return nil +} + +func (m *MsgUpsertSequencer) GetRewardAddrBytes() []byte { + if m != nil { + return m.RewardAddrBytes + } + return nil +} + +type MsgUpsertSequencerResponse struct { +} + +func (m *MsgUpsertSequencerResponse) Reset() { *m = MsgUpsertSequencerResponse{} } +func (m *MsgUpsertSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpsertSequencerResponse) ProtoMessage() {} +func (*MsgUpsertSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_30467481bc397351, []int{3} +} +func (m *MsgUpsertSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpsertSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpsertSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpsertSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpsertSequencerResponse.Merge(m, src) +} +func (m *MsgUpsertSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpsertSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpsertSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpsertSequencerResponse proto.InternalMessageInfo + +type MsgUpdateSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *MsgUpdateSequencer) Reset() { *m = MsgUpdateSequencer{} } +func (m *MsgUpdateSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencer) ProtoMessage() {} +func (*MsgUpdateSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_30467481bc397351, []int{4} +} +func (m *MsgUpdateSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencer.Merge(m, src) +} +func (m *MsgUpdateSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencer proto.InternalMessageInfo + +func (m *MsgUpdateSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgUpdateSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type MsgUpdateSequencerResponse struct { +} + +func (m *MsgUpdateSequencerResponse) Reset() { *m = MsgUpdateSequencerResponse{} } +func (m *MsgUpdateSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencerResponse) ProtoMessage() {} +func (*MsgUpdateSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_30467481bc397351, []int{5} +} +func (m *MsgUpdateSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencerResponse.Merge(m, src) +} +func (m *MsgUpdateSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateSequencer)(nil), "rollapp.sequencers.types.MsgCreateSequencer") + proto.RegisterType((*MsgCreateSequencerResponse)(nil), "rollapp.sequencers.types.MsgCreateSequencerResponse") + proto.RegisterType((*MsgUpsertSequencer)(nil), "rollapp.sequencers.types.MsgUpsertSequencer") + proto.RegisterType((*MsgUpsertSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpsertSequencerResponse") + proto.RegisterType((*MsgUpdateSequencer)(nil), "rollapp.sequencers.types.MsgUpdateSequencer") + proto.RegisterType((*MsgUpdateSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpdateSequencerResponse") +} + +func init() { proto.RegisterFile("types/rollapp/sequencers/tx.proto", fileDescriptor_30467481bc397351) } + +var fileDescriptor_30467481bc397351 = []byte{ + // 395 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0xce, 0xd3, 0x30, + 0x10, 0xc7, 0x6b, 0x90, 0x0a, 0x75, 0x8b, 0x10, 0x51, 0x87, 0x10, 0x95, 0x50, 0x3a, 0x55, 0x95, + 0x88, 0x05, 0x48, 0x0c, 0xdd, 0x5a, 0x46, 0x84, 0x84, 0x02, 0x2c, 0x2c, 0x21, 0x89, 0x0f, 0x13, + 0xd1, 0xd8, 0xc6, 0x76, 0xa0, 0x66, 0x64, 0x66, 0xe0, 0x1d, 0x78, 0x01, 0x1e, 0x83, 0xb1, 0x23, + 0x23, 0x6a, 0x07, 0x5e, 0x03, 0x25, 0x4e, 0x5b, 0xc4, 0xd7, 0x4f, 0xea, 0x94, 0xdc, 0xfd, 0xcf, + 0xff, 0xfb, 0xdd, 0xe9, 0xf0, 0x3d, 0x63, 0x25, 0x68, 0xa2, 0xc4, 0x6a, 0x95, 0x4a, 0x49, 0x34, + 0x7c, 0xa8, 0x80, 0xe7, 0xa0, 0x34, 0x31, 0xeb, 0x48, 0x2a, 0x61, 0x84, 0xe7, 0xb7, 0x62, 0x74, + 0x14, 0xa3, 0xe6, 0x55, 0x30, 0x64, 0x82, 0x89, 0xa6, 0x88, 0xd4, 0x7f, 0xae, 0x3e, 0xb8, 0xe3, + 0x2c, 0x73, 0xa1, 0x4b, 0xa1, 0x49, 0xa9, 0x19, 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0xc6, 0x47, 0x88, + 0xcb, 0xfa, 0xd3, 0x53, 0x3b, 0x5c, 0xbe, 0xfc, 0xb9, 0x0d, 0xd1, 0x66, 0x1b, 0xa2, 0xdf, 0xdb, + 0x10, 0x7d, 0xdb, 0x85, 0x9d, 0xcd, 0x2e, 0xec, 0xfc, 0xda, 0x85, 0x9d, 0xd7, 0x73, 0x56, 0x98, + 0x77, 0x55, 0x16, 0xe5, 0xa2, 0x24, 0xd4, 0x96, 0xc0, 0x75, 0x21, 0xf8, 0xda, 0x7e, 0xae, 0x83, + 0x82, 0x1b, 0xe2, 0x6e, 0x4c, 0x66, 0x27, 0x2e, 0x37, 0xeb, 0x36, 0x8b, 0x7c, 0xf4, 0x37, 0x00, + 0x00, 0xff, 0xff, 0xa1, 0x43, 0x69, 0xfb, 0xdc, 0x02, 0x00, 0x00, +} + +func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1a + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpsertSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpsertSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpsertSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddrBytes) > 0 { + i -= len(m.RewardAddrBytes) + copy(dAtA[i:], m.RewardAddrBytes) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddrBytes))) + i-- + dAtA[i] = 0x1a + } + if m.ConsPubKey != nil { + { + size, err := m.ConsPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpsertSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpsertSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpsertSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpsertSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ConsPubKey != nil { + l = m.ConsPubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddrBytes) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpsertSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpsertSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpsertSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpsertSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsPubKey == nil { + m.ConsPubKey = &types.Any{} + } + if err := m.ConsPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddrBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddrBytes = append(m.RewardAddrBytes[:0], dAtA[iNdEx:postIndex]...) + if m.RewardAddrBytes == nil { + m.RewardAddrBytes = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpsertSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpsertSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpsertSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) From 9f507a4f7a642fcb35f76db0da2763ccc1a387e3 Mon Sep 17 00:00:00 2001 From: keruch Date: Mon, 7 Oct 2024 17:31:04 +0200 Subject: [PATCH 15/27] feat(executor): MsgUpsertSequecner --- block/executor.go | 36 ++----------- block/produce.go | 97 ++++++++++++++++++++++++++++------ block/sequencers.go | 11 ++-- go.mod | 20 +++---- go.sum | 26 +++++++-- settlement/dymension/events.go | 4 +- 6 files changed, 127 insertions(+), 67 deletions(-) diff --git a/block/executor.go b/block/executor.go index dcdf60fa6..feeaadd18 100644 --- a/block/executor.go +++ b/block/executor.go @@ -4,11 +4,8 @@ import ( "errors" "time" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/bech32" 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" @@ -19,7 +16,6 @@ import ( "github.com/dymensionxyz/dymint/mempool" "github.com/dymensionxyz/dymint/types" - "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers" ) // default minimum block max size allowed. not specific reason to set it to 10K, but we need to avoid no transactions can be included in a block. @@ -107,47 +103,25 @@ func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, valset []*tmtypes.Vali }) } -// CreateBlock reaps transactions from mempool and builds a block. +// CreateBlock reaps transactions from mempool and builds a block. Optionally, executes consensus messages that +// gets from the consensus messages stream or from the method args. func (e *Executor) CreateBlock( height uint64, lastCommit *types.Commit, lastHeaderHash, nextSeqHash [32]byte, state *types.State, maxBlockDataSizeBytes uint64, + consensusMsgs ...proto2.Message, ) *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...) - } - // Set the initial sequencer reward address on the very first block after the genesis - const rotationBlock = false - if state.LastBlockHeight.Load() == 1 { - val, _ := state.Sequencers.Proposer.TMValidator() - tmPubKey, err := tmcrypto.PubKeyToProto(val.PubKey) - if err != nil { - return nil - } - anyTmPubKey, err := codectypes.NewAnyWithValue(&tmPubKey) - if err != nil { - return nil - } - _, addrBytes, err := bech32.DecodeAndConvert(state.Sequencers.Proposer.SettlementAddress) - if err != nil { - return nil - } - consensusAnyMessages = append(consensusAnyMessages, fromProtoMsgSliceToAnySlice(&sequencers.MsgUpsertSequencer{ - Operator: val.Address.String(), // ?? - ConsPubKey: anyTmPubKey, - RewardAddrBytes: addrBytes, - })...) + consensusMsgs = append(consensusMsgs, consensusMessages...) } block := &types.Block{ @@ -170,7 +144,7 @@ func (e *Executor) CreateBlock( Txs: toDymintTxs(mempoolTxs), IntermediateStateRoots: types.IntermediateStateRoots{RawRootsList: nil}, Evidence: types.EvidenceData{Evidence: nil}, - ConsensusMessages: consensusAnyMessages, + ConsensusMessages: fromProtoMsgSliceToAnySlice(consensusMsgs...), }, LastCommit: *lastCommit, } diff --git a/block/produce.go b/block/produce.go index e9c77a909..1a8ea9d86 100644 --- a/block/produce.go +++ b/block/produce.go @@ -6,18 +6,21 @@ import ( "fmt" "time" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/types/bech32" + sequencertypes "github.com/dymensionxyz/dymension-rdk/x/sequencers/types" "github.com/dymensionxyz/gerr-cosmos/gerrc" - - "github.com/dymensionxyz/dymint/node/events" - "github.com/dymensionxyz/dymint/store" - uevent "github.com/dymensionxyz/dymint/utils/event" - + "github.com/gogo/protobuf/proto" tmed25519 "github.com/tendermint/tendermint/crypto/ed25519" + tmcrypto "github.com/tendermint/tendermint/crypto/encoding" cmtproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" + "github.com/dymensionxyz/dymint/node/events" + "github.com/dymensionxyz/dymint/store" "github.com/dymensionxyz/dymint/types" + uevent "github.com/dymensionxyz/dymint/utils/event" ) // ProduceBlockLoop is calling publishBlock in a loop as long as we're synced. @@ -96,9 +99,17 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) } } +// nextProposerInfo holds information about the next proposer. +type nextProposerInfo struct { + // nextProposerHash is a tendermint-compatible hash of the sequencer. + nextProposerHash [32]byte + // nextProposerAddr is a sequencer's settlement address. + nextProposerAddr string +} + // ProduceApplyGossipLastBlock produces and applies a block with the given nextProposerHash. -func (m *Manager) ProduceApplyGossipLastBlock(ctx context.Context, nextProposerHash [32]byte) (err error) { - _, _, err = m.produceApplyGossip(ctx, true, &nextProposerHash) +func (m *Manager) ProduceApplyGossipLastBlock(ctx context.Context, nextProposerInfo nextProposerInfo) (err error) { + _, _, err = m.produceApplyGossip(ctx, true, &nextProposerInfo) return err } @@ -106,8 +117,8 @@ func (m *Manager) ProduceApplyGossipBlock(ctx context.Context, allowEmpty bool) return m.produceApplyGossip(ctx, allowEmpty, nil) } -func (m *Manager) produceApplyGossip(ctx context.Context, allowEmpty bool, nextProposerHash *[32]byte) (block *types.Block, commit *types.Commit, err error) { - block, commit, err = m.produceBlock(allowEmpty, nextProposerHash) +func (m *Manager) produceApplyGossip(ctx context.Context, allowEmpty bool, nextProposerInfo *nextProposerInfo) (block *types.Block, commit *types.Commit, err error) { + block, commit, err = m.produceBlock(allowEmpty, nextProposerInfo) if err != nil { return nil, nil, fmt.Errorf("produce block: %w", err) } @@ -123,7 +134,7 @@ func (m *Manager) produceApplyGossip(ctx context.Context, allowEmpty bool, nextP return block, commit, nil } -func (m *Manager) produceBlock(allowEmpty bool, nextProposerHash *[32]byte) (*types.Block, *types.Commit, error) { +func (m *Manager) produceBlock(allowEmpty bool, nextProposerInfo *nextProposerInfo) (*types.Block, *types.Commit, error) { newHeight := m.State.NextHeight() lastHeaderHash, lastCommit, err := m.GetPreviousBlockHashes(newHeight) if err != nil { @@ -148,14 +159,24 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerHash *[32]byte) (*ty return nil, nil, fmt.Errorf("load block: height: %d: %w: %w", newHeight, err, ErrNonRecoverable) } - maxBlockDataSize := uint64(float64(m.Conf.BatchSubmitBytes) * types.MaxBlockSizeAdjustment) - proposerHashForBlock := [32]byte(m.State.Sequencers.ProposerHash()) - // if nextProposerHash is set, we create a last block - if nextProposerHash != nil { + var ( + maxBlockDataSize = uint64(float64(m.Conf.BatchSubmitBytes) * types.MaxBlockSizeAdjustment) + proposerHashForBlock = [32]byte(m.State.Sequencers.ProposerHash()) + nextProposerAddr = m.State.Sequencers.Proposer.SettlementAddress + lastProposerBlock = false // Indicates that the block is the last for the current seq. True during the rotation. + ) + // if nextProposerInfo is set, we create a last block + if nextProposerInfo != nil { maxBlockDataSize = 0 - proposerHashForBlock = *nextProposerHash + proposerHashForBlock = nextProposerInfo.nextProposerHash + nextProposerAddr = nextProposerInfo.nextProposerAddr + lastProposerBlock = true } - block = m.Executor.CreateBlock(newHeight, lastCommit, lastHeaderHash, proposerHashForBlock, m.State, maxBlockDataSize) + consensusMsgs, err := m.consensusMsgsOnCreateBlock(nextProposerAddr, lastProposerBlock) + if err != nil { + return nil, nil, fmt.Errorf("create consensus msgs for create block: %w: %w", err, ErrNonRecoverable) + } + block = m.Executor.CreateBlock(newHeight, lastCommit, lastHeaderHash, proposerHashForBlock, m.State, maxBlockDataSize, consensusMsgs...) if !allowEmpty && len(block.Data.Txs) == 0 { return nil, nil, fmt.Errorf("%w: %w", types.ErrEmptyBlock, ErrRecoverable) } @@ -171,6 +192,50 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerHash *[32]byte) (*ty return block, commit, nil } +// consensusMsgsOnCreateBlock forms a list of consensus messages that need execution on rollapp's BeginBlock. +// Currently, we need to create a sequencer in the rollapp if it doesn't exist in the following cases: +// - On the very first block after the genesis or +// - On the last block of the current sequencer (eg, during the rotation). +func (m *Manager) consensusMsgsOnCreateBlock( + nextProposerSettlementAddr string, + lastSeqBlock bool, // Indicates that the block is the last for the current seq. True during the rotation. +) ([]proto.Message, error) { + if m.State.IsGenesis() || lastSeqBlock { + nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) + // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. + if nextSeq == nil { + panic(fmt.Errorf("no sequencer found for address while creating a new block %s", nextProposerSettlementAddr)) + } + + // Get proposer's consensus public key and convert it to proto.Any + val, err := nextSeq.TMValidator() + if err != nil { + return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) + } + pubKey, err := tmcrypto.PubKeyToProto(val.PubKey) + if err != nil { + return nil, fmt.Errorf("next squencer pub key to proto: %w", err) + } + anyPubKey, err := codectypes.NewAnyWithValue(&pubKey) + if err != nil { + return nil, fmt.Errorf("next squencer pubkey to proto any: %w", err) + } + + // Get raw bytes of the proposer's settlement address. These bytes are to be converted to the rollapp format later. + _, addrBytes, err := bech32.DecodeAndConvert(nextProposerSettlementAddr) + if err != nil { + return nil, fmt.Errorf("next squencer settlement addr to bech32: %w", err) + } + + return []proto.Message{&sequencertypes.MsgUpsertSequencer{ + Operator: nextProposerSettlementAddr, + ConsPubKey: anyPubKey, + RewardAddrBytes: addrBytes, + }}, nil + } + return nil, nil +} + // create commit for block func (m *Manager) createCommit(block *types.Block) (*types.Commit, error) { abciHeaderPb := types.ToABCIHeaderPB(&block.Header) diff --git a/block/sequencers.go b/block/sequencers.go index 4c98c4f3b..5e10b4a48 100644 --- a/block/sequencers.go +++ b/block/sequencers.go @@ -119,7 +119,10 @@ func (m *Manager) CompleteRotation(ctx context.Context, nextSeqAddr string) erro copy(nextSeqHash[:], seq.Hash()) } - err := m.CreateAndPostLastBatch(ctx, nextSeqHash) + err := m.CreateAndPostLastBatch(ctx, nextProposerInfo{ + nextProposerHash: nextSeqHash, + nextProposerAddr: nextSeqAddr, + }) if err != nil { return fmt.Errorf("create and post last batch: %w", err) } @@ -130,7 +133,7 @@ func (m *Manager) CompleteRotation(ctx context.Context, nextSeqAddr string) erro // CreateAndPostLastBatch creates and posts the last batch to the hub // this called after manager shuts down the block producer and submitter -func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextSeqHash [32]byte) error { +func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextProposerInfo nextProposerInfo) error { h := m.State.Height() block, err := m.Store.LoadBlock(h) if err != nil { @@ -138,10 +141,10 @@ func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextSeqHash [32]by } // check if the last block already produced with nextProposerHash set - if bytes.Equal(block.Header.NextSequencersHash[:], nextSeqHash[:]) { + if bytes.Equal(block.Header.NextSequencersHash[:], nextProposerInfo.nextProposerHash[:]) { m.logger.Debug("Last block already produced and applied.") } else { - err := m.ProduceApplyGossipLastBlock(ctx, nextSeqHash) + err := m.ProduceApplyGossipLastBlock(ctx, nextProposerInfo) if err != nil { return fmt.Errorf("produce apply gossip last block: %w", err) } diff --git a/go.mod b/go.mod index 903f622d9..cff87fc44 100644 --- a/go.mod +++ b/go.mod @@ -11,6 +11,7 @@ require ( github.com/cosmos/cosmos-sdk v0.46.16 github.com/dgraph-io/badger/v4 v4.3.0 github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 + github.com/dymensionxyz/dymension-rdk v1.6.1 github.com/dymensionxyz/gerr-cosmos v1.0.0 github.com/go-kit/kit v0.12.0 github.com/gofrs/uuid v4.3.0+incompatible @@ -42,18 +43,14 @@ require ( ) require ( - cloud.google.com/go v0.112.1 // indirect - cloud.google.com/go/storage v1.38.0 // indirect github.com/celestiaorg/go-square v1.0.1 // indirect github.com/celestiaorg/go-square/merkle v0.0.0-20240429192549-dea967e1533b // indirect github.com/cskr/pubsub v1.0.2 // indirect github.com/dgraph-io/badger/v3 v3.2103.3 // indirect - github.com/felixge/httpsnoop v1.0.4 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect - github.com/tklauser/go-sysconf v0.3.11 // indirect - google.golang.org/api v0.169.0 // indirect + github.com/tklauser/numcpus v0.6.0 // indirect ) require ( @@ -257,7 +254,7 @@ require ( require ( cosmossdk.io/math v1.3.0 // indirect - github.com/DataDog/zstd v1.5.2 // indirect + github.com/DataDog/zstd v1.5.5 // indirect github.com/Jorropo/jsync v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect @@ -267,10 +264,9 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/ibc-go/v6 v6.2.1 // indirect github.com/danwt/gerr v1.0.0 // indirect github.com/evmos/evmos/v12 v12.1.6 // indirect - github.com/getsentry/sentry-go v0.18.0 // indirect + github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect github.com/holiman/uint256 v1.2.2 // indirect github.com/ipfs/bbloom v0.0.4 // indirect @@ -296,11 +292,17 @@ require ( ) replace ( + // This replacement is needed in order to import dymension-rdk properly. It's inherited from + // https://github.com/dymensionxyz/dymension-rdk/blob/82c4d5f8c09365b20b4378c0cc459b414fd306e8/go.mod#L315. + github.com/CosmWasm/wasmd => github.com/decentrio/wasmd v0.33.0-sdk46.2 github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/availproject/go-substrate-rpc-client/v4 v4.0.12-avail-1.4.0-rc1-5e286e3 - github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240827102903-08636e7ab3f8 + // TODO: uncomment after https://github.com/dymensionxyz/dymension-rdk/pull/563 is merged + // github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240827102903-08636e7ab3f8 + github.com/dymensionxyz/dymension-rdk => ../dymension-rdk 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 + // TODO: uncomment after https://github.com/dymensionxyz/cometbft/pull/9 is merged // github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e github.com/tendermint/tendermint => ../cometbft ) diff --git a/go.sum b/go.sum index 85c734c3a..138a23d43 100644 --- a/go.sum +++ b/go.sum @@ -189,6 +189,14 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= +cosmossdk.io/api v0.7.0 h1:QsEMIWuv9xWDbF2HZnW4Lpu1/SejCztPu0LQx7t6MN4= +cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= +cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= +cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= +cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU= +cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= +cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= +cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= @@ -211,9 +219,11 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= +github.com/CosmWasm/wasmvm v1.2.3 h1:OKYlobwmVGbl0eSn0mXoAAjE5hIuXnQCLPjbNd91sVY= +github.com/CosmWasm/wasmvm v1.2.3/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= -github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= +github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -374,6 +384,8 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= +github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= +github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= github.com/cosmos/cosmos-sdk v0.46.16 h1:RVGv1+RulLZeNyfCaPZrZtv0kY7ZZNAI6JGpub0Uh6o= @@ -411,6 +423,8 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= +github.com/decentrio/wasmd v0.33.0-sdk46.2 h1:cUgYN8crDXiQiKLBYfGR5IXg77Z/QrvZBoU9Fg/1ACo= +github.com/decentrio/wasmd v0.33.0-sdk46.2/go.mod h1:mPBiB+54La70eS2HHzvK2Vn7Frgf7rjnxDo70oopw+w= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= @@ -443,6 +457,8 @@ github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM= github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= +github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= +github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -465,6 +481,8 @@ github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj51 github.com/dymensionxyz/gerr-cosmos v1.0.0/go.mod h1:n+0olxPogzWqFKba45mCpvrHLGmeS8W9UZjggHnWk6c= github.com/dymensionxyz/rpc v1.3.1 h1:7EXWIobaBes5zldRvTIg7TmNsEKjicrWA/OjCc0NaGs= github.com/dymensionxyz/rpc v1.3.1/go.mod h1:f+WpX8ysy8wt95iGc6auYlHcnHj2bUkhiRVkkKNys8c= +github.com/dymensionxyz/sdk-utils v0.1.2-0.20240905104639-19dc09f5c6f5 h1:o6Jh8D4QZ7yifvOWV7/uoIugLZE0mTSOdz05ScaNNdU= +github.com/dymensionxyz/sdk-utils v0.1.2-0.20240905104639-19dc09f5c6f5/go.mod h1:5fmenxP75quS5D1gPynbmh5qE6vla64Kks2O/hM+gi4= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= @@ -507,8 +525,8 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= -github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= +github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= +github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= diff --git a/settlement/dymension/events.go b/settlement/dymension/events.go index abe8ee2c3..18f53cdef 100644 --- a/settlement/dymension/events.go +++ b/settlement/dymension/events.go @@ -158,7 +158,5 @@ func convertToRotationStartedEvent(rawEventData ctypes.ResultEvent) (*settlement rotationStartedEvent := &settlement.EventDataRotationStarted{ NextSeqAddr: nextProposer, } - return &settlement.EventDataRotationStarted{ - NextSeqAddr: nextProposer, - }, nil + return rotationStartedEvent, nil } From d55070b17ed82a1e80462b1c29257aa115db8b4e Mon Sep 17 00:00:00 2001 From: keruch Date: Mon, 7 Oct 2024 18:46:46 +0200 Subject: [PATCH 16/27] tests fix 1 --- block/produce.go | 4 ++-- settlement/grpc/grpc.go | 12 +++++++++++- settlement/local/local.go | 13 +++++++++++-- types/sequencer_set.go | 4 ++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/block/produce.go b/block/produce.go index 1a8ea9d86..77492508d 100644 --- a/block/produce.go +++ b/block/produce.go @@ -174,7 +174,7 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerInfo *nextProposerIn } consensusMsgs, err := m.consensusMsgsOnCreateBlock(nextProposerAddr, lastProposerBlock) if err != nil { - return nil, nil, fmt.Errorf("create consensus msgs for create block: %w: %w", err, ErrNonRecoverable) + return nil, nil, fmt.Errorf("create consensus msgs for create block: last proposer block: %v, height: %d, next proposer addr: %s: %w: %w", lastProposerBlock, newHeight, nextProposerAddr, err, ErrNonRecoverable) } block = m.Executor.CreateBlock(newHeight, lastCommit, lastHeaderHash, proposerHashForBlock, m.State, maxBlockDataSize, consensusMsgs...) if !allowEmpty && len(block.Data.Txs) == 0 { @@ -204,7 +204,7 @@ func (m *Manager) consensusMsgsOnCreateBlock( nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. if nextSeq == nil { - panic(fmt.Errorf("no sequencer found for address while creating a new block %s", nextProposerSettlementAddr)) + return nil, fmt.Errorf("no sequencer found for address while creating a new block: %s", nextProposerSettlementAddr) } // Get proposer's consensus public key and convert it to proto.Any diff --git a/settlement/grpc/grpc.go b/settlement/grpc/grpc.go index 67c62e0d3..37b32ba78 100644 --- a/settlement/grpc/grpc.go +++ b/settlement/grpc/grpc.go @@ -14,6 +14,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/libp2p/go-libp2p/core/crypto" "github.com/tendermint/tendermint/libs/pubsub" @@ -28,6 +29,10 @@ import ( rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" ) +const ( + addressPrefix = "dym" +) + // Client is an extension of the base settlement layer client // for usage in tests and local development. type Client struct { @@ -225,7 +230,12 @@ func (c *Client) GetProposer() *types.Sequencer { c.logger.Error("Error converting to tendermint pubkey", "err", err) return nil } - return types.NewSequencer(tmPubKey, pubKey.Address().String()) + settlementAddr, err := bech32.ConvertAndEncode(addressPrefix, pubKeyBytes) + if err != nil { + c.logger.Error("Error converting pubkey to settlement address", "err", err) + return nil + } + return types.NewSequencer(tmPubKey, settlementAddr) } // GetAllSequencers implements settlement.ClientI. diff --git a/settlement/local/local.go b/settlement/local/local.go index b085a567b..6cf97ed0a 100644 --- a/settlement/local/local.go +++ b/settlement/local/local.go @@ -15,6 +15,7 @@ import ( cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/libp2p/go-libp2p/core/crypto" "github.com/tendermint/tendermint/libs/pubsub" @@ -28,7 +29,10 @@ import ( uevent "github.com/dymensionxyz/dymint/utils/event" ) -const kvStoreDBName = "settlement" +const ( + kvStoreDBName = "settlement" + addressPrefix = "dym" +) var ( settlementKVPrefix = []byte{0} @@ -203,7 +207,12 @@ func (c *Client) GetProposer() *types.Sequencer { c.logger.Error("Error converting to tendermint pubkey", "err", err) return nil } - return types.NewSequencer(tmPubKey, pubKey.Address().String()) + settlementAddr, err := bech32.ConvertAndEncode(addressPrefix, pubKeyBytes) + if err != nil { + c.logger.Error("Error converting pubkey to settlement address", "err", err) + return nil + } + return types.NewSequencer(tmPubKey, settlementAddr) } // GetAllSequencers implements settlement.ClientI. diff --git a/types/sequencer_set.go b/types/sequencer_set.go index 45ab8447b..b557147a0 100644 --- a/types/sequencer_set.go +++ b/types/sequencer_set.go @@ -52,6 +52,10 @@ func (s Sequencer) Hash() []byte { return tempProposerSet.Hash() } +func (s Sequencer) String() string { + return fmt.Sprintf("Sequencer{SettlementAddress: %s Validator: %s}", s.SettlementAddress, s.val.String()) +} + // SequencerSet is a set of rollapp sequencers and a proposer. type SequencerSet struct { // Sequencers is the set of sequencers registered in the settlement layer From ef2a708cee1731a3b87b11fec57fb598fa3c9936 Mon Sep 17 00:00:00 2001 From: keruch Date: Mon, 7 Oct 2024 19:10:11 +0200 Subject: [PATCH 17/27] tests fix 2 --- block/produce.go | 2 +- p2p/client_test.go | 4 +- proto/protoc.sh | 1 - proto/types/rollapp/sequencers/tx.proto | 45 - testutil/types.go | 21 +- types/pb/rollapp/sequencers/tx.pb.go | 1314 ----------------------- 6 files changed, 21 insertions(+), 1366 deletions(-) delete mode 100644 proto/types/rollapp/sequencers/tx.proto delete mode 100644 types/pb/rollapp/sequencers/tx.pb.go diff --git a/block/produce.go b/block/produce.go index 77492508d..95f825361 100644 --- a/block/produce.go +++ b/block/produce.go @@ -221,7 +221,7 @@ func (m *Manager) consensusMsgsOnCreateBlock( return nil, fmt.Errorf("next squencer pubkey to proto any: %w", err) } - // Get raw bytes of the proposer's settlement address. These bytes are to be converted to the rollapp format later. + // Get raw bytes of the proposer's settlement address. These bytes will to be converted to the rollapp format in the app. _, addrBytes, err := bech32.DecodeAndConvert(nextProposerSettlementAddr) if err != nil { return nil, fmt.Errorf("next squencer settlement addr to bech32: %w", err) diff --git a/p2p/client_test.go b/p2p/client_test.go index 020d6a052..fcf2ab293 100644 --- a/p2p/client_test.go +++ b/p2p/client_test.go @@ -17,10 +17,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/dymensionxyz/dymint/store" "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/pubsub" + "github.com/dymensionxyz/dymint/store" + "github.com/dymensionxyz/dymint/config" "github.com/dymensionxyz/dymint/p2p" "github.com/dymensionxyz/dymint/testutil" @@ -49,6 +50,7 @@ func TestClientStartup(t *testing.T) { assert.NoError(err) } +// TestBootstrapping TODO: this test is flaky in main. Try running it 100 times to reproduce. func TestBootstrapping(t *testing.T) { assert := assert.New(t) logger := log.TestingLogger() diff --git a/proto/protoc.sh b/proto/protoc.sh index 2937453b7..4b23b9743 100755 --- a/proto/protoc.sh +++ b/proto/protoc.sh @@ -7,7 +7,6 @@ buf generate --path="./proto/types/dalc" --template="buf.gen.yaml" --config="buf buf generate --path="./proto/types/dymint" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/interchain_da" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/dymensionxyz" --template="buf.gen.yaml" --config="buf.yaml" -buf generate --path="./proto/types/rollapp" --template="buf.gen.yaml" --config="buf.yaml" # Generate the `test` proto files buf generate --path="./proto/test" --template="buf.gen.yaml" --config="buf.yaml" diff --git a/proto/types/rollapp/sequencers/tx.proto b/proto/types/rollapp/sequencers/tx.proto deleted file mode 100644 index 2db0f029d..000000000 --- a/proto/types/rollapp/sequencers/tx.proto +++ /dev/null @@ -1,45 +0,0 @@ -// This file is a modified copy of the dymension-rdk/sequencers module proto contract. Source: -// https://github.com/dymensionxyz/dymension-rdk/blob/28628bcb329ac7b4cdd6d19f1c43f26d03410f84/proto/sequencers/tx.proto. -// It contains only message definitions but without the Msg service. -syntax = "proto3"; -package rollapp.sequencers.types; - -import "gogoproto/gogo.proto"; -import "types/cosmos/msg/v1/msg.proto"; -import "google/protobuf/any.proto"; - -option go_package = "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers"; - -message MsgCreateSequencer { - option (cosmos.msg.v1.signer) = "operator"; - // Operator is the bech32-encoded address of the actor sending the update - must be val addr - string operator = 1; - // PubKey is a tendermint consensus pub key - google.protobuf.Any pub_key = 2; - // Signature is operator signed with the private key of pub_key - bytes signature = 3; -} - -message MsgCreateSequencerResponse {} - -message MsgUpsertSequencer { - option (cosmos.msg.v1.signer) = "operator"; - // Operator is the bech32-encoded address of the actor sending the update - must be val addr - string operator = 1; - // ConsPubKey is a tendermint consensus pub key - google.protobuf.Any cons_pub_key = 2; - // RewardAddrBytes is the bytes representation of the sequencer's reward account - bytes reward_addr_bytes = 3; -} - -message MsgUpsertSequencerResponse {} - -message MsgUpdateSequencer { - option (cosmos.msg.v1.signer) = "operator"; - // Operator is the bech32-encoded address of the actor sending the update - must be val addr - string operator = 1; - // RewardAddr is a bech32 encoded sdk acc address - string reward_addr = 3; -} - -message MsgUpdateSequencerResponse {} diff --git a/testutil/types.go b/testutil/types.go index e019fc0bc..0952a8456 100644 --- a/testutil/types.go +++ b/testutil/types.go @@ -5,9 +5,7 @@ import ( "math/big" "time" - "github.com/dymensionxyz/dymint/types" - "github.com/dymensionxyz/dymint/types/pb/dymint" - dymintversion "github.com/dymensionxyz/dymint/version" + "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/libp2p/go-libp2p/core/crypto" abci "github.com/tendermint/tendermint/abci/types" tmcrypto "github.com/tendermint/tendermint/crypto" @@ -16,6 +14,10 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" version "github.com/tendermint/tendermint/proto/tendermint/version" tmtypes "github.com/tendermint/tendermint/types" + + "github.com/dymensionxyz/dymint/types" + "github.com/dymensionxyz/dymint/types/pb/dymint" + dymintversion "github.com/dymensionxyz/dymint/version" ) const ( @@ -23,6 +25,8 @@ const ( BlockVersion = 1 // AppVersion is the default app version for testing AppVersion = 2 + + SettlementAccountPrefix = "dym" ) func createRandomHashes() [][32]byte { @@ -38,6 +42,15 @@ func createRandomHashes() [][32]byte { return h } +func GenerateSettlementAddress() string { + addrBytes := ed25519.GenPrivKey().PubKey().Address().Bytes() + addr, err := bech32.ConvertAndEncode(SettlementAccountPrefix, addrBytes) + if err != nil { + panic(err) + } + return addr +} + func GetRandomTx() types.Tx { n, _ := rand.Int(rand.Reader, big.NewInt(100)) size := uint64(n.Int64()) + 100 @@ -247,7 +260,7 @@ func GenerateStateWithSequencer(initialHeight int64, lastBlockHeight int64, pubk }, }, } - s.Sequencers.SetProposer(types.NewSequencer(pubkey, "")) + s.Sequencers.SetProposer(types.NewSequencer(pubkey, GenerateSettlementAddress())) s.SetHeight(uint64(lastBlockHeight)) return s } diff --git a/types/pb/rollapp/sequencers/tx.pb.go b/types/pb/rollapp/sequencers/tx.pb.go deleted file mode 100644 index 60210f738..000000000 --- a/types/pb/rollapp/sequencers/tx.pb.go +++ /dev/null @@ -1,1314 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: types/rollapp/sequencers/tx.proto - -package sequencers - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - types "github.com/gogo/protobuf/types" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -type MsgCreateSequencer struct { - // Operator is the bech32-encoded address of the actor sending the update - must be val addr - Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` - // PubKey is a tendermint consensus pub key - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - // Signature is operator signed with the private key of pub_key - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` -} - -func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } -func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } -func (*MsgCreateSequencer) ProtoMessage() {} -func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { - return fileDescriptor_30467481bc397351, []int{0} -} -func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateSequencer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgCreateSequencer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateSequencer.Merge(m, src) -} -func (m *MsgCreateSequencer) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateSequencer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateSequencer.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateSequencer proto.InternalMessageInfo - -func (m *MsgCreateSequencer) GetOperator() string { - if m != nil { - return m.Operator - } - return "" -} - -func (m *MsgCreateSequencer) GetPubKey() *types.Any { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *MsgCreateSequencer) GetSignature() []byte { - if m != nil { - return m.Signature - } - return nil -} - -type MsgCreateSequencerResponse struct { -} - -func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerResponse{} } -func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateSequencerResponse) ProtoMessage() {} -func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_30467481bc397351, []int{1} -} -func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgCreateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgCreateSequencerResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgCreateSequencerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateSequencerResponse.Merge(m, src) -} -func (m *MsgCreateSequencerResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgCreateSequencerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateSequencerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo - -type MsgUpsertSequencer struct { - // Operator is the bech32-encoded address of the actor sending the update - must be val addr - Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` - // ConsPubKey is a tendermint consensus pub key - ConsPubKey *types.Any `protobuf:"bytes,2,opt,name=cons_pub_key,json=consPubKey,proto3" json:"cons_pub_key,omitempty"` - // RewardAddrBytes is the bytes representation of the sequencer's reward account - RewardAddrBytes []byte `protobuf:"bytes,3,opt,name=reward_addr_bytes,json=rewardAddrBytes,proto3" json:"reward_addr_bytes,omitempty"` -} - -func (m *MsgUpsertSequencer) Reset() { *m = MsgUpsertSequencer{} } -func (m *MsgUpsertSequencer) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertSequencer) ProtoMessage() {} -func (*MsgUpsertSequencer) Descriptor() ([]byte, []int) { - return fileDescriptor_30467481bc397351, []int{2} -} -func (m *MsgUpsertSequencer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpsertSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpsertSequencer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpsertSequencer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertSequencer.Merge(m, src) -} -func (m *MsgUpsertSequencer) XXX_Size() int { - return m.Size() -} -func (m *MsgUpsertSequencer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertSequencer.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpsertSequencer proto.InternalMessageInfo - -func (m *MsgUpsertSequencer) GetOperator() string { - if m != nil { - return m.Operator - } - return "" -} - -func (m *MsgUpsertSequencer) GetConsPubKey() *types.Any { - if m != nil { - return m.ConsPubKey - } - return nil -} - -func (m *MsgUpsertSequencer) GetRewardAddrBytes() []byte { - if m != nil { - return m.RewardAddrBytes - } - return nil -} - -type MsgUpsertSequencerResponse struct { -} - -func (m *MsgUpsertSequencerResponse) Reset() { *m = MsgUpsertSequencerResponse{} } -func (m *MsgUpsertSequencerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpsertSequencerResponse) ProtoMessage() {} -func (*MsgUpsertSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_30467481bc397351, []int{3} -} -func (m *MsgUpsertSequencerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpsertSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpsertSequencerResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpsertSequencerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpsertSequencerResponse.Merge(m, src) -} -func (m *MsgUpsertSequencerResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpsertSequencerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpsertSequencerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpsertSequencerResponse proto.InternalMessageInfo - -type MsgUpdateSequencer struct { - // Operator is the bech32-encoded address of the actor sending the update - must be val addr - Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` - // RewardAddr is a bech32 encoded sdk acc address - RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` -} - -func (m *MsgUpdateSequencer) Reset() { *m = MsgUpdateSequencer{} } -func (m *MsgUpdateSequencer) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateSequencer) ProtoMessage() {} -func (*MsgUpdateSequencer) Descriptor() ([]byte, []int) { - return fileDescriptor_30467481bc397351, []int{4} -} -func (m *MsgUpdateSequencer) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateSequencer.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateSequencer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateSequencer.Merge(m, src) -} -func (m *MsgUpdateSequencer) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateSequencer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateSequencer.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateSequencer proto.InternalMessageInfo - -func (m *MsgUpdateSequencer) GetOperator() string { - if m != nil { - return m.Operator - } - return "" -} - -func (m *MsgUpdateSequencer) GetRewardAddr() string { - if m != nil { - return m.RewardAddr - } - return "" -} - -type MsgUpdateSequencerResponse struct { -} - -func (m *MsgUpdateSequencerResponse) Reset() { *m = MsgUpdateSequencerResponse{} } -func (m *MsgUpdateSequencerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateSequencerResponse) ProtoMessage() {} -func (*MsgUpdateSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_30467481bc397351, []int{5} -} -func (m *MsgUpdateSequencerResponse) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *MsgUpdateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_MsgUpdateSequencerResponse.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *MsgUpdateSequencerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateSequencerResponse.Merge(m, src) -} -func (m *MsgUpdateSequencerResponse) XXX_Size() int { - return m.Size() -} -func (m *MsgUpdateSequencerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateSequencerResponse.DiscardUnknown(m) -} - -var xxx_messageInfo_MsgUpdateSequencerResponse proto.InternalMessageInfo - -func init() { - proto.RegisterType((*MsgCreateSequencer)(nil), "rollapp.sequencers.types.MsgCreateSequencer") - proto.RegisterType((*MsgCreateSequencerResponse)(nil), "rollapp.sequencers.types.MsgCreateSequencerResponse") - proto.RegisterType((*MsgUpsertSequencer)(nil), "rollapp.sequencers.types.MsgUpsertSequencer") - proto.RegisterType((*MsgUpsertSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpsertSequencerResponse") - proto.RegisterType((*MsgUpdateSequencer)(nil), "rollapp.sequencers.types.MsgUpdateSequencer") - proto.RegisterType((*MsgUpdateSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpdateSequencerResponse") -} - -func init() { proto.RegisterFile("types/rollapp/sequencers/tx.proto", fileDescriptor_30467481bc397351) } - -var fileDescriptor_30467481bc397351 = []byte{ - // 395 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xb1, 0xce, 0xd3, 0x30, - 0x10, 0xc7, 0x6b, 0x90, 0x0a, 0x75, 0x8b, 0x10, 0x51, 0x87, 0x10, 0x95, 0x50, 0x3a, 0x55, 0x95, - 0x88, 0x05, 0x48, 0x0c, 0xdd, 0x5a, 0x46, 0x84, 0x84, 0x02, 0x2c, 0x2c, 0x21, 0x89, 0x0f, 0x13, - 0xd1, 0xd8, 0xc6, 0x76, 0xa0, 0x66, 0x64, 0x66, 0xe0, 0x1d, 0x78, 0x01, 0x1e, 0x83, 0xb1, 0x23, - 0x23, 0x6a, 0x07, 0x5e, 0x03, 0x25, 0x4e, 0x5b, 0xc4, 0xd7, 0x4f, 0xea, 0x94, 0xdc, 0xfd, 0xcf, - 0xff, 0xfb, 0xdd, 0xe9, 0xf0, 0x3d, 0x63, 0x25, 0x68, 0xa2, 0xc4, 0x6a, 0x95, 0x4a, 0x49, 0x34, - 0x7c, 0xa8, 0x80, 0xe7, 0xa0, 0x34, 0x31, 0xeb, 0x48, 0x2a, 0x61, 0x84, 0xe7, 0xb7, 0x62, 0x74, - 0x14, 0xa3, 0xe6, 0x55, 0x30, 0x64, 0x82, 0x89, 0xa6, 0x88, 0xd4, 0x7f, 0xae, 0x3e, 0xb8, 0xe3, - 0x2c, 0x73, 0xa1, 0x4b, 0xa1, 0x49, 0xa9, 0x19, 0xf9, 0xf8, 0xa0, 0xfe, 0xb4, 0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d3, 0x53, 0x3b, 0x5c, 0xbe, 0xfc, 0xb9, 0x0d, 0xd1, 0x66, 0x1b, 0xa2, 0xdf, 0xdb, - 0x10, 0x7d, 0xdb, 0x85, 0x9d, 0xcd, 0x2e, 0xec, 0xfc, 0xda, 0x85, 0x9d, 0xd7, 0x73, 0x56, 0x98, - 0x77, 0x55, 0x16, 0xe5, 0xa2, 0x24, 0xd4, 0x96, 0xc0, 0x75, 0x21, 0xf8, 0xda, 0x7e, 0xae, 0x83, - 0x82, 0x1b, 0xe2, 0x6e, 0x4c, 0x66, 0x27, 0x2e, 0x37, 0xeb, 0x36, 0x8b, 0x7c, 0xf4, 0x37, 0x00, - 0x00, 0xff, 0xff, 0xa1, 0x43, 0x69, 0xfb, 0xdc, 0x02, 0x00, 0x00, -} - -func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x1a - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Operator) > 0 { - i -= len(m.Operator) - copy(dAtA[i:], m.Operator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgCreateSequencerResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCreateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpsertSequencer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpsertSequencer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpsertSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RewardAddrBytes) > 0 { - i -= len(m.RewardAddrBytes) - copy(dAtA[i:], m.RewardAddrBytes) - i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddrBytes))) - i-- - dAtA[i] = 0x1a - } - if m.ConsPubKey != nil { - { - size, err := m.ConsPubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - } - if len(m.Operator) > 0 { - i -= len(m.Operator) - copy(dAtA[i:], m.Operator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpsertSequencerResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpsertSequencerResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpsertSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func (m *MsgUpdateSequencer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateSequencer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.RewardAddr) > 0 { - i -= len(m.RewardAddr) - copy(dAtA[i:], m.RewardAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) - i-- - dAtA[i] = 0x1a - } - if len(m.Operator) > 0 { - i -= len(m.Operator) - copy(dAtA[i:], m.Operator) - i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func (m *MsgUpdateSequencerResponse) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgUpdateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgUpdateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - return len(dAtA) - i, nil -} - -func encodeVarintTx(dAtA []byte, offset int, v uint64) int { - offset -= sovTx(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *MsgCreateSequencer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Operator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signature) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgCreateSequencerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpsertSequencer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Operator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - if m.ConsPubKey != nil { - l = m.ConsPubKey.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.RewardAddrBytes) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpsertSequencerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func (m *MsgUpdateSequencer) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Operator) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.RewardAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } - return n -} - -func (m *MsgUpdateSequencerResponse) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - return n -} - -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubKey == nil { - m.PubKey = &types.Any{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSequencerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpsertSequencer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpsertSequencer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertSequencer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field ConsPubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.ConsPubKey == nil { - m.ConsPubKey = &types.Any{} - } - if err := m.ConsPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardAddrBytes", wireType) - } - var byteLen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - byteLen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if byteLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RewardAddrBytes = append(m.RewardAddrBytes[:0], dAtA[iNdEx:postIndex]...) - if m.RewardAddrBytes == nil { - m.RewardAddrBytes = []byte{} - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpsertSequencerResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpsertSequencerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpsertSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateSequencer: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Operator = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RewardAddr = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func (m *MsgUpdateSequencerResponse) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateSequencerResponse: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - default: - iNdEx = preIndex - skippy, err := skipTx(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthTx - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipTx(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowTx - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthTx - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupTx - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthTx - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") -) From f357f7d13700209700f771109e7a931830fbf012 Mon Sep 17 00:00:00 2001 From: omritoptix Date: Tue, 8 Oct 2024 16:26:16 +0200 Subject: [PATCH 18/27] Updated cometbft version. --- go.mod | 3 +-- go.sum | 2 ++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/go.mod b/go.mod index 903f622d9..c342ffd4b 100644 --- a/go.mod +++ b/go.mod @@ -301,8 +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 => ../cometbft + 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 85c734c3a..cba754ced 100644 --- a/go.sum +++ b/go.sum @@ -457,6 +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.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= From ae841598af2f53ae1c1b5f8619e6f911378152be Mon Sep 17 00:00:00 2001 From: keruch Date: Wed, 9 Oct 2024 17:07:43 +0200 Subject: [PATCH 19/27] linked tasks --- block/manager.go | 2 +- block/produce.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/block/manager.go b/block/manager.go index 89ee16df0..e89b4db87 100644 --- a/block/manager.go +++ b/block/manager.go @@ -112,7 +112,7 @@ func NewManager( mempool, proxyApp, eventBus, - nil, // TODO add ConsensusMessagesStream + nil, // TODO add ConsensusMessagesStream: https://github.com/dymensionxyz/dymint/issues/1125 logger, ) if err != nil { diff --git a/block/produce.go b/block/produce.go index 95f825361..5762c2172 100644 --- a/block/produce.go +++ b/block/produce.go @@ -172,6 +172,10 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerInfo *nextProposerIn nextProposerAddr = nextProposerInfo.nextProposerAddr lastProposerBlock = true } + // TODO: Ideally, there should be only one point for adding consensus messages. Given that they come from + // ConsensusMessagesStream, this should send them there instead of having to ways of sending consensusMessages. + // There is no implementation of the stream as of now. Unify the approach of adding consensus messages when + // the stream is implemented! https://github.com/dymensionxyz/dymint/issues/1125 consensusMsgs, err := m.consensusMsgsOnCreateBlock(nextProposerAddr, lastProposerBlock) if err != nil { return nil, nil, fmt.Errorf("create consensus msgs for create block: last proposer block: %v, height: %d, next proposer addr: %s: %w: %w", lastProposerBlock, newHeight, nextProposerAddr, err, ErrNonRecoverable) From ab8d8d20edb4ef73b65d7614d52040d290479a9c Mon Sep 17 00:00:00 2001 From: keruch Date: Tue, 15 Oct 2024 00:07:25 +0200 Subject: [PATCH 20/27] feat(proto): added hub and rdk x/sequencer --- .mockery.yaml | 2 +- block/produce.go | 64 +- buf.yaml | 1 - go.mod | 14 +- go.sum | 22 +- .../dymint/da/avail/mock_SubstrateApiI.go | 2 +- .../celestia/types/mock_CelestiaRPCClient.go | 2 +- .../da/mock_DataAvailabilityLayerClient.go | 2 +- .../settlement/dymension/mock_CosmosClient.go | 4 +- .../dymint/settlement/mock_ClientI.go | 2 +- .../dymensionxyz/dymint/store/mock_Store.go | 2 +- .../sequencer/types/mock_QueryClient.go | 2 +- .../dymension/rollapp/mock_QueryClient.go | 2 +- .../dymension/sequencer/mock_QueryClient.go | 632 +++++++ .../tendermint/abci/types/mock_Application.go | 2 +- .../tendermint/proxy/mock_AppConnConsensus.go | 2 +- .../tendermint/proxy/mock_AppConns.go | 2 +- proto/protoc.sh | 1 + .../dymension/sequencer/events.proto | 45 + .../dymension/sequencer/genesis.proto | 25 + .../dymension/sequencer/metadata.proto | 54 + .../sequencer/operating_status.proto | 20 + .../dymension/sequencer/params.proto | 36 + .../dymension/sequencer/query.proto | 109 ++ .../dymension/sequencer/sequencer.proto | 64 + .../dymensionxyz/dymension/sequencer/tx.proto | 131 ++ proto/types/rollapp/sequencers/types/tx.proto | 45 + settlement/dymension/cosmosclient.go | 3 +- settlement/dymension/dymension.go | 13 +- settlement/dymension/dymension_test.go | 8 +- .../sequencer/types/description.pb.go | 531 ------ .../dymension/sequencer/types/events.pb.go | 450 ----- .../dymension/sequencer/types/query.pb.gw.go | 769 -------- .../dymension/sequencer}/events.go | 2 +- .../dymension/sequencer/events.pb.go | 1242 +++++++++++++ .../dymension/sequencer}/genesis.pb.go | 60 +- .../dymensionxyz/dymension/sequencer}/keys.go | 2 +- .../dymension/sequencer/metadata.pb.go | 1494 +++++++++++++++ .../sequencer/operating_status.pb.go | 85 + .../dymension/sequencer}/params.go | 2 +- .../dymension/sequencer}/params.pb.go | 70 +- .../dymension/sequencer}/query.pb.go | 614 ++++++- .../dymension/sequencer/sequencer.pb.go | 1241 +++++++++++++ .../dymension/sequencer}/tx.pb.go | 1621 +++++++++++++---- types/pb/rollapp/sequencers/types/tx.pb.go | 1316 +++++++++++++ utils/proto/converters.go | 26 + utils/proto/converters_test.go | 97 + .../test_data/cosmos_proto}/metadata.pb.go | 0 .../cosmos_proto}/operating_status.pb.go | 2 +- .../test_data/cosmos_proto}/sequencer.pb.go | 0 .../proto/test_data/gogo_proto/metadata.pb.go | 1494 +++++++++++++++ .../gogo_proto/operating_status.pb.go | 85 + .../test_data/gogo_proto/sequencer.pb.go | 1241 +++++++++++++ 53 files changed, 11400 insertions(+), 2357 deletions(-) create mode 100644 mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go create mode 100644 proto/types/dymensionxyz/dymension/sequencer/events.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/genesis.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/metadata.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/operating_status.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/params.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/query.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/sequencer.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/tx.proto create mode 100644 proto/types/rollapp/sequencers/types/tx.proto delete mode 100644 third_party/dymension/sequencer/types/description.pb.go delete mode 100644 third_party/dymension/sequencer/types/events.pb.go delete mode 100644 third_party/dymension/sequencer/types/query.pb.gw.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/events.go (98%) create mode 100644 types/pb/dymensionxyz/dymension/sequencer/events.pb.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/genesis.pb.go (86%) rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/keys.go (99%) create mode 100644 types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go create mode 100644 types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/params.go (89%) rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/params.pb.go (80%) rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/query.pb.go (81%) create mode 100644 types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/tx.pb.go (61%) create mode 100644 types/pb/rollapp/sequencers/types/tx.pb.go create mode 100644 utils/proto/converters.go create mode 100644 utils/proto/converters_test.go rename {third_party/dymension/sequencer/types => utils/proto/test_data/cosmos_proto}/metadata.pb.go (100%) rename {third_party/dymension/sequencer/types => utils/proto/test_data/cosmos_proto}/operating_status.pb.go (98%) rename {third_party/dymension/sequencer/types => utils/proto/test_data/cosmos_proto}/sequencer.pb.go (100%) create mode 100644 utils/proto/test_data/gogo_proto/metadata.pb.go create mode 100644 utils/proto/test_data/gogo_proto/operating_status.pb.go create mode 100644 utils/proto/test_data/gogo_proto/sequencer.pb.go diff --git a/.mockery.yaml b/.mockery.yaml index ba06d15ea..d0ef54a13 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -10,7 +10,7 @@ packages: github.com/dymensionxyz/dymint/settlement/dymension: interfaces: CosmosClient: - github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types: + github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer: interfaces: QueryClient: github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp: diff --git a/block/produce.go b/block/produce.go index 5762c2172..ff458887e 100644 --- a/block/produce.go +++ b/block/produce.go @@ -7,20 +7,21 @@ import ( "time" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/types/bech32" - sequencertypes "github.com/dymensionxyz/dymension-rdk/x/sequencers/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/gogo/protobuf/proto" tmed25519 "github.com/tendermint/tendermint/crypto/ed25519" - tmcrypto "github.com/tendermint/tendermint/crypto/encoding" cmtproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers/types" + "github.com/dymensionxyz/dymint/node/events" "github.com/dymensionxyz/dymint/store" "github.com/dymensionxyz/dymint/types" uevent "github.com/dymensionxyz/dymint/utils/event" + protoutils "github.com/dymensionxyz/dymint/utils/proto" ) // ProduceBlockLoop is calling publishBlock in a loop as long as we're synced. @@ -204,40 +205,35 @@ func (m *Manager) consensusMsgsOnCreateBlock( nextProposerSettlementAddr string, lastSeqBlock bool, // Indicates that the block is the last for the current seq. True during the rotation. ) ([]proto.Message, error) { - if m.State.IsGenesis() || lastSeqBlock { - nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) - // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. - if nextSeq == nil { - return nil, fmt.Errorf("no sequencer found for address while creating a new block: %s", nextProposerSettlementAddr) - } - - // Get proposer's consensus public key and convert it to proto.Any - val, err := nextSeq.TMValidator() - if err != nil { - return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) - } - pubKey, err := tmcrypto.PubKeyToProto(val.PubKey) - if err != nil { - return nil, fmt.Errorf("next squencer pub key to proto: %w", err) - } - anyPubKey, err := codectypes.NewAnyWithValue(&pubKey) - if err != nil { - return nil, fmt.Errorf("next squencer pubkey to proto any: %w", err) - } + if !m.State.IsGenesis() && !lastSeqBlock { + return nil, nil + } - // Get raw bytes of the proposer's settlement address. These bytes will to be converted to the rollapp format in the app. - _, addrBytes, err := bech32.DecodeAndConvert(nextProposerSettlementAddr) - if err != nil { - return nil, fmt.Errorf("next squencer settlement addr to bech32: %w", err) - } + nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) + // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. + if nextSeq == nil { + return nil, fmt.Errorf("no sequencer found for address while creating a new block: %s", nextProposerSettlementAddr) + } - return []proto.Message{&sequencertypes.MsgUpsertSequencer{ - Operator: nextProposerSettlementAddr, - ConsPubKey: anyPubKey, - RewardAddrBytes: addrBytes, - }}, nil + // Get proposer's consensus public key and convert it to proto.Any + val, err := nextSeq.TMValidator() + if err != nil { + return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) } - return nil, nil + pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + if err != nil { + return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) + } + anyPK, err := codectypes.NewAnyWithValue(pubKey) + if err != nil { + return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) + } + + return []proto.Message{&sequencertypes.ConsensusMsgUpsertSequencer{ + Operator: nextProposerSettlementAddr, + ConsPubKey: protoutils.CosmosToGogo(anyPK), + RewardAddr: nextProposerSettlementAddr, + }}, nil } // create commit for block diff --git a/buf.yaml b/buf.yaml index 6ed37d3af..ddd1a9051 100644 --- a/buf.yaml +++ b/buf.yaml @@ -3,7 +3,6 @@ version: v1beta1 build: roots: - proto - - third_party/proto lint: use: - DEFAULT diff --git a/go.mod b/go.mod index 442788408..b0d841944 100644 --- a/go.mod +++ b/go.mod @@ -11,7 +11,6 @@ require ( github.com/cosmos/cosmos-sdk v0.46.16 github.com/dgraph-io/badger/v4 v4.3.0 github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 - github.com/dymensionxyz/dymension-rdk v1.6.1 github.com/dymensionxyz/gerr-cosmos v1.0.0 github.com/go-kit/kit v0.12.0 github.com/gofrs/uuid v4.3.0+incompatible @@ -43,14 +42,19 @@ require ( ) require ( + cloud.google.com/go v0.112.1 // indirect + cloud.google.com/go/storage v1.38.0 // indirect github.com/celestiaorg/go-square v1.0.1 // indirect github.com/celestiaorg/go-square/merkle v0.0.0-20240429192549-dea967e1533b // indirect + github.com/cosmos/ibc-go/v6 v6.2.1 // indirect github.com/cskr/pubsub v1.0.2 // indirect github.com/dgraph-io/badger/v3 v3.2103.3 // indirect + github.com/felixge/httpsnoop v1.0.4 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect github.com/tklauser/numcpus v0.6.0 // indirect + google.golang.org/api v0.169.0 // indirect ) require ( @@ -117,7 +121,7 @@ require ( go.uber.org/fx v1.20.1 // indirect golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect sigs.k8s.io/yaml v1.4.0 // indirect @@ -292,13 +296,7 @@ require ( ) replace ( - // This replacement is needed in order to import dymension-rdk properly. It's inherited from - // https://github.com/dymensionxyz/dymension-rdk/blob/82c4d5f8c09365b20b4378c0cc459b414fd306e8/go.mod#L315. - github.com/CosmWasm/wasmd => github.com/decentrio/wasmd v0.33.0-sdk46.2 github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/availproject/go-substrate-rpc-client/v4 v4.0.12-avail-1.4.0-rc1-5e286e3 - // TODO: uncomment after https://github.com/dymensionxyz/dymension-rdk/pull/563 is merged - // github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240827102903-08636e7ab3f8 - github.com/dymensionxyz/dymension-rdk => ../dymension-rdk 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 diff --git a/go.sum b/go.sum index 93221c6d8..38fdd11b2 100644 --- a/go.sum +++ b/go.sum @@ -189,14 +189,6 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.0 h1:QsEMIWuv9xWDbF2HZnW4Lpu1/SejCztPu0LQx7t6MN4= -cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= -cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= -cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU= -cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= @@ -219,8 +211,6 @@ github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03 github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= -github.com/CosmWasm/wasmvm v1.2.3 h1:OKYlobwmVGbl0eSn0mXoAAjE5hIuXnQCLPjbNd91sVY= -github.com/CosmWasm/wasmvm v1.2.3/go.mod h1:vW/E3h8j9xBQs9bCoijDuawKo9kCtxOaS8N8J7KFtkc= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -384,8 +374,6 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8 github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= -github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= -github.com/cosmos/cosmos-db v1.0.0/go.mod h1:iBvi1TtqaedwLdcrZVYRSSCb6eSy61NLj4UNmdIgs0U= github.com/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= github.com/cosmos/cosmos-sdk v0.46.16 h1:RVGv1+RulLZeNyfCaPZrZtv0kY7ZZNAI6JGpub0Uh6o= @@ -423,8 +411,6 @@ github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1 github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c h1:pFUpOrbxDR6AkioZ1ySsx5yxlDQZ8stG2b88gTPxgJU= github.com/davidlazar/go-crypto v0.0.0-20200604182044-b73af7476f6c/go.mod h1:6UhI8N9EjYm1c2odKpFpAYeR8dsBeM7PtzQhRgxRr9U= -github.com/decentrio/wasmd v0.33.0-sdk46.2 h1:cUgYN8crDXiQiKLBYfGR5IXg77Z/QrvZBoU9Fg/1ACo= -github.com/decentrio/wasmd v0.33.0-sdk46.2/go.mod h1:mPBiB+54La70eS2HHzvK2Vn7Frgf7rjnxDo70oopw+w= github.com/deckarep/golang-set v1.8.0 h1:sk9/l/KqpunDwP7pSjUg0keiOOLEnOBHzykLrsPppp4= github.com/deckarep/golang-set v1.8.0/go.mod h1:5nI87KwE7wgsBU1F4GKAw2Qod7p5kyS383rP6+o6qqo= github.com/deckarep/golang-set/v2 v2.1.0 h1:g47V4Or+DUdzbs8FxCCmgb6VYd+ptPAngjM6dtGktsI= @@ -457,8 +443,6 @@ github.com/dlclark/regexp2 v1.7.0 h1:7lJfhqlPssTb1WQx4yvTHN0uElPEv52sbaECrAQxjAo github.com/dlclark/regexp2 v1.7.0/go.mod h1:DHkYz0B9wPfa6wondMfaivmHpzrQ3v9q8cnmRbL6yW8= github.com/docker/cli v23.0.1+incompatible h1:LRyWITpGzl2C9e9uGxzisptnxAn1zfZKXy13Ul2Q5oM= github.com/docker/cli v23.0.1+incompatible/go.mod h1:JLrzqnKDaYBop7H2jaqPtU4hHvMKP+vjCwu2uszcLI8= -github.com/docker/distribution v2.8.2+incompatible h1:T3de5rq0dB1j30rp0sA2rER+m322EBzniBPB6ZIzuh8= -github.com/docker/distribution v2.8.2+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w= github.com/docker/docker v23.0.1+incompatible h1:vjgvJZxprTTE1A37nm+CLNAdwu6xZekyoiVlUZEINcY= github.com/docker/docker v23.0.1+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk= github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ= @@ -483,8 +467,6 @@ github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj51 github.com/dymensionxyz/gerr-cosmos v1.0.0/go.mod h1:n+0olxPogzWqFKba45mCpvrHLGmeS8W9UZjggHnWk6c= github.com/dymensionxyz/rpc v1.3.1 h1:7EXWIobaBes5zldRvTIg7TmNsEKjicrWA/OjCc0NaGs= github.com/dymensionxyz/rpc v1.3.1/go.mod h1:f+WpX8ysy8wt95iGc6auYlHcnHj2bUkhiRVkkKNys8c= -github.com/dymensionxyz/sdk-utils v0.1.2-0.20240905104639-19dc09f5c6f5 h1:o6Jh8D4QZ7yifvOWV7/uoIugLZE0mTSOdz05ScaNNdU= -github.com/dymensionxyz/sdk-utils v0.1.2-0.20240905104639-19dc09f5c6f5/go.mod h1:5fmenxP75quS5D1gPynbmh5qE6vla64Kks2O/hM+gi4= github.com/elastic/gosigar v0.12.0/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= github.com/elastic/gosigar v0.14.2 h1:Dg80n8cr90OZ7x+bAax/QjoW/XqTI11RmA79ZwIm9/4= github.com/elastic/gosigar v0.14.2/go.mod h1:iXRIGg2tLnu7LBdpqzyQfGDEidKCfWcCMS0WKyPWoMs= @@ -1218,8 +1200,8 @@ github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= -github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= -github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= +github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= +github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= diff --git a/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go b/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go index 6a52c1df8..bba31b087 100644 --- a/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go +++ b/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package avail diff --git a/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go b/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go index 4935cc66a..5994cf817 100644 --- a/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go +++ b/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package types diff --git a/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go b/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go index 75727dd5e..1480d557c 100644 --- a/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go +++ b/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package da diff --git a/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go b/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go index 4b14a3eaf..a7bfa4344 100644 --- a/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go +++ b/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package dymension @@ -17,7 +17,7 @@ import ( rollapp "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" types "github.com/cosmos/cosmos-sdk/types" ) diff --git a/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go b/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go index 784febab1..b03a45ddd 100644 --- a/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go +++ b/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package settlement diff --git a/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go b/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go index 010d1c41c..66207d239 100644 --- a/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go +++ b/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package store diff --git a/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go index fed52c6c5..24f426b0f 100644 --- a/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go +++ b/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - types "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" + types "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" ) // MockQueryClient is an autogenerated mock type for the QueryClient type diff --git a/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go index 83c174f72..f182218a5 100644 --- a/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go +++ b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package rollapp diff --git a/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go new file mode 100644 index 000000000..ba704d658 --- /dev/null +++ b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go @@ -0,0 +1,632 @@ +// Code generated by mockery v2.46.0. DO NOT EDIT. + +package sequencer + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + sequencer "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" +) + +// MockQueryClient is an autogenerated mock type for the QueryClient type +type MockQueryClient struct { + mock.Mock +} + +type MockQueryClient_Expecter struct { + mock *mock.Mock +} + +func (_m *MockQueryClient) EXPECT() *MockQueryClient_Expecter { + return &MockQueryClient_Expecter{mock: &_m.Mock} +} + +// GetNextProposerByRollapp provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) GetNextProposerByRollapp(ctx context.Context, in *sequencer.QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption) (*sequencer.QueryGetNextProposerByRollappResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetNextProposerByRollapp") + } + + var r0 *sequencer.QueryGetNextProposerByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetNextProposerByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) *sequencer.QueryGetNextProposerByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetNextProposerByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_GetNextProposerByRollapp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextProposerByRollapp' +type MockQueryClient_GetNextProposerByRollapp_Call struct { + *mock.Call +} + +// GetNextProposerByRollapp is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetNextProposerByRollappRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) GetNextProposerByRollapp(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_GetNextProposerByRollapp_Call { + return &MockQueryClient_GetNextProposerByRollapp_Call{Call: _e.mock.On("GetNextProposerByRollapp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption)) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetNextProposerByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) Return(_a0 *sequencer.QueryGetNextProposerByRollappResponse, _a1 error) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetNextProposerByRollappResponse, error)) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Return(run) + return _c +} + +// GetProposerByRollapp provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) GetProposerByRollapp(ctx context.Context, in *sequencer.QueryGetProposerByRollappRequest, opts ...grpc.CallOption) (*sequencer.QueryGetProposerByRollappResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetProposerByRollapp") + } + + var r0 *sequencer.QueryGetProposerByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetProposerByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) *sequencer.QueryGetProposerByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetProposerByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_GetProposerByRollapp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerByRollapp' +type MockQueryClient_GetProposerByRollapp_Call struct { + *mock.Call +} + +// GetProposerByRollapp is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetProposerByRollappRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) GetProposerByRollapp(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_GetProposerByRollapp_Call { + return &MockQueryClient_GetProposerByRollapp_Call{Call: _e.mock.On("GetProposerByRollapp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetProposerByRollappRequest, opts ...grpc.CallOption)) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetProposerByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) Return(_a0 *sequencer.QueryGetProposerByRollappResponse, _a1 error) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetProposerByRollappResponse, error)) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Return(run) + return _c +} + +// Params provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Params(ctx context.Context, in *sequencer.QueryParamsRequest, opts ...grpc.CallOption) (*sequencer.QueryParamsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Params") + } + + var r0 *sequencer.QueryParamsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) (*sequencer.QueryParamsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) *sequencer.QueryParamsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryParamsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Params_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Params' +type MockQueryClient_Params_Call struct { + *mock.Call +} + +// Params is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryParamsRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Params(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Params_Call { + return &MockQueryClient_Params_Call{Call: _e.mock.On("Params", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Params_Call) Run(run func(ctx context.Context, in *sequencer.QueryParamsRequest, opts ...grpc.CallOption)) *MockQueryClient_Params_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryParamsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Params_Call) Return(_a0 *sequencer.QueryParamsResponse, _a1 error) *MockQueryClient_Params_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Params_Call) RunAndReturn(run func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) (*sequencer.QueryParamsResponse, error)) *MockQueryClient_Params_Call { + _c.Call.Return(run) + return _c +} + +// Proposers provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Proposers(ctx context.Context, in *sequencer.QueryProposersRequest, opts ...grpc.CallOption) (*sequencer.QueryProposersResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Proposers") + } + + var r0 *sequencer.QueryProposersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) (*sequencer.QueryProposersResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) *sequencer.QueryProposersResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryProposersResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Proposers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Proposers' +type MockQueryClient_Proposers_Call struct { + *mock.Call +} + +// Proposers is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryProposersRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Proposers(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Proposers_Call { + return &MockQueryClient_Proposers_Call{Call: _e.mock.On("Proposers", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Proposers_Call) Run(run func(ctx context.Context, in *sequencer.QueryProposersRequest, opts ...grpc.CallOption)) *MockQueryClient_Proposers_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryProposersRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Proposers_Call) Return(_a0 *sequencer.QueryProposersResponse, _a1 error) *MockQueryClient_Proposers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Proposers_Call) RunAndReturn(run func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) (*sequencer.QueryProposersResponse, error)) *MockQueryClient_Proposers_Call { + _c.Call.Return(run) + return _c +} + +// Sequencer provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Sequencer(ctx context.Context, in *sequencer.QueryGetSequencerRequest, opts ...grpc.CallOption) (*sequencer.QueryGetSequencerResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Sequencer") + } + + var r0 *sequencer.QueryGetSequencerResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencerResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) *sequencer.QueryGetSequencerResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetSequencerResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Sequencer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sequencer' +type MockQueryClient_Sequencer_Call struct { + *mock.Call +} + +// Sequencer is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetSequencerRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Sequencer(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Sequencer_Call { + return &MockQueryClient_Sequencer_Call{Call: _e.mock.On("Sequencer", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Sequencer_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetSequencerRequest, opts ...grpc.CallOption)) *MockQueryClient_Sequencer_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetSequencerRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Sequencer_Call) Return(_a0 *sequencer.QueryGetSequencerResponse, _a1 error) *MockQueryClient_Sequencer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Sequencer_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencerResponse, error)) *MockQueryClient_Sequencer_Call { + _c.Call.Return(run) + return _c +} + +// Sequencers provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Sequencers(ctx context.Context, in *sequencer.QuerySequencersRequest, opts ...grpc.CallOption) (*sequencer.QuerySequencersResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Sequencers") + } + + var r0 *sequencer.QuerySequencersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) (*sequencer.QuerySequencersResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) *sequencer.QuerySequencersResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QuerySequencersResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Sequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sequencers' +type MockQueryClient_Sequencers_Call struct { + *mock.Call +} + +// Sequencers is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QuerySequencersRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Sequencers(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Sequencers_Call { + return &MockQueryClient_Sequencers_Call{Call: _e.mock.On("Sequencers", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Sequencers_Call) Run(run func(ctx context.Context, in *sequencer.QuerySequencersRequest, opts ...grpc.CallOption)) *MockQueryClient_Sequencers_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QuerySequencersRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Sequencers_Call) Return(_a0 *sequencer.QuerySequencersResponse, _a1 error) *MockQueryClient_Sequencers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Sequencers_Call) RunAndReturn(run func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) (*sequencer.QuerySequencersResponse, error)) *MockQueryClient_Sequencers_Call { + _c.Call.Return(run) + return _c +} + +// SequencersByRollapp provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) SequencersByRollapp(ctx context.Context, in *sequencer.QueryGetSequencersByRollappRequest, opts ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for SequencersByRollapp") + } + + var r0 *sequencer.QueryGetSequencersByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) *sequencer.QueryGetSequencersByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetSequencersByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_SequencersByRollapp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequencersByRollapp' +type MockQueryClient_SequencersByRollapp_Call struct { + *mock.Call +} + +// SequencersByRollapp is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetSequencersByRollappRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) SequencersByRollapp(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_SequencersByRollapp_Call { + return &MockQueryClient_SequencersByRollapp_Call{Call: _e.mock.On("SequencersByRollapp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_SequencersByRollapp_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetSequencersByRollappRequest, opts ...grpc.CallOption)) *MockQueryClient_SequencersByRollapp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetSequencersByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_SequencersByRollapp_Call) Return(_a0 *sequencer.QueryGetSequencersByRollappResponse, _a1 error) *MockQueryClient_SequencersByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_SequencersByRollapp_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappResponse, error)) *MockQueryClient_SequencersByRollapp_Call { + _c.Call.Return(run) + return _c +} + +// SequencersByRollappByStatus provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) SequencersByRollappByStatus(ctx context.Context, in *sequencer.QueryGetSequencersByRollappByStatusRequest, opts ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappByStatusResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for SequencersByRollappByStatus") + } + + var r0 *sequencer.QueryGetSequencersByRollappByStatusResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappByStatusResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) *sequencer.QueryGetSequencersByRollappByStatusResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetSequencersByRollappByStatusResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_SequencersByRollappByStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequencersByRollappByStatus' +type MockQueryClient_SequencersByRollappByStatus_Call struct { + *mock.Call +} + +// SequencersByRollappByStatus is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetSequencersByRollappByStatusRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) SequencersByRollappByStatus(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_SequencersByRollappByStatus_Call { + return &MockQueryClient_SequencersByRollappByStatus_Call{Call: _e.mock.On("SequencersByRollappByStatus", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_SequencersByRollappByStatus_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetSequencersByRollappByStatusRequest, opts ...grpc.CallOption)) *MockQueryClient_SequencersByRollappByStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetSequencersByRollappByStatusRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_SequencersByRollappByStatus_Call) Return(_a0 *sequencer.QueryGetSequencersByRollappByStatusResponse, _a1 error) *MockQueryClient_SequencersByRollappByStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_SequencersByRollappByStatus_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappByStatusResponse, error)) *MockQueryClient_SequencersByRollappByStatus_Call { + _c.Call.Return(run) + return _c +} + +// NewMockQueryClient creates a new instance of MockQueryClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockQueryClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockQueryClient { + mock := &MockQueryClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go b/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go index 7393ef94e..45011bdc9 100644 --- a/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go +++ b/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package types diff --git a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go index 9ec6b2d18..9a28054e1 100644 --- a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go +++ b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package proxy diff --git a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go index affc90a4e..120c2f698 100644 --- a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go +++ b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package proxy diff --git a/proto/protoc.sh b/proto/protoc.sh index 4b23b9743..2937453b7 100755 --- a/proto/protoc.sh +++ b/proto/protoc.sh @@ -7,6 +7,7 @@ buf generate --path="./proto/types/dalc" --template="buf.gen.yaml" --config="buf buf generate --path="./proto/types/dymint" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/interchain_da" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/dymensionxyz" --template="buf.gen.yaml" --config="buf.yaml" +buf generate --path="./proto/types/rollapp" --template="buf.gen.yaml" --config="buf.yaml" # Generate the `test` proto files buf generate --path="./proto/test" --template="buf.gen.yaml" --config="buf.yaml" diff --git a/proto/types/dymensionxyz/dymension/sequencer/events.proto b/proto/types/dymensionxyz/dymension/sequencer/events.proto new file mode 100644 index 000000000..df7f73219 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/events.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package dymensionxyz.dymension.sequencer; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// EventIncreasedBond is an event emitted when a sequencer's bond is increased. +message EventIncreasedBond { + // sequencer is the bech32-encoded address of the sequencer which increased its bond + string sequencer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // added_amount is the amount of coins added to the sequencer's bond + cosmos.base.v1beta1.Coin added_amount = 2 [(gogoproto.nullable) = false]; + // bond is the new active bond amount of the sequencer + repeated cosmos.base.v1beta1.Coin bond = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +message EventRotationStarted { + // RollappId defines the rollapp to which the sequencer belongs. + string rollapp_id = 1; + // NextProposerAddr is the bech32-encoded address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + string next_proposer_addr = 2; + // RewardAddr is a bech32-encoded address of the sequencer's reward address. + string reward_addr = 3; + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 4; +} + +message EventUpdateRewardAddress { + // Operator is the bech32-encoded address of the actor sending the update + string creator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; +} + +message EventUpdateWhitelistedRelayers { + // Operator is the bech32-encoded address of the actor sending the update + string creator = 1; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/genesis.proto b/proto/types/dymensionxyz/dymension/sequencer/genesis.proto new file mode 100644 index 000000000..70fa8ca04 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/genesis.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +import "gogoproto/gogo.proto"; +import "types/dymensionxyz/dymension/sequencer/params.proto"; +import "types/dymensionxyz/dymension/sequencer/sequencer.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// GenesisState defines the sequencer module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + // sequencerList is a list of all defined sequencers + repeated Sequencer sequencerList = 2 [ (gogoproto.nullable) = false ]; + // genesisProposers is a list of the defined genesis proposers + repeated GenesisProposer genesisProposers = 3 + [ (gogoproto.nullable) = false ]; + // bondReductions is a list of all bond reductions + repeated BondReduction bondReductions = 4 [(gogoproto.nullable) = false]; +} + +message GenesisProposer { + string address = 1; + string rollappId = 2; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/metadata.proto b/proto/types/dymensionxyz/dymension/sequencer/metadata.proto new file mode 100644 index 000000000..02d4d0c7c --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/metadata.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +import "gogoproto/gogo.proto"; + +// Metadata defines rollapp/sequencer extra information. +message SequencerMetadata { + // moniker defines a human-readable name for the sequencer. + string moniker = 1; + // field numbers not to be reused + reserved 2 to 4; + // details define other optional details. + string details = 5; + // bootstrap nodes list + repeated string p2p_seeds = 6; + // RPCs list + repeated string rpcs = 7; + // evm RPCs list + repeated string evm_rpcs = 8; + // REST API URLs + repeated string rest_api_urls = 9; + // block explorer URL + string explorer_url = 10; + // genesis URLs + repeated string genesis_urls = 11; + // contact details + ContactDetails contact_details = 12; + // json dump the sequencer can add (limited by size) + bytes extra_data = 13; + // snapshots of the sequencer + repeated SnapshotInfo snapshots = 14; + // gas_price defines the value for each gas unit + string gas_price = 15 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; +} + +message ContactDetails { + // website URL + string website = 11; + // telegram link + string telegram = 1; + // twitter link + string x = 2; +} + +message SnapshotInfo { + // the snapshot url + string snapshot_url = 1; + // The snapshot height + uint64 height = 2; + // sha-256 checksum value for the snapshot file + string checksum=3; +} diff --git a/proto/types/dymensionxyz/dymension/sequencer/operating_status.proto b/proto/types/dymensionxyz/dymension/sequencer/operating_status.proto new file mode 100644 index 000000000..16ec15031 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/operating_status.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// OperatingStatus defines the operating status of a sequencer +enum OperatingStatus { + option (gogoproto.goproto_enum_prefix) = false; + // OPERATING_STATUS_UNBONDED defines a sequencer that is not active and won't + // be scheduled + OPERATING_STATUS_UNBONDED = 0 + [ (gogoproto.enumvalue_customname) = "Unbonded" ]; + // UNBONDING defines a sequencer that is currently unbonding. + OPERATING_STATUS_UNBONDING = 1 + [ (gogoproto.enumvalue_customname) = "Unbonding" ]; + // OPERATING_STATUS_BONDED defines a sequencer that is bonded and can be + // scheduled + OPERATING_STATUS_BONDED = 2 [ (gogoproto.enumvalue_customname) = "Bonded" ]; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/params.proto b/proto/types/dymensionxyz/dymension/sequencer/params.proto new file mode 100644 index 000000000..9fec1ffe6 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/params.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +import "gogoproto/gogo.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + cosmos.base.v1beta1.Coin min_bond = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "min_bond,omitempty" + ]; + + // unbonding_time is the time duration of unbonding. + google.protobuf.Duration unbonding_time = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // notice_period is the time duration of notice period. + // notice period is the duration between the unbond request and the actual + // unbonding starting. the proposer is still bonded during this period. + google.protobuf.Duration notice_period = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // LivenessSlashMultiplier multiplies with the tokens of the slashed sequencer to compute the burn amount. + string liveness_slash_multiplier = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"liveness_slash_multiplier\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/query.proto b/proto/types/dymensionxyz/dymension/sequencer/query.proto new file mode 100644 index 000000000..91ce9b764 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/query.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +import "gogoproto/gogo.proto"; +import "types/cosmos/base/query/v1beta1/pagination.proto"; +import "types/dymensionxyz/dymension/sequencer/params.proto"; +import "types/dymensionxyz/dymension/sequencer/sequencer.proto"; +import "types/dymensionxyz/dymension/sequencer/operating_status.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {} + + // Queries a Sequencer by address. + rpc Sequencer(QueryGetSequencerRequest) returns (QueryGetSequencerResponse) {} + + // Queries a list of Sequencer items. + rpc Sequencers(QuerySequencersRequest) returns (QuerySequencersResponse) {} + + // Queries a SequencersByRollapp by rollappId. + rpc SequencersByRollapp(QueryGetSequencersByRollappRequest) + returns (QueryGetSequencersByRollappResponse) {} + + // Queries a SequencersByRollappByStatus + rpc SequencersByRollappByStatus(QueryGetSequencersByRollappByStatusRequest) + returns (QueryGetSequencersByRollappByStatusResponse) {} + + // Queries the current proposer by rollappId. + rpc GetProposerByRollapp(QueryGetProposerByRollappRequest) + returns (QueryGetProposerByRollappResponse) {} + + // Queries the next proposer by rollappId. + rpc GetNextProposerByRollapp(QueryGetNextProposerByRollappRequest) + returns (QueryGetNextProposerByRollappResponse) {} + + // Queries a list of proposers. + rpc Proposers(QueryProposersRequest) returns (QueryProposersResponse) {} +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryGetSequencerRequest { string sequencerAddress = 1; } + +message QueryGetSequencerResponse { + Sequencer sequencer = 1 [ (gogoproto.nullable) = false ]; +} + +message QuerySequencersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QuerySequencersResponse { + repeated Sequencer sequencers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetSequencersByRollappRequest { string rollappId = 1; } + +message QueryGetSequencersByRollappResponse { + repeated Sequencer sequencers = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryGetSequencersByRollappByStatusRequest { + string rollappId = 1; + OperatingStatus status = 2; +} + +message QueryGetSequencersByRollappByStatusResponse { + repeated Sequencer sequencers = 1 [ (gogoproto.nullable) = false ]; +} + +// Request type for the GetProposerByRollapp RPC method. +message QueryGetProposerByRollappRequest { string rollappId = 1; } + +// Response type for the GetProposerByRollapp RPC method. +message QueryGetProposerByRollappResponse { string proposerAddr = 1; } + +// Request type for the GetNextProposerByRollapp RPC method. +message QueryGetNextProposerByRollappRequest { string rollappId = 1; } + +// Response type for the GetNextProposerByRollapp RPC method. +message QueryGetNextProposerByRollappResponse { + // nextProposerAddr is the address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + string nextProposerAddr = 1; + // rotationInProgress is true if the proposer rotation is in progress. + bool rotationInProgress = 2; +} + +// Request type for the Proposers RPC method. +message QueryProposersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// Response type for the Proposers RPC method. +message QueryProposersResponse { + repeated Sequencer proposers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/sequencer.proto b/proto/types/dymensionxyz/dymension/sequencer/sequencer.proto new file mode 100644 index 000000000..3681a22e8 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/sequencer.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "types/dymensionxyz/dymension/sequencer/metadata.proto"; +import "types/dymensionxyz/dymension/sequencer/operating_status.proto"; + +// Sequencer defines a sequencer identified by its' address (sequencerAddress). +// The sequencer could be attached to only one rollapp (rollappId). +message Sequencer { + // address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string address = 1; + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + google.protobuf.Any dymintPubKey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // rollappId defines the rollapp to which the sequencer belongs. + string rollappId = 3; + // metadata defines the extra information for the sequencer. + SequencerMetadata metadata = 4 [(gogoproto.nullable) = false]; + // jailed defined whether the sequencer has been jailed from bonded status or not. + bool jailed = 5; + + bool proposer = 6 [deprecated = true]; + + // status is the sequencer status (bonded/unbonding/unbonded). + OperatingStatus status = 7; + // tokens define the delegated tokens (incl. self-delegation). + repeated cosmos.base.v1beta1.Coin tokens = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // unbond_request_height stores the height at which this sequencer has + // requested to unbond. + int64 unbond_request_height = 9; + // unbond_time defines the time when the sequencer will complete unbonding. + google.protobuf.Timestamp unbond_time = 10 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // notice_period_time defines the time when the sequencer will finish it's notice period if started + google.protobuf.Timestamp notice_period_time = 11 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 12; + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 13; +} + +// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount +message BondReduction { + // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string sequencer_address = 1; + // decrease_bond_amount is the amount of tokens to be unbonded. + cosmos.base.v1beta1.Coin decrease_bond_amount = 2 [(gogoproto.nullable) = false]; + // decrease_bond_time defines, if unbonding, the min time for the sequencer to complete unbonding. + google.protobuf.Timestamp decrease_bond_time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/types/dymensionxyz/dymension/sequencer/tx.proto b/proto/types/dymensionxyz/dymension/sequencer/tx.proto new file mode 100644 index 000000000..de5360b8d --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/tx.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "types/dymensionxyz/dymension/sequencer/params.proto"; +import "types/dymensionxyz/dymension/sequencer/metadata.proto"; + +// MsgUpdateParams is the Msg/UpdateParams request type. +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + + + +message MsgCreateSequencer { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1; + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + google.protobuf.Any dymintPubKey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // rollapp_id defines the rollapp to which the sequencer belongs. + string rollapp_id = 3; + // metadata defines the extra information for the sequencer. + SequencerMetadata metadata = 4 [(gogoproto.nullable) = false]; + // entry bond for the sequencer. + cosmos.base.v1beta1.Coin bond = 5 [(gogoproto.nullable) = false]; + // RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid. + // If empty, the creator address is used. + string reward_addr = 6; + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 7; +} + +message MsgCreateSequencerResponse {} + +message MsgUpdateSequencerInformation { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1; + // metadata defines the extra information for the sequencer. + SequencerMetadata metadata = 2 [(gogoproto.nullable) = false]; +} + +message MsgUpdateSequencerInformationResponse {} + +message MsgUpdateRewardAddress { + option (cosmos.msg.v1.signer) = "creator"; + // Creator is the bech32-encoded address of the actor sending the update + string creator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; +} + +message MsgUpdateRewardAddressResponse {} + +message MsgUpdateWhitelistedRelayers { + option (cosmos.msg.v1.signer) = "creator"; + // Creator is the bech32-encoded address of the actor sending the update + string creator = 1; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; +} + +message MsgUpdateWhitelistedRelayersResponse {} + +// MsgUnbond defines a SDK message for performing an undelegation from a +// bond and a sequencer. +message MsgUnbond { + option (cosmos.msg.v1.signer) = "creator"; + option (gogoproto.equal) = false; + string creator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUnbondResponse defines the Msg/Unbond response type. +message MsgUnbondResponse { + // completion_time defines the time at which the unbonding will be completed. + // If unbonding the proposer, the completion time is the time at which the notice period will be completed. + oneof completion_time { + // unbonding_completion_time is the time at which the unbonding will be completed. + google.protobuf.Timestamp unbonding_completion_time = 1 [ (gogoproto.stdtime) = true]; + // notice_period_completion_time is the time at which the notice period will be completed. + google.protobuf.Timestamp notice_period_completion_time = 2 [ (gogoproto.stdtime) = true]; + } +} + +// MsgIncreaseBond defines a SDK message for increasing the bond amount of a sequencer. +message MsgIncreaseBond { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // add_amount is the amount of coins to be added to the sequencer's bond. + cosmos.base.v1beta1.Coin add_amount = 2 [(gogoproto.nullable) = false]; +} + +// MsgIncreaseBondResponse defines the Msg/IncreaseBond response type. +message MsgIncreaseBondResponse {} + +// MsgDecreaseBond defines a SDK message for decreasing the bond of a sequencer. +message MsgDecreaseBond { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // decrease_amount is the amount of coins to decrease the bond by. + cosmos.base.v1beta1.Coin decrease_amount = 2 [(gogoproto.nullable) = false]; +} + +// MsgDecreaseBondResponse defines the Msg/DecreaseBond response type. +message MsgDecreaseBondResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/types/rollapp/sequencers/types/tx.proto b/proto/types/rollapp/sequencers/types/tx.proto new file mode 100644 index 000000000..1c32bdccd --- /dev/null +++ b/proto/types/rollapp/sequencers/types/tx.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package rollapp.sequencers.types; + +import "gogoproto/gogo.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers"; + +message MsgCreateSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // PubKey is a tendermint consensus pub key + google.protobuf.Any pub_key = 2; + // Signature is operator signed with the private key of pub_key + bytes signature = 3; +} + +message MsgCreateSequencerResponse {} + +message MsgUpdateSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // Field no.2 is missing + reserved 2; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 3; +} + +message MsgUpdateSequencerResponse {} + +// ConsensusMsgUpsertSequencer is a consensus message to upsert the sequencer. +message ConsensusMsgUpsertSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update + string operator = 1; + // ConsPubKey is a tendermint consensus pub key + google.protobuf.Any cons_pub_key = 2; + // RewardAddr is the bech32-encoded sequencer's reward address + string reward_addr = 3; +} + +message ConsensusMsgUpsertSequencerResponse {} diff --git a/settlement/dymension/cosmosclient.go b/settlement/dymension/cosmosclient.go index cafc0a7f7..3366bd24b 100644 --- a/settlement/dymension/cosmosclient.go +++ b/settlement/dymension/cosmosclient.go @@ -13,7 +13,8 @@ import ( "github.com/ignite/cli/ignite/pkg/cosmosaccount" ctypes "github.com/tendermint/tendermint/rpc/core/types" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" + rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" ) diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index b0ab5c2dd..6184fba32 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -22,9 +22,11 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" + protoutils "github.com/dymensionxyz/dymint/utils/proto" + "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" "github.com/dymensionxyz/dymint/types" rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" "github.com/dymensionxyz/dymint/version" @@ -341,8 +343,9 @@ func (c *Client) GetSequencerByAddress(address string) (types.Sequencer, error) return types.Sequencer{}, err } + dymintPubKey := protoutils.GogoToCosmos(res.Sequencer.DymintPubKey) var pubKey cryptotypes.PubKey - err = c.protoCodec.UnpackAny(res.Sequencer.DymintPubKey, &pubKey) + err = c.protoCodec.UnpackAny(dymintPubKey, &pubKey) if err != nil { return types.Sequencer{}, err } @@ -387,8 +390,9 @@ func (c *Client) GetAllSequencers() ([]types.Sequencer, error) { var sequencerList []types.Sequencer for _, sequencer := range res.Sequencers { + dymintPubKey := protoutils.GogoToCosmos(sequencer.DymintPubKey) var pubKey cryptotypes.PubKey - err := c.protoCodec.UnpackAny(sequencer.DymintPubKey, &pubKey) + err := c.protoCodec.UnpackAny(dymintPubKey, &pubKey) if err != nil { return nil, err } @@ -435,8 +439,9 @@ func (c *Client) GetBondedSequencers() ([]types.Sequencer, error) { var sequencerList []types.Sequencer for _, sequencer := range res.Sequencers { + dymintPubKey := protoutils.GogoToCosmos(sequencer.DymintPubKey) var pubKey cryptotypes.PubKey - err := c.protoCodec.UnpackAny(sequencer.DymintPubKey, &pubKey) + err := c.protoCodec.UnpackAny(dymintPubKey, &pubKey) if err != nil { return nil, err } diff --git a/settlement/dymension/dymension_test.go b/settlement/dymension/dymension_test.go index 5f24e9cb3..2272a13ee 100644 --- a/settlement/dymension/dymension_test.go +++ b/settlement/dymension/dymension_test.go @@ -22,14 +22,16 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" + sequencertypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" + protoutils "github.com/dymensionxyz/dymint/utils/proto" + "github.com/dymensionxyz/dymint/da" dymensionmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/settlement/dymension" - sequencertypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" rollapptypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/settlement/dymension" "github.com/dymensionxyz/dymint/testutil" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" ) @@ -221,7 +223,7 @@ func generateSequencerByRollappResponse(t *testing.T, count int) *sequencertypes require.NoError(t, err) seq := sequencertypes.Sequencer{ - DymintPubKey: pk, + DymintPubKey: protoutils.CosmosToGogo(pk), Status: sequencertypes.Bonded, } sequencerInfoList = append(sequencerInfoList, seq) diff --git a/third_party/dymension/sequencer/types/description.pb.go b/third_party/dymension/sequencer/types/description.pb.go deleted file mode 100644 index 1d45971a9..000000000 --- a/third_party/dymension/sequencer/types/description.pb.go +++ /dev/null @@ -1,531 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/description.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Description defines a sequencer description. -type Description struct { - // moniker defines a human-readable name for the sequencer. - Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` - // identity defines an optional identity signature (ex. UPort or Keybase). - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - // website defines an optional website link. - Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` - // securityContact defines an optional email for security contact. - SecurityContact string `protobuf:"bytes,4,opt,name=securityContact,proto3" json:"securityContact,omitempty"` - // details define other optional details. - Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` -} - -func (m *Description) Reset() { *m = Description{} } -func (m *Description) String() string { return proto.CompactTextString(m) } -func (*Description) ProtoMessage() {} -func (*Description) Descriptor() ([]byte, []int) { - return fileDescriptor_91de4c32465eb7e7, []int{0} -} -func (m *Description) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Description) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Description.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Description) XXX_Merge(src proto.Message) { - xxx_messageInfo_Description.Merge(m, src) -} -func (m *Description) XXX_Size() int { - return m.Size() -} -func (m *Description) XXX_DiscardUnknown() { - xxx_messageInfo_Description.DiscardUnknown(m) -} - -var xxx_messageInfo_Description proto.InternalMessageInfo - -func (m *Description) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *Description) GetIdentity() string { - if m != nil { - return m.Identity - } - return "" -} - -func (m *Description) GetWebsite() string { - if m != nil { - return m.Website - } - return "" -} - -func (m *Description) GetSecurityContact() string { - if m != nil { - return m.SecurityContact - } - return "" -} - -func (m *Description) GetDetails() string { - if m != nil { - return m.Details - } - return "" -} - -func init() { - proto.RegisterType((*Description)(nil), "dymensionxyz.dymension.sequencer.Description") -} - -func init() { - proto.RegisterFile("dymension/sequencer/description.proto", fileDescriptor_91de4c32465eb7e7) -} - -var fileDescriptor_91de4c32465eb7e7 = []byte{ - // 239 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xa9, 0xcc, 0x4d, - 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x2d, 0xd2, - 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x52, 0x80, 0x2b, 0xab, 0xa8, 0xac, 0xd2, 0x83, 0x73, 0xf4, 0xe0, 0x7a, 0x94, 0x16, - 0x32, 0x72, 0x71, 0xbb, 0x20, 0xf4, 0x09, 0x49, 0x70, 0xb1, 0xe7, 0xe6, 0xe7, 0x65, 0x66, 0xa7, - 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8, 0x42, 0x52, 0x5c, 0x1c, 0x99, 0x29, - 0xa9, 0x79, 0x25, 0x99, 0x25, 0x95, 0x12, 0x4c, 0x60, 0x29, 0x38, 0x1f, 0xa4, 0xab, 0x3c, 0x35, - 0xa9, 0x38, 0xb3, 0x24, 0x55, 0x82, 0x19, 0xa2, 0x0b, 0xca, 0x15, 0xd2, 0xe0, 0xe2, 0x2f, 0x4e, - 0x4d, 0x2e, 0x2d, 0xca, 0x2c, 0xa9, 0x74, 0xce, 0xcf, 0x2b, 0x49, 0x4c, 0x2e, 0x91, 0x60, 0x01, - 0xab, 0x40, 0x17, 0x06, 0x99, 0x91, 0x92, 0x5a, 0x92, 0x98, 0x99, 0x53, 0x2c, 0xc1, 0x0a, 0x31, - 0x03, 0xca, 0x75, 0x0a, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xb3, - 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x64, 0xaf, 0x22, 0x38, 0xfa, - 0x65, 0xc6, 0xfa, 0x15, 0x48, 0x61, 0x54, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x1e, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xcd, 0xd6, 0xb4, 0x47, 0x01, 0x00, 0x00, -} - -func (m *Description) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Description) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Description) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Details) > 0 { - i -= len(m.Details) - copy(dAtA[i:], m.Details) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Details))) - i-- - dAtA[i] = 0x2a - } - if len(m.SecurityContact) > 0 { - i -= len(m.SecurityContact) - copy(dAtA[i:], m.SecurityContact) - i = encodeVarintDescription(dAtA, i, uint64(len(m.SecurityContact))) - i-- - dAtA[i] = 0x22 - } - if len(m.Website) > 0 { - i -= len(m.Website) - copy(dAtA[i:], m.Website) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Website))) - i-- - dAtA[i] = 0x1a - } - if len(m.Identity) > 0 { - i -= len(m.Identity) - copy(dAtA[i:], m.Identity) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Identity))) - i-- - dAtA[i] = 0x12 - } - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDescription(dAtA []byte, offset int, v uint64) int { - offset -= sovDescription(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Description) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.Identity) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.Website) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.SecurityContact) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.Details) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - return n -} - -func sovDescription(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDescription(x uint64) (n int) { - return sovDescription(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Description) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Description: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Description: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Identity = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Website = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecurityContact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Details = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDescription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDescription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDescription(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDescription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDescription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDescription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDescription - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDescription - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDescription - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDescription = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDescription = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDescription = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/dymension/sequencer/types/events.pb.go b/third_party/dymension/sequencer/types/events.pb.go deleted file mode 100644 index 0cfb2da09..000000000 --- a/third_party/dymension/sequencer/types/events.pb.go +++ /dev/null @@ -1,450 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/events.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// EventIncreasedBond is an event emitted when a sequencer's bond is increased. -type EventIncreasedBond struct { - // sequencer is the bech32-encoded address of the sequencer which increased its bond - Sequencer string `protobuf:"bytes,1,opt,name=sequencer,proto3" json:"sequencer,omitempty"` - // added_amount is the amount of coins added to the sequencer's bond - AddedAmount types.Coin `protobuf:"bytes,2,opt,name=added_amount,json=addedAmount,proto3" json:"added_amount"` - // bond is the new active bond amount of the sequencer - Bond github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=bond,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"bond"` -} - -func (m *EventIncreasedBond) Reset() { *m = EventIncreasedBond{} } -func (m *EventIncreasedBond) String() string { return proto.CompactTextString(m) } -func (*EventIncreasedBond) ProtoMessage() {} -func (*EventIncreasedBond) Descriptor() ([]byte, []int) { - return fileDescriptor_8c4c85909720061b, []int{0} -} -func (m *EventIncreasedBond) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventIncreasedBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventIncreasedBond.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventIncreasedBond) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventIncreasedBond.Merge(m, src) -} -func (m *EventIncreasedBond) XXX_Size() int { - return m.Size() -} -func (m *EventIncreasedBond) XXX_DiscardUnknown() { - xxx_messageInfo_EventIncreasedBond.DiscardUnknown(m) -} - -var xxx_messageInfo_EventIncreasedBond proto.InternalMessageInfo - -func (m *EventIncreasedBond) GetSequencer() string { - if m != nil { - return m.Sequencer - } - return "" -} - -func (m *EventIncreasedBond) GetAddedAmount() types.Coin { - if m != nil { - return m.AddedAmount - } - return types.Coin{} -} - -func (m *EventIncreasedBond) GetBond() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Bond - } - return nil -} - -func init() { - proto.RegisterType((*EventIncreasedBond)(nil), "dymensionxyz.dymension.sequencer.EventIncreasedBond") -} - -func init() { proto.RegisterFile("dymension/sequencer/events.proto", fileDescriptor_8c4c85909720061b) } - -var fileDescriptor_8c4c85909720061b = []byte{ - // 337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xb1, 0x6e, 0xea, 0x30, - 0x14, 0x86, 0xe3, 0x0b, 0xba, 0x12, 0xe1, 0x4e, 0x11, 0xd2, 0x0d, 0x0c, 0x26, 0xea, 0xc4, 0x82, - 0x5d, 0x8a, 0xc4, 0x4e, 0xaa, 0x0e, 0xdd, 0x2a, 0xba, 0x75, 0x41, 0x49, 0x6c, 0xa5, 0x51, 0x15, - 0x1f, 0x9a, 0x63, 0x22, 0xe8, 0x53, 0xf4, 0x39, 0x3a, 0xf7, 0x21, 0x18, 0x51, 0xa7, 0x4e, 0x6d, - 0x05, 0x4f, 0xd0, 0x37, 0xa8, 0xe2, 0x58, 0xc0, 0xd4, 0xc9, 0x3e, 0xe7, 0xfc, 0xdf, 0xaf, 0x5f, - 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, 0xc6, 0x2c, 0x81, 0xdc, 0xee, 0xca, 0x3e, 0x43, - 0x14, 0x0f, 0x5c, 0xaf, 0x17, 0x12, 0x0d, 0x80, 0x33, 0x63, 0x1c, 0xde, 0x6c, 0x76, 0x94, 0x6c, - 0x77, 0x94, 0x7c, 0xed, 0x28, 0x79, 0xde, 0x53, 0x67, 0xbb, 0xa7, 0xce, 0xfb, 0x9e, 0x3a, 0x77, - 0x93, 0x13, 0xa7, 0xd3, 0x23, 0x1d, 0x0b, 0x5e, 0x8e, 0xf9, 0xea, 0xe4, 0xb0, 0xc6, 0x3d, 0xfe, - 0x6b, 0x96, 0x39, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xac, 0x07, 0x3b, 0xfc, 0x01, 0x00, - 0x00, -} - -func (m *EventIncreasedBond) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventIncreasedBond) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventIncreasedBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Bond) > 0 { - for iNdEx := len(m.Bond) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Bond[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.AddedAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Sequencer) > 0 { - i -= len(m.Sequencer) - copy(dAtA[i:], m.Sequencer) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Sequencer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventIncreasedBond) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sequencer) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - l = m.AddedAmount.Size() - n += 1 + l + sovEvents(uint64(l)) - if len(m.Bond) > 0 { - for _, e := range m.Bond { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventIncreasedBond) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventIncreasedBond: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventIncreasedBond: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequencer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sequencer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddedAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AddedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bond", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bond = append(m.Bond, types.Coin{}) - if err := m.Bond[len(m.Bond)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/dymension/sequencer/types/query.pb.gw.go b/third_party/dymension/sequencer/types/query.pb.gw.go deleted file mode 100644 index 9429bb4c2..000000000 --- a/third_party/dymension/sequencer/types/query.pb.gw.go +++ /dev/null @@ -1,769 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: dymension/sequencer/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Sequencer_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["sequencerAddress"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencerAddress") - } - - protoReq.SequencerAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencerAddress", err) - } - - msg, err := client.Sequencer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Sequencer_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["sequencerAddress"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencerAddress") - } - - protoReq.SequencerAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencerAddress", err) - } - - msg, err := server.Sequencer(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Sequencers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Sequencers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySequencersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sequencers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Sequencers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Sequencers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySequencersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sequencers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Sequencers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_SequencersByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := client.SequencersByRollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SequencersByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := server.SequencersByRollapp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_SequencersByRollappByStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappByStatusRequest - var metadata runtime.ServerMetadata - - var ( - val string - e int32 - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - val, ok = pathParams["status"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status") - } - - e, err = runtime.Enum(val, OperatingStatus_value) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err) - } - - protoReq.Status = OperatingStatus(e) - - msg, err := client.SequencersByRollappByStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SequencersByRollappByStatus_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappByStatusRequest - var metadata runtime.ServerMetadata - - var ( - val string - e int32 - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - val, ok = pathParams["status"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status") - } - - e, err = runtime.Enum(val, OperatingStatus_value) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err) - } - - protoReq.Status = OperatingStatus(e) - - msg, err := server.SequencersByRollappByStatus(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := client.GetProposerByRollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := server.GetProposerByRollapp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetNextProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetNextProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := client.GetNextProposerByRollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetNextProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetNextProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := server.GetNextProposerByRollapp(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Sequencer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Sequencers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SequencersByRollapp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollappByStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SequencersByRollappByStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollappByStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetProposerByRollapp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetNextProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetNextProposerByRollapp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetNextProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Sequencer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Sequencers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SequencersByRollapp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollappByStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SequencersByRollappByStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollappByStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetProposerByRollapp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetNextProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetNextProposerByRollapp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetNextProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dymensionxyz", "dymension", "sequencer", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Sequencer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dymensionxyz", "dymension", "sequencer", "sequencerAddress"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Sequencers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"dymensionxyz", "dymension", "sequencer"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SequencersByRollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "sequencer", "sequencers_by_rollapp", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SequencersByRollappByStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"dymensionxyz", "dymension", "sequencer", "sequencers_by_rollapp", "rollappId", "status"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GetProposerByRollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "sequencer", "proposer", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GetNextProposerByRollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "sequencer", "next_proposer", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Sequencer_0 = runtime.ForwardResponseMessage - - forward_Query_Sequencers_0 = runtime.ForwardResponseMessage - - forward_Query_SequencersByRollapp_0 = runtime.ForwardResponseMessage - - forward_Query_SequencersByRollappByStatus_0 = runtime.ForwardResponseMessage - - forward_Query_GetProposerByRollapp_0 = runtime.ForwardResponseMessage - - forward_Query_GetNextProposerByRollapp_0 = runtime.ForwardResponseMessage -) diff --git a/third_party/dymension/sequencer/types/events.go b/types/pb/dymensionxyz/dymension/sequencer/events.go similarity index 98% rename from third_party/dymension/sequencer/types/events.go rename to types/pb/dymensionxyz/dymension/sequencer/events.go index 3977bbee5..eb93ddc7a 100644 --- a/third_party/dymension/sequencer/types/events.go +++ b/types/pb/dymensionxyz/dymension/sequencer/events.go @@ -1,4 +1,4 @@ -package types +package sequencer // Incentive module event types. const ( diff --git a/types/pb/dymensionxyz/dymension/sequencer/events.pb.go b/types/pb/dymensionxyz/dymension/sequencer/events.pb.go new file mode 100644 index 000000000..d84c93382 --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/events.pb.go @@ -0,0 +1,1242 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/events.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventIncreasedBond is an event emitted when a sequencer's bond is increased. +type EventIncreasedBond struct { + // sequencer is the bech32-encoded address of the sequencer which increased its bond + Sequencer string `protobuf:"bytes,1,opt,name=sequencer,proto3" json:"sequencer,omitempty"` + // added_amount is the amount of coins added to the sequencer's bond + AddedAmount types.Coin `protobuf:"bytes,2,opt,name=added_amount,json=addedAmount,proto3" json:"added_amount"` + // bond is the new active bond amount of the sequencer + Bond github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=bond,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"bond"` +} + +func (m *EventIncreasedBond) Reset() { *m = EventIncreasedBond{} } +func (m *EventIncreasedBond) String() string { return proto.CompactTextString(m) } +func (*EventIncreasedBond) ProtoMessage() {} +func (*EventIncreasedBond) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{0} +} +func (m *EventIncreasedBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventIncreasedBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventIncreasedBond.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventIncreasedBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventIncreasedBond.Merge(m, src) +} +func (m *EventIncreasedBond) XXX_Size() int { + return m.Size() +} +func (m *EventIncreasedBond) XXX_DiscardUnknown() { + xxx_messageInfo_EventIncreasedBond.DiscardUnknown(m) +} + +var xxx_messageInfo_EventIncreasedBond proto.InternalMessageInfo + +func (m *EventIncreasedBond) GetSequencer() string { + if m != nil { + return m.Sequencer + } + return "" +} + +func (m *EventIncreasedBond) GetAddedAmount() types.Coin { + if m != nil { + return m.AddedAmount + } + return types.Coin{} +} + +func (m *EventIncreasedBond) GetBond() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Bond + } + return nil +} + +type EventRotationStarted struct { + // RollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // NextProposerAddr is the bech32-encoded address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + NextProposerAddr string `protobuf:"bytes,2,opt,name=next_proposer_addr,json=nextProposerAddr,proto3" json:"next_proposer_addr,omitempty"` + // RewardAddr is a bech32-encoded address of the sequencer's reward address. + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,4,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *EventRotationStarted) Reset() { *m = EventRotationStarted{} } +func (m *EventRotationStarted) String() string { return proto.CompactTextString(m) } +func (*EventRotationStarted) ProtoMessage() {} +func (*EventRotationStarted) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{1} +} +func (m *EventRotationStarted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRotationStarted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRotationStarted.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventRotationStarted) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRotationStarted.Merge(m, src) +} +func (m *EventRotationStarted) XXX_Size() int { + return m.Size() +} +func (m *EventRotationStarted) XXX_DiscardUnknown() { + xxx_messageInfo_EventRotationStarted.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRotationStarted proto.InternalMessageInfo + +func (m *EventRotationStarted) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *EventRotationStarted) GetNextProposerAddr() string { + if m != nil { + return m.NextProposerAddr + } + return "" +} + +func (m *EventRotationStarted) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *EventRotationStarted) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +type EventUpdateRewardAddress struct { + // Operator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *EventUpdateRewardAddress) Reset() { *m = EventUpdateRewardAddress{} } +func (m *EventUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*EventUpdateRewardAddress) ProtoMessage() {} +func (*EventUpdateRewardAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{2} +} +func (m *EventUpdateRewardAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateRewardAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateRewardAddress.Merge(m, src) +} +func (m *EventUpdateRewardAddress) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateRewardAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateRewardAddress proto.InternalMessageInfo + +func (m *EventUpdateRewardAddress) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *EventUpdateRewardAddress) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type EventUpdateWhitelistedRelayers struct { + // Operator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *EventUpdateWhitelistedRelayers) Reset() { *m = EventUpdateWhitelistedRelayers{} } +func (m *EventUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*EventUpdateWhitelistedRelayers) ProtoMessage() {} +func (*EventUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{3} +} +func (m *EventUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateWhitelistedRelayers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateWhitelistedRelayers.Merge(m, src) +} +func (m *EventUpdateWhitelistedRelayers) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateWhitelistedRelayers.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateWhitelistedRelayers proto.InternalMessageInfo + +func (m *EventUpdateWhitelistedRelayers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *EventUpdateWhitelistedRelayers) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + +func init() { + proto.RegisterType((*EventIncreasedBond)(nil), "dymensionxyz.dymension.sequencer.EventIncreasedBond") + proto.RegisterType((*EventRotationStarted)(nil), "dymensionxyz.dymension.sequencer.EventRotationStarted") + proto.RegisterType((*EventUpdateRewardAddress)(nil), "dymensionxyz.dymension.sequencer.EventUpdateRewardAddress") + proto.RegisterType((*EventUpdateWhitelistedRelayers)(nil), "dymensionxyz.dymension.sequencer.EventUpdateWhitelistedRelayers") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/events.proto", fileDescriptor_299be36200df0dd4) +} + +var fileDescriptor_299be36200df0dd4 = []byte{ + // 496 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0x13, 0x31, + 0x10, 0xcd, 0x26, 0x11, 0x10, 0x87, 0x03, 0x32, 0x39, 0x6c, 0x23, 0xb1, 0x59, 0x45, 0x1c, 0x72, + 0xa0, 0x6b, 0x42, 0x25, 0xee, 0x5d, 0x84, 0x44, 0x6f, 0xc8, 0x55, 0x41, 0xe2, 0xb2, 0xf2, 0xae, + 0x47, 0xa9, 0x45, 0x62, 0x2f, 0xb6, 0xd3, 0x36, 0x7c, 0x05, 0xdf, 0xc1, 0x19, 0x89, 0x5f, 0xe8, + 0xb1, 0xe2, 0xc4, 0x09, 0x50, 0xf2, 0x05, 0xfc, 0x01, 0x5a, 0x7b, 0xbb, 0x8d, 0x82, 0xd4, 0x9e, + 0x76, 0x67, 0xe6, 0xbd, 0x99, 0x37, 0x7e, 0x36, 0x3a, 0xb0, 0xab, 0x12, 0x0c, 0xe1, 0xab, 0x05, + 0x48, 0x23, 0x94, 0xbc, 0x58, 0x7d, 0xbe, 0x09, 0x88, 0x81, 0x4f, 0x4b, 0x90, 0x05, 0x68, 0x02, + 0x67, 0x20, 0xad, 0x49, 0x4a, 0xad,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0x2f, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xd2, 0xca, 0xec, 0x77, 0x03, 0x00, 0x00, +} + +func (m *EventIncreasedBond) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventIncreasedBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventIncreasedBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bond) > 0 { + for iNdEx := len(m.Bond) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bond[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.AddedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sequencer) > 0 { + i -= len(m.Sequencer) + copy(dAtA[i:], m.Sequencer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Sequencer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventRotationStarted) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventRotationStarted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRotationStarted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.NextProposerAddr) > 0 { + i -= len(m.NextProposerAddr) + copy(dAtA[i:], m.NextProposerAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.NextProposerAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateRewardAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateWhitelistedRelayers) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventIncreasedBond) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sequencer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.AddedAmount.Size() + n += 1 + l + sovEvents(uint64(l)) + if len(m.Bond) > 0 { + for _, e := range m.Bond { + l = e.Size() + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func (m *EventRotationStarted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.NextProposerAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func (m *EventUpdateRewardAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventUpdateWhitelistedRelayers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventIncreasedBond) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventIncreasedBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventIncreasedBond: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sequencer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AddedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bond", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bond = append(m.Bond, types.Coin{}) + if err := m.Bond[len(m.Bond)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventRotationStarted) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventRotationStarted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRotationStarted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextProposerAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextProposerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateRewardAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventUpdateRewardAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateWhitelistedRelayers) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventUpdateWhitelistedRelayers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/sequencer/types/genesis.pb.go b/types/pb/dymensionxyz/dymension/sequencer/genesis.pb.go similarity index 86% rename from third_party/dymension/sequencer/types/genesis.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/genesis.pb.go index 28e75b87a..bf49c2e76 100644 --- a/third_party/dymension/sequencer/types/genesis.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/genesis.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/genesis.proto +// source: types/dymensionxyz/dymension/sequencer/genesis.proto -package types +package sequencer import ( fmt "fmt" @@ -38,7 +38,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_52f5d9dc91070770, []int{0} + return fileDescriptor_9f12ca04b390434e, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -104,7 +104,7 @@ func (m *GenesisProposer) Reset() { *m = GenesisProposer{} } func (m *GenesisProposer) String() string { return proto.CompactTextString(m) } func (*GenesisProposer) ProtoMessage() {} func (*GenesisProposer) Descriptor() ([]byte, []int) { - return fileDescriptor_52f5d9dc91070770, []int{1} + return fileDescriptor_9f12ca04b390434e, []int{1} } func (m *GenesisProposer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,32 +152,34 @@ func init() { proto.RegisterType((*GenesisProposer)(nil), "dymensionxyz.dymension.sequencer.GenesisProposer") } -func init() { proto.RegisterFile("dymension/sequencer/genesis.proto", fileDescriptor_52f5d9dc91070770) } +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/genesis.proto", fileDescriptor_9f12ca04b390434e) +} -var fileDescriptor_52f5d9dc91070770 = []byte{ - // 343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xa9, 0xcc, 0x4d, - 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x2d, 0xd2, - 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x80, - 0x2b, 0xa9, 0xa8, 0xac, 0xd2, 0x83, 0x73, 0xf4, 0xe0, 0xea, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, - 0xc1, 0x8a, 0xf5, 0x41, 0x2c, 0x88, 0x3e, 0x29, 0x05, 0x6c, 0x46, 0x17, 0x24, 0x16, 0x25, 0xe6, - 0x42, 0x4d, 0x96, 0x52, 0xc6, 0xa6, 0x02, 0xce, 0x82, 0x28, 0x52, 0xfa, 0xcc, 0xc4, 0xc5, 0xe3, - 0x0e, 0x71, 0x50, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x1b, 0x17, 0x1b, 0xc4, 0x14, 0x09, 0x46, - 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x0d, 0x3d, 0x42, 0x0e, 0xd4, 0x0b, 0x00, 0xab, 0x77, 0x62, 0x39, - 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x5b, 0x28, 0x9c, 0x8b, 0x17, 0xae, 0xc2, 0x27, 0xb3, 0xb8, - 0x44, 0x82, 0x49, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x9b, 0xb0, 0x71, 0xc1, 0x30, 0x16, 0xd4, 0x44, - 0x54, 0x73, 0x84, 0x92, 0xb9, 0x04, 0xa0, 0x21, 0x18, 0x50, 0x94, 0x5f, 0x90, 0x5f, 0x9c, 0x5a, - 0x54, 0x2c, 0xc1, 0x0c, 0x36, 0xdb, 0x90, 0xb0, 0xd9, 0xee, 0xa8, 0x3a, 0xa1, 0x36, 0x60, 0x18, - 0x28, 0x14, 0xcb, 0xc5, 0x97, 0x94, 0x9f, 0x97, 0x12, 0x94, 0x9a, 0x52, 0x9a, 0x5c, 0x92, 0x99, - 0x9f, 0x57, 0x2c, 0xc1, 0x02, 0xb6, 0x42, 0x9f, 0xb0, 0x15, 0x4e, 0xc8, 0xfa, 0xa0, 0x16, 0xa0, - 0x19, 0xa6, 0xe4, 0xc9, 0xc5, 0x8f, 0xe6, 0x12, 0x21, 0x09, 0x2e, 0xf6, 0xc4, 0x94, 0x94, 0xa2, - 0xd4, 0x62, 0x48, 0xc0, 0x73, 0x06, 0xc1, 0xb8, 0x42, 0x32, 0x5c, 0x9c, 0x45, 0xf9, 0x39, 0x39, - 0x89, 0x05, 0x05, 0x9e, 0x29, 0x12, 0x4c, 0x60, 0x39, 0x84, 0x80, 0x53, 0xc0, 0x89, 0x47, 0x72, - 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, - 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0x23, 0xbb, 0x1a, 0xc1, 0xd1, 0x2f, 0x33, 0xd6, 0xaf, 0x40, 0x4a, 0x1c, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x94, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, - 0xf3, 0x81, 0x1b, 0xbd, 0x02, 0x00, 0x00, +var fileDescriptor_9f12ca04b390434e = []byte{ + // 347 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x4d, 0x6b, 0xc2, 0x30, + 0x1c, 0xc6, 0x5b, 0x15, 0x87, 0x71, 0x6f, 0x84, 0x1d, 0x8a, 0x8c, 0x4e, 0x3c, 0x09, 0x83, 0x96, + 0xe9, 0xd8, 0x07, 0xf0, 0x30, 0x27, 0xec, 0x20, 0x7a, 0x18, 0x0c, 0x76, 0x68, 0x9b, 0xd0, 0x05, + 0x34, 0xc9, 0x92, 0x08, 0x73, 0x9f, 0x62, 0x1f, 0xcb, 0xa3, 0xc7, 0x9d, 0xc6, 0xd0, 0x8f, 0xb0, + 0x2f, 0x30, 0x96, 0xc4, 0xfa, 0x76, 0xa8, 0xb7, 0xff, 0xbf, 0x7d, 0x9e, 0xdf, 0x93, 0x84, 0x07, + 0xdc, 0xaa, 0x29, 0xc7, 0x32, 0x44, 0xd3, 0x31, 0xa6, 0x92, 0x30, 0xfa, 0x3e, 0xfd, 0x58, 0x2f, + 0xa1, 0xc4, 0x6f, 0x13, 0x4c, 0x13, 0x2c, 0xc2, 0x14, 0x53, 0x2c, 0x89, 0x0c, 0xb8, 0x60, 0x8a, + 0xc1, 0xfa, 0xa6, 0x3e, 0xc8, 0x96, 0x20, 0xd3, 0xd7, 0x2e, 0x52, 0x96, 0x32, 0x2d, 0x0e, 0xff, + 0x27, 0xe3, 0xab, 0xb5, 0x0f, 0x4c, 0xe3, 0x91, 0x88, 0xc6, 0x36, 0xac, 0x76, 0x77, 0xa0, 0x29, + 0x9b, 0x8c, 0xaf, 0xf1, 0x5b, 0x00, 0xc7, 0x5d, 0x73, 0xec, 0xa1, 0x8a, 0x14, 0x86, 0xf7, 0xa0, + 0x6c, 0xc0, 0x9e, 0x5b, 0x77, 0x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func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/third_party/dymension/sequencer/types/keys.go b/types/pb/dymensionxyz/dymension/sequencer/keys.go similarity index 99% rename from third_party/dymension/sequencer/types/keys.go rename to types/pb/dymensionxyz/dymension/sequencer/keys.go index 80310719d..c4b84447f 100644 --- a/third_party/dymension/sequencer/types/keys.go +++ b/types/pb/dymensionxyz/dymension/sequencer/keys.go @@ -1,4 +1,4 @@ -package types +package sequencer import ( "encoding/binary" diff --git a/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go b/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go new file mode 100644 index 000000000..fb35f4f5a --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go @@ -0,0 +1,1494 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/metadata.proto + +package sequencer + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Metadata defines rollapp/sequencer extra information. +type SequencerMetadata struct { + // moniker defines a human-readable name for the sequencer. + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // details define other optional details. + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` + // bootstrap nodes list + P2PSeeds []string `protobuf:"bytes,6,rep,name=p2p_seeds,json=p2pSeeds,proto3" json:"p2p_seeds,omitempty"` + // RPCs list + Rpcs []string `protobuf:"bytes,7,rep,name=rpcs,proto3" json:"rpcs,omitempty"` + // evm RPCs list + EvmRpcs []string `protobuf:"bytes,8,rep,name=evm_rpcs,json=evmRpcs,proto3" json:"evm_rpcs,omitempty"` + // REST API URLs + RestApiUrls []string `protobuf:"bytes,9,rep,name=rest_api_urls,json=restApiUrls,proto3" json:"rest_api_urls,omitempty"` + // block explorer URL + ExplorerUrl string `protobuf:"bytes,10,opt,name=explorer_url,json=explorerUrl,proto3" json:"explorer_url,omitempty"` + // genesis URLs + GenesisUrls []string `protobuf:"bytes,11,rep,name=genesis_urls,json=genesisUrls,proto3" json:"genesis_urls,omitempty"` + // contact details + ContactDetails *ContactDetails `protobuf:"bytes,12,opt,name=contact_details,json=contactDetails,proto3" json:"contact_details,omitempty"` + // json dump the sequencer can add (limited by size) + ExtraData []byte `protobuf:"bytes,13,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` + // snapshots of the sequencer + Snapshots []*SnapshotInfo `protobuf:"bytes,14,rep,name=snapshots,proto3" json:"snapshots,omitempty"` + // gas_price defines the value for each gas unit + GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,15,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` +} + +func (m *SequencerMetadata) Reset() { *m = SequencerMetadata{} } +func (m *SequencerMetadata) String() string { return proto.CompactTextString(m) } +func (*SequencerMetadata) ProtoMessage() {} +func (*SequencerMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{0} +} +func (m *SequencerMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SequencerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SequencerMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SequencerMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_SequencerMetadata.Merge(m, src) +} +func (m *SequencerMetadata) XXX_Size() int { + return m.Size() +} +func (m *SequencerMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_SequencerMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_SequencerMetadata proto.InternalMessageInfo + +func (m *SequencerMetadata) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *SequencerMetadata) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func (m *SequencerMetadata) GetP2PSeeds() []string { + if m != nil { + return m.P2PSeeds + } + return nil +} + +func (m *SequencerMetadata) GetRpcs() []string { + if m != nil { + return m.Rpcs + } + return nil +} + +func (m *SequencerMetadata) GetEvmRpcs() []string { + if m != nil { + return m.EvmRpcs + } + return nil +} + +func (m *SequencerMetadata) GetRestApiUrls() []string { + if m != nil { + return m.RestApiUrls + } + return nil +} + +func (m *SequencerMetadata) GetExplorerUrl() string { + if m != nil { + return m.ExplorerUrl + } + return "" +} + +func (m *SequencerMetadata) GetGenesisUrls() []string { + if m != nil { + return m.GenesisUrls + } + return nil +} + +func (m *SequencerMetadata) GetContactDetails() *ContactDetails { + if m != nil { + return m.ContactDetails + } + return nil +} + +func (m *SequencerMetadata) GetExtraData() []byte { + if m != nil { + return m.ExtraData + } + return nil +} + +func (m *SequencerMetadata) GetSnapshots() []*SnapshotInfo { + if m != nil { + return m.Snapshots + } + return nil +} + +type ContactDetails struct { + // website URL + Website string `protobuf:"bytes,11,opt,name=website,proto3" json:"website,omitempty"` + // telegram link + Telegram string `protobuf:"bytes,1,opt,name=telegram,proto3" json:"telegram,omitempty"` + // twitter link + X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *ContactDetails) Reset() { *m = ContactDetails{} } +func (m *ContactDetails) String() string { return proto.CompactTextString(m) } +func (*ContactDetails) ProtoMessage() {} +func (*ContactDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{1} +} +func (m *ContactDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContactDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ContactDetails.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ContactDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContactDetails.Merge(m, src) +} +func (m *ContactDetails) XXX_Size() int { + return m.Size() +} +func (m *ContactDetails) XXX_DiscardUnknown() { + xxx_messageInfo_ContactDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_ContactDetails proto.InternalMessageInfo + +func (m *ContactDetails) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *ContactDetails) GetTelegram() string { + if m != nil { + return m.Telegram + } + return "" +} + +func (m *ContactDetails) GetX() string { + if m != nil { + return m.X + } + return "" +} + +type SnapshotInfo struct { + // the snapshot url + SnapshotUrl string `protobuf:"bytes,1,opt,name=snapshot_url,json=snapshotUrl,proto3" json:"snapshot_url,omitempty"` + // The snapshot height + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // sha-256 checksum value for the snapshot file + Checksum string `protobuf:"bytes,3,opt,name=checksum,proto3" json:"checksum,omitempty"` +} + +func (m *SnapshotInfo) Reset() { *m = SnapshotInfo{} } +func (m *SnapshotInfo) String() string { return proto.CompactTextString(m) } +func (*SnapshotInfo) ProtoMessage() {} +func (*SnapshotInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{2} +} +func (m *SnapshotInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotInfo.Merge(m, src) +} +func (m *SnapshotInfo) XXX_Size() int { + return m.Size() +} +func (m *SnapshotInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotInfo proto.InternalMessageInfo + +func (m *SnapshotInfo) GetSnapshotUrl() string { + if m != nil { + return m.SnapshotUrl + } + return "" +} + +func (m *SnapshotInfo) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *SnapshotInfo) GetChecksum() string { + if m != nil { + return m.Checksum + } + return "" +} + +func init() { + proto.RegisterType((*SequencerMetadata)(nil), "dymensionxyz.dymension.sequencer.SequencerMetadata") + proto.RegisterType((*ContactDetails)(nil), "dymensionxyz.dymension.sequencer.ContactDetails") + proto.RegisterType((*SnapshotInfo)(nil), "dymensionxyz.dymension.sequencer.SnapshotInfo") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/metadata.proto", fileDescriptor_6045a4988478e768) +} + +var fileDescriptor_6045a4988478e768 = []byte{ + // 539 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xad, 0xdb, 0x34, 0xb1, 0xc7, 0x69, 0xfa, 0x9e, 0x85, 0xd0, 0x50, 0x84, 0x31, 0x59, 0xa0, + 0x08, 0x09, 0x1b, 0x05, 0xf1, 0x01, 0x94, 0x4a, 0x50, 0x04, 0x12, 0x72, 0xe8, 0x02, 0x36, 0x96, + 0xe3, 0x5c, 0x1c, 0x2b, 0xb6, 0x67, 0x98, 0x3b, 0x29, 0x09, 0x5f, 0xc1, 0x82, 0x8f, 0x62, 0xd9, + 0x25, 0x62, 0x81, 0x50, 0xf2, 0x23, 0x68, 0xc6, 0x76, 0x9a, 0xb2, 0xc9, 0xca, 0x3e, 0xe7, 0xde, + 0x73, 0x66, 0xe6, 0xdc, 0x19, 0xf2, 0x4c, 0x2e, 0x39, 0x60, 0x30, 0x59, 0x16, 0x50, 0x62, 0xc6, + 0xca, 0xc5, 0xf2, 0xeb, 0x35, 0x08, 0x10, 0x3e, 0xcf, 0xa1, 0x4c, 0x40, 0x04, 0x05, 0xc8, 0x78, + 0x12, 0xcb, 0xd8, 0xe7, 0x82, 0x49, 0xe6, 0x78, 0xdb, 0x02, 0x7f, 0x03, 0xfc, 0x8d, 0xe0, 0xe4, + 0x56, 0xca, 0x52, 0xa6, 0x9b, 0x03, 0xf5, 0x57, 0xe9, 0xfa, 0xdf, 0x5b, 0xe4, 0xff, 0x51, 0xd3, + 0xf3, 0xb6, 0xf6, 0x74, 0x28, 0xe9, 0x14, 0xac, 0xcc, 0x66, 0x20, 0xa8, 0xe1, 0x19, 0x03, 0x2b, + 0x6c, 0xa0, 0xaa, 0x4c, 0x40, 0xc6, 0x59, 0x8e, 0xf4, 0xb0, 0xaa, 0xd4, 0xd0, 0xb9, 0x4b, 0x2c, + 0x3e, 0xe4, 0x11, 0x02, 0x4c, 0x90, 0xb6, 0xbd, 0x83, 0x81, 0x15, 0x9a, 0x7c, 0xc8, 0x47, 0x0a, + 0x3b, 0x0e, 0x69, 0x09, 0x9e, 0x20, 0xed, 0x68, 0x5e, 0xff, 0x3b, 0x77, 0x88, 0x09, 0x97, 0x45, + 0xa4, 0x79, 0x53, 0xf3, 0x1d, 0xb8, 0x2c, 0x42, 0x55, 0xea, 0x93, 0x23, 0x01, 0x28, 0xa3, 0x98, + 0x67, 0xd1, 0x5c, 0xe4, 0x48, 0x2d, 0x5d, 0xb7, 0x15, 0xf9, 0x9c, 0x67, 0x17, 0x22, 0x47, 0xe7, + 0x01, 0xe9, 0xc2, 0x82, 0xe7, 0x4c, 0x80, 0x50, 0x3d, 0x94, 0xe8, 0xed, 0xd8, 0x0d, 0x77, 0x21, + 0x72, 0xd5, 0x92, 0x42, 0x09, 0x98, 0x61, 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c, 0x9a, 0x13, + 0xe8, 0x11, 0x56, 0x6a, 0xbb, 0xe1, 0xd4, 0x08, 0x6f, 0x93, 0xf6, 0x14, 0xb2, 0x74, 0x2a, 0xb5, + 0x4b, 0x2b, 0xac, 0x91, 0x5a, 0x34, 0x99, 0x42, 0x32, 0xc3, 0x79, 0x41, 0x0f, 0xaa, 0x45, 0x1b, + 0x7c, 0x3a, 0xfe, 0xb1, 0x72, 0x8d, 0xab, 0x95, 0x6b, 0xfc, 0x59, 0xb9, 0xc6, 0xb7, 0xb5, 0xbb, + 0x77, 0xb5, 0x76, 0xf7, 0x7e, 0xae, 0xdd, 0xbd, 0x8f, 0xaf, 0xb6, 0xe2, 0xf8, 0xf7, 0x85, 0x65, + 0xa5, 0xac, 0x02, 0x09, 0xf8, 0x78, 0xe7, 0xf3, 0x1b, 0xb7, 0xf5, 0xf3, 0x79, 0xfa, 0x37, 0x00, + 0x00, 0xff, 0xff, 0xef, 0x23, 0x73, 0xc5, 0xaf, 0x03, 0x00, 0x00, +} + +func (m *SequencerMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SequencerMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SequencerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasPrice != nil { + { + size := m.GasPrice.Size() + i -= size + if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.Snapshots) > 0 { + for iNdEx := len(m.Snapshots) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Snapshots[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + } + if len(m.ExtraData) > 0 { + i -= len(m.ExtraData) + copy(dAtA[i:], m.ExtraData) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExtraData))) + i-- + dAtA[i] = 0x6a + } + if m.ContactDetails != nil { + { + size, err := m.ContactDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.GenesisUrls) > 0 { + for iNdEx := len(m.GenesisUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GenesisUrls[iNdEx]) + copy(dAtA[i:], m.GenesisUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.GenesisUrls[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(m.ExplorerUrl) > 0 { + i -= len(m.ExplorerUrl) + copy(dAtA[i:], m.ExplorerUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExplorerUrl))) + i-- + dAtA[i] = 0x52 + } + if len(m.RestApiUrls) > 0 { + for iNdEx := len(m.RestApiUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RestApiUrls[iNdEx]) + copy(dAtA[i:], m.RestApiUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.RestApiUrls[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.EvmRpcs) > 0 { + for iNdEx := len(m.EvmRpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EvmRpcs[iNdEx]) + copy(dAtA[i:], m.EvmRpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.EvmRpcs[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Rpcs) > 0 { + for iNdEx := len(m.Rpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Rpcs[iNdEx]) + copy(dAtA[i:], m.Rpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Rpcs[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.P2PSeeds) > 0 { + for iNdEx := len(m.P2PSeeds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.P2PSeeds[iNdEx]) + copy(dAtA[i:], m.P2PSeeds[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.P2PSeeds[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ContactDetails) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContactDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContactDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x5a + } + if len(m.X) > 0 { + i -= len(m.X) + copy(dAtA[i:], m.X) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.X))) + i-- + dAtA[i] = 0x12 + } + if len(m.Telegram) > 0 { + i -= len(m.Telegram) + copy(dAtA[i:], m.Telegram) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Telegram))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintMetadata(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.SnapshotUrl) > 0 { + i -= len(m.SnapshotUrl) + copy(dAtA[i:], m.SnapshotUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.SnapshotUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovMetadata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SequencerMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.P2PSeeds) > 0 { + for _, s := range m.P2PSeeds { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.Rpcs) > 0 { + for _, s := range m.Rpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.EvmRpcs) > 0 { + for _, s := range m.EvmRpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.RestApiUrls) > 0 { + for _, s := range m.RestApiUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + l = len(m.ExplorerUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.GenesisUrls) > 0 { + for _, s := range m.GenesisUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.ContactDetails != nil { + l = m.ContactDetails.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.ExtraData) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.Snapshots) > 0 { + for _, e := range m.Snapshots { + l = e.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.GasPrice != nil { + l = m.GasPrice.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *ContactDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Telegram) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.X) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *SnapshotInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SnapshotUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovMetadata(uint64(m.Height)) + } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func sovMetadata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMetadata(x uint64) (n int) { + return sovMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SequencerMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SequencerMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SequencerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field P2PSeeds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.P2PSeeds = append(m.P2PSeeds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rpcs = append(m.Rpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvmRpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvmRpcs = append(m.EvmRpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RestApiUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RestApiUrls = append(m.RestApiUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExplorerUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExplorerUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisUrls = append(m.GenesisUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContactDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContactDetails == nil { + m.ContactDetails = &ContactDetails{} + } + if err := m.ContactDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtraData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtraData = append(m.ExtraData[:0], dAtA[iNdEx:postIndex]...) + if m.ExtraData == nil { + m.ExtraData = []byte{} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Snapshots = append(m.Snapshots, &SnapshotInfo{}) + if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.GasPrice = &v + if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContactDetails) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContactDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContactDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Telegram", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Telegram = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.X = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SnapshotUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SnapshotUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMetadata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMetadata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetadata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetadata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetadata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go b/types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go new file mode 100644 index 000000000..e5fbe5cea --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/operating_status.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// OperatingStatus defines the operating status of a sequencer +type OperatingStatus int32 + +const ( + // OPERATING_STATUS_UNBONDED defines a sequencer that is not active and won't + // be scheduled + Unbonded OperatingStatus = 0 + // UNBONDING defines a sequencer that is currently unbonding. + Unbonding OperatingStatus = 1 + // OPERATING_STATUS_BONDED defines a sequencer that is bonded and can be + // scheduled + Bonded OperatingStatus = 2 +) + +var OperatingStatus_name = map[int32]string{ + 0: "OPERATING_STATUS_UNBONDED", + 1: "OPERATING_STATUS_UNBONDING", + 2: "OPERATING_STATUS_BONDED", +} + +var OperatingStatus_value = map[string]int32{ + "OPERATING_STATUS_UNBONDED": 0, + "OPERATING_STATUS_UNBONDING": 1, + "OPERATING_STATUS_BONDED": 2, +} + +func (x OperatingStatus) String() string { + return proto.EnumName(OperatingStatus_name, int32(x)) +} + +func (OperatingStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d854b24b5c08f0d1, []int{0} +} + +func init() { + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/operating_status.proto", fileDescriptor_d854b24b5c08f0d1) +} + +var fileDescriptor_d854b24b5c08f0d1 = []byte{ + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x2d, 0xa9, 0x2c, 0x48, + 0x2d, 0xd6, 0x4f, 0xa9, 0xcc, 0x4d, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xab, 0xa8, 0xac, 0x42, 0x70, + 0xf4, 0x8b, 0x53, 0x0b, 0x4b, 0x53, 0xf3, 0x92, 0x53, 0x8b, 0xf4, 0xf3, 0x0b, 0x52, 0x8b, 0x12, + 0x4b, 0x32, 0xf3, 0xd2, 0xe3, 0x8b, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, + 0xf2, 0x85, 0x14, 0x90, 0x35, 0xea, 0xc1, 0x39, 0x7a, 0x70, 0x8d, 0x52, 0x22, 0xe9, 0xf9, 0xe9, + 0xf9, 0x60, 0xc5, 0xfa, 0x20, 0x16, 0x44, 0x9f, 0xd6, 0x1c, 0x46, 0x2e, 0x7e, 0x7f, 0x98, 0x91, + 0xc1, 0x60, 0x13, 0x85, 0xb4, 0xb9, 0x24, 0xfd, 0x03, 0x5c, 0x83, 0x1c, 0x43, 0x3c, 0xfd, 0xdc, + 0xe3, 0x83, 0x43, 0x1c, 0x43, 0x42, 0x83, 0xe3, 0x43, 0xfd, 0x9c, 0xfc, 0xfd, 0x5c, 0x5c, 0x5d, + 0x04, 0x18, 0xa4, 0x78, 0xba, 0xe6, 0x2a, 0x70, 0x84, 0xe6, 0x25, 0xe5, 0xe7, 0xa5, 0xa4, 0xa6, + 0x08, 0xe9, 0x72, 0x49, 0xe1, 0x50, 0xec, 0xe9, 0xe7, 0x2e, 0xc0, 0x28, 0xc5, 0xdb, 0x35, 0x57, + 0x81, 0x13, 0xa2, 0x3a, 0x33, 0x2f, 0x5d, 0x48, 0x9d, 0x4b, 0x1c, 0x43, 0x39, 0xd4, 0x64, 0x26, + 0x29, 0xae, 0xae, 0xb9, 0x0a, 0x6c, 0x4e, 0x60, 0x73, 0xa5, 0x58, 0x3a, 0x16, 0xcb, 0x31, 0x38, + 0x25, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x47, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x46, 0xa0, 0x65, 0xe6, 0x95, 0xe8, 0x43, 0x82, 0xb3, + 0x20, 0x89, 0x60, 0x88, 0x26, 0xb1, 0x81, 0x43, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x10, + 0x0f, 0x7d, 0xbc, 0x82, 0x01, 0x00, 0x00, +} diff --git a/third_party/dymension/sequencer/types/params.go b/types/pb/dymensionxyz/dymension/sequencer/params.go similarity index 89% rename from third_party/dymension/sequencer/types/params.go rename to types/pb/dymensionxyz/dymension/sequencer/params.go index 2c89595f9..5bf8971f0 100644 --- a/third_party/dymension/sequencer/types/params.go +++ b/types/pb/dymensionxyz/dymension/sequencer/params.go @@ -1,4 +1,4 @@ -package types +package sequencer import ( "gopkg.in/yaml.v2" diff --git a/third_party/dymension/sequencer/types/params.pb.go b/types/pb/dymensionxyz/dymension/sequencer/params.pb.go similarity index 80% rename from third_party/dymension/sequencer/types/params.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/params.pb.go index 26ea35e1d..ba18d1b62 100644 --- a/third_party/dymension/sequencer/types/params.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/params.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/params.proto +// source: types/dymensionxyz/dymension/sequencer/params.proto -package types +package sequencer import ( fmt "fmt" @@ -9,8 +9,8 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" @@ -45,7 +45,7 @@ type Params struct { func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_d06545e8924ecfea, []int{0} + return fileDescriptor_d60422971c962d58, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -99,37 +99,39 @@ func init() { proto.RegisterType((*Params)(nil), "dymensionxyz.dymension.sequencer.Params") } -func init() { proto.RegisterFile("dymension/sequencer/params.proto", fileDescriptor_d06545e8924ecfea) } +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/params.proto", fileDescriptor_d60422971c962d58) +} -var fileDescriptor_d06545e8924ecfea = []byte{ - // 421 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x8b, 0xd4, 0x40, - 0x18, 0xc6, 0x33, 0x9e, 0x9c, 0x6b, 0xf4, 0x2c, 0x82, 0xe0, 0xde, 0x16, 0x49, 0xd8, 0x42, 0xae, - 0xd0, 0x19, 0xce, 0x03, 0x8b, 0x2b, 0xe3, 0x15, 0x22, 0x08, 0x21, 0x5a, 0xd9, 0x84, 0xfc, 0x79, - 0xcd, 0x0d, 0x66, 0xe6, 0x8d, 0x99, 0xc9, 0x72, 0xf1, 0x2b, 0x08, 0x62, 0x79, 0xe5, 0x7d, 0x9c, - 0x2b, 0xaf, 0x14, 0x8b, 0x28, 0xbb, 0x8d, 0x58, 0xfa, 0x09, 0x24, 0x7f, 0x77, 0x1b, 0xc1, 0x2a, - 0x79, 0xe7, 0x79, 0x9e, 0x1f, 0x0f, 0x2f, 0xaf, 0xe9, 0xa6, 0xb5, 0x00, 0xa9, 0x38, 0x4a, 0xa6, - 0xe0, 0x63, 0x05, 0x32, 0x81, 0x92, 0x15, 0x51, 0x19, 0x09, 0x45, 0x8b, 0x12, 0x35, 0x5a, 0x5b, - 0xc7, 0x45, 0xfd, 0x89, 0x4e, 0x03, 0x9d, 0xec, 0x8b, 0x87, 0x19, 0x66, 0xd8, 0x99, 0x59, 0xfb, - 0xd7, 0xe7, 0x16, 0x76, 0x82, 0x4a, 0xa0, 0x62, 0x71, 0xa4, 0x80, 0xad, 0x8e, 0x63, 0xd0, 0xd1, - 0x31, 0x4b, 0x90, 0xcb, 0x51, 0xcf, 0x10, 0xb3, 0x1c, 0x58, 0x37, 0xc5, 0xd5, 0x7b, 0x96, 0x56, - 0x65, 0xa4, 0x5b, 0x72, 0xf7, 0xb2, 0xfc, 0xbc, 0x67,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d, 0x69, 0xa5, - 0xd7, 0x93, 0x72, 0x3a, 0xbb, 0xbc, 0x72, 0x8c, 0x5f, 0x57, 0x0e, 0xf1, 0xfc, 0xeb, 0xb5, 0x4d, - 0x6e, 0xd6, 0x36, 0xf9, 0xb9, 0xb6, 0xc9, 0xd7, 0x8d, 0x6d, 0xdc, 0x6c, 0x6c, 0xe3, 0xdb, 0xc6, - 0x36, 0xde, 0x3d, 0xdf, 0x29, 0xb2, 0x7b, 0x2a, 0xdb, 0x81, 0xad, 0x4e, 0xd8, 0xc5, 0xce, 0x79, - 0x75, 0xe5, 0xe2, 0xfd, 0x6e, 0x2f, 0x27, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x44, 0xa8, 0x10, - 0x6e, 0x82, 0x02, 0x00, 0x00, +var fileDescriptor_d60422971c962d58 = []byte{ + // 429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6b, 0xd4, 0x40, + 0x14, 0xc6, 0x33, 0x56, 0xea, 0x1a, 0xad, 0x87, 0x20, 0xb8, 0xdd, 0x43, 0xb2, 0x2c, 0x22, 0x3d, + 0xe8, 0x0c, 0xb5, 0xb7, 0x1e, 0x63, 0x0f, 0x45, 0x10, 0x96, 0xd5, 0x93, 0x97, 0x90, 0x49, 0x9e, + 0xe9, 0xc3, 0xcc, 0xbc, 0x98, 0x99, 0x14, 0xe3, 0xbf, 0x20, 0x88, 0xc7, 0x1e, 0xfb, 0xe7, 0xf4, + 0xd8, 0xa3, 0x78, 0x58, 0x65, 0xf7, 0x22, 0x1e, 0xfd, 0x0b, 0x24, 0xc9, 0x26, 0x16, 0x41, 0xec, + 0x29, 0x79, 0xf9, 0xbe, 0xef, 0x97, 0x8f, 0x99, 0xe7, 0x1e, 0xd8, 0xba, 0x00, 0x23, 0xd2, 0x5a, + 0x81, 0x36, 0x48, 0xfa, 0x7d, 0xfd, 0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b, 0x5d, 0x72, + 0xde, 0x06, 0xbd, 0x4f, 0xcc, 0xdd, 0xcd, 0xf1, 0x14, 0x34, 0x18, 0x13, 0x99, 0x3c, 0x36, 0x27, + 0x91, 0xaa, 0x72, 0x8b, 0x45, 0x8e, 0x50, 0x8e, 0x6f, 0x4e, 0xd9, 0xde, 0xed, 0x70, 0xd1, 0x64, + 0xbf, 0x2e, 0x83, 0x47, 0x19, 0xda, 0x93, 0x4a, 0xf2, 0x84, 0x54, 0x7f, 0xd2, 0xdd, 0xe3, 0x89, + 0x49, 0xdf, 0x8a, 0xf6, 0x06, 0xf8, 0x11, 0x24, 0xbf, 0x96, 0xc1, 0xb4, 0x8e, 0x55, 0x7e, 0x38, + 0xfb, 0x27, 0x78, 0xb6, 0x78, 0xd0, 0x6b, 0x2f, 0x1b, 0xe9, 0xc5, 0xa0, 0x1c, 0x8e, 0xce, 0xce, + 0x03, 0xe7, 0xc7, 0x79, 0xc0, 0x42, 0x79, 0xb1, 0xf2, 0xd9, 0xe5, 0xca, 0x67, 0xdf, 0x57, 0x3e, + 0xfb, 0xbc, 0xf6, 0x9d, 0xcb, 0xb5, 0xef, 0x7c, 0x59, 0xfb, 0xce, 0xeb, 0xe3, 0x2b, 0x45, 0xfe, + 0xde, 0x2f, 0xd4, 0xb6, 0xab, 0x22, 0x0a, 0xf9, 0xdf, 0xe5, 0x93, 0xdb, 0xed, 0x49, 0x1d, 0xfc, + 0x0e, 0x00, 0x00, 0xff, 0xff, 0x95, 0x9a, 0x5a, 0x36, 0xad, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/third_party/dymension/sequencer/types/query.pb.go b/types/pb/dymensionxyz/dymension/sequencer/query.pb.go similarity index 81% rename from third_party/dymension/sequencer/types/query.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/query.pb.go index d104fe6a2..06f9fb50e 100644 --- a/third_party/dymension/sequencer/types/query.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/query.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/query.proto +// source: types/dymensionxyz/dymension/sequencer/query.proto -package types +package sequencer import ( context "context" @@ -10,7 +10,6 @@ import ( _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -38,7 +37,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{0} + return fileDescriptor_1932d70e167e51a2, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +76,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{1} + return fileDescriptor_1932d70e167e51a2, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,7 +120,7 @@ func (m *QueryGetSequencerRequest) Reset() { *m = QueryGetSequencerReque func (m *QueryGetSequencerRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencerRequest) ProtoMessage() {} func (*QueryGetSequencerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{2} + return fileDescriptor_1932d70e167e51a2, []int{2} } func (m *QueryGetSequencerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,7 +164,7 @@ func (m *QueryGetSequencerResponse) Reset() { *m = QueryGetSequencerResp func (m *QueryGetSequencerResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencerResponse) ProtoMessage() {} func (*QueryGetSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{3} + return fileDescriptor_1932d70e167e51a2, []int{3} } func (m *QueryGetSequencerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +208,7 @@ func (m *QuerySequencersRequest) Reset() { *m = QuerySequencersRequest{} func (m *QuerySequencersRequest) String() string { return proto.CompactTextString(m) } func (*QuerySequencersRequest) ProtoMessage() {} func (*QuerySequencersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{4} + return fileDescriptor_1932d70e167e51a2, []int{4} } func (m *QuerySequencersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +253,7 @@ func (m *QuerySequencersResponse) Reset() { *m = QuerySequencersResponse func (m *QuerySequencersResponse) String() string { return proto.CompactTextString(m) } func (*QuerySequencersResponse) ProtoMessage() {} func (*QuerySequencersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{5} + return fileDescriptor_1932d70e167e51a2, []int{5} } func (m *QuerySequencersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +304,7 @@ func (m *QueryGetSequencersByRollappRequest) Reset() { *m = QueryGetSequ func (m *QueryGetSequencersByRollappRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencersByRollappRequest) ProtoMessage() {} func (*QueryGetSequencersByRollappRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{6} + return fileDescriptor_1932d70e167e51a2, []int{6} } func (m *QueryGetSequencersByRollappRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +348,7 @@ func (m *QueryGetSequencersByRollappResponse) Reset() { *m = QueryGetSeq func (m *QueryGetSequencersByRollappResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencersByRollappResponse) ProtoMessage() {} func (*QueryGetSequencersByRollappResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{7} + return fileDescriptor_1932d70e167e51a2, []int{7} } func (m *QueryGetSequencersByRollappResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -398,7 +397,7 @@ func (m *QueryGetSequencersByRollappByStatusRequest) String() string { } func (*QueryGetSequencersByRollappByStatusRequest) ProtoMessage() {} func (*QueryGetSequencersByRollappByStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{8} + return fileDescriptor_1932d70e167e51a2, []int{8} } func (m *QueryGetSequencersByRollappByStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -453,7 +452,7 @@ func (m *QueryGetSequencersByRollappByStatusResponse) String() string { } func (*QueryGetSequencersByRollappByStatusResponse) ProtoMessage() {} func (*QueryGetSequencersByRollappByStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{9} + return fileDescriptor_1932d70e167e51a2, []int{9} } func (m *QueryGetSequencersByRollappByStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +497,7 @@ func (m *QueryGetProposerByRollappRequest) Reset() { *m = QueryGetPropos func (m *QueryGetProposerByRollappRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetProposerByRollappRequest) ProtoMessage() {} func (*QueryGetProposerByRollappRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{10} + return fileDescriptor_1932d70e167e51a2, []int{10} } func (m *QueryGetProposerByRollappRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +542,7 @@ func (m *QueryGetProposerByRollappResponse) Reset() { *m = QueryGetPropo func (m *QueryGetProposerByRollappResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetProposerByRollappResponse) ProtoMessage() {} func (*QueryGetProposerByRollappResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{11} + return fileDescriptor_1932d70e167e51a2, []int{11} } func (m *QueryGetProposerByRollappResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -588,7 +587,7 @@ func (m *QueryGetNextProposerByRollappRequest) Reset() { *m = QueryGetNe func (m *QueryGetNextProposerByRollappRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNextProposerByRollappRequest) ProtoMessage() {} func (*QueryGetNextProposerByRollappRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{12} + return fileDescriptor_1932d70e167e51a2, []int{12} } func (m *QueryGetNextProposerByRollappRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,15 +625,18 @@ func (m *QueryGetNextProposerByRollappRequest) GetRollappId() string { // Response type for the GetNextProposerByRollapp RPC method. type QueryGetNextProposerByRollappResponse struct { - NextProposerAddr string `protobuf:"bytes,1,opt,name=nextProposerAddr,proto3" json:"nextProposerAddr,omitempty"` - RotationInProgress bool `protobuf:"varint,2,opt,name=rotationInProgress,proto3" json:"rotationInProgress,omitempty"` + // nextProposerAddr is the address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + NextProposerAddr string `protobuf:"bytes,1,opt,name=nextProposerAddr,proto3" json:"nextProposerAddr,omitempty"` + // rotationInProgress is true if the proposer rotation is in progress. + RotationInProgress bool `protobuf:"varint,2,opt,name=rotationInProgress,proto3" json:"rotationInProgress,omitempty"` } func (m *QueryGetNextProposerByRollappResponse) Reset() { *m = QueryGetNextProposerByRollappResponse{} } func (m *QueryGetNextProposerByRollappResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNextProposerByRollappResponse) ProtoMessage() {} func (*QueryGetNextProposerByRollappResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{13} + return fileDescriptor_1932d70e167e51a2, []int{13} } func (m *QueryGetNextProposerByRollappResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -677,6 +679,104 @@ func (m *QueryGetNextProposerByRollappResponse) GetRotationInProgress() bool { return false } +// Request type for the Proposers RPC method. +type QueryProposersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposersRequest) Reset() { *m = QueryProposersRequest{} } +func (m *QueryProposersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposersRequest) ProtoMessage() {} +func (*QueryProposersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1932d70e167e51a2, []int{14} +} +func (m *QueryProposersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposersRequest.Merge(m, src) +} +func (m *QueryProposersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposersRequest proto.InternalMessageInfo + +func (m *QueryProposersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// Response type for the Proposers RPC method. +type QueryProposersResponse struct { + Proposers []Sequencer `protobuf:"bytes,1,rep,name=proposers,proto3" json:"proposers"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposersResponse) Reset() { *m = QueryProposersResponse{} } +func (m *QueryProposersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposersResponse) ProtoMessage() {} +func (*QueryProposersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1932d70e167e51a2, []int{15} +} +func (m *QueryProposersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposersResponse.Merge(m, src) +} +func (m *QueryProposersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposersResponse proto.InternalMessageInfo + +func (m *QueryProposersResponse) GetProposers() []Sequencer { + if m != nil { + return m.Proposers + } + return nil +} + +func (m *QueryProposersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "dymensionxyz.dymension.sequencer.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dymensionxyz.dymension.sequencer.QueryParamsResponse") @@ -692,65 +792,65 @@ func init() { proto.RegisterType((*QueryGetProposerByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetProposerByRollappResponse") proto.RegisterType((*QueryGetNextProposerByRollappRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetNextProposerByRollappRequest") proto.RegisterType((*QueryGetNextProposerByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetNextProposerByRollappResponse") + proto.RegisterType((*QueryProposersRequest)(nil), "dymensionxyz.dymension.sequencer.QueryProposersRequest") + proto.RegisterType((*QueryProposersResponse)(nil), "dymensionxyz.dymension.sequencer.QueryProposersResponse") } -func init() { proto.RegisterFile("dymension/sequencer/query.proto", fileDescriptor_d09222b66a78a447) } - -var fileDescriptor_d09222b66a78a447 = []byte{ - // 842 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x4e, 0x13, 0x5b, - 0x14, 0xee, 0x70, 0xce, 0x69, 0x4e, 0xd7, 0x21, 0x27, 0x64, 0x43, 0xce, 0xc1, 0x91, 0x94, 0x3a, - 0xf8, 0x43, 0x4a, 0x9c, 0x11, 0x50, 0x82, 0x12, 0x09, 0x16, 0x68, 0x43, 0x44, 0x28, 0xc5, 0x2b, - 0x13, 0x53, 0xa7, 0x74, 0x67, 0x6c, 0xd2, 0xce, 0x1e, 0x66, 0x4f, 0x49, 0x2b, 0x21, 0x31, 0xfa, - 0x02, 0x24, 0xc4, 0x67, 0xf0, 0x09, 0xf4, 0x19, 0xb8, 0xf0, 0x82, 0xc4, 0x1b, 0xaf, 0xd4, 0x80, - 0xf7, 0xfa, 0x08, 0x66, 0xf6, 0xec, 0x99, 0xb6, 0x74, 0xda, 0xe9, 0x0f, 0xdc, 0x4d, 0xf7, 0xac, - 0xf5, 0xad, 0xef, 0x5b, 0x6b, 0xd6, 0xb7, 0x0b, 0xe3, 0xf9, 0x6a, 0x09, 0xeb, 0xb4, 0x40, 0x74, - 0x85, 0xe2, 0xdd, 0x32, 0xd6, 0x77, 0xb0, 0xa9, 0xec, 0x96, 0xb1, 0x59, 0x95, 0x0d, 0x93, 0x58, - 0x04, 0xc5, 0xbc, 0x80, 0x4a, 0xf5, 0x95, 0xec, 0xfd, 0x90, 0xbd, 0x68, 0x71, 0x44, 0x23, 0x1a, - 0x61, 0xc1, 0x8a, 0xfd, 0xe4, 0xe4, 0x89, 0x63, 0x1a, 0x21, 0x5a, 0x11, 0x2b, 0xaa, 0x51, 0x50, - 0x54, 0x5d, 0x27, 0x96, 0x6a, 0x15, 0x88, 0x4e, 0xf9, 0xdb, 0xf8, 0x0e, 0xa1, 0x25, 0x42, 0x95, - 0x9c, 0x4a, 0xb1, 0x53, 0x4e, 0xd9, 0x9b, 0xce, 0x61, 0x4b, 0x9d, 0x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a6, 0x7b, - 0x1e, 0xcd, 0x75, 0x60, 0x30, 0x1c, 0xa4, 0x61, 0xe8, 0xbf, 0x04, 0x18, 0x6d, 0xe5, 0xd1, 0x28, - 0xd9, 0x39, 0xc3, 0x76, 0x77, 0x85, 0x98, 0xea, 0x1b, 0x87, 0xab, 0x5d, 0x66, 0x6a, 0x1f, 0xa2, - 0x85, 0x60, 0xb5, 0xf6, 0xe5, 0x91, 0xf5, 0x93, 0x9c, 0x48, 0x1f, 0x9f, 0x46, 0x85, 0x93, 0xd3, - 0xa8, 0xf0, 0xfd, 0x34, 0x2a, 0x1c, 0x9e, 0x45, 0x43, 0x27, 0x67, 0xd1, 0xd0, 0x97, 0xb3, 0x68, - 0xe8, 0xd9, 0x9c, 0x56, 0xb0, 0x5e, 0x96, 0x73, 0xf2, 0x0e, 0x29, 0xb5, 0x2a, 0xb0, 0x37, 0xab, - 0x54, 0xea, 0xaa, 0x58, 0x55, 0x03, 0xd3, 0x5c, 0x98, 0xfd, 0xc7, 0x9f, 0xfd, 0x1d, 0x00, 0x00, - 0xff, 0xff, 0x0f, 0xf5, 0x03, 0x5e, 0xfb, 0x0c, 0x00, 0x00, +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/query.proto", fileDescriptor_1932d70e167e51a2) +} + +var fileDescriptor_1932d70e167e51a2 = []byte{ + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcb, 0x6e, 0xd3, 0x4c, + 0x18, 0x86, 0x33, 0xff, 0x21, 0xfa, 0xf3, 0xfd, 0x08, 0x55, 0xd3, 0x02, 0xc5, 0xa0, 0x50, 0x86, + 0x53, 0xd5, 0x4a, 0x36, 0x4d, 0x39, 0x14, 0x10, 0x12, 0x84, 0x92, 0x50, 0x09, 0x68, 0x9a, 0xee, + 0x90, 0x50, 0x71, 0x9a, 0x91, 0x89, 0xd4, 0x78, 0x5c, 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0xcb, 0xc1, 0x81, 0x49, 0xb5, 0x0c, 0xbc, 0x00, 0x59, 0x71, + 0xbe, 0x82, 0x7e, 0x9e, 0x2c, 0xcc, 0x24, 0xb3, 0x2d, 0x86, 0x27, 0x53, 0xd6, 0x91, 0x06, 0x64, + 0x13, 0xc1, 0x74, 0x2a, 0xae, 0xe3, 0x6b, 0xcd, 0x03, 0x98, 0x08, 0x09, 0x2a, 0x2e, 0x73, 0x18, + 0xa7, 0xee, 0x21, 0x5f, 0x6b, 0x19, 0x2e, 0xf6, 0x71, 0x90, 0xe4, 0x04, 0x4e, 0x38, 0xf2, 0xa1, + 0x7f, 0xb4, 0xa5, 0x4b, 0xd7, 0x18, 0x99, 0x87, 0xcb, 0xa1, 0xd1, 0x73, 0xba, 0x31, 0x28, 0xce, + 0x16, 0x82, 0x2b, 0x09, 0x36, 0x92, 0x69, 0x0a, 0x46, 0xec, 0x8e, 0x09, 0x1d, 0x5c, 0xb1, 0x71, + 0xac, 0x03, 0x76, 0x99, 0x17, 0x9c, 0x85, 0x05, 0xbb, 0xe2, 0x32, 0x2b, 0x48, 0x2d, 0x7f, 0x03, + 0xfc, 0x57, 0xed, 0xf1, 0x84, 0xac, 0xc0, 0x29, 0x11, 0xaf, 0xd2, 0xe4, 0xc8, 0x83, 0xe4, 0x2b, + 0x92, 0x59, 0xd5, 0x51, 0x21, 0x8a, 0xc5, 0xb0, 0xaf, 0x43, 0x6c, 0x92, 0xc8, 0xe3, 0xc8, 0x52, + 0xa4, 0xf0, 0x23, 0x07, 0xff, 0x06, 0xd0, 0xf8, 0x2d, 0x64, 0xc5, 0xbd, 0x81, 0x6f, 0x24, 0xa3, + 0xc5, 0xaf, 0x2f, 0xed, 0xe6, 0x21, 0x55, 0x02, 0x86, 0x64, 0xf0, 0x7b, 0x04, 0x39, 0xb5, 0x54, + 0x7c, 0x37, 0xa5, 0x4d, 0x8f, 0x6b, 0x4c, 0xbb, 0x37, 0x90, 0x56, 0x81, 0x6c, 0x21, 0x80, 0xe8, + 0xcc, 0xe3, 0xb9, 0x94, 0x6e, 0xb1, 0xab, 0x49, 0xbb, 0x33, 0x80, 0x52, 0x51, 0x7c, 0x46, 0x30, + 0xda, 0x23, 0x79, 0xf0, 0xfc, 0x00, 0x8b, 0x8b, 0xdd, 0x07, 0xda, 0xe3, 0x21, 0x5d, 0x14, 0xe6, + 0x77, 0x04, 0xe7, 0xfa, 0x04, 0x24, 0x7e, 0x3a, 0x54, 0xa1, 0x7d, 0xf9, 0xaf, 0x3d, 0x3b, 0x22, + 0x37, 0x85, 0xff, 0x09, 0xc1, 0x58, 0xaf, 0x78, 0xc4, 0xc5, 0xf4, 0x95, 0x0e, 0x8a, 0x43, 0xed, + 0xd1, 0x50, 0x1e, 0x8a, 0xf1, 0x0b, 0x82, 0xf1, 0x83, 0x22, 0x13, 0x97, 0xd2, 0xd7, 0xe8, 0x17, + 0xdd, 0x5a, 0x79, 0x68, 0x1f, 0xc5, 0xbb, 0x89, 0x20, 0xa7, 0xb2, 0x0f, 0xdf, 0x4e, 0x9b, 0x07, + 0xfb, 0xf2, 0x58, 0x9b, 0x3b, 0xbc, 0x30, 0x44, 0x28, 0xd6, 0xb6, 0x77, 0xf3, 0x68, 0x67, 0x37, + 0x8f, 0x7e, 0xef, 0xe6, 0xd1, 0x87, 0xbd, 0x7c, 0x66, 0x67, 0x2f, 0x9f, 0xf9, 0xb9, 0x97, 0xcf, + 0xbc, 0x78, 0x62, 0x35, 0xbc, 0xd7, 0xad, 0x9a, 0xbe, 0xca, 0x9a, 0xb1, 0xef, 0xf6, 0x86, 0xed, + 0x19, 0xe2, 0x8b, 0xde, 0xa9, 0x25, 0x7e, 0xd4, 0xd7, 0xb2, 0xc1, 0x47, 0xfc, 0xec, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xfa, 0x5a, 0x35, 0x3a, 0x10, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -779,6 +879,8 @@ type QueryClient interface { GetProposerByRollapp(ctx context.Context, in *QueryGetProposerByRollappRequest, opts ...grpc.CallOption) (*QueryGetProposerByRollappResponse, error) // Queries the next proposer by rollappId. GetNextProposerByRollapp(ctx context.Context, in *QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption) (*QueryGetNextProposerByRollappResponse, error) + // Queries a list of proposers. + Proposers(ctx context.Context, in *QueryProposersRequest, opts ...grpc.CallOption) (*QueryProposersResponse, error) } type queryClient struct { @@ -852,6 +954,15 @@ func (c *queryClient) GetNextProposerByRollapp(ctx context.Context, in *QueryGet return out, nil } +func (c *queryClient) Proposers(ctx context.Context, in *QueryProposersRequest, opts ...grpc.CallOption) (*QueryProposersResponse, error) { + out := new(QueryProposersResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/Proposers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -868,6 +979,8 @@ type QueryServer interface { GetProposerByRollapp(context.Context, *QueryGetProposerByRollappRequest) (*QueryGetProposerByRollappResponse, error) // Queries the next proposer by rollappId. GetNextProposerByRollapp(context.Context, *QueryGetNextProposerByRollappRequest) (*QueryGetNextProposerByRollappResponse, error) + // Queries a list of proposers. + Proposers(context.Context, *QueryProposersRequest) (*QueryProposersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -895,6 +1008,9 @@ func (*UnimplementedQueryServer) GetProposerByRollapp(ctx context.Context, req * func (*UnimplementedQueryServer) GetNextProposerByRollapp(ctx context.Context, req *QueryGetNextProposerByRollappRequest) (*QueryGetNextProposerByRollappResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNextProposerByRollapp not implemented") } +func (*UnimplementedQueryServer) Proposers(ctx context.Context, req *QueryProposersRequest) (*QueryProposersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposers not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1026,6 +1142,24 @@ func _Query_GetNextProposerByRollapp_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _Query_Proposers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/Proposers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposers(ctx, req.(*QueryProposersRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dymensionxyz.dymension.sequencer.Query", HandlerType: (*QueryServer)(nil), @@ -1058,9 +1192,13 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetNextProposerByRollapp", Handler: _Query_GetNextProposerByRollapp_Handler, }, + { + MethodName: "Proposers", + Handler: _Query_Proposers_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "dymension/sequencer/query.proto", + Metadata: "types/dymensionxyz/dymension/sequencer/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -1535,6 +1673,90 @@ func (m *QueryGetNextProposerByRollappResponse) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } +func (m *QueryProposersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryProposersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Proposers) > 0 { + for iNdEx := len(m.Proposers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1736,6 +1958,38 @@ func (m *QueryGetNextProposerByRollappResponse) Size() (n int) { return n } +func (m *QueryProposersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proposers) > 0 { + for _, e := range m.Proposers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2945,6 +3199,212 @@ func (m *QueryGetNextProposerByRollappResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryProposersRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposers = append(m.Proposers, Sequencer{}) + if err := m.Proposers[len(m.Proposers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go b/types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go new file mode 100644 index 000000000..c8e662fba --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go @@ -0,0 +1,1241 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/sequencer.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Sequencer defines a sequencer identified by its' address (sequencerAddress). +// The sequencer could be attached to only one rollapp (rollappId). +type Sequencer struct { + // address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + DymintPubKey *types.Any `protobuf:"bytes,2,opt,name=dymintPubKey,proto3" json:"dymintPubKey,omitempty"` + // rollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,3,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // metadata defines the extra information for the sequencer. + Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` + // jailed defined whether the sequencer has been jailed from bonded status or not. + Jailed bool `protobuf:"varint,5,opt,name=jailed,proto3" json:"jailed,omitempty"` + Proposer bool `protobuf:"varint,6,opt,name=proposer,proto3" json:"proposer,omitempty"` // Deprecated: Do not use. + // status is the sequencer status (bonded/unbonding/unbonded). + Status OperatingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=dymensionxyz.dymension.sequencer.OperatingStatus" json:"status,omitempty"` + // tokens define the delegated tokens (incl. self-delegation). + Tokens github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=tokens,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"tokens"` + // unbond_request_height stores the height at which this sequencer has + // requested to unbond. + UnbondRequestHeight int64 `protobuf:"varint,9,opt,name=unbond_request_height,json=unbondRequestHeight,proto3" json:"unbond_request_height,omitempty"` + // unbond_time defines the time when the sequencer will complete unbonding. + UnbondTime time.Time `protobuf:"bytes,10,opt,name=unbond_time,json=unbondTime,proto3,stdtime" json:"unbond_time"` + // notice_period_time defines the time when the sequencer will finish it's notice period if started + NoticePeriodTime time.Time `protobuf:"bytes,11,opt,name=notice_period_time,json=noticePeriodTime,proto3,stdtime" json:"notice_period_time"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,12,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,13,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *Sequencer) Reset() { *m = Sequencer{} } +func (m *Sequencer) String() string { return proto.CompactTextString(m) } +func (*Sequencer) ProtoMessage() {} +func (*Sequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{0} +} +func (m *Sequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Sequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sequencer.Merge(m, src) +} +func (m *Sequencer) XXX_Size() int { + return m.Size() +} +func (m *Sequencer) XXX_DiscardUnknown() { + xxx_messageInfo_Sequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_Sequencer proto.InternalMessageInfo + +func (m *Sequencer) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Sequencer) GetDymintPubKey() *types.Any { + if m != nil { + return m.DymintPubKey + } + return nil +} + +func (m *Sequencer) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *Sequencer) GetMetadata() SequencerMetadata { + if m != nil { + return m.Metadata + } + return SequencerMetadata{} +} + +func (m *Sequencer) GetJailed() bool { + if m != nil { + return m.Jailed + } + return false +} + +// Deprecated: Do not use. +func (m *Sequencer) GetProposer() bool { + if m != nil { + return m.Proposer + } + return false +} + +func (m *Sequencer) GetStatus() OperatingStatus { + if m != nil { + return m.Status + } + return Unbonded +} + +func (m *Sequencer) GetTokens() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *Sequencer) GetUnbondRequestHeight() int64 { + if m != nil { + return m.UnbondRequestHeight + } + return 0 +} + +func (m *Sequencer) GetUnbondTime() time.Time { + if m != nil { + return m.UnbondTime + } + return time.Time{} +} + +func (m *Sequencer) GetNoticePeriodTime() time.Time { + if m != nil { + return m.NoticePeriodTime + } + return time.Time{} +} + +func (m *Sequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *Sequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount +type BondReduction struct { + // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + // decrease_bond_amount is the amount of tokens to be unbonded. + DecreaseBondAmount types1.Coin `protobuf:"bytes,2,opt,name=decrease_bond_amount,json=decreaseBondAmount,proto3" json:"decrease_bond_amount"` + // decrease_bond_time defines, if unbonding, the min time for the sequencer to complete unbonding. + DecreaseBondTime time.Time `protobuf:"bytes,3,opt,name=decrease_bond_time,json=decreaseBondTime,proto3,stdtime" json:"decrease_bond_time"` +} + +func (m *BondReduction) Reset() { *m = BondReduction{} } +func (m *BondReduction) String() string { return proto.CompactTextString(m) } +func (*BondReduction) ProtoMessage() {} +func (*BondReduction) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{1} +} +func (m *BondReduction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BondReduction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BondReduction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BondReduction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondReduction.Merge(m, src) +} +func (m *BondReduction) XXX_Size() int { + return m.Size() +} +func (m *BondReduction) XXX_DiscardUnknown() { + xxx_messageInfo_BondReduction.DiscardUnknown(m) +} + +var xxx_messageInfo_BondReduction proto.InternalMessageInfo + +func (m *BondReduction) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *BondReduction) GetDecreaseBondAmount() types1.Coin { + if m != nil { + return m.DecreaseBondAmount + } + return types1.Coin{} +} + +func (m *BondReduction) GetDecreaseBondTime() time.Time { + if m != nil { + return m.DecreaseBondTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*Sequencer)(nil), "dymensionxyz.dymension.sequencer.Sequencer") + proto.RegisterType((*BondReduction)(nil), "dymensionxyz.dymension.sequencer.BondReduction") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/sequencer.proto", fileDescriptor_0c9d1421effe42e1) +} + +var fileDescriptor_0c9d1421effe42e1 = []byte{ + // 706 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x4f, 0xdb, 0x48, + 0x18, 0x8d, 0x09, 0x84, 0x64, 0x02, 0x2b, 0x76, 0xc8, 0xae, 0x0c, 0xda, 0x4d, 0x2c, 0xb4, 0x07, + 0x4b, 0x2b, 0xec, 0x26, 0xa8, 0xbd, 0xf5, 0x90, 0x54, 0x95, 0x40, 0x55, 0x55, 0x6a, 0xda, 0x4b, + 0x2f, 0xd6, 0xd8, 0x9e, 0x3a, 0x2e, 0xf1, 0x8c, 0x3b, 0x33, 0x86, 0xba, 0xbf, 0x82, 0xdf, 0xd1, + 0x73, 0x7f, 0x04, 0xea, 0x89, 0x63, 0x4f, 0xa5, 0x22, 0xbf, 0xa2, 0xb7, 0xca, 0x33, 0xe3, 0x90, + 0x50, 0xa9, 0xc0, 0xc9, 0xfe, 0xe6, 0x7d, 0xef, 0xf9, 0x9b, 0x37, 0x6f, 0x0c, 0x1e, 0x89, 0x22, +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b2, 0xc6, 0x19, 0x92, 0x62, 0x64, 0x7e, 0xf9, 0xbc, 0xdb, + 0xd1, 0x96, 0x87, 0xac, 0xc8, 0x04, 0x75, 0x14, 0xcb, 0x5b, 0xd0, 0x80, 0xff, 0x80, 0x16, 0xa3, + 0x93, 0x09, 0xca, 0xb2, 0x83, 0xc8, 0xac, 0xcb, 0xef, 0x5d, 0x2f, 0xc0, 0xd7, 0xa0, 0x59, 0x6d, + 0xd5, 0x5c, 0x96, 0x5f, 0xdb, 0x73, 0x6e, 0x3b, 0x76, 0x67, 0xb6, 0x95, 0xe7, 0x9a, 0x3a, 0x5a, + 0x3e, 0xff, 0xd6, 0xab, 0x79, 0x33, 0x29, 0xf8, 0x37, 0x68, 0xbc, 0x43, 0xc9, 0x04, 0x47, 0xe6, + 0x8a, 0x65, 0xd8, 0x4d, 0x4f, 0x57, 0xb0, 0x0b, 0x9a, 0x19, 0xa3, 0x19, 0xe5, 0x98, 0x99, 0x8d, + 0x12, 0x19, 0x2d, 0x99, 0x86, 0x37, 0x5b, 0x83, 0x07, 0xa0, 0xa1, 0x8c, 0x33, 0x57, 0x2d, 0xc3, + 0xfe, 0x63, 0xd0, 0xbf, 0x7d, 0x98, 0x17, 0x95, 0xe5, 0x47, 0x92, 0xe8, 0x69, 0x01, 0x18, 0x82, + 0x86, 0xa0, 0xc7, 0x98, 0x70, 0xb3, 0x69, 0xd5, 0xed, 0xf6, 0x60, 0xcb, 0xd1, 0x66, 0x95, 0xc9, + 0x71, 0x74, 0x72, 0x9c, 0x27, 0x34, 0x21, 0xa3, 0x07, 0xe5, 0xf4, 0x9f, 0x2e, 0x7b, 0x76, 0x9c, + 0x88, 0x71, 0x1e, 0x38, 0x21, 0x4d, 0xab, 0x00, 0xa9, 0xc7, 0x2e, 0x8f, 0x8e, 0x5d, 0x19, 0x01, + 0x49, 0xe0, 0x9e, 0x96, 0x86, 0x03, 0xf0, 0x57, 0x4e, 0x02, 0x4a, 0x22, 0x9f, 0x95, 0x03,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 0xd9, 0x30, 0x0a, 0xce, 0xaf, 0xba, 0xc6, 0xc5, 0x55, 0xd7, + 0xf8, 0x7e, 0xd5, 0x35, 0xce, 0xa6, 0xdd, 0xda, 0xc5, 0xb4, 0x5b, 0xfb, 0x3a, 0xed, 0xd6, 0xde, + 0xec, 0xcf, 0x85, 0xea, 0xe6, 0xff, 0x23, 0x21, 0x42, 0xc5, 0xca, 0xcd, 0x82, 0x5b, 0x7f, 0x2e, + 0x41, 0x43, 0xce, 0xb4, 0xf7, 0x33, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xd8, 0xa4, 0x12, 0xd0, 0x05, + 0x00, 0x00, +} + +func (m *Sequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x62 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.NoticePeriodTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintSequencer(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x5a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UnbondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintSequencer(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x52 + if m.UnbondRequestHeight != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.UnbondRequestHeight)) + i-- + dAtA[i] = 0x48 + } + if len(m.Tokens) > 0 { + for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Status != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x38 + } + if m.Proposer { + i-- + if m.Proposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x1a + } + if m.DymintPubKey != nil { + { + size, err := m.DymintPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BondReduction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BondReduction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BondReduction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DecreaseBondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintSequencer(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x1a + { + size, err := m.DecreaseBondAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSequencer(dAtA []byte, offset int, v uint64) int { + offset -= sovSequencer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Sequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if m.DymintPubKey != nil { + l = m.DymintPubKey.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovSequencer(uint64(l)) + if m.Jailed { + n += 2 + } + if m.Proposer { + n += 2 + } + if m.Status != 0 { + n += 1 + sovSequencer(uint64(m.Status)) + } + if len(m.Tokens) > 0 { + for _, e := range m.Tokens { + l = e.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + } + if m.UnbondRequestHeight != 0 { + n += 1 + sovSequencer(uint64(m.UnbondRequestHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime) + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime) + n += 1 + l + sovSequencer(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovSequencer(uint64(l)) + } + } + return n +} + +func (m *BondReduction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.DecreaseBondAmount.Size() + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime) + n += 1 + l + sovSequencer(uint64(l)) + return n +} + +func sovSequencer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSequencer(x uint64) (n int) { + return sovSequencer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Sequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DymintPubKey == nil { + m.DymintPubKey = &types.Any{} + } + if err := m.DymintPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposer = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= OperatingStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = append(m.Tokens, types1.Coin{}) + if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondRequestHeight", wireType) + } + m.UnbondRequestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondRequestHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UnbondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoticePeriodTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.NoticePeriodTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BondReduction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BondReduction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BondReduction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DecreaseBondAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.DecreaseBondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSequencer(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSequencer + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSequencer + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSequencer + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSequencer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSequencer = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSequencer = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/sequencer/types/tx.pb.go b/types/pb/dymensionxyz/dymension/sequencer/tx.pb.go similarity index 61% rename from third_party/dymension/sequencer/types/tx.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/tx.pb.go index 599478313..a59aef007 100644 --- a/third_party/dymension/sequencer/types/tx.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/tx.pb.go @@ -1,23 +1,18 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/tx.proto +// source: types/dymensionxyz/dymension/sequencer/tx.proto -package types +package sequencer import ( - context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -36,6 +31,102 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgUpdateParams is the Msg/UpdateParams request type. +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + type MsgCreateSequencer struct { // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` @@ -47,13 +138,18 @@ type MsgCreateSequencer struct { Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` // entry bond for the sequencer. Bond types1.Coin `protobuf:"bytes,5,opt,name=bond,proto3" json:"bond"` + // RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid. + // If empty, the creator address is used. + RewardAddr string `protobuf:"bytes,6,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,7,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` } func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } func (*MsgCreateSequencer) ProtoMessage() {} func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{0} + return fileDescriptor_a5e88906d3ab6fe1, []int{2} } func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,6 +213,20 @@ func (m *MsgCreateSequencer) GetBond() types1.Coin { return types1.Coin{} } +func (m *MsgCreateSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *MsgCreateSequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + type MsgCreateSequencerResponse struct { } @@ -124,7 +234,7 @@ func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerRe func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateSequencerResponse) ProtoMessage() {} func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{1} + return fileDescriptor_a5e88906d3ab6fe1, []int{3} } func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,17 +266,15 @@ var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo type MsgUpdateSequencerInformation struct { // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - // rollapp_id defines the rollapp to which the sequencer belongs. - RollappId string `protobuf:"bytes,2,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` // metadata defines the extra information for the sequencer. - Metadata SequencerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata"` + Metadata SequencerMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata"` } func (m *MsgUpdateSequencerInformation) Reset() { *m = MsgUpdateSequencerInformation{} } func (m *MsgUpdateSequencerInformation) String() string { return proto.CompactTextString(m) } func (*MsgUpdateSequencerInformation) ProtoMessage() {} func (*MsgUpdateSequencerInformation) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{2} + return fileDescriptor_a5e88906d3ab6fe1, []int{4} } func (m *MsgUpdateSequencerInformation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -202,13 +310,6 @@ func (m *MsgUpdateSequencerInformation) GetCreator() string { return "" } -func (m *MsgUpdateSequencerInformation) GetRollappId() string { - if m != nil { - return m.RollappId - } - return "" -} - func (m *MsgUpdateSequencerInformation) GetMetadata() SequencerMetadata { if m != nil { return m.Metadata @@ -223,7 +324,7 @@ func (m *MsgUpdateSequencerInformationResponse) Reset() { *m = MsgUpdate func (m *MsgUpdateSequencerInformationResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateSequencerInformationResponse) ProtoMessage() {} func (*MsgUpdateSequencerInformationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{3} + return fileDescriptor_a5e88906d3ab6fe1, []int{5} } func (m *MsgUpdateSequencerInformationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -252,6 +353,186 @@ func (m *MsgUpdateSequencerInformationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateSequencerInformationResponse proto.InternalMessageInfo +type MsgUpdateRewardAddress struct { + // Creator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *MsgUpdateRewardAddress) Reset() { *m = MsgUpdateRewardAddress{} } +func (m *MsgUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddress) ProtoMessage() {} +func (*MsgUpdateRewardAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{6} +} +func (m *MsgUpdateRewardAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRewardAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddress.Merge(m, src) +} +func (m *MsgUpdateRewardAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRewardAddress proto.InternalMessageInfo + +func (m *MsgUpdateRewardAddress) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateRewardAddress) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type MsgUpdateRewardAddressResponse struct { +} + +func (m *MsgUpdateRewardAddressResponse) Reset() { *m = MsgUpdateRewardAddressResponse{} } +func (m *MsgUpdateRewardAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddressResponse) ProtoMessage() {} +func (*MsgUpdateRewardAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{7} +} +func (m *MsgUpdateRewardAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRewardAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRewardAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateRewardAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddressResponse.Merge(m, src) +} +func (m *MsgUpdateRewardAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRewardAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRewardAddressResponse proto.InternalMessageInfo + +type MsgUpdateWhitelistedRelayers struct { + // Creator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *MsgUpdateWhitelistedRelayers) Reset() { *m = MsgUpdateWhitelistedRelayers{} } +func (m *MsgUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayers) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{8} +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateWhitelistedRelayers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.Merge(m, src) +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateWhitelistedRelayers proto.InternalMessageInfo + +func (m *MsgUpdateWhitelistedRelayers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateWhitelistedRelayers) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + +type MsgUpdateWhitelistedRelayersResponse struct { +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Reset() { *m = MsgUpdateWhitelistedRelayersResponse{} } +func (m *MsgUpdateWhitelistedRelayersResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayersResponse) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{9} +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Merge(m, src) +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse proto.InternalMessageInfo + // MsgUnbond defines a SDK message for performing an undelegation from a // bond and a sequencer. type MsgUnbond struct { @@ -262,7 +543,7 @@ func (m *MsgUnbond) Reset() { *m = MsgUnbond{} } func (m *MsgUnbond) String() string { return proto.CompactTextString(m) } func (*MsgUnbond) ProtoMessage() {} func (*MsgUnbond) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{4} + return fileDescriptor_a5e88906d3ab6fe1, []int{10} } func (m *MsgUnbond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +594,7 @@ func (m *MsgUnbondResponse) Reset() { *m = MsgUnbondResponse{} } func (m *MsgUnbondResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnbondResponse) ProtoMessage() {} func (*MsgUnbondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{5} + return fileDescriptor_a5e88906d3ab6fe1, []int{11} } func (m *MsgUnbondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +680,7 @@ func (m *MsgIncreaseBond) Reset() { *m = MsgIncreaseBond{} } func (m *MsgIncreaseBond) String() string { return proto.CompactTextString(m) } func (*MsgIncreaseBond) ProtoMessage() {} func (*MsgIncreaseBond) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{6} + return fileDescriptor_a5e88906d3ab6fe1, []int{12} } func (m *MsgIncreaseBond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,7 +731,7 @@ func (m *MsgIncreaseBondResponse) Reset() { *m = MsgIncreaseBondResponse func (m *MsgIncreaseBondResponse) String() string { return proto.CompactTextString(m) } func (*MsgIncreaseBondResponse) ProtoMessage() {} func (*MsgIncreaseBondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{7} + return fileDescriptor_a5e88906d3ab6fe1, []int{13} } func (m *MsgIncreaseBondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,7 +772,7 @@ func (m *MsgDecreaseBond) Reset() { *m = MsgDecreaseBond{} } func (m *MsgDecreaseBond) String() string { return proto.CompactTextString(m) } func (*MsgDecreaseBond) ProtoMessage() {} func (*MsgDecreaseBond) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{8} + return fileDescriptor_a5e88906d3ab6fe1, []int{14} } func (m *MsgDecreaseBond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +824,7 @@ func (m *MsgDecreaseBondResponse) Reset() { *m = MsgDecreaseBondResponse func (m *MsgDecreaseBondResponse) String() string { return proto.CompactTextString(m) } func (*MsgDecreaseBondResponse) ProtoMessage() {} func (*MsgDecreaseBondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{9} + return fileDescriptor_a5e88906d3ab6fe1, []int{15} } func (m *MsgDecreaseBondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -580,10 +861,16 @@ func (m *MsgDecreaseBondResponse) GetCompletionTime() time.Time { } func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateParamsResponse") proto.RegisterType((*MsgCreateSequencer)(nil), "dymensionxyz.dymension.sequencer.MsgCreateSequencer") proto.RegisterType((*MsgCreateSequencerResponse)(nil), "dymensionxyz.dymension.sequencer.MsgCreateSequencerResponse") proto.RegisterType((*MsgUpdateSequencerInformation)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateSequencerInformation") proto.RegisterType((*MsgUpdateSequencerInformationResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateSequencerInformationResponse") + proto.RegisterType((*MsgUpdateRewardAddress)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateRewardAddress") + proto.RegisterType((*MsgUpdateRewardAddressResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateRewardAddressResponse") + proto.RegisterType((*MsgUpdateWhitelistedRelayers)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateWhitelistedRelayers") + proto.RegisterType((*MsgUpdateWhitelistedRelayersResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateWhitelistedRelayersResponse") proto.RegisterType((*MsgUnbond)(nil), "dymensionxyz.dymension.sequencer.MsgUnbond") proto.RegisterType((*MsgUnbondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUnbondResponse") proto.RegisterType((*MsgIncreaseBond)(nil), "dymensionxyz.dymension.sequencer.MsgIncreaseBond") @@ -592,315 +879,167 @@ func init() { proto.RegisterType((*MsgDecreaseBondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgDecreaseBondResponse") } -func init() { proto.RegisterFile("dymension/sequencer/tx.proto", fileDescriptor_26d679aa996065f1) } - -var fileDescriptor_26d679aa996065f1 = []byte{ - // 784 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6b, 0x13, 0x4d, - 0x18, 0xce, 0xa6, 0x69, 0xbf, 0x66, 0x5a, 0x9a, 0xaf, 0x4b, 0xa1, 0x9b, 0xa5, 0x4d, 0x4a, 0x40, - 0x2c, 0x8a, 0xbb, 0x24, 0x11, 0xc1, 0x22, 0x4a, 0x53, 0xc1, 0x16, 0x09, 0xd4, 0xd4, 0x5e, 0x3c, - 0x18, 0x36, 0x3b, 0xd3, 0xed, 0x4a, 0x76, 0x66, 0xdd, 0x99, 0x94, 0xae, 0x78, 0x12, 0xbc, 0x17, - 0x3c, 0x2b, 0x9e, 0x3c, 0x7b, 0xf0, 0x26, 0xde, 0x8b, 0x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, 0x2f, 0xc7, 0x5d, 0xb0, 0x0c, 0xa1, 0x87, 0x28, 0xdd, 0x60, - 0x9e, 0x8d, 0x2d, 0x51, 0xed, 0xd2, 0xff, 0xbf, 0xde, 0x16, 0x53, 0x3d, 0xdc, 0xbf, 0x25, 0x30, - 0x2d, 0x30, 0x63, 0x22, 0xf9, 0x31, 0xc8, 0x77, 0xc2, 0x1d, 0x1b, 0x5b, 0x4d, 0x93, 0x38, 0x6e, - 0x1b, 0x05, 0x42, 0x9a, 0xc1, 0x48, 0x84, 0x6c, 0x13, 0x15, 0x75, 0xa0, 0x13, 0x1f, 0xc6, 0xf3, - 0x52, 0xcb, 0xec, 0x7d, 0x2f, 0x4a, 0xab, 0xa9, 0xc6, 0xac, 0x00, 0x59, 0x11, 0x18, 0x41, 0x94, - 0x8c, 0xc0, 0x3c, 0x26, 0xcc, 0x36, 0x51, 0xd3, 0x45, 0x9e, 0x4d, 0xe0, 0x00, 0x47, 0x3a, 0x31, - 0x87, 0x1a, 0x01, 0xad, 0x87, 0x38, 0xbd, 0x34, 0xb5, 0x69, 0x90, 0xeb, 0x03, 0x2e, 0xbd, 0x92, - 0x40, 0xae, 0x4e, 0xad, 0x35, 0x1c, 0x18, 0x40, 0x51, 0xed, 0x9c, 0x4e, 0xca, 0xb7, 0x01, 0x30, - 0x20, 0x6c, 0x1a, 0x0e, 0xe9, 0x60, 0xc6, 0xe5, 0x9e, 0xda, 0xda, 0x59, 0x03, 0xc2, 0xe5, 0x30, - 0xa3, 0xaf, 0x03, 0xf2, 0x60, 0xb6, 0x4f, 0x94, 0xb8, 0xf3, 0xd7, 0x91, 0xe0, 0xbb, 0xe8, 0x82, - 0x82, 0x57, 0x41, 0x0e, 0x72, 0x8c, 0x33, 0xaa, 0x9e, 0x8a, 0xf3, 0x4e, 0x94, 0xbe, 0x1d, 0x4a, - 0xef, 0x96, 0x27, 0xba, 0xa8, 0x3e, 0x60, 0x7f, 0x82, 0xde, 0x19, 0x0f, 0x38, 0x83, 0xbb, 0x6d, - 0x4c, 0x99, 0x3d, 0xb7, 0x59, 0x79, 0x33, 0x0a, 0x46, 0xea, 0xd4, 0x92, 0x5f, 0x4a, 0x20, 0xd7, - 0xff, 0x8e, 0x5e, 0x3f, 0x7d, 0x2a, 0x07, 0x1f, 0x10, 0xf5, 0xd6, 0x79, 0xb2, 0x44, 0x79, 0xef, - 0x24, 0xa0, 0x0e, 0x79, 0x73, 0xee, 0x24, 0x02, 0xff, 0x3b, 0x80, 0x7a, 0xef, 0x82, 0x00, 0x42, - 0xe8, 0x13, 0x30, 0xc6, 0xdf, 0x8c, 0xab, 0xc9, 0x20, 0xc3, 0x60, 0xb5, 0x7a, 0x86, 0x60, 0xc1, - 0xf5, 0x1c, 0x4c, 0xf6, 0xcc, 0x56, 0x39, 0x11, 0x48, 0x77, 0x8a, 0x7a, 0xf3, 0xcc, 0x29, 0xdd, - 0xec, 0x3d, 0x83, 0x92, 0x8c, 0xbd, 0x3b, 0x25, 0x21, 0xfb, 0x49, 0xfd, 0x5e, 0x5b, 0xdf, 0x3f, - 0x2c, 0x48, 0x07, 0x87, 0x05, 0xe9, 0xc7, 0x61, 0x41, 0xda, 0x3b, 0x2a, 0xa4, 0x0e, 0x8e, 0x0a, - 0xa9, 0xaf, 0x47, 0x85, 0xd4, 0xa3, 0x1b, 0x96, 0xcd, 0xb6, 0x3b, 0x2d, 0xcd, 0x24, 0x8e, 0xde, - 0x0d, 0x7f, 0xbc, 0xd0, 0x77, 0xaa, 0xfa, 0x6e, 0xf7, 0x47, 0x92, 0xef, 0x22, 0xda, 0x1a, 0x0b, - 0x07, 0xa4, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0x14, 0xb6, 0xa0, 0xf9, 0x48, 0x09, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // CreateSequencer defines a method for creating a new sequencer. - CreateSequencer(ctx context.Context, in *MsgCreateSequencer, opts ...grpc.CallOption) (*MsgCreateSequencerResponse, error) - // UpdateSequencerInformation defines a method for updating the sequencer's metadata. - UpdateSequencerInformation(ctx context.Context, in *MsgUpdateSequencerInformation, opts ...grpc.CallOption) (*MsgUpdateSequencerInformationResponse, error) - // Unbond defines a method for removing coins from sequencer's bond - Unbond(ctx context.Context, in *MsgUnbond, opts ...grpc.CallOption) (*MsgUnbondResponse, error) - // IncreaseBond defines a method for increasing a sequencer's bond amount - IncreaseBond(ctx context.Context, in *MsgIncreaseBond, opts ...grpc.CallOption) (*MsgIncreaseBondResponse, error) - // DecreaseBond defines a method for decreasing the bond of a sequencer. - DecreaseBond(ctx context.Context, in *MsgDecreaseBond, opts ...grpc.CallOption) (*MsgDecreaseBondResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateSequencer(ctx context.Context, in *MsgCreateSequencer, opts ...grpc.CallOption) (*MsgCreateSequencerResponse, error) { - out := new(MsgCreateSequencerResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/CreateSequencer", in, out, opts...) +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/tx.proto", fileDescriptor_a5e88906d3ab6fe1) +} + +var fileDescriptor_a5e88906d3ab6fe1 = []byte{ + // 861 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0x23, 0x35, + 0x18, 0xcd, 0xa4, 0xa5, 0xdb, 0xb8, 0xab, 0x96, 0x1d, 0x2a, 0x76, 0x12, 0x6d, 0x93, 0x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 0x16, 0x32, 0x18, 0xff, 0x52, + 0xf5, 0x66, 0xd5, 0x77, 0xa3, 0xf4, 0x0b, 0x25, 0x7d, 0x52, 0x9e, 0x7d, 0x45, 0x67, 0x33, 0xf6, + 0x2f, 0xf1, 0x76, 0xd6, 0x4b, 0xce, 0x32, 0xdb, 0x70, 0x33, 0x99, 0x4e, 0x33, 0x7e, 0x7e, 0xd9, + 0x75, 0x5e, 0x5c, 0x76, 0x9d, 0x3f, 0x2e, 0xbb, 0xce, 0xb3, 0xab, 0x6e, 0xe3, 0xc5, 0x55, 0xb7, + 0xf1, 0xeb, 0x55, 0xb7, 0xf1, 0xd9, 0x49, 0x4a, 0xe4, 0xc5, 0x38, 0xf6, 0x13, 0x96, 0xcd, 0x7c, + 0x9d, 0x09, 0x95, 0xe6, 0x3f, 0x9e, 0x3c, 0x5e, 0xf8, 0xe9, 0x8e, 0xd7, 0x94, 0xa2, 0x83, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0xf6, 0xb4, 0xe6, 0x25, 0x09, 0x00, 0x00, +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *msgClient) UpdateSequencerInformation(ctx context.Context, in *MsgUpdateSequencerInformation, opts ...grpc.CallOption) (*MsgUpdateSequencerInformationResponse, error) { - out := new(MsgUpdateSequencerInformationResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/UpdateSequencerInformation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *msgClient) Unbond(ctx context.Context, in *MsgUnbond, opts ...grpc.CallOption) (*MsgUnbondResponse, error) { - out := new(MsgUnbondResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/Unbond", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - return out, nil -} - -func (c *msgClient) IncreaseBond(ctx context.Context, in *MsgIncreaseBond, opts ...grpc.CallOption) (*MsgIncreaseBondResponse, error) { - out := new(MsgIncreaseBondResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/IncreaseBond", in, out, opts...) - if err != nil { - return nil, err + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa } - return out, nil + return len(dAtA) - i, nil } -func (c *msgClient) DecreaseBond(ctx context.Context, in *MsgDecreaseBond, opts ...grpc.CallOption) (*MsgDecreaseBondResponse, error) { - out := new(MsgDecreaseBondResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/DecreaseBond", in, out, opts...) +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -// MsgServer is the server API for Msg service. -type MsgServer interface { - // CreateSequencer defines a method for creating a new sequencer. - CreateSequencer(context.Context, *MsgCreateSequencer) (*MsgCreateSequencerResponse, error) - // UpdateSequencerInformation defines a method for updating the sequencer's metadata. - UpdateSequencerInformation(context.Context, *MsgUpdateSequencerInformation) (*MsgUpdateSequencerInformationResponse, error) - // Unbond defines a method for removing coins from sequencer's bond - Unbond(context.Context, *MsgUnbond) (*MsgUnbondResponse, error) - // IncreaseBond defines a method for increasing a sequencer's bond amount - IncreaseBond(context.Context, *MsgIncreaseBond) (*MsgIncreaseBondResponse, error) - // DecreaseBond defines a method for decreasing the bond of a sequencer. - DecreaseBond(context.Context, *MsgDecreaseBond) (*MsgDecreaseBondResponse, error) +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil } -func (*UnimplementedMsgServer) CreateSequencer(ctx context.Context, req *MsgCreateSequencer) (*MsgCreateSequencerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSequencer not implemented") -} -func (*UnimplementedMsgServer) UpdateSequencerInformation(ctx context.Context, req *MsgUpdateSequencerInformation) (*MsgUpdateSequencerInformationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateSequencerInformation not implemented") -} -func (*UnimplementedMsgServer) Unbond(ctx context.Context, req *MsgUnbond) (*MsgUnbondResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Unbond not implemented") -} -func (*UnimplementedMsgServer) IncreaseBond(ctx context.Context, req *MsgIncreaseBond) (*MsgIncreaseBondResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IncreaseBond not implemented") -} -func (*UnimplementedMsgServer) DecreaseBond(ctx context.Context, req *MsgDecreaseBond) (*MsgDecreaseBondResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DecreaseBond not implemented") +func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) +func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Msg_CreateSequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateSequencer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateSequencer(ctx, in) +func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x3a + } } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/CreateSequencer", + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x32 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateSequencer(ctx, req.(*MsgCreateSequencer)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateSequencerInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateSequencerInformation) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateSequencerInformation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/UpdateSequencerInformation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateSequencerInformation(ctx, req.(*MsgUpdateSequencerInformation)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Unbond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnbond) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Unbond(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/Unbond", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Unbond(ctx, req.(*MsgUnbond)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_IncreaseBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgIncreaseBond) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).IncreaseBond(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/IncreaseBond", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).IncreaseBond(ctx, req.(*MsgIncreaseBond)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_DecreaseBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDecreaseBond) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DecreaseBond(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/DecreaseBond", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DecreaseBond(ctx, req.(*MsgDecreaseBond)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "dymensionxyz.dymension.sequencer.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateSequencer", - Handler: _Msg_CreateSequencer_Handler, - }, - { - MethodName: "UpdateSequencerInformation", - Handler: _Msg_UpdateSequencerInformation_Handler, - }, - { - MethodName: "Unbond", - Handler: _Msg_Unbond_Handler, - }, - { - MethodName: "IncreaseBond", - Handler: _Msg_IncreaseBond_Handler, - }, - { - MethodName: "DecreaseBond", - Handler: _Msg_DecreaseBond_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "dymension/sequencer/tx.proto", -} - -func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l { size, err := m.Bond.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1002,14 +1141,7 @@ func (m *MsgUpdateSequencerInformation) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - if len(m.RollappId) > 0 { - i -= len(m.RollappId) - copy(dAtA[i:], m.RollappId) - i = encodeVarintTx(dAtA, i, uint64(len(m.RollappId))) - i-- - dAtA[i] = 0x12 - } + dAtA[i] = 0x12 if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -1043,6 +1175,128 @@ func (m *MsgUpdateSequencerInformationResponse) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } +func (m *MsgUpdateRewardAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRewardAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateRewardAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRewardAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateWhitelistedRelayers) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgUnbond) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1113,12 +1367,12 @@ func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalTo(dAtA []byte) (int, func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UnbondingCompletionTime != nil { - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UnbondingCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UnbondingCompletionTime):]) - if err5 != nil { - return 0, err5 + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UnbondingCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UnbondingCompletionTime):]) + if err6 != nil { + return 0, err6 } - i -= n5 - i = encodeVarintTx(dAtA, i, uint64(n5)) + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) i-- dAtA[i] = 0xa } @@ -1132,12 +1386,12 @@ func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalTo(dAtA []byte) (i func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.NoticePeriodCompletionTime != nil { - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NoticePeriodCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NoticePeriodCompletionTime):]) - if err6 != nil { - return 0, err6 + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NoticePeriodCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NoticePeriodCompletionTime):]) + if err7 != nil { + return 0, err7 } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x12 } @@ -1266,12 +1520,12 @@ func (m *MsgDecreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintTx(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintTx(dAtA, i, uint64(n10)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1288,6 +1542,30 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgCreateSequencer) Size() (n int) { if m == nil { return 0 @@ -1310,6 +1588,16 @@ func (m *MsgCreateSequencer) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.Bond.Size() n += 1 + l + sovTx(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -1332,10 +1620,6 @@ func (m *MsgUpdateSequencerInformation) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.RollappId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } l = m.Metadata.Size() n += 1 + l + sovTx(uint64(l)) return n @@ -1350,6 +1634,60 @@ func (m *MsgUpdateSequencerInformationResponse) Size() (n int) { return n } +func (m *MsgUpdateRewardAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateRewardAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateWhitelistedRelayers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgUnbond) Size() (n int) { if m == nil { return 0 @@ -1455,7 +1793,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1478,15 +1816,15 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1514,11 +1852,11 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Creator = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1545,8 +1883,173 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DymintPubKey == nil { - m.DymintPubKey = &types.Any{} + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DymintPubKey == nil { + m.DymintPubKey = &types.Any{} } if err := m.DymintPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1650,6 +2153,70 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1783,38 +2350,6 @@ func (m *MsgUpdateSequencerInformation) Unmarshal(dAtA []byte) error { m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RollappId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -1918,6 +2453,334 @@ func (m *MsgUpdateSequencerInformationResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateRewardAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRewardAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRewardAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateWhitelistedRelayers) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateWhitelistedRelayersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgUnbond) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/types/pb/rollapp/sequencers/types/tx.pb.go b/types/pb/rollapp/sequencers/types/tx.pb.go new file mode 100644 index 000000000..153860f64 --- /dev/null +++ b/types/pb/rollapp/sequencers/types/tx.pb.go @@ -0,0 +1,1316 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/rollapp/sequencers/types/tx.proto + +package sequencers + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // PubKey is a tendermint consensus pub key + PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + // Signature is operator signed with the private key of pub_key + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } +func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSequencer) ProtoMessage() {} +func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{0} +} +func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSequencer.Merge(m, src) +} +func (m *MsgCreateSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSequencer proto.InternalMessageInfo + +func (m *MsgCreateSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgCreateSequencer) GetPubKey() *types.Any { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *MsgCreateSequencer) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type MsgCreateSequencerResponse struct { +} + +func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerResponse{} } +func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSequencerResponse) ProtoMessage() {} +func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{1} +} +func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSequencerResponse.Merge(m, src) +} +func (m *MsgCreateSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo + +type MsgUpdateSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *MsgUpdateSequencer) Reset() { *m = MsgUpdateSequencer{} } +func (m *MsgUpdateSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencer) ProtoMessage() {} +func (*MsgUpdateSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{2} +} +func (m *MsgUpdateSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencer.Merge(m, src) +} +func (m *MsgUpdateSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencer proto.InternalMessageInfo + +func (m *MsgUpdateSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgUpdateSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type MsgUpdateSequencerResponse struct { +} + +func (m *MsgUpdateSequencerResponse) Reset() { *m = MsgUpdateSequencerResponse{} } +func (m *MsgUpdateSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencerResponse) ProtoMessage() {} +func (*MsgUpdateSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{3} +} +func (m *MsgUpdateSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencerResponse.Merge(m, src) +} +func (m *MsgUpdateSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencerResponse proto.InternalMessageInfo + +// ConsensusMsgUpsertSequencer is a consensus message to upsert the sequencer. +type ConsensusMsgUpsertSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // ConsPubKey is a tendermint consensus pub key + ConsPubKey *types.Any `protobuf:"bytes,2,opt,name=cons_pub_key,json=consPubKey,proto3" json:"cons_pub_key,omitempty"` + // RewardAddr is the bech32-encoded sequencer's reward address + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *ConsensusMsgUpsertSequencer) Reset() { *m = ConsensusMsgUpsertSequencer{} } +func (m *ConsensusMsgUpsertSequencer) String() string { return proto.CompactTextString(m) } +func (*ConsensusMsgUpsertSequencer) ProtoMessage() {} +func (*ConsensusMsgUpsertSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{4} +} +func (m *ConsensusMsgUpsertSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusMsgUpsertSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusMsgUpsertSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusMsgUpsertSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusMsgUpsertSequencer.Merge(m, src) +} +func (m *ConsensusMsgUpsertSequencer) XXX_Size() int { + return m.Size() +} +func (m *ConsensusMsgUpsertSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusMsgUpsertSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusMsgUpsertSequencer proto.InternalMessageInfo + +func (m *ConsensusMsgUpsertSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *ConsensusMsgUpsertSequencer) GetConsPubKey() *types.Any { + if m != nil { + return m.ConsPubKey + } + return nil +} + +func (m *ConsensusMsgUpsertSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type ConsensusMsgUpsertSequencerResponse struct { +} + +func (m *ConsensusMsgUpsertSequencerResponse) Reset() { *m = ConsensusMsgUpsertSequencerResponse{} } +func (m *ConsensusMsgUpsertSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*ConsensusMsgUpsertSequencerResponse) ProtoMessage() {} +func (*ConsensusMsgUpsertSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{5} +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusMsgUpsertSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusMsgUpsertSequencerResponse.Merge(m, src) +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusMsgUpsertSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusMsgUpsertSequencerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateSequencer)(nil), "rollapp.sequencers.types.MsgCreateSequencer") + proto.RegisterType((*MsgCreateSequencerResponse)(nil), "rollapp.sequencers.types.MsgCreateSequencerResponse") + proto.RegisterType((*MsgUpdateSequencer)(nil), "rollapp.sequencers.types.MsgUpdateSequencer") + proto.RegisterType((*MsgUpdateSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpdateSequencerResponse") + proto.RegisterType((*ConsensusMsgUpsertSequencer)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencer") + proto.RegisterType((*ConsensusMsgUpsertSequencerResponse)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencerResponse") +} + +func init() { + proto.RegisterFile("types/rollapp/sequencers/types/tx.proto", fileDescriptor_bb27942d1c1a6ff0) +} + +var fileDescriptor_bb27942d1c1a6ff0 = []byte{ + // 406 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xbd, 0x8e, 0xd3, 0x40, + 0x10, 0xc7, 0xb3, 0x09, 0x0a, 0xc9, 0x26, 0x48, 0xc8, 0x4a, 0x61, 0x4c, 0x30, 0x91, 0x11, 0x22, + 0x42, 0xc2, 0x2b, 0x40, 0xa2, 0x48, 0x17, 0xd2, 0x81, 0x90, 0x90, 0x81, 0x86, 0x26, 0xf2, 0xc7, + 0x64, 0xb1, 0x88, 0x77, 0x97, 0xdd, 0x35, 0xc4, 0x94, 0x57, 0x5f, 0x71, 0xaf, 0x70, 0x6f, 0x70, + 0x8f, 0x71, 0x65, 0xca, 0x2b, 0x4f, 0x49, 0x71, 0xaf, 0x71, 0xf2, 0x47, 0x12, 0x29, 0x77, 0x3a, + 0xe5, 0x2a, 0xef, 0xcc, 0xfc, 0x3d, 0xff, 0xdf, 0x8c, 0x06, 0xbf, 0xd2, 0x99, 0x00, 0x45, 0x24, + 0x9f, 0xcf, 0x7d, 0x21, 0x88, 0x82, 0x3f, 0x29, 0xb0, 0x10, 0xa4, 0x22, 0x65, 0x41, 0x2f, 0x5c, + 0x21, 0xb9, 0xe6, 0x86, 0x59, 0x49, 0xdc, 0x9d, 0xc4, 0x2d, 0x24, 0x56, 0x8f, 0x72, 0xca, 0x0b, + 0x11, 0xc9, 0x5f, 0xa5, 0xde, 0x7a, 0x56, 0xfe, 0x1f, 0x72, 0x95, 0x70, 0x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x10, 0xe7, 0xca, 0xaf, 0xe5, 0x12, 0xef, 0x39, 0x87, 0xf3, 0x12, 0xbf, 0xb8, 0x03, 0x71, 0x33, + 0xca, 0xc7, 0xef, 0xe7, 0x2b, 0x1b, 0x2d, 0x57, 0x36, 0xba, 0x5c, 0xd9, 0xe8, 0x64, 0x6d, 0xd7, + 0x96, 0x6b, 0xbb, 0x76, 0xb1, 0xb6, 0x6b, 0x3f, 0x47, 0x34, 0xd6, 0xbf, 0xd2, 0xc0, 0x0d, 0x79, + 0x42, 0xa2, 0x2c, 0x01, 0xa6, 0x62, 0xce, 0x16, 0xd9, 0xff, 0x3c, 0x88, 0x99, 0xae, 0x0e, 0x56, + 0x04, 0xb7, 0x1c, 0x73, 0xd0, 0x2c, 0xc6, 0x78, 0x7f, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x38, 0x7c, + 0xd4, 0x90, 0xef, 0x02, 0x00, 0x00, +} + +func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1a + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ConsensusMsgUpsertSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusMsgUpsertSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusMsgUpsertSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if m.ConsPubKey != nil { + { + size, err := m.ConsPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsensusMsgUpsertSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusMsgUpsertSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusMsgUpsertSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ConsensusMsgUpsertSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ConsPubKey != nil { + l = m.ConsPubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ConsensusMsgUpsertSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusMsgUpsertSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsPubKey == nil { + m.ConsPubKey = &types.Any{} + } + if err := m.ConsPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusMsgUpsertSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/utils/proto/converters.go b/utils/proto/converters.go new file mode 100644 index 000000000..32c9902a5 --- /dev/null +++ b/utils/proto/converters.go @@ -0,0 +1,26 @@ +package proto + +import ( + cosmos "github.com/cosmos/cosmos-sdk/codec/types" + gogo "github.com/gogo/protobuf/types" +) + +func GogoToCosmos(v *gogo.Any) *cosmos.Any { + if v == nil { + return nil + } + return &cosmos.Any{ + TypeUrl: v.TypeUrl, + Value: v.Value, + } +} + +func CosmosToGogo(v *cosmos.Any) *gogo.Any { + if v == nil { + return nil + } + return &gogo.Any{ + TypeUrl: v.TypeUrl, + Value: v.Value, + } +} diff --git a/utils/proto/converters_test.go b/utils/proto/converters_test.go new file mode 100644 index 000000000..5733d8eb7 --- /dev/null +++ b/utils/proto/converters_test.go @@ -0,0 +1,97 @@ +package proto_test + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/gogo/protobuf/proto" + "github.com/stretchr/testify/require" + + protoutils "github.com/dymensionxyz/dymint/utils/proto" + cosmosseq "github.com/dymensionxyz/dymint/utils/proto/test_data/cosmos_proto" + gogoseq "github.com/dymensionxyz/dymint/utils/proto/test_data/gogo_proto" +) + +func TestConvertCosmosToGogo(t *testing.T) { + setup() + + // generate the expected pubkey + expectedPK := ed25519.GenPrivKey().PubKey() + + // convert it to cosmos any + cosmosProtoPK, err := cdctypes.NewAnyWithValue(expectedPK) + require.NoError(t, err) + + // convert cosmos to gogo any + gogoProtoPK := protoutils.CosmosToGogo(cosmosProtoPK) + + // create a sequencer with gogo any + gogoSeq := &gogoseq.Sequencer{ + DymintPubKey: gogoProtoPK, + } + + // serialize the sequencer with gogo any + gogoSeqBytes, err := proto.Marshal(gogoSeq) + require.NoError(t, err) + + // deserialize the sequencer, now it holds a cosmos any + cosmosSeq := cosmosseq.Sequencer{} + err = proto.Unmarshal(gogoSeqBytes, &cosmosSeq) + require.NoError(t, err) + + // try to deserialize gogo to cosmos any + var actualPK cryptotypes.PubKey + err = cdc.UnpackAny(cosmosSeq.DymintPubKey, &actualPK) + require.NoError(t, err) + + // check that the value matches the initial + require.Equal(t, expectedPK, actualPK) +} + +func TestConvertGogoToCosmos(t *testing.T) { + setup() + + // generate the expected pubkey + expectedPK := ed25519.GenPrivKey().PubKey() + + // convert it to cosmos any + cosmosProtoPK, err := cdctypes.NewAnyWithValue(expectedPK) + require.NoError(t, err) + + // create a sequencer with cosmos any + cosmosSeq := &cosmosseq.Sequencer{ + DymintPubKey: cosmosProtoPK, + } + + // serialize the sequencer with cosmos any + cosmosSeqBytes, err := proto.Marshal(cosmosSeq) + require.NoError(t, err) + + // deserialize the sequencer, now it holds gogo any + gogoSeq := gogoseq.Sequencer{} + err = proto.Unmarshal(cosmosSeqBytes, &gogoSeq) + require.NoError(t, err) + + // convert gogo to cosmos any + cosmosProtoPK1 := protoutils.GogoToCosmos(gogoSeq.DymintPubKey) + + // try to deserialize it to cosmos any + var actualPK cryptotypes.PubKey + err = cdc.UnpackAny(cosmosProtoPK1, &actualPK) + require.NoError(t, err) + + // check that the value matches the initial + require.Equal(t, expectedPK, actualPK) +} + +var cdc *codec.ProtoCodec + +func setup() { + interfaceRegistry := cdctypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(interfaceRegistry) + cdc = codec.NewProtoCodec(interfaceRegistry) +} diff --git a/third_party/dymension/sequencer/types/metadata.pb.go b/utils/proto/test_data/cosmos_proto/metadata.pb.go similarity index 100% rename from third_party/dymension/sequencer/types/metadata.pb.go rename to utils/proto/test_data/cosmos_proto/metadata.pb.go diff --git a/third_party/dymension/sequencer/types/operating_status.pb.go b/utils/proto/test_data/cosmos_proto/operating_status.pb.go similarity index 98% rename from third_party/dymension/sequencer/types/operating_status.pb.go rename to utils/proto/test_data/cosmos_proto/operating_status.pb.go index a3dae80b5..3a9668f5e 100644 --- a/third_party/dymension/sequencer/types/operating_status.pb.go +++ b/utils/proto/test_data/cosmos_proto/operating_status.pb.go @@ -56,7 +56,7 @@ func (OperatingStatus) EnumDescriptor() ([]byte, []int) { } func init() { - proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus1", OperatingStatus_name, OperatingStatus_value) } func init() { diff --git a/third_party/dymension/sequencer/types/sequencer.pb.go b/utils/proto/test_data/cosmos_proto/sequencer.pb.go similarity index 100% rename from third_party/dymension/sequencer/types/sequencer.pb.go rename to utils/proto/test_data/cosmos_proto/sequencer.pb.go diff --git a/utils/proto/test_data/gogo_proto/metadata.pb.go b/utils/proto/test_data/gogo_proto/metadata.pb.go new file mode 100644 index 000000000..fb35f4f5a --- /dev/null +++ b/utils/proto/test_data/gogo_proto/metadata.pb.go @@ -0,0 +1,1494 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/metadata.proto + +package sequencer + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Metadata defines rollapp/sequencer extra information. +type SequencerMetadata struct { + // moniker defines a human-readable name for the sequencer. + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // details define other optional details. + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` + // bootstrap nodes list + P2PSeeds []string `protobuf:"bytes,6,rep,name=p2p_seeds,json=p2pSeeds,proto3" json:"p2p_seeds,omitempty"` + // RPCs list + Rpcs []string `protobuf:"bytes,7,rep,name=rpcs,proto3" json:"rpcs,omitempty"` + // evm RPCs list + EvmRpcs []string `protobuf:"bytes,8,rep,name=evm_rpcs,json=evmRpcs,proto3" json:"evm_rpcs,omitempty"` + // REST API URLs + RestApiUrls []string `protobuf:"bytes,9,rep,name=rest_api_urls,json=restApiUrls,proto3" json:"rest_api_urls,omitempty"` + // block explorer URL + ExplorerUrl string `protobuf:"bytes,10,opt,name=explorer_url,json=explorerUrl,proto3" json:"explorer_url,omitempty"` + // genesis URLs + GenesisUrls []string `protobuf:"bytes,11,rep,name=genesis_urls,json=genesisUrls,proto3" json:"genesis_urls,omitempty"` + // contact details + ContactDetails *ContactDetails `protobuf:"bytes,12,opt,name=contact_details,json=contactDetails,proto3" json:"contact_details,omitempty"` + // json dump the sequencer can add (limited by size) + ExtraData []byte `protobuf:"bytes,13,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` + // snapshots of the sequencer + Snapshots []*SnapshotInfo `protobuf:"bytes,14,rep,name=snapshots,proto3" json:"snapshots,omitempty"` + // gas_price defines the value for each gas unit + GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,15,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` +} + +func (m *SequencerMetadata) Reset() { *m = SequencerMetadata{} } +func (m *SequencerMetadata) String() string { return proto.CompactTextString(m) } +func (*SequencerMetadata) ProtoMessage() {} +func (*SequencerMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{0} +} +func (m *SequencerMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SequencerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SequencerMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SequencerMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_SequencerMetadata.Merge(m, src) +} +func (m *SequencerMetadata) XXX_Size() int { + return m.Size() +} +func (m *SequencerMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_SequencerMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_SequencerMetadata proto.InternalMessageInfo + +func (m *SequencerMetadata) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *SequencerMetadata) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func (m *SequencerMetadata) GetP2PSeeds() []string { + if m != nil { + return m.P2PSeeds + } + return nil +} + +func (m *SequencerMetadata) GetRpcs() []string { + if m != nil { + return m.Rpcs + } + return nil +} + +func (m *SequencerMetadata) GetEvmRpcs() []string { + if m != nil { + return m.EvmRpcs + } + return nil +} + +func (m *SequencerMetadata) GetRestApiUrls() []string { + if m != nil { + return m.RestApiUrls + } + return nil +} + +func (m *SequencerMetadata) GetExplorerUrl() string { + if m != nil { + return m.ExplorerUrl + } + return "" +} + +func (m *SequencerMetadata) GetGenesisUrls() []string { + if m != nil { + return m.GenesisUrls + } + return nil +} + +func (m *SequencerMetadata) GetContactDetails() *ContactDetails { + if m != nil { + return m.ContactDetails + } + return nil +} + +func (m *SequencerMetadata) GetExtraData() []byte { + if m != nil { + return m.ExtraData + } + return nil +} + +func (m *SequencerMetadata) GetSnapshots() []*SnapshotInfo { + if m != nil { + return m.Snapshots + } + return nil +} + +type ContactDetails struct { + // website URL + Website string `protobuf:"bytes,11,opt,name=website,proto3" json:"website,omitempty"` + // telegram link + Telegram string `protobuf:"bytes,1,opt,name=telegram,proto3" json:"telegram,omitempty"` + // twitter link + X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *ContactDetails) Reset() { *m = ContactDetails{} } +func (m *ContactDetails) String() string { return proto.CompactTextString(m) } +func (*ContactDetails) ProtoMessage() {} +func (*ContactDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{1} +} +func (m *ContactDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContactDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ContactDetails.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ContactDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContactDetails.Merge(m, src) +} +func (m *ContactDetails) XXX_Size() int { + return m.Size() +} +func (m *ContactDetails) XXX_DiscardUnknown() { + xxx_messageInfo_ContactDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_ContactDetails proto.InternalMessageInfo + +func (m *ContactDetails) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *ContactDetails) GetTelegram() string { + if m != nil { + return m.Telegram + } + return "" +} + +func (m *ContactDetails) GetX() string { + if m != nil { + return m.X + } + return "" +} + +type SnapshotInfo struct { + // the snapshot url + SnapshotUrl string `protobuf:"bytes,1,opt,name=snapshot_url,json=snapshotUrl,proto3" json:"snapshot_url,omitempty"` + // The snapshot height + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // sha-256 checksum value for the snapshot file + Checksum string `protobuf:"bytes,3,opt,name=checksum,proto3" json:"checksum,omitempty"` +} + +func (m *SnapshotInfo) Reset() { *m = SnapshotInfo{} } +func (m *SnapshotInfo) String() string { return proto.CompactTextString(m) } +func (*SnapshotInfo) ProtoMessage() {} +func (*SnapshotInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{2} +} +func (m *SnapshotInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotInfo.Merge(m, src) +} +func (m *SnapshotInfo) XXX_Size() int { + return m.Size() +} +func (m *SnapshotInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotInfo proto.InternalMessageInfo + +func (m *SnapshotInfo) GetSnapshotUrl() string { + if m != nil { + return m.SnapshotUrl + } + return "" +} + +func (m *SnapshotInfo) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *SnapshotInfo) GetChecksum() string { + if m != nil { + return m.Checksum + } + return "" +} + +func init() { + proto.RegisterType((*SequencerMetadata)(nil), "dymensionxyz.dymension.sequencer.SequencerMetadata") + proto.RegisterType((*ContactDetails)(nil), "dymensionxyz.dymension.sequencer.ContactDetails") + proto.RegisterType((*SnapshotInfo)(nil), "dymensionxyz.dymension.sequencer.SnapshotInfo") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/metadata.proto", fileDescriptor_6045a4988478e768) +} + +var fileDescriptor_6045a4988478e768 = []byte{ + // 539 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xad, 0xdb, 0x34, 0xb1, 0xc7, 0x69, 0xfa, 0x9e, 0x85, 0xd0, 0x50, 0x84, 0x31, 0x59, 0xa0, + 0x08, 0x09, 0x1b, 0x05, 0xf1, 0x01, 0x94, 0x4a, 0x50, 0x04, 0x12, 0x72, 0xe8, 0x02, 0x36, 0x96, + 0xe3, 0x5c, 0x1c, 0x2b, 0xb6, 0x67, 0x98, 0x3b, 0x29, 0x09, 0x5f, 0xc1, 0x82, 0x8f, 0x62, 0xd9, + 0x25, 0x62, 0x81, 0x50, 0xf2, 0x23, 0x68, 0xc6, 0x76, 0x9a, 0xb2, 0xc9, 0xca, 0x3e, 0xe7, 0xde, + 0x73, 0x66, 0xe6, 0xdc, 0x19, 0xf2, 0x4c, 0x2e, 0x39, 0x60, 0x30, 0x59, 0x16, 0x50, 0x62, 0xc6, + 0xca, 0xc5, 0xf2, 0xeb, 0x35, 0x08, 0x10, 0x3e, 0xcf, 0xa1, 0x4c, 0x40, 0x04, 0x05, 0xc8, 0x78, + 0x12, 0xcb, 0xd8, 0xe7, 0x82, 0x49, 0xe6, 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72, 0x8d, 0xab, 0x95, 0x6b, 0xfc, 0x59, 0xb9, 0xc6, 0xb7, 0xb5, 0xbb, + 0x77, 0xb5, 0x76, 0xf7, 0x7e, 0xae, 0xdd, 0xbd, 0x8f, 0xaf, 0xb6, 0xe2, 0xf8, 0xf7, 0x85, 0x65, + 0xa5, 0xac, 0x02, 0x09, 0xf8, 0x78, 0xe7, 0xf3, 0x1b, 0xb7, 0xf5, 0xf3, 0x79, 0xfa, 0x37, 0x00, + 0x00, 0xff, 0xff, 0xef, 0x23, 0x73, 0xc5, 0xaf, 0x03, 0x00, 0x00, +} + +func (m *SequencerMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SequencerMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SequencerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasPrice != nil { + { + size := m.GasPrice.Size() + i -= size + if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.Snapshots) > 0 { + for iNdEx := len(m.Snapshots) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Snapshots[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + } + if len(m.ExtraData) > 0 { + i -= len(m.ExtraData) + copy(dAtA[i:], m.ExtraData) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExtraData))) + i-- + dAtA[i] = 0x6a + } + if m.ContactDetails != nil { + { + size, err := m.ContactDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.GenesisUrls) > 0 { + for iNdEx := len(m.GenesisUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GenesisUrls[iNdEx]) + copy(dAtA[i:], m.GenesisUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.GenesisUrls[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(m.ExplorerUrl) > 0 { + i -= len(m.ExplorerUrl) + copy(dAtA[i:], m.ExplorerUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExplorerUrl))) + i-- + dAtA[i] = 0x52 + } + if len(m.RestApiUrls) > 0 { + for iNdEx := len(m.RestApiUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RestApiUrls[iNdEx]) + copy(dAtA[i:], m.RestApiUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.RestApiUrls[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.EvmRpcs) > 0 { + for iNdEx := len(m.EvmRpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EvmRpcs[iNdEx]) + copy(dAtA[i:], m.EvmRpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.EvmRpcs[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Rpcs) > 0 { + for iNdEx := len(m.Rpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Rpcs[iNdEx]) + copy(dAtA[i:], m.Rpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Rpcs[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.P2PSeeds) > 0 { + for iNdEx := len(m.P2PSeeds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.P2PSeeds[iNdEx]) + copy(dAtA[i:], m.P2PSeeds[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.P2PSeeds[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ContactDetails) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContactDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContactDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x5a + } + if len(m.X) > 0 { + i -= len(m.X) + copy(dAtA[i:], m.X) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.X))) + i-- + dAtA[i] = 0x12 + } + if len(m.Telegram) > 0 { + i -= len(m.Telegram) + copy(dAtA[i:], m.Telegram) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Telegram))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintMetadata(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.SnapshotUrl) > 0 { + i -= len(m.SnapshotUrl) + copy(dAtA[i:], m.SnapshotUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.SnapshotUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovMetadata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SequencerMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.P2PSeeds) > 0 { + for _, s := range m.P2PSeeds { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.Rpcs) > 0 { + for _, s := range m.Rpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.EvmRpcs) > 0 { + for _, s := range m.EvmRpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.RestApiUrls) > 0 { + for _, s := range m.RestApiUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + l = len(m.ExplorerUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.GenesisUrls) > 0 { + for _, s := range m.GenesisUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.ContactDetails != nil { + l = m.ContactDetails.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.ExtraData) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.Snapshots) > 0 { + for _, e := range m.Snapshots { + l = e.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.GasPrice != nil { + l = m.GasPrice.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *ContactDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Telegram) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.X) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *SnapshotInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SnapshotUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovMetadata(uint64(m.Height)) + } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func sovMetadata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMetadata(x uint64) (n int) { + return sovMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SequencerMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SequencerMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SequencerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field P2PSeeds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.P2PSeeds = append(m.P2PSeeds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rpcs = append(m.Rpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvmRpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvmRpcs = append(m.EvmRpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RestApiUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RestApiUrls = append(m.RestApiUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExplorerUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExplorerUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisUrls = append(m.GenesisUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContactDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContactDetails == nil { + m.ContactDetails = &ContactDetails{} + } + if err := m.ContactDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtraData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtraData = append(m.ExtraData[:0], dAtA[iNdEx:postIndex]...) + if m.ExtraData == nil { + m.ExtraData = []byte{} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Snapshots = append(m.Snapshots, &SnapshotInfo{}) + if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.GasPrice = &v + if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContactDetails) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContactDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContactDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Telegram", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Telegram = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.X = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SnapshotUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SnapshotUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMetadata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMetadata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetadata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetadata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetadata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/utils/proto/test_data/gogo_proto/operating_status.pb.go b/utils/proto/test_data/gogo_proto/operating_status.pb.go new file mode 100644 index 000000000..e5fbe5cea --- /dev/null +++ b/utils/proto/test_data/gogo_proto/operating_status.pb.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/operating_status.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// OperatingStatus defines the operating status of a sequencer +type OperatingStatus int32 + +const ( + // OPERATING_STATUS_UNBONDED defines a sequencer that is not active and won't + // be scheduled + Unbonded OperatingStatus = 0 + // UNBONDING defines a sequencer that is currently unbonding. + Unbonding OperatingStatus = 1 + // OPERATING_STATUS_BONDED defines a sequencer that is bonded and can be + // scheduled + Bonded OperatingStatus = 2 +) + +var OperatingStatus_name = map[int32]string{ + 0: "OPERATING_STATUS_UNBONDED", + 1: "OPERATING_STATUS_UNBONDING", + 2: "OPERATING_STATUS_BONDED", +} + +var OperatingStatus_value = map[string]int32{ + "OPERATING_STATUS_UNBONDED": 0, + "OPERATING_STATUS_UNBONDING": 1, + "OPERATING_STATUS_BONDED": 2, +} + +func (x OperatingStatus) String() string { + return proto.EnumName(OperatingStatus_name, int32(x)) +} + +func (OperatingStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d854b24b5c08f0d1, []int{0} +} + +func init() { + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/operating_status.proto", fileDescriptor_d854b24b5c08f0d1) +} + +var fileDescriptor_d854b24b5c08f0d1 = []byte{ + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x2d, 0xa9, 0x2c, 0x48, + 0x2d, 0xd6, 0x4f, 0xa9, 0xcc, 0x4d, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xab, 0xa8, 0xac, 0x42, 0x70, + 0xf4, 0x8b, 0x53, 0x0b, 0x4b, 0x53, 0xf3, 0x92, 0x53, 0x8b, 0xf4, 0xf3, 0x0b, 0x52, 0x8b, 0x12, + 0x4b, 0x32, 0xf3, 0xd2, 0xe3, 0x8b, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, + 0xf2, 0x85, 0x14, 0x90, 0x35, 0xea, 0xc1, 0x39, 0x7a, 0x70, 0x8d, 0x52, 0x22, 0xe9, 0xf9, 0xe9, + 0xf9, 0x60, 0xc5, 0xfa, 0x20, 0x16, 0x44, 0x9f, 0xd6, 0x1c, 0x46, 0x2e, 0x7e, 0x7f, 0x98, 0x91, + 0xc1, 0x60, 0x13, 0x85, 0xb4, 0xb9, 0x24, 0xfd, 0x03, 0x5c, 0x83, 0x1c, 0x43, 0x3c, 0xfd, 0xdc, + 0xe3, 0x83, 0x43, 0x1c, 0x43, 0x42, 0x83, 0xe3, 0x43, 0xfd, 0x9c, 0xfc, 0xfd, 0x5c, 0x5c, 0x5d, + 0x04, 0x18, 0xa4, 0x78, 0xba, 0xe6, 0x2a, 0x70, 0x84, 0xe6, 0x25, 0xe5, 0xe7, 0xa5, 0xa4, 0xa6, + 0x08, 0xe9, 0x72, 0x49, 0xe1, 0x50, 0xec, 0xe9, 0xe7, 0x2e, 0xc0, 0x28, 0xc5, 0xdb, 0x35, 0x57, + 0x81, 0x13, 0xa2, 0x3a, 0x33, 0x2f, 0x5d, 0x48, 0x9d, 0x4b, 0x1c, 0x43, 0x39, 0xd4, 0x64, 0x26, + 0x29, 0xae, 0xae, 0xb9, 0x0a, 0x6c, 0x4e, 0x60, 0x73, 0xa5, 0x58, 0x3a, 0x16, 0xcb, 0x31, 0x38, + 0x25, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x47, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x46, 0xa0, 0x65, 0xe6, 0x95, 0xe8, 0x43, 0x82, 0xb3, + 0x20, 0x89, 0x60, 0x88, 0x26, 0xb1, 0x81, 0x43, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x10, + 0x0f, 0x7d, 0xbc, 0x82, 0x01, 0x00, 0x00, +} diff --git a/utils/proto/test_data/gogo_proto/sequencer.pb.go b/utils/proto/test_data/gogo_proto/sequencer.pb.go new file mode 100644 index 000000000..c8e662fba --- /dev/null +++ b/utils/proto/test_data/gogo_proto/sequencer.pb.go @@ -0,0 +1,1241 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/sequencer.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Sequencer defines a sequencer identified by its' address (sequencerAddress). +// The sequencer could be attached to only one rollapp (rollappId). +type Sequencer struct { + // address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + DymintPubKey *types.Any `protobuf:"bytes,2,opt,name=dymintPubKey,proto3" json:"dymintPubKey,omitempty"` + // rollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,3,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // metadata defines the extra information for the sequencer. + Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` + // jailed defined whether the sequencer has been jailed from bonded status or not. + Jailed bool `protobuf:"varint,5,opt,name=jailed,proto3" json:"jailed,omitempty"` + Proposer bool `protobuf:"varint,6,opt,name=proposer,proto3" json:"proposer,omitempty"` // Deprecated: Do not use. + // status is the sequencer status (bonded/unbonding/unbonded). + Status OperatingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=dymensionxyz.dymension.sequencer.OperatingStatus" json:"status,omitempty"` + // tokens define the delegated tokens (incl. self-delegation). + Tokens github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=tokens,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"tokens"` + // unbond_request_height stores the height at which this sequencer has + // requested to unbond. + UnbondRequestHeight int64 `protobuf:"varint,9,opt,name=unbond_request_height,json=unbondRequestHeight,proto3" json:"unbond_request_height,omitempty"` + // unbond_time defines the time when the sequencer will complete unbonding. + UnbondTime time.Time `protobuf:"bytes,10,opt,name=unbond_time,json=unbondTime,proto3,stdtime" json:"unbond_time"` + // notice_period_time defines the time when the sequencer will finish it's notice period if started + NoticePeriodTime time.Time `protobuf:"bytes,11,opt,name=notice_period_time,json=noticePeriodTime,proto3,stdtime" json:"notice_period_time"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,12,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,13,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *Sequencer) Reset() { *m = Sequencer{} } +func (m *Sequencer) String() string { return proto.CompactTextString(m) } +func (*Sequencer) ProtoMessage() {} +func (*Sequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{0} +} +func (m *Sequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Sequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sequencer.Merge(m, src) +} +func (m *Sequencer) XXX_Size() int { + return m.Size() +} +func (m *Sequencer) XXX_DiscardUnknown() { + xxx_messageInfo_Sequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_Sequencer proto.InternalMessageInfo + +func (m *Sequencer) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Sequencer) GetDymintPubKey() *types.Any { + if m != nil { + return m.DymintPubKey + } + return nil +} + +func (m *Sequencer) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *Sequencer) GetMetadata() SequencerMetadata { + if m != nil { + return m.Metadata + } + return SequencerMetadata{} +} + +func (m *Sequencer) GetJailed() bool { + if m != nil { + return m.Jailed + } + return false +} + +// Deprecated: Do not use. +func (m *Sequencer) GetProposer() bool { + if m != nil { + return m.Proposer + } + return false +} + +func (m *Sequencer) GetStatus() OperatingStatus { + if m != nil { + return m.Status + } + return Unbonded +} + +func (m *Sequencer) GetTokens() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *Sequencer) GetUnbondRequestHeight() int64 { + if m != nil { + return m.UnbondRequestHeight + } + return 0 +} + +func (m *Sequencer) GetUnbondTime() time.Time { + if m != nil { + return m.UnbondTime + } + return time.Time{} +} + +func (m *Sequencer) GetNoticePeriodTime() time.Time { + if m != nil { + return m.NoticePeriodTime + } + return time.Time{} +} + +func (m *Sequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *Sequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount +type BondReduction struct { + // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + // decrease_bond_amount is the amount of tokens to be unbonded. + DecreaseBondAmount types1.Coin `protobuf:"bytes,2,opt,name=decrease_bond_amount,json=decreaseBondAmount,proto3" json:"decrease_bond_amount"` + // decrease_bond_time defines, if unbonding, the min time for the sequencer to complete unbonding. + DecreaseBondTime time.Time `protobuf:"bytes,3,opt,name=decrease_bond_time,json=decreaseBondTime,proto3,stdtime" json:"decrease_bond_time"` +} + +func (m *BondReduction) Reset() { *m = BondReduction{} } +func (m *BondReduction) String() string { return proto.CompactTextString(m) } +func (*BondReduction) ProtoMessage() {} +func (*BondReduction) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{1} +} +func (m *BondReduction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BondReduction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BondReduction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BondReduction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondReduction.Merge(m, src) +} +func (m *BondReduction) XXX_Size() int { + return m.Size() +} +func (m *BondReduction) XXX_DiscardUnknown() { + xxx_messageInfo_BondReduction.DiscardUnknown(m) +} + +var xxx_messageInfo_BondReduction proto.InternalMessageInfo + +func (m *BondReduction) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *BondReduction) GetDecreaseBondAmount() types1.Coin { + if m != nil { + return m.DecreaseBondAmount + } + return types1.Coin{} +} + +func (m *BondReduction) GetDecreaseBondTime() time.Time { + if m != nil { + return m.DecreaseBondTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*Sequencer)(nil), "dymensionxyz.dymension.sequencer.Sequencer") + proto.RegisterType((*BondReduction)(nil), "dymensionxyz.dymension.sequencer.BondReduction") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/sequencer.proto", fileDescriptor_0c9d1421effe42e1) +} + +var fileDescriptor_0c9d1421effe42e1 = []byte{ + // 706 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00,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38, 0x11, 0x78, 0x92, + 0x70, 0x81, 0xcb, 0x4d, 0x4f, 0x50, 0x81, 0x19, 0x37, 0xd7, 0xad, 0xba, 0xdd, 0xf2, 0x36, 0xe7, + 0x30, 0x4f, 0x43, 0x3b, 0x53, 0x03, 0xac, 0x8f, 0xa4, 0x09, 0x51, 0x1e, 0x8a, 0x84, 0x12, 0xf8, + 0x3f, 0xf8, 0x73, 0x76, 0x7c, 0xfe, 0xe2, 0x4d, 0xd8, 0x98, 0x01, 0x43, 0x7d, 0x25, 0x5e, 0x82, + 0x4e, 0x84, 0x43, 0x86, 0x11, 0xc7, 0xbe, 0x34, 0x0d, 0xa5, 0x34, 0x27, 0x42, 0x5f, 0x8d, 0xdf, + 0x1c, 0xaa, 0x8a, 0x24, 0xac, 0xc8, 0xe5, 0x08, 0x43, 0x49, 0x2d, 0x9d, 0x5b, 0x94, 0x94, 0xce, + 0xd5, 0xef, 0xe3, 0xdc, 0xbc, 0x6a, 0xd9, 0x30, 0x0a, 0xce, 0xaf, 0xba, 0xc6, 0xc5, 0x55, 0xd7, + 0xf8, 0x7e, 0xd5, 0x35, 0xce, 0xa6, 0xdd, 0xda, 0xc5, 0xb4, 0x5b, 0xfb, 0x3a, 0xed, 0xd6, 0xde, + 0xec, 0xcf, 0x85, 0xea, 0xe6, 0xff, 0x23, 0x21, 0x42, 0xc5, 0xca, 0xcd, 0x82, 0x5b, 0x7f, 0x2e, + 0x41, 0x43, 0xce, 0xb4, 0xf7, 0x33, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xd8, 0xa4, 0x12, 0xd0, 0x05, + 0x00, 0x00, +} + +func (m *Sequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x62 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.NoticePeriodTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintSequencer(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x5a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UnbondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintSequencer(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x52 + if m.UnbondRequestHeight != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.UnbondRequestHeight)) + i-- + dAtA[i] = 0x48 + } + if len(m.Tokens) > 0 { + for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Status != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x38 + } + if m.Proposer { + i-- + if m.Proposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x1a + } + if m.DymintPubKey != nil { + { + size, err := m.DymintPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BondReduction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BondReduction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BondReduction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DecreaseBondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintSequencer(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x1a + { + size, err := m.DecreaseBondAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSequencer(dAtA []byte, offset int, v uint64) int { + offset -= sovSequencer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Sequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if m.DymintPubKey != nil { + l = m.DymintPubKey.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovSequencer(uint64(l)) + if m.Jailed { + n += 2 + } + if m.Proposer { + n += 2 + } + if m.Status != 0 { + n += 1 + sovSequencer(uint64(m.Status)) + } + if len(m.Tokens) > 0 { + for _, e := range m.Tokens { + l = e.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + } + if m.UnbondRequestHeight != 0 { + n += 1 + sovSequencer(uint64(m.UnbondRequestHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime) + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime) + n += 1 + l + sovSequencer(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovSequencer(uint64(l)) + } + } + return n +} + +func (m *BondReduction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.DecreaseBondAmount.Size() + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime) + n += 1 + l + sovSequencer(uint64(l)) + return n +} + +func sovSequencer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSequencer(x uint64) (n int) { + return sovSequencer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Sequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DymintPubKey == nil { + m.DymintPubKey = &types.Any{} + } + if err := m.DymintPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposer = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= OperatingStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = append(m.Tokens, types1.Coin{}) + if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondRequestHeight", wireType) + } + m.UnbondRequestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondRequestHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UnbondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoticePeriodTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.NoticePeriodTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BondReduction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BondReduction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BondReduction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DecreaseBondAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.DecreaseBondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSequencer(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSequencer + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSequencer + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSequencer + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSequencer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSequencer = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSequencer = fmt.Errorf("proto: unexpected end of group") +) From fae24da52dd867e741c640577f29542823f28f19 Mon Sep 17 00:00:00 2001 From: keruch Date: Tue, 15 Oct 2024 00:34:31 +0200 Subject: [PATCH 21/27] feat(proto): added hub and rdk x/sequencer --- .mockery.yaml | 2 +- go.mod | 3 +- .../dymint/da/avail/mock_SubstrateApiI.go | 2 +- .../celestia/types/mock_CelestiaRPCClient.go | 2 +- .../da/mock_DataAvailabilityLayerClient.go | 2 +- .../settlement/dymension/mock_CosmosClient.go | 4 +- .../dymint/settlement/mock_ClientI.go | 2 +- .../dymensionxyz/dymint/store/mock_Store.go | 2 +- .../sequencer/types/mock_QueryClient.go | 2 +- .../dymension/rollapp/mock_QueryClient.go | 2 +- .../dymension/sequencer/mock_QueryClient.go | 632 +++++++ .../tendermint/abci/types/mock_Application.go | 2 +- .../tendermint/proxy/mock_AppConnConsensus.go | 2 +- .../tendermint/proxy/mock_AppConns.go | 2 +- proto/protoc.sh | 1 + .../dymension/sequencer/events.proto | 45 + .../dymension/sequencer/genesis.proto | 25 + .../dymension/sequencer/metadata.proto | 54 + .../sequencer/operating_status.proto | 20 + .../dymension/sequencer/params.proto | 36 + .../dymension/sequencer/query.proto | 109 ++ .../dymension/sequencer/sequencer.proto | 64 + .../dymensionxyz/dymension/sequencer/tx.proto | 131 ++ proto/types/rollapp/sequencers/types/tx.proto | 45 + settlement/dymension/cosmosclient.go | 2 +- settlement/dymension/dymension.go | 12 +- settlement/dymension/dymension_test.go | 7 +- .../sequencer/types/description.pb.go | 531 ------ .../dymension/sequencer/types/events.pb.go | 450 ----- .../dymension/sequencer/types/query.pb.gw.go | 769 -------- .../dymension/sequencer}/events.go | 2 +- .../dymension/sequencer/events.pb.go | 1242 +++++++++++++ .../dymension/sequencer}/genesis.pb.go | 60 +- .../dymensionxyz/dymension/sequencer}/keys.go | 2 +- .../dymension/sequencer/metadata.pb.go | 1494 +++++++++++++++ .../sequencer/operating_status.pb.go | 85 + .../dymension/sequencer}/params.go | 2 +- .../dymension/sequencer}/params.pb.go | 70 +- .../dymension/sequencer}/query.pb.go | 614 ++++++- .../dymension/sequencer/sequencer.pb.go | 1241 +++++++++++++ .../dymension/sequencer}/tx.pb.go | 1621 +++++++++++++---- types/pb/rollapp/sequencers/types/tx.pb.go | 1316 +++++++++++++ utils/proto/converters.go | 26 + utils/proto/converters_test.go | 97 + .../test_data/cosmos_proto}/metadata.pb.go | 0 .../cosmos_proto}/operating_status.pb.go | 2 +- .../test_data/cosmos_proto}/sequencer.pb.go | 0 .../proto/test_data/gogo_proto/metadata.pb.go | 1494 +++++++++++++++ .../gogo_proto/operating_status.pb.go | 85 + .../test_data/gogo_proto/sequencer.pb.go | 1241 +++++++++++++ 50 files changed, 11360 insertions(+), 2296 deletions(-) create mode 100644 mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go create mode 100644 proto/types/dymensionxyz/dymension/sequencer/events.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/genesis.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/metadata.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/operating_status.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/params.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/query.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/sequencer.proto create mode 100644 proto/types/dymensionxyz/dymension/sequencer/tx.proto create mode 100644 proto/types/rollapp/sequencers/types/tx.proto delete mode 100644 third_party/dymension/sequencer/types/description.pb.go delete mode 100644 third_party/dymension/sequencer/types/events.pb.go delete mode 100644 third_party/dymension/sequencer/types/query.pb.gw.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/events.go (98%) create mode 100644 types/pb/dymensionxyz/dymension/sequencer/events.pb.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/genesis.pb.go (86%) rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/keys.go (99%) create mode 100644 types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go create mode 100644 types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/params.go (89%) rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/params.pb.go (80%) rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/query.pb.go (81%) create mode 100644 types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go rename {third_party/dymension/sequencer/types => types/pb/dymensionxyz/dymension/sequencer}/tx.pb.go (61%) create mode 100644 types/pb/rollapp/sequencers/types/tx.pb.go create mode 100644 utils/proto/converters.go create mode 100644 utils/proto/converters_test.go rename {third_party/dymension/sequencer/types => utils/proto/test_data/cosmos_proto}/metadata.pb.go (100%) rename {third_party/dymension/sequencer/types => utils/proto/test_data/cosmos_proto}/operating_status.pb.go (98%) rename {third_party/dymension/sequencer/types => utils/proto/test_data/cosmos_proto}/sequencer.pb.go (100%) create mode 100644 utils/proto/test_data/gogo_proto/metadata.pb.go create mode 100644 utils/proto/test_data/gogo_proto/operating_status.pb.go create mode 100644 utils/proto/test_data/gogo_proto/sequencer.pb.go diff --git a/.mockery.yaml b/.mockery.yaml index ba06d15ea..d0ef54a13 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -10,7 +10,7 @@ packages: github.com/dymensionxyz/dymint/settlement/dymension: interfaces: CosmosClient: - github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types: + github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer: interfaces: QueryClient: github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp: diff --git a/go.mod b/go.mod index c342ffd4b..1be30661b 100644 --- a/go.mod +++ b/go.mod @@ -120,7 +120,7 @@ require ( go.uber.org/fx v1.20.1 // indirect golang.org/x/exp v0.0.0-20240213143201-ec583247a57a golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 // indirect gopkg.in/natefinch/npipe.v2 v2.0.0-20160621034901-c1b8fa8bdcce // indirect sigs.k8s.io/yaml v1.4.0 // indirect @@ -297,7 +297,6 @@ require ( replace ( github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/availproject/go-substrate-rpc-client/v4 v4.0.12-avail-1.4.0-rc1-5e286e3 - github.com/dymensionxyz/dymension-rdk => github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240827102903-08636e7ab3f8 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 diff --git a/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go b/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go index 6a52c1df8..bba31b087 100644 --- a/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go +++ b/mocks/github.com/dymensionxyz/dymint/da/avail/mock_SubstrateApiI.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package avail diff --git a/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go b/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go index 4935cc66a..5994cf817 100644 --- a/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go +++ b/mocks/github.com/dymensionxyz/dymint/da/celestia/types/mock_CelestiaRPCClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package types diff --git a/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go b/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go index 75727dd5e..1480d557c 100644 --- a/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go +++ b/mocks/github.com/dymensionxyz/dymint/da/mock_DataAvailabilityLayerClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package da diff --git a/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go b/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go index 4b14a3eaf..a7bfa4344 100644 --- a/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go +++ b/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package dymension @@ -17,7 +17,7 @@ import ( rollapp "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" types "github.com/cosmos/cosmos-sdk/types" ) diff --git a/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go b/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go index 784febab1..b03a45ddd 100644 --- a/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go +++ b/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package settlement diff --git a/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go b/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go index 010d1c41c..66207d239 100644 --- a/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go +++ b/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package store diff --git a/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go index fed52c6c5..24f426b0f 100644 --- a/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go +++ b/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types/mock_QueryClient.go @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - types "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" + types "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" ) // MockQueryClient is an autogenerated mock type for the QueryClient type diff --git a/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go index 83c174f72..f182218a5 100644 --- a/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go +++ b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp/mock_QueryClient.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package rollapp diff --git a/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go new file mode 100644 index 000000000..ba704d658 --- /dev/null +++ b/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer/mock_QueryClient.go @@ -0,0 +1,632 @@ +// Code generated by mockery v2.46.0. DO NOT EDIT. + +package sequencer + +import ( + context "context" + + grpc "google.golang.org/grpc" + + mock "github.com/stretchr/testify/mock" + + sequencer "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" +) + +// MockQueryClient is an autogenerated mock type for the QueryClient type +type MockQueryClient struct { + mock.Mock +} + +type MockQueryClient_Expecter struct { + mock *mock.Mock +} + +func (_m *MockQueryClient) EXPECT() *MockQueryClient_Expecter { + return &MockQueryClient_Expecter{mock: &_m.Mock} +} + +// GetNextProposerByRollapp provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) GetNextProposerByRollapp(ctx context.Context, in *sequencer.QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption) (*sequencer.QueryGetNextProposerByRollappResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetNextProposerByRollapp") + } + + var r0 *sequencer.QueryGetNextProposerByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetNextProposerByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) *sequencer.QueryGetNextProposerByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetNextProposerByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_GetNextProposerByRollapp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetNextProposerByRollapp' +type MockQueryClient_GetNextProposerByRollapp_Call struct { + *mock.Call +} + +// GetNextProposerByRollapp is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetNextProposerByRollappRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) GetNextProposerByRollapp(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_GetNextProposerByRollapp_Call { + return &MockQueryClient_GetNextProposerByRollapp_Call{Call: _e.mock.On("GetNextProposerByRollapp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption)) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetNextProposerByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) Return(_a0 *sequencer.QueryGetNextProposerByRollappResponse, _a1 error) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetNextProposerByRollappResponse, error)) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Return(run) + return _c +} + +// GetProposerByRollapp provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) GetProposerByRollapp(ctx context.Context, in *sequencer.QueryGetProposerByRollappRequest, opts ...grpc.CallOption) (*sequencer.QueryGetProposerByRollappResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for GetProposerByRollapp") + } + + var r0 *sequencer.QueryGetProposerByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetProposerByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) *sequencer.QueryGetProposerByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetProposerByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_GetProposerByRollapp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerByRollapp' +type MockQueryClient_GetProposerByRollapp_Call struct { + *mock.Call +} + +// GetProposerByRollapp is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetProposerByRollappRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) GetProposerByRollapp(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_GetProposerByRollapp_Call { + return &MockQueryClient_GetProposerByRollapp_Call{Call: _e.mock.On("GetProposerByRollapp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetProposerByRollappRequest, opts ...grpc.CallOption)) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetProposerByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) Return(_a0 *sequencer.QueryGetProposerByRollappResponse, _a1 error) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetProposerByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetProposerByRollappResponse, error)) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Return(run) + return _c +} + +// Params provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Params(ctx context.Context, in *sequencer.QueryParamsRequest, opts ...grpc.CallOption) (*sequencer.QueryParamsResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Params") + } + + var r0 *sequencer.QueryParamsResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) (*sequencer.QueryParamsResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) *sequencer.QueryParamsResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryParamsResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Params_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Params' +type MockQueryClient_Params_Call struct { + *mock.Call +} + +// Params is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryParamsRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Params(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Params_Call { + return &MockQueryClient_Params_Call{Call: _e.mock.On("Params", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Params_Call) Run(run func(ctx context.Context, in *sequencer.QueryParamsRequest, opts ...grpc.CallOption)) *MockQueryClient_Params_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryParamsRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Params_Call) Return(_a0 *sequencer.QueryParamsResponse, _a1 error) *MockQueryClient_Params_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Params_Call) RunAndReturn(run func(context.Context, *sequencer.QueryParamsRequest, ...grpc.CallOption) (*sequencer.QueryParamsResponse, error)) *MockQueryClient_Params_Call { + _c.Call.Return(run) + return _c +} + +// Proposers provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Proposers(ctx context.Context, in *sequencer.QueryProposersRequest, opts ...grpc.CallOption) (*sequencer.QueryProposersResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Proposers") + } + + var r0 *sequencer.QueryProposersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) (*sequencer.QueryProposersResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) *sequencer.QueryProposersResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryProposersResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Proposers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Proposers' +type MockQueryClient_Proposers_Call struct { + *mock.Call +} + +// Proposers is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryProposersRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Proposers(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Proposers_Call { + return &MockQueryClient_Proposers_Call{Call: _e.mock.On("Proposers", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Proposers_Call) Run(run func(ctx context.Context, in *sequencer.QueryProposersRequest, opts ...grpc.CallOption)) *MockQueryClient_Proposers_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryProposersRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Proposers_Call) Return(_a0 *sequencer.QueryProposersResponse, _a1 error) *MockQueryClient_Proposers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Proposers_Call) RunAndReturn(run func(context.Context, *sequencer.QueryProposersRequest, ...grpc.CallOption) (*sequencer.QueryProposersResponse, error)) *MockQueryClient_Proposers_Call { + _c.Call.Return(run) + return _c +} + +// Sequencer provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Sequencer(ctx context.Context, in *sequencer.QueryGetSequencerRequest, opts ...grpc.CallOption) (*sequencer.QueryGetSequencerResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Sequencer") + } + + var r0 *sequencer.QueryGetSequencerResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencerResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) *sequencer.QueryGetSequencerResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetSequencerResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Sequencer_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sequencer' +type MockQueryClient_Sequencer_Call struct { + *mock.Call +} + +// Sequencer is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetSequencerRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Sequencer(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Sequencer_Call { + return &MockQueryClient_Sequencer_Call{Call: _e.mock.On("Sequencer", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Sequencer_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetSequencerRequest, opts ...grpc.CallOption)) *MockQueryClient_Sequencer_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetSequencerRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Sequencer_Call) Return(_a0 *sequencer.QueryGetSequencerResponse, _a1 error) *MockQueryClient_Sequencer_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Sequencer_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetSequencerRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencerResponse, error)) *MockQueryClient_Sequencer_Call { + _c.Call.Return(run) + return _c +} + +// Sequencers provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) Sequencers(ctx context.Context, in *sequencer.QuerySequencersRequest, opts ...grpc.CallOption) (*sequencer.QuerySequencersResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for Sequencers") + } + + var r0 *sequencer.QuerySequencersResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) (*sequencer.QuerySequencersResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) *sequencer.QuerySequencersResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QuerySequencersResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_Sequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Sequencers' +type MockQueryClient_Sequencers_Call struct { + *mock.Call +} + +// Sequencers is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QuerySequencersRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) Sequencers(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_Sequencers_Call { + return &MockQueryClient_Sequencers_Call{Call: _e.mock.On("Sequencers", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_Sequencers_Call) Run(run func(ctx context.Context, in *sequencer.QuerySequencersRequest, opts ...grpc.CallOption)) *MockQueryClient_Sequencers_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QuerySequencersRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_Sequencers_Call) Return(_a0 *sequencer.QuerySequencersResponse, _a1 error) *MockQueryClient_Sequencers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_Sequencers_Call) RunAndReturn(run func(context.Context, *sequencer.QuerySequencersRequest, ...grpc.CallOption) (*sequencer.QuerySequencersResponse, error)) *MockQueryClient_Sequencers_Call { + _c.Call.Return(run) + return _c +} + +// SequencersByRollapp provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) SequencersByRollapp(ctx context.Context, in *sequencer.QueryGetSequencersByRollappRequest, opts ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for SequencersByRollapp") + } + + var r0 *sequencer.QueryGetSequencersByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) *sequencer.QueryGetSequencersByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetSequencersByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_SequencersByRollapp_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequencersByRollapp' +type MockQueryClient_SequencersByRollapp_Call struct { + *mock.Call +} + +// SequencersByRollapp is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetSequencersByRollappRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) SequencersByRollapp(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_SequencersByRollapp_Call { + return &MockQueryClient_SequencersByRollapp_Call{Call: _e.mock.On("SequencersByRollapp", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_SequencersByRollapp_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetSequencersByRollappRequest, opts ...grpc.CallOption)) *MockQueryClient_SequencersByRollapp_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetSequencersByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_SequencersByRollapp_Call) Return(_a0 *sequencer.QueryGetSequencersByRollappResponse, _a1 error) *MockQueryClient_SequencersByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_SequencersByRollapp_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetSequencersByRollappRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappResponse, error)) *MockQueryClient_SequencersByRollapp_Call { + _c.Call.Return(run) + return _c +} + +// SequencersByRollappByStatus provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) SequencersByRollappByStatus(ctx context.Context, in *sequencer.QueryGetSequencersByRollappByStatusRequest, opts ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappByStatusResponse, error) { + _va := make([]interface{}, len(opts)) + for _i := range opts { + _va[_i] = opts[_i] + } + var _ca []interface{} + _ca = append(_ca, ctx, in) + _ca = append(_ca, _va...) + ret := _m.Called(_ca...) + + if len(ret) == 0 { + panic("no return value specified for SequencersByRollappByStatus") + } + + var r0 *sequencer.QueryGetSequencersByRollappByStatusResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappByStatusResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) *sequencer.QueryGetSequencersByRollappByStatusResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*sequencer.QueryGetSequencersByRollappByStatusResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_SequencersByRollappByStatus_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SequencersByRollappByStatus' +type MockQueryClient_SequencersByRollappByStatus_Call struct { + *mock.Call +} + +// SequencersByRollappByStatus is a helper method to define mock.On call +// - ctx context.Context +// - in *sequencer.QueryGetSequencersByRollappByStatusRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) SequencersByRollappByStatus(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_SequencersByRollappByStatus_Call { + return &MockQueryClient_SequencersByRollappByStatus_Call{Call: _e.mock.On("SequencersByRollappByStatus", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_SequencersByRollappByStatus_Call) Run(run func(ctx context.Context, in *sequencer.QueryGetSequencersByRollappByStatusRequest, opts ...grpc.CallOption)) *MockQueryClient_SequencersByRollappByStatus_Call { + _c.Call.Run(func(args mock.Arguments) { + variadicArgs := make([]grpc.CallOption, len(args)-2) + for i, a := range args[2:] { + if a != nil { + variadicArgs[i] = a.(grpc.CallOption) + } + } + run(args[0].(context.Context), args[1].(*sequencer.QueryGetSequencersByRollappByStatusRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_SequencersByRollappByStatus_Call) Return(_a0 *sequencer.QueryGetSequencersByRollappByStatusResponse, _a1 error) *MockQueryClient_SequencersByRollappByStatus_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_SequencersByRollappByStatus_Call) RunAndReturn(run func(context.Context, *sequencer.QueryGetSequencersByRollappByStatusRequest, ...grpc.CallOption) (*sequencer.QueryGetSequencersByRollappByStatusResponse, error)) *MockQueryClient_SequencersByRollappByStatus_Call { + _c.Call.Return(run) + return _c +} + +// NewMockQueryClient creates a new instance of MockQueryClient. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. +// The first argument is typically a *testing.T value. +func NewMockQueryClient(t interface { + mock.TestingT + Cleanup(func()) +}) *MockQueryClient { + mock := &MockQueryClient{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} diff --git a/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go b/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go index 7393ef94e..45011bdc9 100644 --- a/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go +++ b/mocks/github.com/tendermint/tendermint/abci/types/mock_Application.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package types diff --git a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go index 9ec6b2d18..9a28054e1 100644 --- a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go +++ b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConnConsensus.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package proxy diff --git a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go index affc90a4e..120c2f698 100644 --- a/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go +++ b/mocks/github.com/tendermint/tendermint/proxy/mock_AppConns.go @@ -1,4 +1,4 @@ -// Code generated by mockery v2.42.3. DO NOT EDIT. +// Code generated by mockery v2.46.0. DO NOT EDIT. package proxy diff --git a/proto/protoc.sh b/proto/protoc.sh index 4b23b9743..2937453b7 100755 --- a/proto/protoc.sh +++ b/proto/protoc.sh @@ -7,6 +7,7 @@ buf generate --path="./proto/types/dalc" --template="buf.gen.yaml" --config="buf buf generate --path="./proto/types/dymint" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/interchain_da" --template="buf.gen.yaml" --config="buf.yaml" buf generate --path="./proto/types/dymensionxyz" --template="buf.gen.yaml" --config="buf.yaml" +buf generate --path="./proto/types/rollapp" --template="buf.gen.yaml" --config="buf.yaml" # Generate the `test` proto files buf generate --path="./proto/test" --template="buf.gen.yaml" --config="buf.yaml" diff --git a/proto/types/dymensionxyz/dymension/sequencer/events.proto b/proto/types/dymensionxyz/dymension/sequencer/events.proto new file mode 100644 index 000000000..df7f73219 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/events.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; + +package dymensionxyz.dymension.sequencer; + +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// EventIncreasedBond is an event emitted when a sequencer's bond is increased. +message EventIncreasedBond { + // sequencer is the bech32-encoded address of the sequencer which increased its bond + string sequencer = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // added_amount is the amount of coins added to the sequencer's bond + cosmos.base.v1beta1.Coin added_amount = 2 [(gogoproto.nullable) = false]; + // bond is the new active bond amount of the sequencer + repeated cosmos.base.v1beta1.Coin bond = 3 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; +} + +message EventRotationStarted { + // RollappId defines the rollapp to which the sequencer belongs. + string rollapp_id = 1; + // NextProposerAddr is the bech32-encoded address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + string next_proposer_addr = 2; + // RewardAddr is a bech32-encoded address of the sequencer's reward address. + string reward_addr = 3; + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 4; +} + +message EventUpdateRewardAddress { + // Operator is the bech32-encoded address of the actor sending the update + string creator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; +} + +message EventUpdateWhitelistedRelayers { + // Operator is the bech32-encoded address of the actor sending the update + string creator = 1; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/genesis.proto b/proto/types/dymensionxyz/dymension/sequencer/genesis.proto new file mode 100644 index 000000000..70fa8ca04 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/genesis.proto @@ -0,0 +1,25 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +import "gogoproto/gogo.proto"; +import "types/dymensionxyz/dymension/sequencer/params.proto"; +import "types/dymensionxyz/dymension/sequencer/sequencer.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// GenesisState defines the sequencer module's genesis state. +message GenesisState { + Params params = 1 [ (gogoproto.nullable) = false ]; + // sequencerList is a list of all defined sequencers + repeated Sequencer sequencerList = 2 [ (gogoproto.nullable) = false ]; + // genesisProposers is a list of the defined genesis proposers + repeated GenesisProposer genesisProposers = 3 + [ (gogoproto.nullable) = false ]; + // bondReductions is a list of all bond reductions + repeated BondReduction bondReductions = 4 [(gogoproto.nullable) = false]; +} + +message GenesisProposer { + string address = 1; + string rollappId = 2; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/metadata.proto b/proto/types/dymensionxyz/dymension/sequencer/metadata.proto new file mode 100644 index 000000000..02d4d0c7c --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/metadata.proto @@ -0,0 +1,54 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +import "gogoproto/gogo.proto"; + +// Metadata defines rollapp/sequencer extra information. +message SequencerMetadata { + // moniker defines a human-readable name for the sequencer. + string moniker = 1; + // field numbers not to be reused + reserved 2 to 4; + // details define other optional details. + string details = 5; + // bootstrap nodes list + repeated string p2p_seeds = 6; + // RPCs list + repeated string rpcs = 7; + // evm RPCs list + repeated string evm_rpcs = 8; + // REST API URLs + repeated string rest_api_urls = 9; + // block explorer URL + string explorer_url = 10; + // genesis URLs + repeated string genesis_urls = 11; + // contact details + ContactDetails contact_details = 12; + // json dump the sequencer can add (limited by size) + bytes extra_data = 13; + // snapshots of the sequencer + repeated SnapshotInfo snapshots = 14; + // gas_price defines the value for each gas unit + string gas_price = 15 [(gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Int"]; +} + +message ContactDetails { + // website URL + string website = 11; + // telegram link + string telegram = 1; + // twitter link + string x = 2; +} + +message SnapshotInfo { + // the snapshot url + string snapshot_url = 1; + // The snapshot height + uint64 height = 2; + // sha-256 checksum value for the snapshot file + string checksum=3; +} diff --git a/proto/types/dymensionxyz/dymension/sequencer/operating_status.proto b/proto/types/dymensionxyz/dymension/sequencer/operating_status.proto new file mode 100644 index 000000000..16ec15031 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/operating_status.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; +import "gogoproto/gogo.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// OperatingStatus defines the operating status of a sequencer +enum OperatingStatus { + option (gogoproto.goproto_enum_prefix) = false; + // OPERATING_STATUS_UNBONDED defines a sequencer that is not active and won't + // be scheduled + OPERATING_STATUS_UNBONDED = 0 + [ (gogoproto.enumvalue_customname) = "Unbonded" ]; + // UNBONDING defines a sequencer that is currently unbonding. + OPERATING_STATUS_UNBONDING = 1 + [ (gogoproto.enumvalue_customname) = "Unbonding" ]; + // OPERATING_STATUS_BONDED defines a sequencer that is bonded and can be + // scheduled + OPERATING_STATUS_BONDED = 2 [ (gogoproto.enumvalue_customname) = "Bonded" ]; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/params.proto b/proto/types/dymensionxyz/dymension/sequencer/params.proto new file mode 100644 index 000000000..9fec1ffe6 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/params.proto @@ -0,0 +1,36 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +import "gogoproto/gogo.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "google/protobuf/duration.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// Params defines the parameters for the module. +message Params { + option (gogoproto.equal) = true; + option (gogoproto.goproto_stringer) = false; + + cosmos.base.v1beta1.Coin min_bond = 1 [ + (gogoproto.nullable) = false, + (gogoproto.jsontag) = "min_bond,omitempty" + ]; + + // unbonding_time is the time duration of unbonding. + google.protobuf.Duration unbonding_time = 2 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // notice_period is the time duration of notice period. + // notice period is the duration between the unbond request and the actual + // unbonding starting. the proposer is still bonded during this period. + google.protobuf.Duration notice_period = 3 + [ (gogoproto.nullable) = false, (gogoproto.stdduration) = true ]; + + // LivenessSlashMultiplier multiplies with the tokens of the slashed sequencer to compute the burn amount. + string liveness_slash_multiplier = 4 [ + (gogoproto.customtype) = "github.com/cosmos/cosmos-sdk/types.Dec", + (gogoproto.moretags) = "yaml:\"liveness_slash_multiplier\"", + (gogoproto.nullable) = false + ]; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/query.proto b/proto/types/dymensionxyz/dymension/sequencer/query.proto new file mode 100644 index 000000000..91ce9b764 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/query.proto @@ -0,0 +1,109 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +import "gogoproto/gogo.proto"; +import "types/cosmos/base/query/v1beta1/pagination.proto"; +import "types/dymensionxyz/dymension/sequencer/params.proto"; +import "types/dymensionxyz/dymension/sequencer/sequencer.proto"; +import "types/dymensionxyz/dymension/sequencer/operating_status.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +// Query defines the gRPC querier service. +service Query { + // Parameters queries the parameters of the module. + rpc Params(QueryParamsRequest) returns (QueryParamsResponse) {} + + // Queries a Sequencer by address. + rpc Sequencer(QueryGetSequencerRequest) returns (QueryGetSequencerResponse) {} + + // Queries a list of Sequencer items. + rpc Sequencers(QuerySequencersRequest) returns (QuerySequencersResponse) {} + + // Queries a SequencersByRollapp by rollappId. + rpc SequencersByRollapp(QueryGetSequencersByRollappRequest) + returns (QueryGetSequencersByRollappResponse) {} + + // Queries a SequencersByRollappByStatus + rpc SequencersByRollappByStatus(QueryGetSequencersByRollappByStatusRequest) + returns (QueryGetSequencersByRollappByStatusResponse) {} + + // Queries the current proposer by rollappId. + rpc GetProposerByRollapp(QueryGetProposerByRollappRequest) + returns (QueryGetProposerByRollappResponse) {} + + // Queries the next proposer by rollappId. + rpc GetNextProposerByRollapp(QueryGetNextProposerByRollappRequest) + returns (QueryGetNextProposerByRollappResponse) {} + + // Queries a list of proposers. + rpc Proposers(QueryProposersRequest) returns (QueryProposersResponse) {} +} + +// QueryParamsRequest is request type for the Query/Params RPC method. +message QueryParamsRequest {} + +// QueryParamsResponse is response type for the Query/Params RPC method. +message QueryParamsResponse { + // params holds all the parameters of this module. + Params params = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryGetSequencerRequest { string sequencerAddress = 1; } + +message QueryGetSequencerResponse { + Sequencer sequencer = 1 [ (gogoproto.nullable) = false ]; +} + +message QuerySequencersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +message QuerySequencersResponse { + repeated Sequencer sequencers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} + +message QueryGetSequencersByRollappRequest { string rollappId = 1; } + +message QueryGetSequencersByRollappResponse { + repeated Sequencer sequencers = 1 [ (gogoproto.nullable) = false ]; +} + +message QueryGetSequencersByRollappByStatusRequest { + string rollappId = 1; + OperatingStatus status = 2; +} + +message QueryGetSequencersByRollappByStatusResponse { + repeated Sequencer sequencers = 1 [ (gogoproto.nullable) = false ]; +} + +// Request type for the GetProposerByRollapp RPC method. +message QueryGetProposerByRollappRequest { string rollappId = 1; } + +// Response type for the GetProposerByRollapp RPC method. +message QueryGetProposerByRollappResponse { string proposerAddr = 1; } + +// Request type for the GetNextProposerByRollapp RPC method. +message QueryGetNextProposerByRollappRequest { string rollappId = 1; } + +// Response type for the GetNextProposerByRollapp RPC method. +message QueryGetNextProposerByRollappResponse { + // nextProposerAddr is the address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + string nextProposerAddr = 1; + // rotationInProgress is true if the proposer rotation is in progress. + bool rotationInProgress = 2; +} + +// Request type for the Proposers RPC method. +message QueryProposersRequest { + cosmos.base.query.v1beta1.PageRequest pagination = 1; +} + +// Response type for the Proposers RPC method. +message QueryProposersResponse { + repeated Sequencer proposers = 1 [ (gogoproto.nullable) = false ]; + cosmos.base.query.v1beta1.PageResponse pagination = 2; +} \ No newline at end of file diff --git a/proto/types/dymensionxyz/dymension/sequencer/sequencer.proto b/proto/types/dymensionxyz/dymension/sequencer/sequencer.proto new file mode 100644 index 000000000..3681a22e8 --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/sequencer.proto @@ -0,0 +1,64 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +import "cosmos_proto/cosmos.proto"; +import "google/protobuf/any.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "types/dymensionxyz/dymension/sequencer/metadata.proto"; +import "types/dymensionxyz/dymension/sequencer/operating_status.proto"; + +// Sequencer defines a sequencer identified by its' address (sequencerAddress). +// The sequencer could be attached to only one rollapp (rollappId). +message Sequencer { + // address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string address = 1; + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + google.protobuf.Any dymintPubKey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // rollappId defines the rollapp to which the sequencer belongs. + string rollappId = 3; + // metadata defines the extra information for the sequencer. + SequencerMetadata metadata = 4 [(gogoproto.nullable) = false]; + // jailed defined whether the sequencer has been jailed from bonded status or not. + bool jailed = 5; + + bool proposer = 6 [deprecated = true]; + + // status is the sequencer status (bonded/unbonding/unbonded). + OperatingStatus status = 7; + // tokens define the delegated tokens (incl. self-delegation). + repeated cosmos.base.v1beta1.Coin tokens = 8 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins" + ]; + + // unbond_request_height stores the height at which this sequencer has + // requested to unbond. + int64 unbond_request_height = 9; + // unbond_time defines the time when the sequencer will complete unbonding. + google.protobuf.Timestamp unbond_time = 10 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // notice_period_time defines the time when the sequencer will finish it's notice period if started + google.protobuf.Timestamp notice_period_time = 11 + [ (gogoproto.nullable) = false, (gogoproto.stdtime) = true ]; + + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 12; + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 13; +} + +// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount +message BondReduction { + // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string sequencer_address = 1; + // decrease_bond_amount is the amount of tokens to be unbonded. + cosmos.base.v1beta1.Coin decrease_bond_amount = 2 [(gogoproto.nullable) = false]; + // decrease_bond_time defines, if unbonding, the min time for the sequencer to complete unbonding. + google.protobuf.Timestamp decrease_bond_time = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/types/dymensionxyz/dymension/sequencer/tx.proto b/proto/types/dymensionxyz/dymension/sequencer/tx.proto new file mode 100644 index 000000000..de5360b8d --- /dev/null +++ b/proto/types/dymensionxyz/dymension/sequencer/tx.proto @@ -0,0 +1,131 @@ +syntax = "proto3"; +package dymensionxyz.dymension.sequencer; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer"; + +import "google/protobuf/any.proto"; +import "cosmos_proto/cosmos.proto"; +import "gogoproto/gogo.proto"; +import "google/protobuf/timestamp.proto"; +import "types/cosmos/base/v1beta1/coin.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "types/dymensionxyz/dymension/sequencer/params.proto"; +import "types/dymensionxyz/dymension/sequencer/metadata.proto"; + +// MsgUpdateParams is the Msg/UpdateParams request type. +// Since: cosmos-sdk 0.47 +message MsgUpdateParams { + option (cosmos.msg.v1.signer) = "authority"; + + // authority is the address that controls the module (defaults to x/gov unless overwritten). + string authority = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + // NOTE: All parameters must be supplied. + Params params = 2 [(gogoproto.nullable) = false]; +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +message MsgUpdateParamsResponse {} + + + +message MsgCreateSequencer { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1; + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + google.protobuf.Any dymintPubKey = 2 [(cosmos_proto.accepts_interface) = "cosmos.crypto.PubKey"]; + // rollapp_id defines the rollapp to which the sequencer belongs. + string rollapp_id = 3; + // metadata defines the extra information for the sequencer. + SequencerMetadata metadata = 4 [(gogoproto.nullable) = false]; + // entry bond for the sequencer. + cosmos.base.v1beta1.Coin bond = 5 [(gogoproto.nullable) = false]; + // RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid. + // If empty, the creator address is used. + string reward_addr = 6; + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 7; +} + +message MsgCreateSequencerResponse {} + +message MsgUpdateSequencerInformation { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1; + // metadata defines the extra information for the sequencer. + SequencerMetadata metadata = 2 [(gogoproto.nullable) = false]; +} + +message MsgUpdateSequencerInformationResponse {} + +message MsgUpdateRewardAddress { + option (cosmos.msg.v1.signer) = "creator"; + // Creator is the bech32-encoded address of the actor sending the update + string creator = 1; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; +} + +message MsgUpdateRewardAddressResponse {} + +message MsgUpdateWhitelistedRelayers { + option (cosmos.msg.v1.signer) = "creator"; + // Creator is the bech32-encoded address of the actor sending the update + string creator = 1; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; +} + +message MsgUpdateWhitelistedRelayersResponse {} + +// MsgUnbond defines a SDK message for performing an undelegation from a +// bond and a sequencer. +message MsgUnbond { + option (cosmos.msg.v1.signer) = "creator"; + option (gogoproto.equal) = false; + string creator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +} + +// MsgUnbondResponse defines the Msg/Unbond response type. +message MsgUnbondResponse { + // completion_time defines the time at which the unbonding will be completed. + // If unbonding the proposer, the completion time is the time at which the notice period will be completed. + oneof completion_time { + // unbonding_completion_time is the time at which the unbonding will be completed. + google.protobuf.Timestamp unbonding_completion_time = 1 [ (gogoproto.stdtime) = true]; + // notice_period_completion_time is the time at which the notice period will be completed. + google.protobuf.Timestamp notice_period_completion_time = 2 [ (gogoproto.stdtime) = true]; + } +} + +// MsgIncreaseBond defines a SDK message for increasing the bond amount of a sequencer. +message MsgIncreaseBond { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // add_amount is the amount of coins to be added to the sequencer's bond. + cosmos.base.v1beta1.Coin add_amount = 2 [(gogoproto.nullable) = false]; +} + +// MsgIncreaseBondResponse defines the Msg/IncreaseBond response type. +message MsgIncreaseBondResponse {} + +// MsgDecreaseBond defines a SDK message for decreasing the bond of a sequencer. +message MsgDecreaseBond { + option (cosmos.msg.v1.signer) = "creator"; + // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + string creator = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // decrease_amount is the amount of coins to decrease the bond by. + cosmos.base.v1beta1.Coin decrease_amount = 2 [(gogoproto.nullable) = false]; +} + +// MsgDecreaseBondResponse defines the Msg/DecreaseBond response type. +message MsgDecreaseBondResponse { + google.protobuf.Timestamp completion_time = 1 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; +} diff --git a/proto/types/rollapp/sequencers/types/tx.proto b/proto/types/rollapp/sequencers/types/tx.proto new file mode 100644 index 000000000..1c32bdccd --- /dev/null +++ b/proto/types/rollapp/sequencers/types/tx.proto @@ -0,0 +1,45 @@ +syntax = "proto3"; +package rollapp.sequencers.types; + +import "gogoproto/gogo.proto"; +import "types/cosmos/msg/v1/msg.proto"; +import "google/protobuf/any.proto"; + +option go_package = "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers"; + +message MsgCreateSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // PubKey is a tendermint consensus pub key + google.protobuf.Any pub_key = 2; + // Signature is operator signed with the private key of pub_key + bytes signature = 3; +} + +message MsgCreateSequencerResponse {} + +message MsgUpdateSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + string operator = 1; + // Field no.2 is missing + reserved 2; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 3; +} + +message MsgUpdateSequencerResponse {} + +// ConsensusMsgUpsertSequencer is a consensus message to upsert the sequencer. +message ConsensusMsgUpsertSequencer { + option (cosmos.msg.v1.signer) = "operator"; + // Operator is the bech32-encoded address of the actor sending the update + string operator = 1; + // ConsPubKey is a tendermint consensus pub key + google.protobuf.Any cons_pub_key = 2; + // RewardAddr is the bech32-encoded sequencer's reward address + string reward_addr = 3; +} + +message ConsensusMsgUpsertSequencerResponse {} diff --git a/settlement/dymension/cosmosclient.go b/settlement/dymension/cosmosclient.go index cafc0a7f7..db69e477a 100644 --- a/settlement/dymension/cosmosclient.go +++ b/settlement/dymension/cosmosclient.go @@ -13,8 +13,8 @@ import ( "github.com/ignite/cli/ignite/pkg/cosmosaccount" ctypes "github.com/tendermint/tendermint/rpc/core/types" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" ) // CosmosClient is an interface for interacting with cosmos client chains. diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index b0ab5c2dd..201006f31 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -24,9 +24,10 @@ import ( "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" "github.com/dymensionxyz/dymint/types" rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" + protoutils "github.com/dymensionxyz/dymint/utils/proto" "github.com/dymensionxyz/dymint/version" ) @@ -341,8 +342,9 @@ func (c *Client) GetSequencerByAddress(address string) (types.Sequencer, error) return types.Sequencer{}, err } + dymintPubKey := protoutils.GogoToCosmos(res.Sequencer.DymintPubKey) var pubKey cryptotypes.PubKey - err = c.protoCodec.UnpackAny(res.Sequencer.DymintPubKey, &pubKey) + err = c.protoCodec.UnpackAny(dymintPubKey, &pubKey) if err != nil { return types.Sequencer{}, err } @@ -387,8 +389,9 @@ func (c *Client) GetAllSequencers() ([]types.Sequencer, error) { var sequencerList []types.Sequencer for _, sequencer := range res.Sequencers { + dymintPubKey := protoutils.GogoToCosmos(sequencer.DymintPubKey) var pubKey cryptotypes.PubKey - err := c.protoCodec.UnpackAny(sequencer.DymintPubKey, &pubKey) + err := c.protoCodec.UnpackAny(dymintPubKey, &pubKey) if err != nil { return nil, err } @@ -435,8 +438,9 @@ func (c *Client) GetBondedSequencers() ([]types.Sequencer, error) { var sequencerList []types.Sequencer for _, sequencer := range res.Sequencers { + dymintPubKey := protoutils.GogoToCosmos(sequencer.DymintPubKey) var pubKey cryptotypes.PubKey - err := c.protoCodec.UnpackAny(sequencer.DymintPubKey, &pubKey) + err := c.protoCodec.UnpackAny(dymintPubKey, &pubKey) if err != nil { return nil, err } diff --git a/settlement/dymension/dymension_test.go b/settlement/dymension/dymension_test.go index 5f24e9cb3..fdd712914 100644 --- a/settlement/dymension/dymension_test.go +++ b/settlement/dymension/dymension_test.go @@ -24,13 +24,14 @@ import ( "github.com/dymensionxyz/dymint/da" dymensionmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/settlement/dymension" - sequencertypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" rollapptypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" + sequencertypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/settlement/dymension" "github.com/dymensionxyz/dymint/testutil" - sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" rollapptypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" + sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" + protoutils "github.com/dymensionxyz/dymint/utils/proto" ) func TestGetSequencers(t *testing.T) { @@ -221,7 +222,7 @@ func generateSequencerByRollappResponse(t *testing.T, count int) *sequencertypes require.NoError(t, err) seq := sequencertypes.Sequencer{ - DymintPubKey: pk, + DymintPubKey: protoutils.CosmosToGogo(pk), Status: sequencertypes.Bonded, } sequencerInfoList = append(sequencerInfoList, seq) diff --git a/third_party/dymension/sequencer/types/description.pb.go b/third_party/dymension/sequencer/types/description.pb.go deleted file mode 100644 index 1d45971a9..000000000 --- a/third_party/dymension/sequencer/types/description.pb.go +++ /dev/null @@ -1,531 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/description.proto - -package types - -import ( - fmt "fmt" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// Description defines a sequencer description. -type Description struct { - // moniker defines a human-readable name for the sequencer. - Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` - // identity defines an optional identity signature (ex. UPort or Keybase). - Identity string `protobuf:"bytes,2,opt,name=identity,proto3" json:"identity,omitempty"` - // website defines an optional website link. - Website string `protobuf:"bytes,3,opt,name=website,proto3" json:"website,omitempty"` - // securityContact defines an optional email for security contact. - SecurityContact string `protobuf:"bytes,4,opt,name=securityContact,proto3" json:"securityContact,omitempty"` - // details define other optional details. - Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` -} - -func (m *Description) Reset() { *m = Description{} } -func (m *Description) String() string { return proto.CompactTextString(m) } -func (*Description) ProtoMessage() {} -func (*Description) Descriptor() ([]byte, []int) { - return fileDescriptor_91de4c32465eb7e7, []int{0} -} -func (m *Description) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *Description) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_Description.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *Description) XXX_Merge(src proto.Message) { - xxx_messageInfo_Description.Merge(m, src) -} -func (m *Description) XXX_Size() int { - return m.Size() -} -func (m *Description) XXX_DiscardUnknown() { - xxx_messageInfo_Description.DiscardUnknown(m) -} - -var xxx_messageInfo_Description proto.InternalMessageInfo - -func (m *Description) GetMoniker() string { - if m != nil { - return m.Moniker - } - return "" -} - -func (m *Description) GetIdentity() string { - if m != nil { - return m.Identity - } - return "" -} - -func (m *Description) GetWebsite() string { - if m != nil { - return m.Website - } - return "" -} - -func (m *Description) GetSecurityContact() string { - if m != nil { - return m.SecurityContact - } - return "" -} - -func (m *Description) GetDetails() string { - if m != nil { - return m.Details - } - return "" -} - -func init() { - proto.RegisterType((*Description)(nil), "dymensionxyz.dymension.sequencer.Description") -} - -func init() { - proto.RegisterFile("dymension/sequencer/description.proto", fileDescriptor_91de4c32465eb7e7) -} - -var fileDescriptor_91de4c32465eb7e7 = []byte{ - // 239 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4d, 0xa9, 0xcc, 0x4d, - 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x2d, 0xd2, - 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0xcc, 0xcf, 0xd3, 0x2b, 0x28, 0xca, 0x2f, - 0xc9, 0x17, 0x52, 0x80, 0x2b, 0xab, 0xa8, 0xac, 0xd2, 0x83, 0x73, 0xf4, 0xe0, 0x7a, 0x94, 0x16, - 0x32, 0x72, 0x71, 0xbb, 0x20, 0xf4, 0x09, 0x49, 0x70, 0xb1, 0xe7, 0xe6, 0xe7, 0x65, 0x66, 0xa7, - 0x16, 0x49, 0x30, 0x2a, 0x30, 0x6a, 0x70, 0x06, 0xc1, 0xb8, 0x42, 0x52, 0x5c, 0x1c, 0x99, 0x29, - 0xa9, 0x79, 0x25, 0x99, 0x25, 0x95, 0x12, 0x4c, 0x60, 0x29, 0x38, 0x1f, 0xa4, 0xab, 0x3c, 0x35, - 0xa9, 0x38, 0xb3, 0x24, 0x55, 0x82, 0x19, 0xa2, 0x0b, 0xca, 0x15, 0xd2, 0xe0, 0xe2, 0x2f, 0x4e, - 0x4d, 0x2e, 0x2d, 0xca, 0x2c, 0xa9, 0x74, 0xce, 0xcf, 0x2b, 0x49, 0x4c, 0x2e, 0x91, 0x60, 0x01, - 0xab, 0x40, 0x17, 0x06, 0x99, 0x91, 0x92, 0x5a, 0x92, 0x98, 0x99, 0x53, 0x2c, 0xc1, 0x0a, 0x31, - 0x03, 0xca, 0x75, 0x0a, 0x38, 0xf1, 0x48, 0x8e, 0xf1, 0xc2, 0x23, 0x39, 0xc6, 0x07, 0x8f, 0xe4, - 0x18, 0x27, 0x3c, 0x96, 0x63, 0xb8, 0xf0, 0x58, 0x8e, 0xe1, 0xc6, 0x63, 0x39, 0x86, 0x28, 0xb3, - 0xf4, 0xcc, 0x92, 0x8c, 0xd2, 0x24, 0xbd, 0xe4, 0xfc, 0x5c, 0x7d, 0x64, 0xaf, 0x22, 0x38, 0xfa, - 0x65, 0xc6, 0xfa, 0x15, 0x48, 0x61, 0x54, 0x52, 0x59, 0x90, 0x5a, 0x9c, 0xc4, 0x06, 0x0e, 0x1e, - 0x63, 0x40, 0x00, 0x00, 0x00, 0xff, 0xff, 0x2d, 0xcd, 0xd6, 0xb4, 0x47, 0x01, 0x00, 0x00, -} - -func (m *Description) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *Description) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *Description) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Details) > 0 { - i -= len(m.Details) - copy(dAtA[i:], m.Details) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Details))) - i-- - dAtA[i] = 0x2a - } - if len(m.SecurityContact) > 0 { - i -= len(m.SecurityContact) - copy(dAtA[i:], m.SecurityContact) - i = encodeVarintDescription(dAtA, i, uint64(len(m.SecurityContact))) - i-- - dAtA[i] = 0x22 - } - if len(m.Website) > 0 { - i -= len(m.Website) - copy(dAtA[i:], m.Website) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Website))) - i-- - dAtA[i] = 0x1a - } - if len(m.Identity) > 0 { - i -= len(m.Identity) - copy(dAtA[i:], m.Identity) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Identity))) - i-- - dAtA[i] = 0x12 - } - if len(m.Moniker) > 0 { - i -= len(m.Moniker) - copy(dAtA[i:], m.Moniker) - i = encodeVarintDescription(dAtA, i, uint64(len(m.Moniker))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintDescription(dAtA []byte, offset int, v uint64) int { - offset -= sovDescription(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *Description) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Moniker) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.Identity) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.Website) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.SecurityContact) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - l = len(m.Details) - if l > 0 { - n += 1 + l + sovDescription(uint64(l)) - } - return n -} - -func sovDescription(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozDescription(x uint64) (n int) { - return sovDescription(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *Description) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: Description: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: Description: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Moniker = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Identity", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Identity = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Website = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 4: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SecurityContact", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.SecurityContact = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 5: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowDescription - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthDescription - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthDescription - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Details = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipDescription(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthDescription - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipDescription(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDescription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDescription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowDescription - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthDescription - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupDescription - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthDescription - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthDescription = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowDescription = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupDescription = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/dymension/sequencer/types/events.pb.go b/third_party/dymension/sequencer/types/events.pb.go deleted file mode 100644 index 0cfb2da09..000000000 --- a/third_party/dymension/sequencer/types/events.pb.go +++ /dev/null @@ -1,450 +0,0 @@ -// Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/events.proto - -package types - -import ( - fmt "fmt" - _ "github.com/cosmos/cosmos-proto" - github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" - types "github.com/cosmos/cosmos-sdk/types" - _ "github.com/cosmos/cosmos-sdk/types/msgservice" - _ "github.com/gogo/protobuf/gogoproto" - proto "github.com/gogo/protobuf/proto" - io "io" - math "math" - math_bits "math/bits" -) - -// Reference imports to suppress errors if they are not otherwise used. -var _ = proto.Marshal -var _ = fmt.Errorf -var _ = math.Inf - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the proto package it is being compiled against. -// A compilation error at this line likely means your copy of the -// proto package needs to be updated. -const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package - -// EventIncreasedBond is an event emitted when a sequencer's bond is increased. -type EventIncreasedBond struct { - // sequencer is the bech32-encoded address of the sequencer which increased its bond - Sequencer string `protobuf:"bytes,1,opt,name=sequencer,proto3" json:"sequencer,omitempty"` - // added_amount is the amount of coins added to the sequencer's bond - AddedAmount types.Coin `protobuf:"bytes,2,opt,name=added_amount,json=addedAmount,proto3" json:"added_amount"` - // bond is the new active bond amount of the sequencer - Bond github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=bond,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"bond"` -} - -func (m *EventIncreasedBond) Reset() { *m = EventIncreasedBond{} } -func (m *EventIncreasedBond) String() string { return proto.CompactTextString(m) } -func (*EventIncreasedBond) ProtoMessage() {} -func (*EventIncreasedBond) Descriptor() ([]byte, []int) { - return fileDescriptor_8c4c85909720061b, []int{0} -} -func (m *EventIncreasedBond) XXX_Unmarshal(b []byte) error { - return m.Unmarshal(b) -} -func (m *EventIncreasedBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { - if deterministic { - return xxx_messageInfo_EventIncreasedBond.Marshal(b, m, deterministic) - } else { - b = b[:cap(b)] - n, err := m.MarshalToSizedBuffer(b) - if err != nil { - return nil, err - } - return b[:n], nil - } -} -func (m *EventIncreasedBond) XXX_Merge(src proto.Message) { - xxx_messageInfo_EventIncreasedBond.Merge(m, src) -} -func (m *EventIncreasedBond) XXX_Size() int { - return m.Size() -} -func (m *EventIncreasedBond) XXX_DiscardUnknown() { - xxx_messageInfo_EventIncreasedBond.DiscardUnknown(m) -} - -var xxx_messageInfo_EventIncreasedBond proto.InternalMessageInfo - -func (m *EventIncreasedBond) GetSequencer() string { - if m != nil { - return m.Sequencer - } - return "" -} - -func (m *EventIncreasedBond) GetAddedAmount() types.Coin { - if m != nil { - return m.AddedAmount - } - return types.Coin{} -} - -func (m *EventIncreasedBond) GetBond() github_com_cosmos_cosmos_sdk_types.Coins { - if m != nil { - return m.Bond - } - return nil -} - -func init() { - proto.RegisterType((*EventIncreasedBond)(nil), "dymensionxyz.dymension.sequencer.EventIncreasedBond") -} - -func init() { proto.RegisterFile("dymension/sequencer/events.proto", fileDescriptor_8c4c85909720061b) } - -var fileDescriptor_8c4c85909720061b = []byte{ - // 337 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x91, 0xb1, 0x6e, 0xea, 0x30, - 0x14, 0x86, 0xe3, 0x0b, 0xba, 0x12, 0xe1, 0x4e, 0x11, 0xd2, 0x0d, 0x0c, 0x26, 0xea, 0xc4, 0x82, - 0x5d, 0x8a, 0xc4, 0x4e, 0xaa, 0x0e, 0xdd, 0x2a, 0xba, 0x75, 0x41, 0x49, 0x6c, 0xa5, 0x51, 0x15, - 0x1f, 0x9a, 0x63, 0x22, 0xe8, 0x53, 0xf4, 0x39, 0x3a, 0xf7, 0x21, 0x18, 0x51, 0xa7, 0x4e, 0x6d, - 0x05, 0x4f, 0xd0, 0x37, 0xa8, 0xe2, 0x58, 0xc0, 0xd4, 0xc9, 0x3e, 0xe7, 0xfc, 0xdf, 0xaf, 0x5f, - 0xe7, 0xb8, 0x81, 0x58, 0xe7, 0x52, 0x61, 0x06, 0x8a, 0xa3, 0x7c, 0x5c, 0x4a, 0x95, 0xc8, 0x82,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80, 0x33, 0x63, 0x1c, 0xde, 0x6c, 0x76, 0x94, 0x6c, - 0x77, 0x94, 0x7c, 0xed, 0x28, 0x79, 0xde, 0x53, 0x67, 0xbb, 0xa7, 0xce, 0xfb, 0x9e, 0x3a, 0x77, - 0x93, 0x13, 0xa7, 0xd3, 0x23, 0x1d, 0x0b, 0x5e, 0x8e, 0xf9, 0xea, 0xe4, 0xb0, 0xc6, 0x3d, 0xfe, - 0x6b, 0x96, 0x39, 0xfe, 0x09, 0x00, 0x00, 0xff, 0xff, 0x7a, 0xac, 0x07, 0x3b, 0xfc, 0x01, 0x00, - 0x00, -} - -func (m *EventIncreasedBond) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *EventIncreasedBond) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *EventIncreasedBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l - if len(m.Bond) > 0 { - for iNdEx := len(m.Bond) - 1; iNdEx >= 0; iNdEx-- { - { - size, err := m.Bond[iNdEx].MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x1a - } - } - { - size, err := m.AddedAmount.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintEvents(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x12 - if len(m.Sequencer) > 0 { - i -= len(m.Sequencer) - copy(dAtA[i:], m.Sequencer) - i = encodeVarintEvents(dAtA, i, uint64(len(m.Sequencer))) - i-- - dAtA[i] = 0xa - } - return len(dAtA) - i, nil -} - -func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { - offset -= sovEvents(v) - base := offset - for v >= 1<<7 { - dAtA[offset] = uint8(v&0x7f | 0x80) - v >>= 7 - offset++ - } - dAtA[offset] = uint8(v) - return base -} -func (m *EventIncreasedBond) Size() (n int) { - if m == nil { - return 0 - } - var l int - _ = l - l = len(m.Sequencer) - if l > 0 { - n += 1 + l + sovEvents(uint64(l)) - } - l = m.AddedAmount.Size() - n += 1 + l + sovEvents(uint64(l)) - if len(m.Bond) > 0 { - for _, e := range m.Bond { - l = e.Size() - n += 1 + l + sovEvents(uint64(l)) - } - } - return n -} - -func sovEvents(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozEvents(x uint64) (n int) { - return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *EventIncreasedBond) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: EventIncreasedBond: wiretype end group for non-group") - } - if fieldNum <= 0 { - return fmt.Errorf("proto: EventIncreasedBond: illegal tag %d (wire type %d)", fieldNum, wire) - } - switch fieldNum { - case 1: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Sequencer", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Sequencer = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field AddedAmount", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if err := m.AddedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Bond", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowEvents - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthEvents - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthEvents - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.Bond = append(m.Bond, types.Coin{}) - if err := m.Bond[len(m.Bond)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - default: - iNdEx = preIndex - skippy, err := skipEvents(dAtA[iNdEx:]) - if err != nil { - return err - } - if (skippy < 0) || (iNdEx+skippy) < 0 { - return ErrInvalidLengthEvents - } - if (iNdEx + skippy) > l { - return io.ErrUnexpectedEOF - } - iNdEx += skippy - } - } - - if iNdEx > l { - return io.ErrUnexpectedEOF - } - return nil -} -func skipEvents(dAtA []byte) (n int, err error) { - l := len(dAtA) - iNdEx := 0 - depth := 0 - for iNdEx < l { - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= (uint64(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - wireType := int(wire & 0x7) - switch wireType { - case 0: - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - iNdEx++ - if dAtA[iNdEx-1] < 0x80 { - break - } - } - case 1: - iNdEx += 8 - case 2: - var length int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return 0, ErrIntOverflowEvents - } - if iNdEx >= l { - return 0, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - length |= (int(b) & 0x7F) << shift - if b < 0x80 { - break - } - } - if length < 0 { - return 0, ErrInvalidLengthEvents - } - iNdEx += length - case 3: - depth++ - case 4: - if depth == 0 { - return 0, ErrUnexpectedEndOfGroupEvents - } - depth-- - case 5: - iNdEx += 4 - default: - return 0, fmt.Errorf("proto: illegal wireType %d", wireType) - } - if iNdEx < 0 { - return 0, ErrInvalidLengthEvents - } - if depth == 0 { - return iNdEx, nil - } - } - return 0, io.ErrUnexpectedEOF -} - -var ( - ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") - ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") - ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") -) diff --git a/third_party/dymension/sequencer/types/query.pb.gw.go b/third_party/dymension/sequencer/types/query.pb.gw.go deleted file mode 100644 index 9429bb4c2..000000000 --- a/third_party/dymension/sequencer/types/query.pb.gw.go +++ /dev/null @@ -1,769 +0,0 @@ -// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. -// source: dymension/sequencer/query.proto - -/* -Package types is a reverse proxy. - -It translates gRPC into RESTful JSON APIs. -*/ -package types - -import ( - "context" - "io" - "net/http" - - "github.com/golang/protobuf/descriptor" - "github.com/golang/protobuf/proto" - "github.com/grpc-ecosystem/grpc-gateway/runtime" - "github.com/grpc-ecosystem/grpc-gateway/utilities" - "google.golang.org/grpc" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/grpclog" - "google.golang.org/grpc/metadata" - "google.golang.org/grpc/status" -) - -// Suppress "imported and not used" errors -var _ codes.Code -var _ io.Reader -var _ status.Status -var _ = runtime.String -var _ = utilities.NewDoubleArray -var _ = descriptor.ForMessage -var _ = metadata.Join - -func request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := client.Params(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Params_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryParamsRequest - var metadata runtime.ServerMetadata - - msg, err := server.Params(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_Sequencer_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["sequencerAddress"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencerAddress") - } - - protoReq.SequencerAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencerAddress", err) - } - - msg, err := client.Sequencer(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Sequencer_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencerRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["sequencerAddress"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "sequencerAddress") - } - - protoReq.SequencerAddress, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "sequencerAddress", err) - } - - msg, err := server.Sequencer(ctx, &protoReq) - return msg, metadata, err - -} - -var ( - filter_Query_Sequencers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} -) - -func request_Query_Sequencers_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySequencersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sequencers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := client.Sequencers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_Sequencers_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QuerySequencersRequest - var metadata runtime.ServerMetadata - - if err := req.ParseForm(); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_Sequencers_0); err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) - } - - msg, err := server.Sequencers(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_SequencersByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := client.SequencersByRollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SequencersByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := server.SequencersByRollapp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_SequencersByRollappByStatus_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappByStatusRequest - var metadata runtime.ServerMetadata - - var ( - val string - e int32 - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - val, ok = pathParams["status"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status") - } - - e, err = runtime.Enum(val, OperatingStatus_value) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err) - } - - protoReq.Status = OperatingStatus(e) - - msg, err := client.SequencersByRollappByStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_SequencersByRollappByStatus_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetSequencersByRollappByStatusRequest - var metadata runtime.ServerMetadata - - var ( - val string - e int32 - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - val, ok = pathParams["status"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "status") - } - - e, err = runtime.Enum(val, OperatingStatus_value) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "status", err) - } - - protoReq.Status = OperatingStatus(e) - - msg, err := server.SequencersByRollappByStatus(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := client.GetProposerByRollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := server.GetProposerByRollapp(ctx, &protoReq) - return msg, metadata, err - -} - -func request_Query_GetNextProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetNextProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := client.GetNextProposerByRollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) - return msg, metadata, err - -} - -func local_request_Query_GetNextProposerByRollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { - var protoReq QueryGetNextProposerByRollappRequest - var metadata runtime.ServerMetadata - - var ( - val string - ok bool - err error - _ = err - ) - - val, ok = pathParams["rollappId"] - if !ok { - return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "rollappId") - } - - protoReq.RollappId, err = runtime.String(val) - - if err != nil { - return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "rollappId", err) - } - - msg, err := server.GetNextProposerByRollapp(ctx, &protoReq) - return msg, metadata, err - -} - -// RegisterQueryHandlerServer registers the http handlers for service Query to "mux". -// UnaryRPC :call QueryServer directly. -// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. -// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterQueryHandlerFromEndpoint instead. -func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, server QueryServer) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Params_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Sequencer_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_Sequencers_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SequencersByRollapp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollappByStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_SequencersByRollappByStatus_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollappByStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetProposerByRollapp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetNextProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - var stream runtime.ServerTransportStream - ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := local_request_Query_GetNextProposerByRollapp_0(rctx, inboundMarshaler, server, req, pathParams) - md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetNextProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -// RegisterQueryHandlerFromEndpoint is same as RegisterQueryHandler but -// automatically dials to "endpoint" and closes the connection when "ctx" gets done. -func RegisterQueryHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) { - conn, err := grpc.Dial(endpoint, opts...) - if err != nil { - return err - } - defer func() { - if err != nil { - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - return - } - go func() { - <-ctx.Done() - if cerr := conn.Close(); cerr != nil { - grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr) - } - }() - }() - - return RegisterQueryHandler(ctx, mux, conn) -} - -// RegisterQueryHandler registers the http handlers for service Query to "mux". -// The handlers forward requests to the grpc endpoint over "conn". -func RegisterQueryHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error { - return RegisterQueryHandlerClient(ctx, mux, NewQueryClient(conn)) -} - -// RegisterQueryHandlerClient registers the http handlers for service Query -// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "QueryClient". -// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "QueryClient" -// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in -// "QueryClient" to call the correct interceptors. -func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, client QueryClient) error { - - mux.Handle("GET", pattern_Query_Params_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Params_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Params_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencer_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Sequencer_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencer_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_Sequencers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_Sequencers_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_Sequencers_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SequencersByRollapp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_SequencersByRollappByStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_SequencersByRollappByStatus_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_SequencersByRollappByStatus_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetProposerByRollapp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - mux.Handle("GET", pattern_Query_GetNextProposerByRollapp_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { - ctx, cancel := context.WithCancel(req.Context()) - defer cancel() - inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) - rctx, err := runtime.AnnotateContext(ctx, mux, req) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - resp, md, err := request_Query_GetNextProposerByRollapp_0(rctx, inboundMarshaler, client, req, pathParams) - ctx = runtime.NewServerMetadataContext(ctx, md) - if err != nil { - runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) - return - } - - forward_Query_GetNextProposerByRollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) - - }) - - return nil -} - -var ( - pattern_Query_Params_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"dymensionxyz", "dymension", "sequencer", "params"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Sequencer_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dymensionxyz", "dymension", "sequencer", "sequencerAddress"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_Sequencers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"dymensionxyz", "dymension", "sequencer"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SequencersByRollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "sequencer", "sequencers_by_rollapp", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_SequencersByRollappByStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 1, 0, 4, 1, 5, 5}, []string{"dymensionxyz", "dymension", "sequencer", "sequencers_by_rollapp", "rollappId", "status"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GetProposerByRollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "sequencer", "proposer", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) - - pattern_Query_GetNextProposerByRollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "sequencer", "next_proposer", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) -) - -var ( - forward_Query_Params_0 = runtime.ForwardResponseMessage - - forward_Query_Sequencer_0 = runtime.ForwardResponseMessage - - forward_Query_Sequencers_0 = runtime.ForwardResponseMessage - - forward_Query_SequencersByRollapp_0 = runtime.ForwardResponseMessage - - forward_Query_SequencersByRollappByStatus_0 = runtime.ForwardResponseMessage - - forward_Query_GetProposerByRollapp_0 = runtime.ForwardResponseMessage - - forward_Query_GetNextProposerByRollapp_0 = runtime.ForwardResponseMessage -) diff --git a/third_party/dymension/sequencer/types/events.go b/types/pb/dymensionxyz/dymension/sequencer/events.go similarity index 98% rename from third_party/dymension/sequencer/types/events.go rename to types/pb/dymensionxyz/dymension/sequencer/events.go index 3977bbee5..eb93ddc7a 100644 --- a/third_party/dymension/sequencer/types/events.go +++ b/types/pb/dymensionxyz/dymension/sequencer/events.go @@ -1,4 +1,4 @@ -package types +package sequencer // Incentive module event types. const ( diff --git a/types/pb/dymensionxyz/dymension/sequencer/events.pb.go b/types/pb/dymensionxyz/dymension/sequencer/events.pb.go new file mode 100644 index 000000000..d84c93382 --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/events.pb.go @@ -0,0 +1,1242 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/events.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// EventIncreasedBond is an event emitted when a sequencer's bond is increased. +type EventIncreasedBond struct { + // sequencer is the bech32-encoded address of the sequencer which increased its bond + Sequencer string `protobuf:"bytes,1,opt,name=sequencer,proto3" json:"sequencer,omitempty"` + // added_amount is the amount of coins added to the sequencer's bond + AddedAmount types.Coin `protobuf:"bytes,2,opt,name=added_amount,json=addedAmount,proto3" json:"added_amount"` + // bond is the new active bond amount of the sequencer + Bond github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,3,rep,name=bond,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"bond"` +} + +func (m *EventIncreasedBond) Reset() { *m = EventIncreasedBond{} } +func (m *EventIncreasedBond) String() string { return proto.CompactTextString(m) } +func (*EventIncreasedBond) ProtoMessage() {} +func (*EventIncreasedBond) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{0} +} +func (m *EventIncreasedBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventIncreasedBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventIncreasedBond.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventIncreasedBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventIncreasedBond.Merge(m, src) +} +func (m *EventIncreasedBond) XXX_Size() int { + return m.Size() +} +func (m *EventIncreasedBond) XXX_DiscardUnknown() { + xxx_messageInfo_EventIncreasedBond.DiscardUnknown(m) +} + +var xxx_messageInfo_EventIncreasedBond proto.InternalMessageInfo + +func (m *EventIncreasedBond) GetSequencer() string { + if m != nil { + return m.Sequencer + } + return "" +} + +func (m *EventIncreasedBond) GetAddedAmount() types.Coin { + if m != nil { + return m.AddedAmount + } + return types.Coin{} +} + +func (m *EventIncreasedBond) GetBond() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Bond + } + return nil +} + +type EventRotationStarted struct { + // RollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // NextProposerAddr is the bech32-encoded address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + NextProposerAddr string `protobuf:"bytes,2,opt,name=next_proposer_addr,json=nextProposerAddr,proto3" json:"next_proposer_addr,omitempty"` + // RewardAddr is a bech32-encoded address of the sequencer's reward address. + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,4,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *EventRotationStarted) Reset() { *m = EventRotationStarted{} } +func (m *EventRotationStarted) String() string { return proto.CompactTextString(m) } +func (*EventRotationStarted) ProtoMessage() {} +func (*EventRotationStarted) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{1} +} +func (m *EventRotationStarted) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventRotationStarted) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventRotationStarted.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventRotationStarted) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventRotationStarted.Merge(m, src) +} +func (m *EventRotationStarted) XXX_Size() int { + return m.Size() +} +func (m *EventRotationStarted) XXX_DiscardUnknown() { + xxx_messageInfo_EventRotationStarted.DiscardUnknown(m) +} + +var xxx_messageInfo_EventRotationStarted proto.InternalMessageInfo + +func (m *EventRotationStarted) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *EventRotationStarted) GetNextProposerAddr() string { + if m != nil { + return m.NextProposerAddr + } + return "" +} + +func (m *EventRotationStarted) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *EventRotationStarted) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +type EventUpdateRewardAddress struct { + // Operator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *EventUpdateRewardAddress) Reset() { *m = EventUpdateRewardAddress{} } +func (m *EventUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*EventUpdateRewardAddress) ProtoMessage() {} +func (*EventUpdateRewardAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{2} +} +func (m *EventUpdateRewardAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateRewardAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateRewardAddress.Merge(m, src) +} +func (m *EventUpdateRewardAddress) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateRewardAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateRewardAddress proto.InternalMessageInfo + +func (m *EventUpdateRewardAddress) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *EventUpdateRewardAddress) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type EventUpdateWhitelistedRelayers struct { + // Operator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *EventUpdateWhitelistedRelayers) Reset() { *m = EventUpdateWhitelistedRelayers{} } +func (m *EventUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*EventUpdateWhitelistedRelayers) ProtoMessage() {} +func (*EventUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { + return fileDescriptor_299be36200df0dd4, []int{3} +} +func (m *EventUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *EventUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_EventUpdateWhitelistedRelayers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *EventUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_EventUpdateWhitelistedRelayers.Merge(m, src) +} +func (m *EventUpdateWhitelistedRelayers) XXX_Size() int { + return m.Size() +} +func (m *EventUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_EventUpdateWhitelistedRelayers.DiscardUnknown(m) +} + +var xxx_messageInfo_EventUpdateWhitelistedRelayers proto.InternalMessageInfo + +func (m *EventUpdateWhitelistedRelayers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *EventUpdateWhitelistedRelayers) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + +func init() { + proto.RegisterType((*EventIncreasedBond)(nil), "dymensionxyz.dymension.sequencer.EventIncreasedBond") + proto.RegisterType((*EventRotationStarted)(nil), "dymensionxyz.dymension.sequencer.EventRotationStarted") + proto.RegisterType((*EventUpdateRewardAddress)(nil), "dymensionxyz.dymension.sequencer.EventUpdateRewardAddress") + proto.RegisterType((*EventUpdateWhitelistedRelayers)(nil), "dymensionxyz.dymension.sequencer.EventUpdateWhitelistedRelayers") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/events.proto", fileDescriptor_299be36200df0dd4) +} + +var fileDescriptor_299be36200df0dd4 = []byte{ + // 496 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0x13, 0x31, + 0x10, 0xcd, 0x26, 0x11, 0x10, 0x87, 0x03, 0x32, 0x39, 0x6c, 0x23, 0xb1, 0x59, 0x45, 0x1c, 0x72, + 0xa0, 0x6b, 0x42, 0x25, 0xee, 0x5d, 0x84, 0x44, 0x6f, 0xc8, 0x55, 0x41, 0xe2, 0xb2, 0xf2, 0xae, + 0x47, 0xa9, 0x45, 0x62, 0x2f, 0xb6, 0xd3, 0x36, 0x7c, 0x05, 0xdf, 0xc1, 0x19, 0x89, 0x5f, 0xe8, + 0xb1, 0xe2, 0xc4, 0x09, 0x50, 0xf2, 0x05, 0xfc, 0x01, 0x5a, 0x7b, 0xbb, 0x8d, 0x82, 0xd4, 0x9e, + 0x76, 0x67, 0xe6, 0xbd, 0x99, 0x37, 0x7e, 0x36, 0x3a, 0xb0, 0xab, 0x12, 0x0c, 0xe1, 0xab, 0x05, + 0x48, 0x23, 0x94, 0xbc, 0x58, 0x7d, 0xbe, 0x09, 0x88, 0x81, 0x4f, 0x4b, 0x90, 0x05, 0x68, 0x02, + 0x67, 0x20, 0xad, 0x49, 0x4a, 0xad, 0xac, 0xc2, 0xf1, 0x36, 0x3c, 0x69, 0x82, 0xa4, 0x81, 0x0f, + 0xf7, 0x0a, 0x65, 0x16, 0xca, 0x64,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, 0xee, 0xd7, 0xa6, 0xbd, + 0x3a, 0x73, 0xc4, 0xf1, 0x33, 0x84, 0x25, 0x5c, 0xd8, 0xca, 0x82, 0x52, 0x19, 0xd0, 0x19, 0xe3, + 0x5c, 0xbb, 0x15, 0x7b, 0xf4, 0x51, 0x55, 0x79, 0x5b, 0x17, 0xaa, 0xe3, 0xc1, 0x23, 0xd4, 0xd7, + 0x70, 0xce, 0x34, 0xf7, 0xb0, 0x8e, 0x83, 0x21, 0x9f, 0x72, 0x80, 0x29, 0x1a, 0x9c, 0x9f, 0x0a, + 0x0b, 0x73, 0x61, 0x2c, 0xf0, 0x4c, 0xc3, 0x9c, 0xad, 0x40, 0x9b, 0xb0, 0x1b, 0x77, 0x26, 0x3d, + 0xfa, 0x78, 0xab, 0x46, 0xeb, 0xd2, 0xf8, 0x04, 0x85, 0x4e, 0xf8, 0x49, 0xc9, 0x99, 0x05, 0xda, + 0xf4, 0x02, 0x63, 0x70, 0x88, 0xee, 0x57, 0x0e, 0x5a, 0x55, 0x1b, 0x46, 0xaf, 0xc3, 0x5d, 0x25, + 0xed, 0x5d, 0x25, 0xe3, 0x77, 0x28, 0xda, 0x6a, 0xfb, 0xfe, 0xff, 0xc1, 0xb7, 0x34, 0x1f, 0xa2, + 0x07, 0x8d, 0xf2, 0xb6, 0x53, 0xde, 0xc4, 0x69, 0x7e, 0xb9, 0x8e, 0x82, 0xab, 0x75, 0x14, 0xfc, + 0x59, 0x47, 0xc1, 0x97, 0x4d, 0xd4, 0xba, 0xda, 0x44, 0xad, 0x9f, 0x9b, 0xa8, 0xf5, 0xe1, 0xcd, + 0x96, 0x65, 0xbb, 0x2f, 0x45, 0x48, 0xeb, 0x4d, 0x23, 0x65, 0x7e, 0xe7, 0x33, 0xca, 0xef, 0xb9, + 0x7b, 0x7c, 0xf0, 0x2f, 0x00, 0x00, 0xff, 0xff, 0x7b, 0xd2, 0xca, 0xec, 0x77, 0x03, 0x00, 0x00, +} + +func (m *EventIncreasedBond) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventIncreasedBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventIncreasedBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Bond) > 0 { + for iNdEx := len(m.Bond) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Bond[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + { + size, err := m.AddedAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintEvents(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.Sequencer) > 0 { + i -= len(m.Sequencer) + copy(dAtA[i:], m.Sequencer) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Sequencer))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventRotationStarted) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventRotationStarted) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventRotationStarted) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.NextProposerAddr) > 0 { + i -= len(m.NextProposerAddr) + copy(dAtA[i:], m.NextProposerAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.NextProposerAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateRewardAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintEvents(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *EventUpdateWhitelistedRelayers) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *EventUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *EventUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintEvents(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintEvents(dAtA []byte, offset int, v uint64) int { + offset -= sovEvents(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *EventIncreasedBond) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Sequencer) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = m.AddedAmount.Size() + n += 1 + l + sovEvents(uint64(l)) + if len(m.Bond) > 0 { + for _, e := range m.Bond { + l = e.Size() + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func (m *EventRotationStarted) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.NextProposerAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func (m *EventUpdateRewardAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + return n +} + +func (m *EventUpdateWhitelistedRelayers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovEvents(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovEvents(uint64(l)) + } + } + return n +} + +func sovEvents(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozEvents(x uint64) (n int) { + return sovEvents(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *EventIncreasedBond) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventIncreasedBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventIncreasedBond: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sequencer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AddedAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.AddedAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bond", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bond = append(m.Bond, types.Coin{}) + if err := m.Bond[len(m.Bond)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventRotationStarted) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventRotationStarted: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventRotationStarted: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextProposerAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextProposerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateRewardAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventUpdateRewardAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *EventUpdateWhitelistedRelayers) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: EventUpdateWhitelistedRelayers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: EventUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowEvents + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthEvents + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthEvents + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipEvents(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthEvents + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipEvents(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowEvents + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthEvents + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupEvents + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthEvents + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthEvents = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowEvents = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupEvents = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/sequencer/types/genesis.pb.go b/types/pb/dymensionxyz/dymension/sequencer/genesis.pb.go similarity index 86% rename from third_party/dymension/sequencer/types/genesis.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/genesis.pb.go index 28e75b87a..bf49c2e76 100644 --- a/third_party/dymension/sequencer/types/genesis.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/genesis.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/genesis.proto +// source: types/dymensionxyz/dymension/sequencer/genesis.proto -package types +package sequencer import ( fmt "fmt" @@ -38,7 +38,7 @@ func (m *GenesisState) Reset() { *m = GenesisState{} } func (m *GenesisState) String() string { return proto.CompactTextString(m) } func (*GenesisState) ProtoMessage() {} func (*GenesisState) Descriptor() ([]byte, []int) { - return fileDescriptor_52f5d9dc91070770, []int{0} + return fileDescriptor_9f12ca04b390434e, []int{0} } func (m *GenesisState) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -104,7 +104,7 @@ func (m *GenesisProposer) Reset() { *m = GenesisProposer{} } func (m *GenesisProposer) String() string { return proto.CompactTextString(m) } func (*GenesisProposer) ProtoMessage() {} func (*GenesisProposer) Descriptor() ([]byte, []int) { - return fileDescriptor_52f5d9dc91070770, []int{1} + return fileDescriptor_9f12ca04b390434e, []int{1} } func (m *GenesisProposer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -152,32 +152,34 @@ func init() { proto.RegisterType((*GenesisProposer)(nil), "dymensionxyz.dymension.sequencer.GenesisProposer") } -func init() { proto.RegisterFile("dymension/sequencer/genesis.proto", fileDescriptor_52f5d9dc91070770) } +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/genesis.proto", fileDescriptor_9f12ca04b390434e) +} -var fileDescriptor_52f5d9dc91070770 = []byte{ - // 343 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0x52, 0x4c, 0xa9, 0xcc, 0x4d, - 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x2d, 0xd2, - 0x4f, 0x4f, 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x80, - 0x2b, 0xa9, 0xa8, 0xac, 0xd2, 0x83, 0x73, 0xf4, 0xe0, 0xea, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, - 0xc1, 0x8a, 0xf5, 0x41, 0x2c, 0x88, 0x3e, 0x29, 0x05, 0x6c, 0x46, 0x17, 0x24, 0x16, 0x25, 0xe6, - 0x42, 0x4d, 0x96, 0x52, 0xc6, 0xa6, 0x02, 0xce, 0x82, 0x28, 0x52, 0xfa, 0xcc, 0xc4, 0xc5, 0xe3, - 0x0e, 0x71, 0x50, 0x70, 0x49, 0x62, 0x49, 0xaa, 0x90, 0x1b, 0x17, 0x1b, 0xc4, 0x14, 0x09, 0x46, - 0x05, 0x46, 0x0d, 0x6e, 0x23, 0x0d, 0x3d, 0x42, 0x0e, 0xd4, 0x0b, 0x00, 0xab, 0x77, 0x62, 0x39, - 0x71, 0x4f, 0x9e, 0x21, 0x08, 0xaa, 0x5b, 0x28, 0x9c, 0x8b, 0x17, 0xae, 0xc2, 0x27, 0xb3, 0xb8, - 0x44, 0x82, 0x49, 0x81, 0x59, 0x83, 0xdb, 0x48, 0x9b, 0xb0, 0x71, 0xc1, 0x30, 0x16, 0xd4, 0x44, - 0x54, 0x73, 0x84, 0x92, 0xb9, 0x04, 0xa0, 0x21, 0x18, 0x50, 0x94, 0x5f, 0x90, 0x5f, 0x9c, 0x5a, - 0x54, 0x2c, 0xc1, 0x0c, 0x36, 0xdb, 0x90, 0xb0, 0xd9, 0xee, 0xa8, 0x3a, 0xa1, 0x36, 0x60, 0x18, - 0x28, 0x14, 0xcb, 0xc5, 0x97, 0x94, 0x9f, 0x97, 0x12, 0x94, 0x9a, 0x52, 0x9a, 0x5c, 0x92, 0x99, - 0x9f, 0x57, 0x2c, 0xc1, 0x02, 0xb6, 0x42, 0x9f, 0xb0, 0x15, 0x4e, 0xc8, 0xfa, 0xa0, 0x16, 0xa0, - 0x19, 0xa6, 0xe4, 0xc9, 0xc5, 0x8f, 0xe6, 0x12, 0x21, 0x09, 0x2e, 0xf6, 0xc4, 0x94, 0x94, 0xa2, - 0xd4, 0x62, 0x48, 0xc0, 0x73, 0x06, 0xc1, 0xb8, 0x42, 0x32, 0x5c, 0x9c, 0x45, 0xf9, 0x39, 0x39, - 0x89, 0x05, 0x05, 0x9e, 0x29, 0x12, 0x4c, 0x60, 0x39, 0x84, 0x80, 0x53, 0xc0, 0x89, 0x47, 0x72, - 0x8c, 0x17, 0x1e, 0xc9, 0x31, 0x3e, 0x78, 0x24, 0xc7, 0x38, 0xe1, 0xb1, 0x1c, 0xc3, 0x85, 0xc7, - 0x72, 0x0c, 0x37, 0x1e, 0xcb, 0x31, 0x44, 0x99, 0xa5, 0x67, 0x96, 0x64, 0x94, 0x26, 0xe9, 0x25, - 0xe7, 0xe7, 0xea, 0x23, 0xbb, 0x1a, 0xc1, 0xd1, 0x2f, 0x33, 0xd6, 0xaf, 0x40, 0x4a, 0x1c, 0x25, - 0x95, 0x05, 0xa9, 0xc5, 0x49, 0x6c, 0xe0, 0x94, 0x61, 0x0c, 0x08, 0x00, 0x00, 0xff, 0xff, 0xb5, - 0xf3, 0x81, 0x1b, 0xbd, 0x02, 0x00, 0x00, +var fileDescriptor_9f12ca04b390434e = []byte{ + // 347 bytes of a gzipped FileDescri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c, 0xac, 0x1b, 0x3e, 0x81, 0x93, 0x4c, 0xf1, 0x48, 0xa4, 0xf2, 0x0a, + 0xf5, 0x62, 0xb3, 0xda, 0xba, 0xce, 0xc7, 0x0d, 0x57, 0x93, 0x25, 0x6e, 0x73, 0x60, 0x02, 0xce, + 0xed, 0x3b, 0xf7, 0x05, 0xe3, 0x4c, 0x62, 0x21, 0xbd, 0xa2, 0x66, 0xdf, 0xe4, 0xb3, 0xbb, 0xdb, + 0x4e, 0x9b, 0xb0, 0x07, 0x84, 0x2f, 0xe0, 0x34, 0x66, 0x14, 0x0d, 0x30, 0x9a, 0x24, 0x8a, 0x30, + 0x2a, 0xbd, 0x92, 0x8e, 0x08, 0xf3, 0x23, 0x3a, 0x9b, 0x3e, 0x1b, 0xb0, 0x03, 0x6b, 0xf4, 0xc0, + 0xd9, 0xce, 0x49, 0xa0, 0x07, 0x8e, 0x22, 0x84, 0x04, 0x96, 0xe6, 0xe1, 0x2b, 0x83, 0xd5, 0x0a, + 0x2f, 0x41, 0x45, 0xb0, 0xd1, 0x28, 0xe2, 0xbc, 0x87, 0xbc, 0x82, 0xfe, 0xb7, 0xfe, 0xd0, 0x89, + 0x67, 0x0b, 0xdf, 0x9d, 0x2f, 0x7c, 0xf7, 0x67, 0xe1, 0xbb, 0x9f, 0x4b, 0xdf, 0x99, 0x2f, 0x7d, + 0xe7, 0x6b, 0xe9, 0x3b, 0xcf, 0x0f, 0x29, 0x51, 0xaf, 0x93, 0x38, 0x48, 0xd8, 0x78, 0xaf, 0x17, + 0x84, 0xaa, 0xd0, 0x34, 0x86, 0xc7, 0xb9, 0xa5, 0x89, 0xcb, 0xba, 0x2b, 0xed, 0xbf, 0x00, 0x00, + 0x00, 0xff, 0xff, 0x40, 0x93, 0xc2, 0xe6, 0x08, 0x03, 0x00, 0x00, } func (m *GenesisState) Marshal() (dAtA []byte, err error) { diff --git a/third_party/dymension/sequencer/types/keys.go b/types/pb/dymensionxyz/dymension/sequencer/keys.go similarity index 99% rename from third_party/dymension/sequencer/types/keys.go rename to types/pb/dymensionxyz/dymension/sequencer/keys.go index 80310719d..c4b84447f 100644 --- a/third_party/dymension/sequencer/types/keys.go +++ b/types/pb/dymensionxyz/dymension/sequencer/keys.go @@ -1,4 +1,4 @@ -package types +package sequencer import ( "encoding/binary" diff --git a/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go b/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go new file mode 100644 index 000000000..fb35f4f5a --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/metadata.pb.go @@ -0,0 +1,1494 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/metadata.proto + +package sequencer + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Metadata defines rollapp/sequencer extra information. +type SequencerMetadata struct { + // moniker defines a human-readable name for the sequencer. + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // details define other optional details. + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` + // bootstrap nodes list + P2PSeeds []string `protobuf:"bytes,6,rep,name=p2p_seeds,json=p2pSeeds,proto3" json:"p2p_seeds,omitempty"` + // RPCs list + Rpcs []string `protobuf:"bytes,7,rep,name=rpcs,proto3" json:"rpcs,omitempty"` + // evm RPCs list + EvmRpcs []string `protobuf:"bytes,8,rep,name=evm_rpcs,json=evmRpcs,proto3" json:"evm_rpcs,omitempty"` + // REST API URLs + RestApiUrls []string `protobuf:"bytes,9,rep,name=rest_api_urls,json=restApiUrls,proto3" json:"rest_api_urls,omitempty"` + // block explorer URL + ExplorerUrl string `protobuf:"bytes,10,opt,name=explorer_url,json=explorerUrl,proto3" json:"explorer_url,omitempty"` + // genesis URLs + GenesisUrls []string `protobuf:"bytes,11,rep,name=genesis_urls,json=genesisUrls,proto3" json:"genesis_urls,omitempty"` + // contact details + ContactDetails *ContactDetails `protobuf:"bytes,12,opt,name=contact_details,json=contactDetails,proto3" json:"contact_details,omitempty"` + // json dump the sequencer can add (limited by size) + ExtraData []byte `protobuf:"bytes,13,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` + // snapshots of the sequencer + Snapshots []*SnapshotInfo `protobuf:"bytes,14,rep,name=snapshots,proto3" json:"snapshots,omitempty"` + // gas_price defines the value for each gas unit + GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,15,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` +} + +func (m *SequencerMetadata) Reset() { *m = SequencerMetadata{} } +func (m *SequencerMetadata) String() string { return proto.CompactTextString(m) } +func (*SequencerMetadata) ProtoMessage() {} +func (*SequencerMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{0} +} +func (m *SequencerMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SequencerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SequencerMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SequencerMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_SequencerMetadata.Merge(m, src) +} +func (m *SequencerMetadata) XXX_Size() int { + return m.Size() +} +func (m *SequencerMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_SequencerMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_SequencerMetadata proto.InternalMessageInfo + +func (m *SequencerMetadata) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *SequencerMetadata) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func (m *SequencerMetadata) GetP2PSeeds() []string { + if m != nil { + return m.P2PSeeds + } + return nil +} + +func (m *SequencerMetadata) GetRpcs() []string { + if m != nil { + return m.Rpcs + } + return nil +} + +func (m *SequencerMetadata) GetEvmRpcs() []string { + if m != nil { + return m.EvmRpcs + } + return nil +} + +func (m *SequencerMetadata) GetRestApiUrls() []string { + if m != nil { + return m.RestApiUrls + } + return nil +} + +func (m *SequencerMetadata) GetExplorerUrl() string { + if m != nil { + return m.ExplorerUrl + } + return "" +} + +func (m *SequencerMetadata) GetGenesisUrls() []string { + if m != nil { + return m.GenesisUrls + } + return nil +} + +func (m *SequencerMetadata) GetContactDetails() *ContactDetails { + if m != nil { + return m.ContactDetails + } + return nil +} + +func (m *SequencerMetadata) GetExtraData() []byte { + if m != nil { + return m.ExtraData + } + return nil +} + +func (m *SequencerMetadata) GetSnapshots() []*SnapshotInfo { + if m != nil { + return m.Snapshots + } + return nil +} + +type ContactDetails struct { + // website URL + Website string `protobuf:"bytes,11,opt,name=website,proto3" json:"website,omitempty"` + // telegram link + Telegram string `protobuf:"bytes,1,opt,name=telegram,proto3" json:"telegram,omitempty"` + // twitter link + X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *ContactDetails) Reset() { *m = ContactDetails{} } +func (m *ContactDetails) String() string { return proto.CompactTextString(m) } +func (*ContactDetails) ProtoMessage() {} +func (*ContactDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{1} +} +func (m *ContactDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContactDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ContactDetails.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ContactDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContactDetails.Merge(m, src) +} +func (m *ContactDetails) XXX_Size() int { + return m.Size() +} +func (m *ContactDetails) XXX_DiscardUnknown() { + xxx_messageInfo_ContactDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_ContactDetails proto.InternalMessageInfo + +func (m *ContactDetails) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *ContactDetails) GetTelegram() string { + if m != nil { + return m.Telegram + } + return "" +} + +func (m *ContactDetails) GetX() string { + if m != nil { + return m.X + } + return "" +} + +type SnapshotInfo struct { + // the snapshot url + SnapshotUrl string `protobuf:"bytes,1,opt,name=snapshot_url,json=snapshotUrl,proto3" json:"snapshot_url,omitempty"` + // The snapshot height + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // sha-256 checksum value for the snapshot file + Checksum string `protobuf:"bytes,3,opt,name=checksum,proto3" json:"checksum,omitempty"` +} + +func (m *SnapshotInfo) Reset() { *m = SnapshotInfo{} } +func (m *SnapshotInfo) String() string { return proto.CompactTextString(m) } +func (*SnapshotInfo) ProtoMessage() {} +func (*SnapshotInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{2} +} +func (m *SnapshotInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotInfo.Merge(m, src) +} +func (m *SnapshotInfo) XXX_Size() int { + return m.Size() +} +func (m *SnapshotInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotInfo proto.InternalMessageInfo + +func (m *SnapshotInfo) GetSnapshotUrl() string { + if m != nil { + return m.SnapshotUrl + } + return "" +} + +func (m *SnapshotInfo) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *SnapshotInfo) GetChecksum() string { + if m != nil { + return m.Checksum + } + return "" +} + +func init() { + proto.RegisterType((*SequencerMetadata)(nil), "dymensionxyz.dymension.sequencer.SequencerMetadata") + proto.RegisterType((*ContactDetails)(nil), "dymensionxyz.dymension.sequencer.ContactDetails") + proto.RegisterType((*SnapshotInfo)(nil), "dymensionxyz.dymension.sequencer.SnapshotInfo") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/metadata.proto", fileDescriptor_6045a4988478e768) +} + +var fileDescriptor_6045a4988478e768 = []byte{ + // 539 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xad, 0xdb, 0x34, 0xb1, 0xc7, 0x69, 0xfa, 0x9e, 0x85, 0xd0, 0x50, 0x84, 0x31, 0x59, 0xa0, + 0x08, 0x09, 0x1b, 0x05, 0xf1, 0x01, 0x94, 0x4a, 0x50, 0x04, 0x12, 0x72, 0xe8, 0x02, 0x36, 0x96, + 0xe3, 0x5c, 0x1c, 0x2b, 0xb6, 0x67, 0x98, 0x3b, 0x29, 0x09, 0x5f, 0xc1, 0x82, 0x8f, 0x62, 0xd9, + 0x25, 0x62, 0x81, 0x50, 0xf2, 0x23, 0x68, 0xc6, 0x76, 0x9a, 0xb2, 0xc9, 0xca, 0x3e, 0xe7, 0xde, + 0x73, 0x66, 0xe6, 0xdc, 0x19, 0xf2, 0x4c, 0x2e, 0x39, 0x60, 0x30, 0x59, 0x16, 0x50, 0x62, 0xc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0x74, 0x2a, 0xb5, + 0x4b, 0x2b, 0xac, 0x91, 0x5a, 0x34, 0x99, 0x42, 0x32, 0xc3, 0x79, 0x41, 0x0f, 0xaa, 0x45, 0x1b, + 0x7c, 0x3a, 0xfe, 0xb1, 0x72, 0x8d, 0xab, 0x95, 0x6b, 0xfc, 0x59, 0xb9, 0xc6, 0xb7, 0xb5, 0xbb, + 0x77, 0xb5, 0x76, 0xf7, 0x7e, 0xae, 0xdd, 0xbd, 0x8f, 0xaf, 0xb6, 0xe2, 0xf8, 0xf7, 0x85, 0x65, + 0xa5, 0xac, 0x02, 0x09, 0xf8, 0x78, 0xe7, 0xf3, 0x1b, 0xb7, 0xf5, 0xf3, 0x79, 0xfa, 0x37, 0x00, + 0x00, 0xff, 0xff, 0xef, 0x23, 0x73, 0xc5, 0xaf, 0x03, 0x00, 0x00, +} + +func (m *SequencerMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SequencerMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SequencerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasPrice != nil { + { + size := m.GasPrice.Size() + i -= size + if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.Snapshots) > 0 { + for iNdEx := len(m.Snapshots) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Snapshots[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + } + if len(m.ExtraData) > 0 { + i -= len(m.ExtraData) + copy(dAtA[i:], m.ExtraData) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExtraData))) + i-- + dAtA[i] = 0x6a + } + if m.ContactDetails != nil { + { + size, err := m.ContactDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.GenesisUrls) > 0 { + for iNdEx := len(m.GenesisUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GenesisUrls[iNdEx]) + copy(dAtA[i:], m.GenesisUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.GenesisUrls[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(m.ExplorerUrl) > 0 { + i -= len(m.ExplorerUrl) + copy(dAtA[i:], m.ExplorerUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExplorerUrl))) + i-- + dAtA[i] = 0x52 + } + if len(m.RestApiUrls) > 0 { + for iNdEx := len(m.RestApiUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RestApiUrls[iNdEx]) + copy(dAtA[i:], m.RestApiUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.RestApiUrls[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.EvmRpcs) > 0 { + for iNdEx := len(m.EvmRpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EvmRpcs[iNdEx]) + copy(dAtA[i:], m.EvmRpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.EvmRpcs[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Rpcs) > 0 { + for iNdEx := len(m.Rpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Rpcs[iNdEx]) + copy(dAtA[i:], m.Rpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Rpcs[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.P2PSeeds) > 0 { + for iNdEx := len(m.P2PSeeds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.P2PSeeds[iNdEx]) + copy(dAtA[i:], m.P2PSeeds[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.P2PSeeds[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ContactDetails) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContactDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContactDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x5a + } + if len(m.X) > 0 { + i -= len(m.X) + copy(dAtA[i:], m.X) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.X))) + i-- + dAtA[i] = 0x12 + } + if len(m.Telegram) > 0 { + i -= len(m.Telegram) + copy(dAtA[i:], m.Telegram) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Telegram))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintMetadata(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.SnapshotUrl) > 0 { + i -= len(m.SnapshotUrl) + copy(dAtA[i:], m.SnapshotUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.SnapshotUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovMetadata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SequencerMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.P2PSeeds) > 0 { + for _, s := range m.P2PSeeds { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.Rpcs) > 0 { + for _, s := range m.Rpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.EvmRpcs) > 0 { + for _, s := range m.EvmRpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.RestApiUrls) > 0 { + for _, s := range m.RestApiUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + l = len(m.ExplorerUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.GenesisUrls) > 0 { + for _, s := range m.GenesisUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.ContactDetails != nil { + l = m.ContactDetails.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.ExtraData) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.Snapshots) > 0 { + for _, e := range m.Snapshots { + l = e.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.GasPrice != nil { + l = m.GasPrice.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *ContactDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Telegram) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.X) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *SnapshotInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SnapshotUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovMetadata(uint64(m.Height)) + } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func sovMetadata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMetadata(x uint64) (n int) { + return sovMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SequencerMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SequencerMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SequencerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field P2PSeeds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.P2PSeeds = append(m.P2PSeeds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rpcs = append(m.Rpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvmRpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvmRpcs = append(m.EvmRpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RestApiUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RestApiUrls = append(m.RestApiUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExplorerUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExplorerUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisUrls = append(m.GenesisUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContactDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContactDetails == nil { + m.ContactDetails = &ContactDetails{} + } + if err := m.ContactDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtraData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtraData = append(m.ExtraData[:0], dAtA[iNdEx:postIndex]...) + if m.ExtraData == nil { + m.ExtraData = []byte{} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Snapshots = append(m.Snapshots, &SnapshotInfo{}) + if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.GasPrice = &v + if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContactDetails) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContactDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContactDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Telegram", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Telegram = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.X = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SnapshotUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SnapshotUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMetadata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMetadata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetadata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetadata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetadata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go b/types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go new file mode 100644 index 000000000..e5fbe5cea --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/operating_status.pb.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/operating_status.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// OperatingStatus defines the operating status of a sequencer +type OperatingStatus int32 + +const ( + // OPERATING_STATUS_UNBONDED defines a sequencer that is not active and won't + // be scheduled + Unbonded OperatingStatus = 0 + // UNBONDING defines a sequencer that is currently unbonding. + Unbonding OperatingStatus = 1 + // OPERATING_STATUS_BONDED defines a sequencer that is bonded and can be + // scheduled + Bonded OperatingStatus = 2 +) + +var OperatingStatus_name = map[int32]string{ + 0: "OPERATING_STATUS_UNBONDED", + 1: "OPERATING_STATUS_UNBONDING", + 2: "OPERATING_STATUS_BONDED", +} + +var OperatingStatus_value = map[string]int32{ + "OPERATING_STATUS_UNBONDED": 0, + "OPERATING_STATUS_UNBONDING": 1, + "OPERATING_STATUS_BONDED": 2, +} + +func (x OperatingStatus) String() string { + return proto.EnumName(OperatingStatus_name, int32(x)) +} + +func (OperatingStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d854b24b5c08f0d1, []int{0} +} + +func init() { + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/operating_status.proto", fileDescriptor_d854b24b5c08f0d1) +} + +var fileDescriptor_d854b24b5c08f0d1 = []byte{ + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x2d, 0xa9, 0x2c, 0x48, + 0x2d, 0xd6, 0x4f, 0xa9, 0xcc, 0x4d, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xab, 0xa8, 0xac, 0x42, 0x70, + 0xf4, 0x8b, 0x53, 0x0b, 0x4b, 0x53, 0xf3, 0x92, 0x53, 0x8b, 0xf4, 0xf3, 0x0b, 0x52, 0x8b, 0x12, + 0x4b, 0x32, 0xf3, 0xd2, 0xe3, 0x8b, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, + 0xf2, 0x85, 0x14, 0x90, 0x35, 0xea, 0xc1, 0x39, 0x7a, 0x70, 0x8d, 0x52, 0x22, 0xe9, 0xf9, 0xe9, + 0xf9, 0x60, 0xc5, 0xfa, 0x20, 0x16, 0x44, 0x9f, 0xd6, 0x1c, 0x46, 0x2e, 0x7e, 0x7f, 0x98, 0x91, + 0xc1, 0x60, 0x13, 0x85, 0xb4, 0xb9, 0x24, 0xfd, 0x03, 0x5c, 0x83, 0x1c, 0x43, 0x3c, 0xfd, 0xdc, + 0xe3, 0x83, 0x43, 0x1c, 0x43, 0x42, 0x83, 0xe3, 0x43, 0xfd, 0x9c, 0xfc, 0xfd, 0x5c, 0x5c, 0x5d, + 0x04, 0x18, 0xa4, 0x78, 0xba, 0xe6, 0x2a, 0x70, 0x84, 0xe6, 0x25, 0xe5, 0xe7, 0xa5, 0xa4, 0xa6, + 0x08, 0xe9, 0x72, 0x49, 0xe1, 0x50, 0xec, 0xe9, 0xe7, 0x2e, 0xc0, 0x28, 0xc5, 0xdb, 0x35, 0x57, + 0x81, 0x13, 0xa2, 0x3a, 0x33, 0x2f, 0x5d, 0x48, 0x9d, 0x4b, 0x1c, 0x43, 0x39, 0xd4, 0x64, 0x26, + 0x29, 0xae, 0xae, 0xb9, 0x0a, 0x6c, 0x4e, 0x60, 0x73, 0xa5, 0x58, 0x3a, 0x16, 0xcb, 0x31, 0x38, + 0x25, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x47, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x46, 0xa0, 0x65, 0xe6, 0x95, 0xe8, 0x43, 0x82, 0xb3, + 0x20, 0x89, 0x60, 0x88, 0x26, 0xb1, 0x81, 0x43, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x10, + 0x0f, 0x7d, 0xbc, 0x82, 0x01, 0x00, 0x00, +} diff --git a/third_party/dymension/sequencer/types/params.go b/types/pb/dymensionxyz/dymension/sequencer/params.go similarity index 89% rename from third_party/dymension/sequencer/types/params.go rename to types/pb/dymensionxyz/dymension/sequencer/params.go index 2c89595f9..5bf8971f0 100644 --- a/third_party/dymension/sequencer/types/params.go +++ b/types/pb/dymensionxyz/dymension/sequencer/params.go @@ -1,4 +1,4 @@ -package types +package sequencer import ( "gopkg.in/yaml.v2" diff --git a/third_party/dymension/sequencer/types/params.pb.go b/types/pb/dymensionxyz/dymension/sequencer/params.pb.go similarity index 80% rename from third_party/dymension/sequencer/types/params.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/params.pb.go index 26ea35e1d..ba18d1b62 100644 --- a/third_party/dymension/sequencer/types/params.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/params.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/params.proto +// source: types/dymensionxyz/dymension/sequencer/params.proto -package types +package sequencer import ( fmt "fmt" @@ -9,8 +9,8 @@ import ( types "github.com/cosmos/cosmos-sdk/types" _ "github.com/gogo/protobuf/gogoproto" proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/durationpb" io "io" math "math" math_bits "math/bits" @@ -45,7 +45,7 @@ type Params struct { func (m *Params) Reset() { *m = Params{} } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_d06545e8924ecfea, []int{0} + return fileDescriptor_d60422971c962d58, []int{0} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -99,37 +99,39 @@ func init() { proto.RegisterType((*Params)(nil), "dymensionxyz.dymension.sequencer.Params") } -func init() { proto.RegisterFile("dymension/sequencer/params.proto", fileDescriptor_d06545e8924ecfea) } +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/params.proto", fileDescriptor_d60422971c962d58) +} -var fileDescriptor_d06545e8924ecfea = []byte{ - // 421 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0x3f, 0x8b, 0xd4, 0x40, - 0x18, 0xc6, 0x33, 0x9e, 0x9c, 0x6b, 0xf4, 0x2c, 0x82, 0xe0, 0xde, 0x16, 0x49, 0xd8, 0x42, 0xae, - 0xd0, 0x19, 0xce, 0x03, 0x8b, 0x2b, 0xe3, 0x15, 0x22, 0x08, 0x21, 0x5a, 0xd9, 0x84, 0xfc, 0x79, - 0xcd, 0x0d, 0x66, 0xe6, 0x8d, 0x99, 0xc9, 0x72, 0xf1, 0x2b, 0x08, 0x62, 0x79, 0xe5, 0x7d, 0x9c, - 0x2b, 0xaf, 0x14, 0x8b, 0x28, 0xbb, 0x8d, 0x58, 0xfa, 0x09, 0x24, 0x7f, 0x77, 0x1b, 0xc1, 0x2a, - 0x79, 0xe7, 0x79, 0x9e, 0x1f, 0x0f, 0x2f, 0xaf, 0xe9, 0xa6, 0xb5, 0x00, 0xa9, 0x38, 0x4a, 0xa6, - 0xe0, 0x63, 0x05, 0x32, 0x81, 0x92, 0x15, 0x51, 0x19, 0x09, 0x45, 0x8b, 0x12, 0x35, 0x5a, 0x5b, - 0xc7, 0x45, 0xfd, 0x89, 0x4e, 0x03, 0x9d, 0xec, 0x8b, 0x87, 0x19, 0x66, 0xd8, 0x99, 0x59, 0xfb, - 0xd7, 0xe7, 0x16, 0x76, 0x82, 0x4a, 0xa0, 0x62, 0x71, 0xa4, 0x80, 0xad, 0x8e, 0x63, 0xd0, 0xd1, - 0x31, 0x4b, 0x90, 0xcb, 0x51, 0xcf, 0x10, 0xb3, 0x1c, 0x58, 0x37, 0xc5, 0xd5, 0x7b, 0x96, 0x56, - 0x65, 0xa4, 0x5b, 0x72, 0xf7, 0xb2, 0xfc, 0xbc, 0x67, 0xee, 0xfb, 0x5d, 0x11, 0xcb, 0x37, 0x67, - 0x82, 0xcb, 0x30, 0x46, 0x99, 0xce, 0x89, 0x4b, 0x8e, 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 0xeb, 0xb5, 0x4d, - 0x6e, 0xd6, 0x36, 0xf9, 0xb9, 0xb6, 0xc9, 0xd7, 0x8d, 0x6d, 0xdc, 0x6c, 0x6c, 0xe3, 0xdb, 0xc6, - 0x36, 0xde, 0x3d, 0xdf, 0x29, 0xb2, 0x7b, 0x2a, 0xdb, 0x81, 0xad, 0x4e, 0xd8, 0xc5, 0xce, 0x79, - 0x75, 0xe5, 0xe2, 0xfd, 0x6e, 0x2f, 0x27, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x44, 0xa8, 0x10, - 0x6e, 0x82, 0x02, 0x00, 0x00, +var fileDescriptor_d60422971c962d58 = []byte{ + // 429 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x92, 0xc1, 0x6b, 0xd4, 0x40, + 0x14, 0xc6, 0x33, 0x56, 0xea, 0x1a, 0xad, 0x87, 0x20, 0xb8, 0xdd, 0x43, 0xb2, 0x2c, 0x22, 0x3d, + 0xe8, 0x0c, 0xb5, 0xb7, 0x1e, 0x63, 0x0f, 0x45, 0x10, 0x96, 0xd5, 0x93, 0x97, 0x90, 0x49, 0x9e, + 0xe9, 0xc3, 0xcc, 0xbc, 0x98, 0x99, 0x14, 0xe3, 0xbf, 0x20, 0x88, 0xc7, 0x1e, 0xfb, 0xe7, 0xf4, + 0xd8, 0xa3, 0x78, 0x58, 0x65, 0xf7, 0x22, 0x1e, 0xfd, 0x0b, 0x24, 0xc9, 0x26, 0x16, 0x41, 0xec, + 0x29, 0x79, 0xf9, 0xbe, 0xef, 0x97, 0x8f, 0x99, 0xe7, 0x1e, 0xd8, 0xba, 0x00, 0x23, 0xd2, 0x5a, + 0x81, 0x36, 0x48, 0xfa, 0x7d, 0xfd, 0xe1, 0xcf, 0x20, 0x0c, 0xbc, 0xab, 0x40, 0x27, 0x50, 0x8a, + 0x22, 0x2e, 0x63, 0x65, 0x78, 0x51, 0x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3c, 0x36, 0x27, + 0x91, 0xaa, 0x72, 0x8b, 0x45, 0x8e, 0x50, 0x8e, 0x6f, 0x4e, 0xd9, 0xde, 0xed, 0x70, 0xd1, 0x64, + 0xbf, 0x2e, 0x83, 0x47, 0x19, 0xda, 0x93, 0x4a, 0xf2, 0x84, 0x54, 0x7f, 0xd2, 0xdd, 0xe3, 0x89, + 0x49, 0xdf, 0x8a, 0xf6, 0x06, 0xf8, 0x11, 0x24, 0xbf, 0x96, 0xc1, 0xb4, 0x8e, 0x55, 0x7e, 0x38, + 0xfb, 0x27, 0x78, 0xb6, 0x78, 0xd0, 0x6b, 0x2f, 0x1b, 0xe9, 0xc5, 0xa0, 0x1c, 0x8e, 0xce, 0xce, + 0x03, 0xe7, 0xc7, 0x79, 0xc0, 0x42, 0x79, 0xb1, 0xf2, 0xd9, 0xe5, 0xca, 0x67, 0xdf, 0x57, 0x3e, + 0xfb, 0xbc, 0xf6, 0x9d, 0xcb, 0xb5, 0xef, 0x7c, 0x59, 0xfb, 0xce, 0xeb, 0xe3, 0x2b, 0x45, 0xfe, + 0xde, 0x2f, 0xd4, 0xb6, 0xab, 0x22, 0x0a, 0xf9, 0xdf, 0xe5, 0x93, 0xdb, 0xed, 0x49, 0x1d, 0xfc, + 0x0e, 0x00, 0x00, 0xff, 0xff, 0x95, 0x9a, 0x5a, 0x36, 0xad, 0x02, 0x00, 0x00, } func (this *Params) Equal(that interface{}) bool { diff --git a/third_party/dymension/sequencer/types/query.pb.go b/types/pb/dymensionxyz/dymension/sequencer/query.pb.go similarity index 81% rename from third_party/dymension/sequencer/types/query.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/query.pb.go index d104fe6a2..06f9fb50e 100644 --- a/third_party/dymension/sequencer/types/query.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/query.pb.go @@ -1,7 +1,7 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/query.proto +// source: types/dymensionxyz/dymension/sequencer/query.proto -package types +package sequencer import ( context "context" @@ -10,7 +10,6 @@ import ( _ "github.com/gogo/protobuf/gogoproto" grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - _ "google.golang.org/genproto/googleapis/api/annotations" grpc "google.golang.org/grpc" codes "google.golang.org/grpc/codes" status "google.golang.org/grpc/status" @@ -38,7 +37,7 @@ func (m *QueryParamsRequest) Reset() { *m = QueryParamsRequest{} } func (m *QueryParamsRequest) String() string { return proto.CompactTextString(m) } func (*QueryParamsRequest) ProtoMessage() {} func (*QueryParamsRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{0} + return fileDescriptor_1932d70e167e51a2, []int{0} } func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -77,7 +76,7 @@ func (m *QueryParamsResponse) Reset() { *m = QueryParamsResponse{} } func (m *QueryParamsResponse) String() string { return proto.CompactTextString(m) } func (*QueryParamsResponse) ProtoMessage() {} func (*QueryParamsResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{1} + return fileDescriptor_1932d70e167e51a2, []int{1} } func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -121,7 +120,7 @@ func (m *QueryGetSequencerRequest) Reset() { *m = QueryGetSequencerReque func (m *QueryGetSequencerRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencerRequest) ProtoMessage() {} func (*QueryGetSequencerRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{2} + return fileDescriptor_1932d70e167e51a2, []int{2} } func (m *QueryGetSequencerRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -165,7 +164,7 @@ func (m *QueryGetSequencerResponse) Reset() { *m = QueryGetSequencerResp func (m *QueryGetSequencerResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencerResponse) ProtoMessage() {} func (*QueryGetSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{3} + return fileDescriptor_1932d70e167e51a2, []int{3} } func (m *QueryGetSequencerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -209,7 +208,7 @@ func (m *QuerySequencersRequest) Reset() { *m = QuerySequencersRequest{} func (m *QuerySequencersRequest) String() string { return proto.CompactTextString(m) } func (*QuerySequencersRequest) ProtoMessage() {} func (*QuerySequencersRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{4} + return fileDescriptor_1932d70e167e51a2, []int{4} } func (m *QuerySequencersRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -254,7 +253,7 @@ func (m *QuerySequencersResponse) Reset() { *m = QuerySequencersResponse func (m *QuerySequencersResponse) String() string { return proto.CompactTextString(m) } func (*QuerySequencersResponse) ProtoMessage() {} func (*QuerySequencersResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{5} + return fileDescriptor_1932d70e167e51a2, []int{5} } func (m *QuerySequencersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -305,7 +304,7 @@ func (m *QueryGetSequencersByRollappRequest) Reset() { *m = QueryGetSequ func (m *QueryGetSequencersByRollappRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencersByRollappRequest) ProtoMessage() {} func (*QueryGetSequencersByRollappRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{6} + return fileDescriptor_1932d70e167e51a2, []int{6} } func (m *QueryGetSequencersByRollappRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -349,7 +348,7 @@ func (m *QueryGetSequencersByRollappResponse) Reset() { *m = QueryGetSeq func (m *QueryGetSequencersByRollappResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetSequencersByRollappResponse) ProtoMessage() {} func (*QueryGetSequencersByRollappResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{7} + return fileDescriptor_1932d70e167e51a2, []int{7} } func (m *QueryGetSequencersByRollappResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -398,7 +397,7 @@ func (m *QueryGetSequencersByRollappByStatusRequest) String() string { } func (*QueryGetSequencersByRollappByStatusRequest) ProtoMessage() {} func (*QueryGetSequencersByRollappByStatusRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{8} + return fileDescriptor_1932d70e167e51a2, []int{8} } func (m *QueryGetSequencersByRollappByStatusRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -453,7 +452,7 @@ func (m *QueryGetSequencersByRollappByStatusResponse) String() string { } func (*QueryGetSequencersByRollappByStatusResponse) ProtoMessage() {} func (*QueryGetSequencersByRollappByStatusResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{9} + return fileDescriptor_1932d70e167e51a2, []int{9} } func (m *QueryGetSequencersByRollappByStatusResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -498,7 +497,7 @@ func (m *QueryGetProposerByRollappRequest) Reset() { *m = QueryGetPropos func (m *QueryGetProposerByRollappRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetProposerByRollappRequest) ProtoMessage() {} func (*QueryGetProposerByRollappRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{10} + return fileDescriptor_1932d70e167e51a2, []int{10} } func (m *QueryGetProposerByRollappRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +542,7 @@ func (m *QueryGetProposerByRollappResponse) Reset() { *m = QueryGetPropo func (m *QueryGetProposerByRollappResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetProposerByRollappResponse) ProtoMessage() {} func (*QueryGetProposerByRollappResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{11} + return fileDescriptor_1932d70e167e51a2, []int{11} } func (m *QueryGetProposerByRollappResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -588,7 +587,7 @@ func (m *QueryGetNextProposerByRollappRequest) Reset() { *m = QueryGetNe func (m *QueryGetNextProposerByRollappRequest) String() string { return proto.CompactTextString(m) } func (*QueryGetNextProposerByRollappRequest) ProtoMessage() {} func (*QueryGetNextProposerByRollappRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{12} + return fileDescriptor_1932d70e167e51a2, []int{12} } func (m *QueryGetNextProposerByRollappRequest) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -626,15 +625,18 @@ func (m *QueryGetNextProposerByRollappRequest) GetRollappId() string { // Response type for the GetNextProposerByRollapp RPC method. type QueryGetNextProposerByRollappResponse struct { - NextProposerAddr string `protobuf:"bytes,1,opt,name=nextProposerAddr,proto3" json:"nextProposerAddr,omitempty"` - RotationInProgress bool `protobuf:"varint,2,opt,name=rotationInProgress,proto3" json:"rotationInProgress,omitempty"` + // nextProposerAddr is the address of the next proposer. + // can be empty if no sequencer is available to be the next proposer. + NextProposerAddr string `protobuf:"bytes,1,opt,name=nextProposerAddr,proto3" json:"nextProposerAddr,omitempty"` + // rotationInProgress is true if the proposer rotation is in progress. + RotationInProgress bool `protobuf:"varint,2,opt,name=rotationInProgress,proto3" json:"rotationInProgress,omitempty"` } func (m *QueryGetNextProposerByRollappResponse) Reset() { *m = QueryGetNextProposerByRollappResponse{} } func (m *QueryGetNextProposerByRollappResponse) String() string { return proto.CompactTextString(m) } func (*QueryGetNextProposerByRollappResponse) ProtoMessage() {} func (*QueryGetNextProposerByRollappResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_d09222b66a78a447, []int{13} + return fileDescriptor_1932d70e167e51a2, []int{13} } func (m *QueryGetNextProposerByRollappResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -677,6 +679,104 @@ func (m *QueryGetNextProposerByRollappResponse) GetRotationInProgress() bool { return false } +// Request type for the Proposers RPC method. +type QueryProposersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposersRequest) Reset() { *m = QueryProposersRequest{} } +func (m *QueryProposersRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposersRequest) ProtoMessage() {} +func (*QueryProposersRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_1932d70e167e51a2, []int{14} +} +func (m *QueryProposersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposersRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposersRequest.Merge(m, src) +} +func (m *QueryProposersRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposersRequest proto.InternalMessageInfo + +func (m *QueryProposersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +// Response type for the Proposers RPC method. +type QueryProposersResponse struct { + Proposers []Sequencer `protobuf:"bytes,1,rep,name=proposers,proto3" json:"proposers"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryProposersResponse) Reset() { *m = QueryProposersResponse{} } +func (m *QueryProposersResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposersResponse) ProtoMessage() {} +func (*QueryProposersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_1932d70e167e51a2, []int{15} +} +func (m *QueryProposersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposersResponse.Merge(m, src) +} +func (m *QueryProposersResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposersResponse proto.InternalMessageInfo + +func (m *QueryProposersResponse) GetProposers() []Sequencer { + if m != nil { + return m.Proposers + } + return nil +} + +func (m *QueryProposersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + func init() { proto.RegisterType((*QueryParamsRequest)(nil), "dymensionxyz.dymension.sequencer.QueryParamsRequest") proto.RegisterType((*QueryParamsResponse)(nil), "dymensionxyz.dymension.sequencer.QueryParamsResponse") @@ -692,65 +792,65 @@ func init() { proto.RegisterType((*QueryGetProposerByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetProposerByRollappResponse") proto.RegisterType((*QueryGetNextProposerByRollappRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetNextProposerByRollappRequest") proto.RegisterType((*QueryGetNextProposerByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetNextProposerByRollappResponse") + proto.RegisterType((*QueryProposersRequest)(nil), "dymensionxyz.dymension.sequencer.QueryProposersRequest") + proto.RegisterType((*QueryProposersResponse)(nil), "dymensionxyz.dymension.sequencer.QueryProposersResponse") } -func init() { proto.RegisterFile("dymension/sequencer/query.proto", fileDescriptor_d09222b66a78a447) } - -var fileDescriptor_d09222b66a78a447 = []byte{ - // 842 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x56, 0xdd, 0x4e, 0x13, 0x5b, - 0x14, 0xee, 0x70, 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 0xd1, 0x28, - 0xd9, 0x39, 0xc3, 0x76, 0x77, 0x85, 0x98, 0xea, 0x1b, 0x87, 0xab, 0x5d, 0x66, 0x6a, 0x1f, 0xa2, - 0x85, 0x60, 0xb5, 0xf6, 0xe5, 0x91, 0xf5, 0x93, 0x9c, 0x48, 0x1f, 0x9f, 0x46, 0x85, 0x93, 0xd3, - 0xa8, 0xf0, 0xfd, 0x34, 0x2a, 0x1c, 0x9e, 0x45, 0x43, 0x27, 0x67, 0xd1, 0xd0, 0x97, 0xb3, 0x68, - 0xe8, 0xd9, 0x9c, 0x56, 0xb0, 0x5e, 0x96, 0x73, 0xf2, 0x0e, 0x29, 0xb5, 0x2a, 0xb0, 0x37, 0xab, - 0x54, 0xea, 0xaa, 0x58, 0x55, 0x03, 0xd3, 0x5c, 0x98, 0xfd, 0xc7, 0x9f, 0xfd, 0x1d, 0x00, 0x00, - 0xff, 0xff, 0x0f, 0xf5, 0x03, 0x5e, 0xfb, 0x0c, 0x00, 0x00, +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/query.proto", fileDescriptor_1932d70e167e51a2) +} + +var fileDescriptor_1932d70e167e51a2 = []byte{ + // 780 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x96, 0xcb, 0x6e, 0xd3, 0x4c, + 0x18, 0x86, 0x33, 0xff, 0x21, 0xfa, 0xf3, 0xfd, 0x08, 0x55, 0xd3, 0x02, 0xc5, 0xa0, 0x50, 0x86, + 0x53, 0xd5, 0x4a, 0x36, 0x4d, 0x39, 0x14, 0x10, 0x12, 0x84, 0x92, 0x50, 0x09, 0x68, 0x9a, 0xee, + 0x90, 0x50, 0x71, 0x9a, 0x91, 0x89, 0xd4, 0x78, 0x5c, 0x8f, 0x03, 0x0d, 0xab, 0x4a, 0x95, 0x58, + 0xb3, 0xe1, 0x02, 0x90, 0xd8, 0xb2, 0x41, 0x62, 0xc7,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c, 0x24, 0xb3, 0x2d, 0x86, 0x27, 0x53, 0xd6, 0x91, 0x06, 0x64, + 0x13, 0xc1, 0x74, 0x2a, 0xae, 0xe3, 0x6b, 0xcd, 0x03, 0x98, 0x08, 0x09, 0x2a, 0x2e, 0x73, 0x18, + 0xa7, 0xee, 0x21, 0x5f, 0x6b, 0x19, 0x2e, 0xf6, 0x71, 0x90, 0xe4, 0x04, 0x4e, 0x38, 0xf2, 0xa1, + 0x7f, 0xb4, 0xa5, 0x4b, 0xd7, 0x18, 0x99, 0x87, 0xcb, 0xa1, 0xd1, 0x73, 0xba, 0x31, 0x28, 0xce, + 0x16, 0x82, 0x2b, 0x09, 0x36, 0x92, 0x69, 0x0a, 0x46, 0xec, 0x8e, 0x09, 0x1d, 0x5c, 0xb1, 0x71, + 0xac, 0x03, 0x76, 0x99, 0x17, 0x9c, 0x85, 0x05, 0xbb, 0xe2, 0x32, 0x2b, 0x48, 0x2d, 0x7f, 0x03, + 0xfc, 0x57, 0xed, 0xf1, 0x84, 0xac, 0xc0, 0x29, 0x11, 0xaf, 0xd2, 0xe4, 0xc8, 0x83, 0xe4, 0x2b, + 0x92, 0x59, 0xd5, 0x51, 0x21, 0x8a, 0xc5, 0xb0, 0xaf, 0x43, 0x6c, 0x92, 0xc8, 0xe3, 0xc8, 0x52, + 0xa4, 0xf0, 0x23, 0x07, 0xff, 0x06, 0xd0, 0xf8, 0x2d, 0x64, 0xc5, 0xbd, 0x81, 0x6f, 0x24, 0xa3, + 0xc5, 0xaf, 0x2f, 0xed, 0xe6, 0x21, 0x55, 0x02, 0x86, 0x64, 0xf0, 0x7b, 0x04, 0x39, 0xb5, 0x54, + 0x7c, 0x37, 0xa5, 0x4d, 0x8f, 0x6b, 0x4c, 0xbb, 0x37, 0x90, 0x56, 0x81, 0x6c, 0x21, 0x80, 0xe8, + 0xcc, 0xe3, 0xb9, 0x94, 0x6e, 0xb1, 0xab, 0x49, 0xbb, 0x33, 0x80, 0x52, 0x51, 0x7c, 0x46, 0x30, + 0xda, 0x23, 0x79, 0xf0, 0xfc, 0x00, 0x8b, 0x8b, 0xdd, 0x07, 0xda, 0xe3, 0x21, 0x5d, 0x14, 0xe6, + 0x77, 0x04, 0xe7, 0xfa, 0x04, 0x24, 0x7e, 0x3a, 0x54, 0xa1, 0x7d, 0xf9, 0xaf, 0x3d, 0x3b, 0x22, + 0x37, 0x85, 0xff, 0x09, 0xc1, 0x58, 0xaf, 0x78, 0xc4, 0xc5, 0xf4, 0x95, 0x0e, 0x8a, 0x43, 0xed, + 0xd1, 0x50, 0x1e, 0x8a, 0xf1, 0x0b, 0x82, 0xf1, 0x83, 0x22, 0x13, 0x97, 0xd2, 0xd7, 0xe8, 0x17, + 0xdd, 0x5a, 0x79, 0x68, 0x1f, 0xc5, 0xbb, 0x89, 0x20, 0xa7, 0xb2, 0x0f, 0xdf, 0x4e, 0x9b, 0x07, + 0xfb, 0xf2, 0x58, 0x9b, 0x3b, 0xbc, 0x30, 0x44, 0x28, 0xd6, 0xb6, 0x77, 0xf3, 0x68, 0x67, 0x37, + 0x8f, 0x7e, 0xef, 0xe6, 0xd1, 0x87, 0xbd, 0x7c, 0x66, 0x67, 0x2f, 0x9f, 0xf9, 0xb9, 0x97, 0xcf, + 0xbc, 0x78, 0x62, 0x35, 0xbc, 0xd7, 0xad, 0x9a, 0xbe, 0xca, 0x9a, 0xb1, 0xef, 0xf6, 0x86, 0xed, + 0x19, 0xe2, 0x8b, 0xde, 0xa9, 0x25, 0x7e, 0xd4, 0xd7, 0xb2, 0xc1, 0x47, 0xfc, 0xec, 0x9f, 0x00, + 0x00, 0x00, 0xff, 0xff, 0xfa, 0x5a, 0x35, 0x3a, 0x10, 0x0d, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -779,6 +879,8 @@ type QueryClient interface { GetProposerByRollapp(ctx context.Context, in *QueryGetProposerByRollappRequest, opts ...grpc.CallOption) (*QueryGetProposerByRollappResponse, error) // Queries the next proposer by rollappId. GetNextProposerByRollapp(ctx context.Context, in *QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption) (*QueryGetNextProposerByRollappResponse, error) + // Queries a list of proposers. + Proposers(ctx context.Context, in *QueryProposersRequest, opts ...grpc.CallOption) (*QueryProposersResponse, error) } type queryClient struct { @@ -852,6 +954,15 @@ func (c *queryClient) GetNextProposerByRollapp(ctx context.Context, in *QueryGet return out, nil } +func (c *queryClient) Proposers(ctx context.Context, in *QueryProposersRequest, opts ...grpc.CallOption) (*QueryProposersResponse, error) { + out := new(QueryProposersResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/Proposers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Parameters queries the parameters of the module. @@ -868,6 +979,8 @@ type QueryServer interface { GetProposerByRollapp(context.Context, *QueryGetProposerByRollappRequest) (*QueryGetProposerByRollappResponse, error) // Queries the next proposer by rollappId. GetNextProposerByRollapp(context.Context, *QueryGetNextProposerByRollappRequest) (*QueryGetNextProposerByRollappResponse, error) + // Queries a list of proposers. + Proposers(context.Context, *QueryProposersRequest) (*QueryProposersResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -895,6 +1008,9 @@ func (*UnimplementedQueryServer) GetProposerByRollapp(ctx context.Context, req * func (*UnimplementedQueryServer) GetNextProposerByRollapp(ctx context.Context, req *QueryGetNextProposerByRollappRequest) (*QueryGetNextProposerByRollappResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method GetNextProposerByRollapp not implemented") } +func (*UnimplementedQueryServer) Proposers(ctx context.Context, req *QueryProposersRequest) (*QueryProposersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Proposers not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1026,6 +1142,24 @@ func _Query_GetNextProposerByRollapp_Handler(srv interface{}, ctx context.Contex return interceptor(ctx, in, info, handler) } +func _Query_Proposers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Proposers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/Proposers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Proposers(ctx, req.(*QueryProposersRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "dymensionxyz.dymension.sequencer.Query", HandlerType: (*QueryServer)(nil), @@ -1058,9 +1192,13 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "GetNextProposerByRollapp", Handler: _Query_GetNextProposerByRollapp_Handler, }, + { + MethodName: "Proposers", + Handler: _Query_Proposers_Handler, + }, }, Streams: []grpc.StreamDesc{}, - Metadata: "dymension/sequencer/query.proto", + Metadata: "types/dymensionxyz/dymension/sequencer/query.proto", } func (m *QueryParamsRequest) Marshal() (dAtA []byte, err error) { @@ -1535,6 +1673,90 @@ func (m *QueryGetNextProposerByRollappResponse) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } +func (m *QueryProposersRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposersRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryProposersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Pagination != nil { + { + size, err := m.Pagination.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Proposers) > 0 { + for iNdEx := len(m.Proposers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Proposers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -1736,6 +1958,38 @@ func (m *QueryGetNextProposerByRollappResponse) Size() (n int) { return n } +func (m *QueryProposersRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryProposersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Proposers) > 0 { + for _, e := range m.Proposers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + if m.Pagination != nil { + l = m.Pagination.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -2945,6 +3199,212 @@ func (m *QueryGetNextProposerByRollappResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryProposersRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposersRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageRequest{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposers = append(m.Proposers, Sequencer{}) + if err := m.Proposers[len(m.Proposers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Pagination", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Pagination == nil { + m.Pagination = &query.PageResponse{} + } + if err := m.Pagination.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go b/types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go new file mode 100644 index 000000000..c8e662fba --- /dev/null +++ b/types/pb/dymensionxyz/dymension/sequencer/sequencer.pb.go @@ -0,0 +1,1241 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/sequencer.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Sequencer defines a sequencer identified by its' address (sequencerAddress). +// The sequencer could be attached to only one rollapp (rollappId). +type Sequencer struct { + // address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + DymintPubKey *types.Any `protobuf:"bytes,2,opt,name=dymintPubKey,proto3" json:"dymintPubKey,omitempty"` + // rollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,3,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // metadata defines the extra information for the sequencer. + Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` + // jailed defined whether the sequencer has been jailed from bonded status or not. + Jailed bool `protobuf:"varint,5,opt,name=jailed,proto3" json:"jailed,omitempty"` + Proposer bool `protobuf:"varint,6,opt,name=proposer,proto3" json:"proposer,omitempty"` // Deprecated: Do not use. + // status is the sequencer status (bonded/unbonding/unbonded). + Status OperatingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=dymensionxyz.dymension.sequencer.OperatingStatus" json:"status,omitempty"` + // tokens define the delegated tokens (incl. self-delegation). + Tokens github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=tokens,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"tokens"` + // unbond_request_height stores the height at which this sequencer has + // requested to unbond. + UnbondRequestHeight int64 `protobuf:"varint,9,opt,name=unbond_request_height,json=unbondRequestHeight,proto3" json:"unbond_request_height,omitempty"` + // unbond_time defines the time when the sequencer will complete unbonding. + UnbondTime time.Time `protobuf:"bytes,10,opt,name=unbond_time,json=unbondTime,proto3,stdtime" json:"unbond_time"` + // notice_period_time defines the time when the sequencer will finish it's notice period if started + NoticePeriodTime time.Time `protobuf:"bytes,11,opt,name=notice_period_time,json=noticePeriodTime,proto3,stdtime" json:"notice_period_time"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,12,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,13,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *Sequencer) Reset() { *m = Sequencer{} } +func (m *Sequencer) String() string { return proto.CompactTextString(m) } +func (*Sequencer) ProtoMessage() {} +func (*Sequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{0} +} +func (m *Sequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Sequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sequencer.Merge(m, src) +} +func (m *Sequencer) XXX_Size() int { + return m.Size() +} +func (m *Sequencer) XXX_DiscardUnknown() { + xxx_messageInfo_Sequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_Sequencer proto.InternalMessageInfo + +func (m *Sequencer) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Sequencer) GetDymintPubKey() *types.Any { + if m != nil { + return m.DymintPubKey + } + return nil +} + +func (m *Sequencer) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *Sequencer) GetMetadata() SequencerMetadata { + if m != nil { + return m.Metadata + } + return SequencerMetadata{} +} + +func (m *Sequencer) GetJailed() bool { + if m != nil { + return m.Jailed + } + return false +} + +// Deprecated: Do not use. +func (m *Sequencer) GetProposer() bool { + if m != nil { + return m.Proposer + } + return false +} + +func (m *Sequencer) GetStatus() OperatingStatus { + if m != nil { + return m.Status + } + return Unbonded +} + +func (m *Sequencer) GetTokens() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *Sequencer) GetUnbondRequestHeight() int64 { + if m != nil { + return m.UnbondRequestHeight + } + return 0 +} + +func (m *Sequencer) GetUnbondTime() time.Time { + if m != nil { + return m.UnbondTime + } + return time.Time{} +} + +func (m *Sequencer) GetNoticePeriodTime() time.Time { + if m != nil { + return m.NoticePeriodTime + } + return time.Time{} +} + +func (m *Sequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *Sequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount +type BondReduction struct { + // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + // decrease_bond_amount is the amount of tokens to be unbonded. + DecreaseBondAmount types1.Coin `protobuf:"bytes,2,opt,name=decrease_bond_amount,json=decreaseBondAmount,proto3" json:"decrease_bond_amount"` + // decrease_bond_time defines, if unbonding, the min time for the sequencer to complete unbonding. + DecreaseBondTime time.Time `protobuf:"bytes,3,opt,name=decrease_bond_time,json=decreaseBondTime,proto3,stdtime" json:"decrease_bond_time"` +} + +func (m *BondReduction) Reset() { *m = BondReduction{} } +func (m *BondReduction) String() string { return proto.CompactTextString(m) } +func (*BondReduction) ProtoMessage() {} +func (*BondReduction) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{1} +} +func (m *BondReduction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BondReduction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BondReduction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BondReduction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondReduction.Merge(m, src) +} +func (m *BondReduction) XXX_Size() int { + return m.Size() +} +func (m *BondReduction) XXX_DiscardUnknown() { + xxx_messageInfo_BondReduction.DiscardUnknown(m) +} + +var xxx_messageInfo_BondReduction proto.InternalMessageInfo + +func (m *BondReduction) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *BondReduction) GetDecreaseBondAmount() types1.Coin { + if m != nil { + return m.DecreaseBondAmount + } + return types1.Coin{} +} + +func (m *BondReduction) GetDecreaseBondTime() time.Time { + if m != nil { + return m.DecreaseBondTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*Sequencer)(nil), "dymensionxyz.dymension.sequencer.Sequencer") + proto.RegisterType((*BondReduction)(nil), "dymensionxyz.dymension.sequencer.BondReduction") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/sequencer.proto", fileDescriptor_0c9d1421effe42e1) +} + +var fileDescriptor_0c9d1421effe42e1 = []byte{ + // 706 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x4f, 0xdb, 0x48, + 0x18, 0x8d, 0x09, 0x84, 0x64, 0x02, 0x2b, 0x76, 0xc8, 0xae, 0x0c, 0xda, 0x4d, 0x2c, 0xb4, 0x07, + 0x4b, 0x2b, 0xec, 0x26, 0xa8, 0xbd, 0xf5, 0x90, 0x54, 0x95, 0x40, 0x55, 0x55, 0x6a, 0xda, 0x4b, + 0x2f, 0xd6, 0xd8, 0x9e, 0x3a, 0x2e, 0xf1, 0x8c, 0x3b, 0x33, 0x86, 0xba, 0xbf, 0x82, 0xdf, 0xd1, + 0x73, 0x7f, 0x04, 0xea, 0x89, 0x63, 0x4f, 0xa5, 0x22, 0xbf, 0xa2, 0xb7, 0xca, 0x33, 0xe3, 0x90, + 0x50, 0xa9, 0xc0, 0xc9, 0xfe, 0xe6, 0x7d, 0xef, 0xf9, 0x9b, 0x37, 0x6f, 0x0c, 0x1e, 0x89, 0x22, + 0xc3, 0xdc, 0x8d, 0x8a, 0x14, 0x13, 0x9e, 0x50, 0xf2, 0xa1, 0xf8, 0x78, 0x5d, 0xb8, 0x1c, 0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a6, 0xdd, 0xda, 0xc5, 0xb4, 0x5b, 0xfb, 0x3a, 0xed, 0xd6, 0xde, + 0xec, 0xcf, 0x85, 0xea, 0xe6, 0xff, 0x23, 0x21, 0x42, 0xc5, 0xca, 0xcd, 0x82, 0x5b, 0x7f, 0x2e, + 0x41, 0x43, 0xce, 0xb4, 0xf7, 0x33, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xd8, 0xa4, 0x12, 0xd0, 0x05, + 0x00, 0x00, +} + +func (m *Sequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x62 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.NoticePeriodTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintSequencer(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x5a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UnbondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintSequencer(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x52 + if m.UnbondRequestHeight != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.UnbondRequestHeight)) + i-- + dAtA[i] = 0x48 + } + if len(m.Tokens) > 0 { + for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Status != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x38 + } + if m.Proposer { + i-- + if m.Proposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x1a + } + if m.DymintPubKey != nil { + { + size, err := m.DymintPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BondReduction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BondReduction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BondReduction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DecreaseBondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintSequencer(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x1a + { + size, err := m.DecreaseBondAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSequencer(dAtA []byte, offset int, v uint64) int { + offset -= sovSequencer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Sequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if m.DymintPubKey != nil { + l = m.DymintPubKey.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovSequencer(uint64(l)) + if m.Jailed { + n += 2 + } + if m.Proposer { + n += 2 + } + if m.Status != 0 { + n += 1 + sovSequencer(uint64(m.Status)) + } + if len(m.Tokens) > 0 { + for _, e := range m.Tokens { + l = e.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + } + if m.UnbondRequestHeight != 0 { + n += 1 + sovSequencer(uint64(m.UnbondRequestHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime) + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime) + n += 1 + l + sovSequencer(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovSequencer(uint64(l)) + } + } + return n +} + +func (m *BondReduction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.DecreaseBondAmount.Size() + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime) + n += 1 + l + sovSequencer(uint64(l)) + return n +} + +func sovSequencer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSequencer(x uint64) (n int) { + return sovSequencer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Sequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DymintPubKey == nil { + m.DymintPubKey = &types.Any{} + } + if err := m.DymintPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposer = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= OperatingStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = append(m.Tokens, types1.Coin{}) + if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondRequestHeight", wireType) + } + m.UnbondRequestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondRequestHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UnbondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoticePeriodTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.NoticePeriodTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BondReduction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BondReduction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BondReduction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DecreaseBondAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.DecreaseBondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSequencer(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSequencer + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSequencer + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSequencer + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSequencer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSequencer = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSequencer = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/sequencer/types/tx.pb.go b/types/pb/dymensionxyz/dymension/sequencer/tx.pb.go similarity index 61% rename from third_party/dymension/sequencer/types/tx.pb.go rename to types/pb/dymensionxyz/dymension/sequencer/tx.pb.go index 599478313..a59aef007 100644 --- a/third_party/dymension/sequencer/types/tx.pb.go +++ b/types/pb/dymensionxyz/dymension/sequencer/tx.pb.go @@ -1,23 +1,18 @@ // Code generated by protoc-gen-gogo. DO NOT EDIT. -// source: dymension/sequencer/tx.proto +// source: types/dymensionxyz/dymension/sequencer/tx.proto -package types +package sequencer import ( - context "context" fmt "fmt" _ "github.com/cosmos/cosmos-proto" - types "github.com/cosmos/cosmos-sdk/codec/types" types1 "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/msgservice" _ "github.com/gogo/protobuf/gogoproto" - grpc1 "github.com/gogo/protobuf/grpc" proto "github.com/gogo/protobuf/proto" - _ "github.com/gogo/protobuf/types" github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" - grpc "google.golang.org/grpc" - codes "google.golang.org/grpc/codes" - status "google.golang.org/grpc/status" + types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" io "io" math "math" math_bits "math/bits" @@ -36,6 +31,102 @@ var _ = time.Kitchen // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package +// MsgUpdateParams is the Msg/UpdateParams request type. +// Since: cosmos-sdk 0.47 +type MsgUpdateParams struct { + // authority is the address that controls the module (defaults to x/gov unless overwritten). + Authority string `protobuf:"bytes,1,opt,name=authority,proto3" json:"authority,omitempty"` + // NOTE: All parameters must be supplied. + Params Params `protobuf:"bytes,2,opt,name=params,proto3" json:"params"` +} + +func (m *MsgUpdateParams) Reset() { *m = MsgUpdateParams{} } +func (m *MsgUpdateParams) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParams) ProtoMessage() {} +func (*MsgUpdateParams) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{0} +} +func (m *MsgUpdateParams) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParams) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParams.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParams) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParams.Merge(m, src) +} +func (m *MsgUpdateParams) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParams) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParams.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParams proto.InternalMessageInfo + +func (m *MsgUpdateParams) GetAuthority() string { + if m != nil { + return m.Authority + } + return "" +} + +func (m *MsgUpdateParams) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +// MsgUpdateParamsResponse defines the response structure for executing a +// MsgUpdateParams message. +// +// Since: cosmos-sdk 0.47 +type MsgUpdateParamsResponse struct { +} + +func (m *MsgUpdateParamsResponse) Reset() { *m = MsgUpdateParamsResponse{} } +func (m *MsgUpdateParamsResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateParamsResponse) ProtoMessage() {} +func (*MsgUpdateParamsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{1} +} +func (m *MsgUpdateParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateParamsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateParamsResponse.Merge(m, src) +} +func (m *MsgUpdateParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateParamsResponse proto.InternalMessageInfo + type MsgCreateSequencer struct { // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` @@ -47,13 +138,18 @@ type MsgCreateSequencer struct { Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` // entry bond for the sequencer. Bond types1.Coin `protobuf:"bytes,5,opt,name=bond,proto3" json:"bond"` + // RewardAddr is the bech32-encoded sequencer's reward address. Empty is valid. + // If empty, the creator address is used. + RewardAddr string `protobuf:"bytes,6,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,7,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` } func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } func (*MsgCreateSequencer) ProtoMessage() {} func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{0} + return fileDescriptor_a5e88906d3ab6fe1, []int{2} } func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -117,6 +213,20 @@ func (m *MsgCreateSequencer) GetBond() types1.Coin { return types1.Coin{} } +func (m *MsgCreateSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *MsgCreateSequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + type MsgCreateSequencerResponse struct { } @@ -124,7 +234,7 @@ func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerRe func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } func (*MsgCreateSequencerResponse) ProtoMessage() {} func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{1} + return fileDescriptor_a5e88906d3ab6fe1, []int{3} } func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -156,17 +266,15 @@ var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo type MsgUpdateSequencerInformation struct { // creator is the bech32-encoded address of the sequencer account which is the account that the message was sent from. Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` - // rollapp_id defines the rollapp to which the sequencer belongs. - RollappId string `protobuf:"bytes,2,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` // metadata defines the extra information for the sequencer. - Metadata SequencerMetadata `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata"` + Metadata SequencerMetadata `protobuf:"bytes,2,opt,name=metadata,proto3" json:"metadata"` } func (m *MsgUpdateSequencerInformation) Reset() { *m = MsgUpdateSequencerInformation{} } func (m *MsgUpdateSequencerInformation) String() string { return proto.CompactTextString(m) } func (*MsgUpdateSequencerInformation) ProtoMessage() {} func (*MsgUpdateSequencerInformation) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{2} + return fileDescriptor_a5e88906d3ab6fe1, []int{4} } func (m *MsgUpdateSequencerInformation) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -202,13 +310,6 @@ func (m *MsgUpdateSequencerInformation) GetCreator() string { return "" } -func (m *MsgUpdateSequencerInformation) GetRollappId() string { - if m != nil { - return m.RollappId - } - return "" -} - func (m *MsgUpdateSequencerInformation) GetMetadata() SequencerMetadata { if m != nil { return m.Metadata @@ -223,7 +324,7 @@ func (m *MsgUpdateSequencerInformationResponse) Reset() { *m = MsgUpdate func (m *MsgUpdateSequencerInformationResponse) String() string { return proto.CompactTextString(m) } func (*MsgUpdateSequencerInformationResponse) ProtoMessage() {} func (*MsgUpdateSequencerInformationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{3} + return fileDescriptor_a5e88906d3ab6fe1, []int{5} } func (m *MsgUpdateSequencerInformationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -252,6 +353,186 @@ func (m *MsgUpdateSequencerInformationResponse) XXX_DiscardUnknown() { var xxx_messageInfo_MsgUpdateSequencerInformationResponse proto.InternalMessageInfo +type MsgUpdateRewardAddress struct { + // Creator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *MsgUpdateRewardAddress) Reset() { *m = MsgUpdateRewardAddress{} } +func (m *MsgUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddress) ProtoMessage() {} +func (*MsgUpdateRewardAddress) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{6} +} +func (m *MsgUpdateRewardAddress) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRewardAddress.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddress.Merge(m, src) +} +func (m *MsgUpdateRewardAddress) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddress.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRewardAddress proto.InternalMessageInfo + +func (m *MsgUpdateRewardAddress) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateRewardAddress) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type MsgUpdateRewardAddressResponse struct { +} + +func (m *MsgUpdateRewardAddressResponse) Reset() { *m = MsgUpdateRewardAddressResponse{} } +func (m *MsgUpdateRewardAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddressResponse) ProtoMessage() {} +func (*MsgUpdateRewardAddressResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{7} +} +func (m *MsgUpdateRewardAddressResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRewardAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRewardAddressResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateRewardAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddressResponse.Merge(m, src) +} +func (m *MsgUpdateRewardAddressResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRewardAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddressResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRewardAddressResponse proto.InternalMessageInfo + +type MsgUpdateWhitelistedRelayers struct { + // Creator is the bech32-encoded address of the actor sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` +} + +func (m *MsgUpdateWhitelistedRelayers) Reset() { *m = MsgUpdateWhitelistedRelayers{} } +func (m *MsgUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayers) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{8} +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateWhitelistedRelayers.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.Merge(m, src) +} +func (m *MsgUpdateWhitelistedRelayers) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateWhitelistedRelayers proto.InternalMessageInfo + +func (m *MsgUpdateWhitelistedRelayers) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateWhitelistedRelayers) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + +type MsgUpdateWhitelistedRelayersResponse struct { +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Reset() { *m = MsgUpdateWhitelistedRelayersResponse{} } +func (m *MsgUpdateWhitelistedRelayersResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayersResponse) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayersResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_a5e88906d3ab6fe1, []int{9} +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Merge(m, src) +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse proto.InternalMessageInfo + // MsgUnbond defines a SDK message for performing an undelegation from a // bond and a sequencer. type MsgUnbond struct { @@ -262,7 +543,7 @@ func (m *MsgUnbond) Reset() { *m = MsgUnbond{} } func (m *MsgUnbond) String() string { return proto.CompactTextString(m) } func (*MsgUnbond) ProtoMessage() {} func (*MsgUnbond) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{4} + return fileDescriptor_a5e88906d3ab6fe1, []int{10} } func (m *MsgUnbond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -313,7 +594,7 @@ func (m *MsgUnbondResponse) Reset() { *m = MsgUnbondResponse{} } func (m *MsgUnbondResponse) String() string { return proto.CompactTextString(m) } func (*MsgUnbondResponse) ProtoMessage() {} func (*MsgUnbondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{5} + return fileDescriptor_a5e88906d3ab6fe1, []int{11} } func (m *MsgUnbondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -399,7 +680,7 @@ func (m *MsgIncreaseBond) Reset() { *m = MsgIncreaseBond{} } func (m *MsgIncreaseBond) String() string { return proto.CompactTextString(m) } func (*MsgIncreaseBond) ProtoMessage() {} func (*MsgIncreaseBond) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{6} + return fileDescriptor_a5e88906d3ab6fe1, []int{12} } func (m *MsgIncreaseBond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -450,7 +731,7 @@ func (m *MsgIncreaseBondResponse) Reset() { *m = MsgIncreaseBondResponse func (m *MsgIncreaseBondResponse) String() string { return proto.CompactTextString(m) } func (*MsgIncreaseBondResponse) ProtoMessage() {} func (*MsgIncreaseBondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{7} + return fileDescriptor_a5e88906d3ab6fe1, []int{13} } func (m *MsgIncreaseBondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -491,7 +772,7 @@ func (m *MsgDecreaseBond) Reset() { *m = MsgDecreaseBond{} } func (m *MsgDecreaseBond) String() string { return proto.CompactTextString(m) } func (*MsgDecreaseBond) ProtoMessage() {} func (*MsgDecreaseBond) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{8} + return fileDescriptor_a5e88906d3ab6fe1, []int{14} } func (m *MsgDecreaseBond) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -543,7 +824,7 @@ func (m *MsgDecreaseBondResponse) Reset() { *m = MsgDecreaseBondResponse func (m *MsgDecreaseBondResponse) String() string { return proto.CompactTextString(m) } func (*MsgDecreaseBondResponse) ProtoMessage() {} func (*MsgDecreaseBondResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_26d679aa996065f1, []int{9} + return fileDescriptor_a5e88906d3ab6fe1, []int{15} } func (m *MsgDecreaseBondResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -580,10 +861,16 @@ func (m *MsgDecreaseBondResponse) GetCompletionTime() time.Time { } func init() { + proto.RegisterType((*MsgUpdateParams)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateParams") + proto.RegisterType((*MsgUpdateParamsResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateParamsResponse") proto.RegisterType((*MsgCreateSequencer)(nil), "dymensionxyz.dymension.sequencer.MsgCreateSequencer") proto.RegisterType((*MsgCreateSequencerResponse)(nil), "dymensionxyz.dymension.sequencer.MsgCreateSequencerResponse") proto.RegisterType((*MsgUpdateSequencerInformation)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateSequencerInformation") proto.RegisterType((*MsgUpdateSequencerInformationResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateSequencerInformationResponse") + proto.RegisterType((*MsgUpdateRewardAddress)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateRewardAddress") + proto.RegisterType((*MsgUpdateRewardAddressResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateRewardAddressResponse") + proto.RegisterType((*MsgUpdateWhitelistedRelayers)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateWhitelistedRelayers") + proto.RegisterType((*MsgUpdateWhitelistedRelayersResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUpdateWhitelistedRelayersResponse") proto.RegisterType((*MsgUnbond)(nil), "dymensionxyz.dymension.sequencer.MsgUnbond") proto.RegisterType((*MsgUnbondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUnbondResponse") proto.RegisterType((*MsgIncreaseBond)(nil), "dymensionxyz.dymension.sequencer.MsgIncreaseBond") @@ -592,315 +879,167 @@ func init() { proto.RegisterType((*MsgDecreaseBondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgDecreaseBondResponse") } -func init() { proto.RegisterFile("dymension/sequencer/tx.proto", fileDescriptor_26d679aa996065f1) } - -var fileDescriptor_26d679aa996065f1 = []byte{ - // 784 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0xcf, 0x6b, 0x13, 0x4d, - 0x18, 0xce, 0xa6, 0x69, 0xbf, 0x66, 0x5a, 0x9a, 0xaf, 0x4b, 0xa1, 0x9b, 0xa5, 0x4d, 0x4a, 0x40, - 0x2c, 0x8a, 0xbb, 0x24, 0x11, 0xc1, 0x22, 0x4a, 0x53, 0xc1, 0x16, 0x09, 0xd4, 0xd4, 0x5e, 0x3c, - 0x18, 0x36, 0x3b, 0xd3, 0xed, 0x4a, 0x76, 0x66, 0xdd, 0x99, 0x94, 0xae, 0x78, 0x12, 0xbc, 0x17, - 0x3c, 0x2b, 0x9e, 0x3c, 0x7b, 0xf0, 0x26, 0xde, 0x8b, 0xa7, 0xe2, 0xc9, 0x93, 0x4a, 0x7b, 0xd0, - 0x8b, 0xff, 0x83, 0xec, 0xee, 0xec, 0x34, 0x3f, 0x6a, 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0xd2, 0xff, 0xbf, 0xde, 0x16, 0x53, 0x3d, 0xdc, 0xbf, 0x25, 0x30, - 0x2d, 0x30, 0x63, 0x22, 0xf9, 0x31, 0xc8, 0x77, 0xc2, 0x1d, 0x1b, 0x5b, 0x4d, 0x93, 0x38, 0x6e, - 0x1b, 0x05, 0x42, 0x9a, 0xc1, 0x48, 0x84, 0x6c, 0x13, 0x15, 0x75, 0xa0, 0x13, 0x1f, 0xc6, 0xf3, - 0x52, 0xcb, 0xec, 0x7d, 0x2f, 0x4a, 0xab, 0xa9, 0xc6, 0xac, 0x00, 0x59, 0x11, 0x18, 0x41, 0x94, - 0x8c, 0xc0, 0x3c, 0x26, 0xcc, 0x36, 0x51, 0xd3, 0x45, 0x9e, 0x4d, 0xe0, 0x00, 0x47, 0x3a, 0x31, - 0x87, 0x1a, 0x01, 0xad, 0x87, 0x38, 0xbd, 0x34, 0xb5, 0x69, 0x90, 0xeb, 0x03, 0x2e, 0xbd, 0x92, - 0x40, 0xae, 0x4e, 0xad, 0x35, 0x1c, 0x18, 0x40, 0x51, 0xed, 0x9c, 0x4e, 0xca, 0xb7, 0x01, 0x30, - 0x20, 0x6c, 0x1a, 0x0e, 0xe9, 0x60, 0xc6, 0xe5, 0x9e, 0xda, 0xda, 0x59, 0x03, 0xc2, 0xe5, 0x30, - 0xa3, 0xaf, 0x03, 0xf2, 0x60, 0xb6, 0x4f, 0x94, 0xb8, 0xf3, 0xd7, 0x91, 0xe0, 0xbb, 0xe8, 0x82, - 0x82, 0x57, 0x41, 0x0e, 0x72, 0x8c, 0x33, 0xaa, 0x9e, 0x8a, 0xf3, 0x4e, 0x94, 0xbe, 0x1d, 0x4a, - 0xef, 0x96, 0x27, 0xba, 0xa8, 0x3e, 0x60, 0x7f, 0x82, 0xde, 0x19, 0x0f, 0x38, 0x83, 0xbb, 0x6d, - 0x4c, 0x99, 0x3d, 0xb7, 0x59, 0x79, 0x33, 0x0a, 0x46, 0xea, 0xd4, 0x92, 0x5f, 0x4a, 0x20, 0xd7, - 0xff, 0x8e, 0x5e, 0x3f, 0x7d, 0x2a, 0x07, 0x1f, 0x10, 0xf5, 0xd6, 0x79, 0xb2, 0x44, 0x79, 0xef, - 0x24, 0xa0, 0x0e, 0x79, 0x73, 0xee, 0x24, 0x02, 0xff, 0x3b, 0x80, 0x7a, 0xef, 0x82, 0x00, 0x42, - 0xe8, 0x13, 0x30, 0xc6, 0xdf, 0x8c, 0xab, 0xc9, 0x20, 0xc3, 0x60, 0xb5, 0x7a, 0x86, 0x60, 0xc1, - 0xf5, 0x1c, 0x4c, 0xf6, 0xcc, 0x56, 0x39, 0x11, 0x48, 0x77, 0x8a, 0x7a, 0xf3, 0xcc, 0x29, 0xdd, - 0xec, 0x3d, 0x83, 0x92, 0x8c, 0xbd, 0x3b, 0x25, 0x21, 0xfb, 0x49, 0xfd, 0x5e, 0x5b, 0xdf, 0x3f, - 0x2c, 0x48, 0x07, 0x87, 0x05, 0xe9, 0xc7, 0x61, 0x41, 0xda, 0x3b, 0x2a, 0xa4, 0x0e, 0x8e, 0x0a, - 0xa9, 0xaf, 0x47, 0x85, 0xd4, 0xa3, 0x1b, 0x96, 0xcd, 0xb6, 0x3b, 0x2d, 0xcd, 0x24, 0x8e, 0xde, - 0x0d, 0x7f, 0xbc, 0xd0, 0x77, 0xaa, 0xfa, 0x6e, 0xf7, 0x47, 0x92, 0xef, 0x22, 0xda, 0x1a, 0x0b, - 0x07, 0xa4, 0xfa, 0x27, 0x00, 0x00, 0xff, 0xff, 0x14, 0xb6, 0xa0, 0xf9, 0x48, 0x09, 0x00, 0x00, -} - -// Reference imports to suppress errors if they are not otherwise used. -var _ context.Context -var _ grpc.ClientConn - -// This is a compile-time assertion to ensure that this generated file -// is compatible with the grpc package it is being compiled against. -const _ = grpc.SupportPackageIsVersion4 - -// MsgClient is the client API for Msg service. -// -// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. -type MsgClient interface { - // CreateSequencer defines a method for creating a new sequencer. - CreateSequencer(ctx context.Context, in *MsgCreateSequencer, opts ...grpc.CallOption) (*MsgCreateSequencerResponse, error) - // UpdateSequencerInformation defines a method for updating the sequencer's metadata. - UpdateSequencerInformation(ctx context.Context, in *MsgUpdateSequencerInformation, opts ...grpc.CallOption) (*MsgUpdateSequencerInformationResponse, error) - // Unbond defines a method for removing coins from sequencer's bond - Unbond(ctx context.Context, in *MsgUnbond, opts ...grpc.CallOption) (*MsgUnbondResponse, error) - // IncreaseBond defines a method for increasing a sequencer's bond amount - IncreaseBond(ctx context.Context, in *MsgIncreaseBond, opts ...grpc.CallOption) (*MsgIncreaseBondResponse, error) - // DecreaseBond defines a method for decreasing the bond of a sequencer. - DecreaseBond(ctx context.Context, in *MsgDecreaseBond, opts ...grpc.CallOption) (*MsgDecreaseBondResponse, error) -} - -type msgClient struct { - cc grpc1.ClientConn -} - -func NewMsgClient(cc grpc1.ClientConn) MsgClient { - return &msgClient{cc} -} - -func (c *msgClient) CreateSequencer(ctx context.Context, in *MsgCreateSequencer, opts ...grpc.CallOption) (*MsgCreateSequencerResponse, error) { - out := new(MsgCreateSequencerResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/CreateSequencer", in, out, opts...) +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/tx.proto", fileDescriptor_a5e88906d3ab6fe1) +} + +var fileDescriptor_a5e88906d3ab6fe1 = []byte{ + // 861 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x41, 0x6f, 0x23, 0x35, + 0x18, 0xcd, 0xa4, 0xa5, 0xdb, 0xb8, 0xab, 0x96, 0x1d, 0x2a, 0x76, 0x12, 0x6d, 0x93, 0x28, 0x5a, + 0xa0, 0x42, 0x62, 0x46, 0x6d, 0x05, 0x87, 0x1e, 0x90, 0x9a, 0x22, 0xd4, 0x0a, 0x55, 0x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 0x7d, 0x45, 0x67, 0x33, 0xf6, + 0x2f, 0xf1, 0x76, 0xd6, 0x4b, 0xce, 0x32, 0xdb, 0x70, 0x33, 0x99, 0x4e, 0x33, 0x7e, 0x7e, 0xd9, + 0x75, 0x5e, 0x5c, 0x76, 0x9d, 0x3f, 0x2e, 0xbb, 0xce, 0xb3, 0xab, 0x6e, 0xe3, 0xc5, 0x55, 0xb7, + 0xf1, 0xeb, 0x55, 0xb7, 0xf1, 0xd9, 0x49, 0x4a, 0xe4, 0xc5, 0x38, 0xf6, 0x13, 0x96, 0xcd, 0x7c, + 0x9d, 0x09, 0x95, 0xe6, 0x3f, 0x9e, 0x3c, 0x5e, 0xf8, 0xe9, 0x8e, 0xd7, 0x94, 0xa2, 0x83, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0x67, 0xf6, 0xb4, 0xe6, 0x25, 0x09, 0x00, 0x00, +} + +func (m *MsgUpdateParams) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -func (c *msgClient) UpdateSequencerInformation(ctx context.Context, in *MsgUpdateSequencerInformation, opts ...grpc.CallOption) (*MsgUpdateSequencerInformationResponse, error) { - out := new(MsgUpdateSequencerInformationResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/UpdateSequencerInformation", in, out, opts...) - if err != nil { - return nil, err - } - return out, nil +func (m *MsgUpdateParams) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func (c *msgClient) Unbond(ctx context.Context, in *MsgUnbond, opts ...grpc.CallOption) (*MsgUnbondResponse, error) { - out := new(MsgUnbondResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/Unbond", in, out, opts...) - if err != nil { - return nil, err +func (m *MsgUpdateParams) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) } - return out, nil -} - -func (c *msgClient) IncreaseBond(ctx context.Context, in *MsgIncreaseBond, opts ...grpc.CallOption) (*MsgIncreaseBondResponse, error) { - out := new(MsgIncreaseBondResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/IncreaseBond", in, out, opts...) - if err != nil { - return nil, err + i-- + dAtA[i] = 0x12 + if len(m.Authority) > 0 { + i -= len(m.Authority) + copy(dAtA[i:], m.Authority) + i = encodeVarintTx(dAtA, i, uint64(len(m.Authority))) + i-- + dAtA[i] = 0xa } - return out, nil + return len(dAtA) - i, nil } -func (c *msgClient) DecreaseBond(ctx context.Context, in *MsgDecreaseBond, opts ...grpc.CallOption) (*MsgDecreaseBondResponse, error) { - out := new(MsgDecreaseBondResponse) - err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Msg/DecreaseBond", in, out, opts...) +func (m *MsgUpdateParamsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) if err != nil { return nil, err } - return out, nil + return dAtA[:n], nil } -// MsgServer is the server API for Msg service. -type MsgServer interface { - // CreateSequencer defines a method for creating a new sequencer. - CreateSequencer(context.Context, *MsgCreateSequencer) (*MsgCreateSequencerResponse, error) - // UpdateSequencerInformation defines a method for updating the sequencer's metadata. - UpdateSequencerInformation(context.Context, *MsgUpdateSequencerInformation) (*MsgUpdateSequencerInformationResponse, error) - // Unbond defines a method for removing coins from sequencer's bond - Unbond(context.Context, *MsgUnbond) (*MsgUnbondResponse, error) - // IncreaseBond defines a method for increasing a sequencer's bond amount - IncreaseBond(context.Context, *MsgIncreaseBond) (*MsgIncreaseBondResponse, error) - // DecreaseBond defines a method for decreasing the bond of a sequencer. - DecreaseBond(context.Context, *MsgDecreaseBond) (*MsgDecreaseBondResponse, error) +func (m *MsgUpdateParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -// UnimplementedMsgServer can be embedded to have forward compatible implementations. -type UnimplementedMsgServer struct { +func (m *MsgUpdateParamsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil } -func (*UnimplementedMsgServer) CreateSequencer(ctx context.Context, req *MsgCreateSequencer) (*MsgCreateSequencerResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method CreateSequencer not implemented") -} -func (*UnimplementedMsgServer) UpdateSequencerInformation(ctx context.Context, req *MsgUpdateSequencerInformation) (*MsgUpdateSequencerInformationResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method UpdateSequencerInformation not implemented") -} -func (*UnimplementedMsgServer) Unbond(ctx context.Context, req *MsgUnbond) (*MsgUnbondResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method Unbond not implemented") -} -func (*UnimplementedMsgServer) IncreaseBond(ctx context.Context, req *MsgIncreaseBond) (*MsgIncreaseBondResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method IncreaseBond not implemented") -} -func (*UnimplementedMsgServer) DecreaseBond(ctx context.Context, req *MsgDecreaseBond) (*MsgDecreaseBondResponse, error) { - return nil, status.Errorf(codes.Unimplemented, "method DecreaseBond not implemented") +func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil } -func RegisterMsgServer(s grpc1.Server, srv MsgServer) { - s.RegisterService(&_Msg_serviceDesc, srv) +func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) } -func _Msg_CreateSequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgCreateSequencer) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).CreateSequencer(ctx, in) +func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x3a + } } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/CreateSequencer", + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x32 } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).CreateSequencer(ctx, req.(*MsgCreateSequencer)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_UpdateSequencerInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUpdateSequencerInformation) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).UpdateSequencerInformation(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/UpdateSequencerInformation", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).UpdateSequencerInformation(ctx, req.(*MsgUpdateSequencerInformation)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_Unbond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgUnbond) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).Unbond(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/Unbond", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).Unbond(ctx, req.(*MsgUnbond)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_IncreaseBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgIncreaseBond) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).IncreaseBond(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/IncreaseBond", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).IncreaseBond(ctx, req.(*MsgIncreaseBond)) - } - return interceptor(ctx, in, info, handler) -} - -func _Msg_DecreaseBond_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { - in := new(MsgDecreaseBond) - if err := dec(in); err != nil { - return nil, err - } - if interceptor == nil { - return srv.(MsgServer).DecreaseBond(ctx, in) - } - info := &grpc.UnaryServerInfo{ - Server: srv, - FullMethod: "/dymensionxyz.dymension.sequencer.Msg/DecreaseBond", - } - handler := func(ctx context.Context, req interface{}) (interface{}, error) { - return srv.(MsgServer).DecreaseBond(ctx, req.(*MsgDecreaseBond)) - } - return interceptor(ctx, in, info, handler) -} - -var _Msg_serviceDesc = grpc.ServiceDesc{ - ServiceName: "dymensionxyz.dymension.sequencer.Msg", - HandlerType: (*MsgServer)(nil), - Methods: []grpc.MethodDesc{ - { - MethodName: "CreateSequencer", - Handler: _Msg_CreateSequencer_Handler, - }, - { - MethodName: "UpdateSequencerInformation", - Handler: _Msg_UpdateSequencerInformation_Handler, - }, - { - MethodName: "Unbond", - Handler: _Msg_Unbond_Handler, - }, - { - MethodName: "IncreaseBond", - Handler: _Msg_IncreaseBond_Handler, - }, - { - MethodName: "DecreaseBond", - Handler: _Msg_DecreaseBond_Handler, - }, - }, - Streams: []grpc.StreamDesc{}, - Metadata: "dymension/sequencer/tx.proto", -} - -func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { - size := m.Size() - dAtA = make([]byte, size) - n, err := m.MarshalToSizedBuffer(dAtA[:size]) - if err != nil { - return nil, err - } - return dAtA[:n], nil -} - -func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { - size := m.Size() - return m.MarshalToSizedBuffer(dAtA[:size]) -} - -func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { - i := len(dAtA) - _ = i - var l int - _ = l { size, err := m.Bond.MarshalToSizedBuffer(dAtA[:i]) if err != nil { @@ -1002,14 +1141,7 @@ func (m *MsgUpdateSequencerInformation) MarshalToSizedBuffer(dAtA []byte) (int, i = encodeVarintTx(dAtA, i, uint64(size)) } i-- - dAtA[i] = 0x1a - if len(m.RollappId) > 0 { - i -= len(m.RollappId) - copy(dAtA[i:], m.RollappId) - i = encodeVarintTx(dAtA, i, uint64(len(m.RollappId))) - i-- - dAtA[i] = 0x12 - } + dAtA[i] = 0x12 if len(m.Creator) > 0 { i -= len(m.Creator) copy(dAtA[i:], m.Creator) @@ -1043,6 +1175,128 @@ func (m *MsgUpdateSequencerInformationResponse) MarshalToSizedBuffer(dAtA []byte return len(dAtA) - i, nil } +func (m *MsgUpdateRewardAddress) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x12 + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRewardAddressResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateRewardAddressResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRewardAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateWhitelistedRelayers) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } + } + if len(m.Creator) > 0 { + i -= len(m.Creator) + copy(dAtA[i:], m.Creator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Creator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + func (m *MsgUnbond) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1113,12 +1367,12 @@ func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalTo(dAtA []byte) (int, func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.UnbondingCompletionTime != nil { - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UnbondingCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UnbondingCompletionTime):]) - if err5 != nil { - return 0, err5 + n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.UnbondingCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.UnbondingCompletionTime):]) + if err6 != nil { + return 0, err6 } - i -= n5 - i = encodeVarintTx(dAtA, i, uint64(n5)) + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) i-- dAtA[i] = 0xa } @@ -1132,12 +1386,12 @@ func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalTo(dAtA []byte) (i func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) if m.NoticePeriodCompletionTime != nil { - n6, err6 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NoticePeriodCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NoticePeriodCompletionTime):]) - if err6 != nil { - return 0, err6 + n7, err7 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.NoticePeriodCompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.NoticePeriodCompletionTime):]) + if err7 != nil { + return 0, err7 } - i -= n6 - i = encodeVarintTx(dAtA, i, uint64(n6)) + i -= n7 + i = encodeVarintTx(dAtA, i, uint64(n7)) i-- dAtA[i] = 0x12 } @@ -1266,12 +1520,12 @@ func (m *MsgDecreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) _ = i var l int _ = l - n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) - if err9 != nil { - return 0, err9 + n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.CompletionTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime):]) + if err10 != nil { + return 0, err10 } - i -= n9 - i = encodeVarintTx(dAtA, i, uint64(n9)) + i -= n10 + i = encodeVarintTx(dAtA, i, uint64(n10)) i-- dAtA[i] = 0xa return len(dAtA) - i, nil @@ -1288,6 +1542,30 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } +func (m *MsgUpdateParams) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Authority) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Params.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgCreateSequencer) Size() (n int) { if m == nil { return 0 @@ -1310,6 +1588,16 @@ func (m *MsgCreateSequencer) Size() (n int) { n += 1 + l + sovTx(uint64(l)) l = m.Bond.Size() n += 1 + l + sovTx(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -1332,10 +1620,6 @@ func (m *MsgUpdateSequencerInformation) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.RollappId) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) - } l = m.Metadata.Size() n += 1 + l + sovTx(uint64(l)) return n @@ -1350,6 +1634,60 @@ func (m *MsgUpdateSequencerInformationResponse) Size() (n int) { return n } +func (m *MsgUpdateRewardAddress) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateRewardAddressResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateWhitelistedRelayers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } + return n +} + +func (m *MsgUpdateWhitelistedRelayersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + func (m *MsgUnbond) Size() (n int) { if m == nil { return 0 @@ -1455,7 +1793,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateParams) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1478,15 +1816,15 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateParams: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateParams: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Authority", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -1514,11 +1852,11 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.Creator = string(dAtA[iNdEx:postIndex]) + m.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) } var msglen int for shift := uint(0); ; shift += 7 { @@ -1545,8 +1883,173 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - if m.DymintPubKey == nil { - m.DymintPubKey = &types.Any{} + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateParamsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DymintPubKey == nil { + m.DymintPubKey = &types.Any{} } if err := m.DymintPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { return err @@ -1650,6 +2153,70 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) @@ -1783,38 +2350,6 @@ func (m *MsgUpdateSequencerInformation) Unmarshal(dAtA []byte) error { m.Creator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 2: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) - } - var stringLen uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - stringLen |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - intStringLen := int(stringLen) - if intStringLen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + intStringLen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - m.RollappId = string(dAtA[iNdEx:postIndex]) - iNdEx = postIndex - case 3: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) } @@ -1918,6 +2453,334 @@ func (m *MsgUpdateSequencerInformationResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgUpdateRewardAddress) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRewardAddress: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateRewardAddressResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateWhitelistedRelayers) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Creator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Creator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateWhitelistedRelayersResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *MsgUnbond) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 diff --git a/types/pb/rollapp/sequencers/types/tx.pb.go b/types/pb/rollapp/sequencers/types/tx.pb.go new file mode 100644 index 000000000..153860f64 --- /dev/null +++ b/types/pb/rollapp/sequencers/types/tx.pb.go @@ -0,0 +1,1316 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/rollapp/sequencers/types/tx.proto + +package sequencers + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + types "github.com/gogo/protobuf/types" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +type MsgCreateSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // PubKey is a tendermint consensus pub key + PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` + // Signature is operator signed with the private key of pub_key + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` +} + +func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } +func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSequencer) ProtoMessage() {} +func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{0} +} +func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSequencer.Merge(m, src) +} +func (m *MsgCreateSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSequencer proto.InternalMessageInfo + +func (m *MsgCreateSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgCreateSequencer) GetPubKey() *types.Any { + if m != nil { + return m.PubKey + } + return nil +} + +func (m *MsgCreateSequencer) GetSignature() []byte { + if m != nil { + return m.Signature + } + return nil +} + +type MsgCreateSequencerResponse struct { +} + +func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerResponse{} } +func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateSequencerResponse) ProtoMessage() {} +func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{1} +} +func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgCreateSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateSequencerResponse.Merge(m, src) +} +func (m *MsgCreateSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo + +type MsgUpdateSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update - must be val addr + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *MsgUpdateSequencer) Reset() { *m = MsgUpdateSequencer{} } +func (m *MsgUpdateSequencer) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencer) ProtoMessage() {} +func (*MsgUpdateSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{2} +} +func (m *MsgUpdateSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencer.Merge(m, src) +} +func (m *MsgUpdateSequencer) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencer proto.InternalMessageInfo + +func (m *MsgUpdateSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *MsgUpdateSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type MsgUpdateSequencerResponse struct { +} + +func (m *MsgUpdateSequencerResponse) Reset() { *m = MsgUpdateSequencerResponse{} } +func (m *MsgUpdateSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencerResponse) ProtoMessage() {} +func (*MsgUpdateSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{3} +} +func (m *MsgUpdateSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgUpdateSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencerResponse.Merge(m, src) +} +func (m *MsgUpdateSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencerResponse proto.InternalMessageInfo + +// ConsensusMsgUpsertSequencer is a consensus message to upsert the sequencer. +type ConsensusMsgUpsertSequencer struct { + // Operator is the bech32-encoded address of the actor sending the update + Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` + // ConsPubKey is a tendermint consensus pub key + ConsPubKey *types.Any `protobuf:"bytes,2,opt,name=cons_pub_key,json=consPubKey,proto3" json:"cons_pub_key,omitempty"` + // RewardAddr is the bech32-encoded sequencer's reward address + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` +} + +func (m *ConsensusMsgUpsertSequencer) Reset() { *m = ConsensusMsgUpsertSequencer{} } +func (m *ConsensusMsgUpsertSequencer) String() string { return proto.CompactTextString(m) } +func (*ConsensusMsgUpsertSequencer) ProtoMessage() {} +func (*ConsensusMsgUpsertSequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{4} +} +func (m *ConsensusMsgUpsertSequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusMsgUpsertSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusMsgUpsertSequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusMsgUpsertSequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusMsgUpsertSequencer.Merge(m, src) +} +func (m *ConsensusMsgUpsertSequencer) XXX_Size() int { + return m.Size() +} +func (m *ConsensusMsgUpsertSequencer) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusMsgUpsertSequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusMsgUpsertSequencer proto.InternalMessageInfo + +func (m *ConsensusMsgUpsertSequencer) GetOperator() string { + if m != nil { + return m.Operator + } + return "" +} + +func (m *ConsensusMsgUpsertSequencer) GetConsPubKey() *types.Any { + if m != nil { + return m.ConsPubKey + } + return nil +} + +func (m *ConsensusMsgUpsertSequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +type ConsensusMsgUpsertSequencerResponse struct { +} + +func (m *ConsensusMsgUpsertSequencerResponse) Reset() { *m = ConsensusMsgUpsertSequencerResponse{} } +func (m *ConsensusMsgUpsertSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*ConsensusMsgUpsertSequencerResponse) ProtoMessage() {} +func (*ConsensusMsgUpsertSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_bb27942d1c1a6ff0, []int{5} +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ConsensusMsgUpsertSequencerResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_ConsensusMsgUpsertSequencerResponse.Merge(m, src) +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *ConsensusMsgUpsertSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_ConsensusMsgUpsertSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_ConsensusMsgUpsertSequencerResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateSequencer)(nil), "rollapp.sequencers.types.MsgCreateSequencer") + proto.RegisterType((*MsgCreateSequencerResponse)(nil), "rollapp.sequencers.types.MsgCreateSequencerResponse") + proto.RegisterType((*MsgUpdateSequencer)(nil), "rollapp.sequencers.types.MsgUpdateSequencer") + proto.RegisterType((*MsgUpdateSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpdateSequencerResponse") + proto.RegisterType((*ConsensusMsgUpsertSequencer)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencer") + proto.RegisterType((*ConsensusMsgUpsertSequencerResponse)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencerResponse") +} + +func init() { + proto.RegisterFile("types/rollapp/sequencers/types/tx.proto", fileDescriptor_bb27942d1c1a6ff0) +} + +var fileDescriptor_bb27942d1c1a6ff0 = []byte{ + // 406 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xbd, 0x8e, 0xd3, 0x40, + 0x10, 0xc7, 0xb3, 0x09, 0x0a, 0xc9, 0x26, 0x48, 0xc8, 0x4a, 0x61, 0x4c, 0x30, 0x91, 0x11, 0x22, + 0x42, 0xc2, 0x2b, 0x40, 0xa2, 0x48, 0x17, 0xd2, 0x81, 0x90, 0x90, 0x81, 0x86, 0x26, 0xf2, 0xc7, + 0x64, 0xb1, 0x88, 0x77, 0x97, 0xdd, 0x35, 0xc4, 0x94, 0x57, 0x5f, 0x71, 0xaf, 0x70, 0x6f, 0x70, + 0x8f, 0x71, 0x65, 0xca, 0x2b, 0x4f, 0x49, 0x71, 0xaf, 0x71, 0xf2, 0x47, 0x12, 0x29, 0x77, 0x3a, + 0xe5, 0x2a, 0xef, 0xcc, 0xfc, 0x3d, 0xff, 0xdf, 0x8c, 0x06, 0xbf, 0xd2, 0x99, 0x00, 0x45, 0x24, + 0x9f, 0xcf, 0x7d, 0x21, 0x88, 0x82, 0x3f, 0x29, 0xb0, 0x10, 0xa4, 0x22, 0x65, 0x41, 0x2f, 0x5c, + 0x21, 0xb9, 0xe6, 0x86, 0x59, 0x49, 0xdc, 0x9d, 0xc4, 0x2d, 0x24, 0x56, 0x8f, 0x72, 0xca, 0x0b, + 0x11, 0xc9, 0x5f, 0xa5, 0xde, 0x7a, 0x56, 0xfe, 0x1f, 0x72, 0x95, 0x70, 0x45, 0x12, 0x45, 0xc9, + 0xdf, 0xb7, 0xf9, 0xa7, 0x2a, 0x3f, 0xa1, 0x9c, 0xd3, 0x39, 0x90, 0x22,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ca, 0xc7, 0xef, 0xe7, 0x2b, 0x1b, 0x2d, 0x57, 0x36, 0xba, 0x5c, 0xd9, 0xe8, 0x64, 0x6d, 0xd7, + 0x96, 0x6b, 0xbb, 0x76, 0xb1, 0xb6, 0x6b, 0x3f, 0x47, 0x34, 0xd6, 0xbf, 0xd2, 0xc0, 0x0d, 0x79, + 0x42, 0xa2, 0x2c, 0x01, 0xa6, 0x62, 0xce, 0x16, 0xd9, 0xff, 0x3c, 0x88, 0x99, 0xae, 0x0e, 0x56, + 0x04, 0xb7, 0x1c, 0x73, 0xd0, 0x2c, 0xc6, 0x78, 0x7f, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x38, 0x7c, + 0xd4, 0x90, 0xef, 0x02, 0x00, 0x00, +} + +func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Signature) > 0 { + i -= len(m.Signature) + copy(dAtA[i:], m.Signature) + i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) + i-- + dAtA[i] = 0x1a + } + if m.PubKey != nil { + { + size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgCreateSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgCreateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUpdateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *ConsensusMsgUpsertSequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusMsgUpsertSequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusMsgUpsertSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } + if m.ConsPubKey != nil { + { + size, err := m.ConsPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Operator) > 0 { + i -= len(m.Operator) + copy(dAtA[i:], m.Operator) + i = encodeVarintTx(dAtA, i, uint64(len(m.Operator))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ConsensusMsgUpsertSequencerResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ConsensusMsgUpsertSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ConsensusMsgUpsertSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func encodeVarintTx(dAtA []byte, offset int, v uint64) int { + offset -= sovTx(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *MsgCreateSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.PubKey != nil { + l = m.PubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Signature) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgCreateSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *ConsensusMsgUpsertSequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Operator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.ConsPubKey != nil { + l = m.ConsPubKey.Size() + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *ConsensusMsgUpsertSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.PubKey == nil { + m.PubKey = &types.Any{} + } + if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) + if m.Signature == nil { + m.Signature = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgCreateSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgUpdateSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgUpdateSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusMsgUpsertSequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Operator", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Operator = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ConsPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ConsPubKey == nil { + m.ConsPubKey = &types.Any{} + } + if err := m.ConsPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ConsensusMsgUpsertSequencerResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ConsensusMsgUpsertSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipTx(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowTx + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthTx + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupTx + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthTx + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthTx = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowTx = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupTx = fmt.Errorf("proto: unexpected end of group") +) diff --git a/utils/proto/converters.go b/utils/proto/converters.go new file mode 100644 index 000000000..32c9902a5 --- /dev/null +++ b/utils/proto/converters.go @@ -0,0 +1,26 @@ +package proto + +import ( + cosmos "github.com/cosmos/cosmos-sdk/codec/types" + gogo "github.com/gogo/protobuf/types" +) + +func GogoToCosmos(v *gogo.Any) *cosmos.Any { + if v == nil { + return nil + } + return &cosmos.Any{ + TypeUrl: v.TypeUrl, + Value: v.Value, + } +} + +func CosmosToGogo(v *cosmos.Any) *gogo.Any { + if v == nil { + return nil + } + return &gogo.Any{ + TypeUrl: v.TypeUrl, + Value: v.Value, + } +} diff --git a/utils/proto/converters_test.go b/utils/proto/converters_test.go new file mode 100644 index 000000000..5733d8eb7 --- /dev/null +++ b/utils/proto/converters_test.go @@ -0,0 +1,97 @@ +package proto_test + +import ( + "testing" + + "github.com/cosmos/cosmos-sdk/codec" + cdctypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/gogo/protobuf/proto" + "github.com/stretchr/testify/require" + + protoutils "github.com/dymensionxyz/dymint/utils/proto" + cosmosseq "github.com/dymensionxyz/dymint/utils/proto/test_data/cosmos_proto" + gogoseq "github.com/dymensionxyz/dymint/utils/proto/test_data/gogo_proto" +) + +func TestConvertCosmosToGogo(t *testing.T) { + setup() + + // generate the expected pubkey + expectedPK := ed25519.GenPrivKey().PubKey() + + // convert it to cosmos any + cosmosProtoPK, err := cdctypes.NewAnyWithValue(expectedPK) + require.NoError(t, err) + + // convert cosmos to gogo any + gogoProtoPK := protoutils.CosmosToGogo(cosmosProtoPK) + + // create a sequencer with gogo any + gogoSeq := &gogoseq.Sequencer{ + DymintPubKey: gogoProtoPK, + } + + // serialize the sequencer with gogo any + gogoSeqBytes, err := proto.Marshal(gogoSeq) + require.NoError(t, err) + + // deserialize the sequencer, now it holds a cosmos any + cosmosSeq := cosmosseq.Sequencer{} + err = proto.Unmarshal(gogoSeqBytes, &cosmosSeq) + require.NoError(t, err) + + // try to deserialize gogo to cosmos any + var actualPK cryptotypes.PubKey + err = cdc.UnpackAny(cosmosSeq.DymintPubKey, &actualPK) + require.NoError(t, err) + + // check that the value matches the initial + require.Equal(t, expectedPK, actualPK) +} + +func TestConvertGogoToCosmos(t *testing.T) { + setup() + + // generate the expected pubkey + expectedPK := ed25519.GenPrivKey().PubKey() + + // convert it to cosmos any + cosmosProtoPK, err := cdctypes.NewAnyWithValue(expectedPK) + require.NoError(t, err) + + // create a sequencer with cosmos any + cosmosSeq := &cosmosseq.Sequencer{ + DymintPubKey: cosmosProtoPK, + } + + // serialize the sequencer with cosmos any + cosmosSeqBytes, err := proto.Marshal(cosmosSeq) + require.NoError(t, err) + + // deserialize the sequencer, now it holds gogo any + gogoSeq := gogoseq.Sequencer{} + err = proto.Unmarshal(cosmosSeqBytes, &gogoSeq) + require.NoError(t, err) + + // convert gogo to cosmos any + cosmosProtoPK1 := protoutils.GogoToCosmos(gogoSeq.DymintPubKey) + + // try to deserialize it to cosmos any + var actualPK cryptotypes.PubKey + err = cdc.UnpackAny(cosmosProtoPK1, &actualPK) + require.NoError(t, err) + + // check that the value matches the initial + require.Equal(t, expectedPK, actualPK) +} + +var cdc *codec.ProtoCodec + +func setup() { + interfaceRegistry := cdctypes.NewInterfaceRegistry() + cryptocodec.RegisterInterfaces(interfaceRegistry) + cdc = codec.NewProtoCodec(interfaceRegistry) +} diff --git a/third_party/dymension/sequencer/types/metadata.pb.go b/utils/proto/test_data/cosmos_proto/metadata.pb.go similarity index 100% rename from third_party/dymension/sequencer/types/metadata.pb.go rename to utils/proto/test_data/cosmos_proto/metadata.pb.go diff --git a/third_party/dymension/sequencer/types/operating_status.pb.go b/utils/proto/test_data/cosmos_proto/operating_status.pb.go similarity index 98% rename from third_party/dymension/sequencer/types/operating_status.pb.go rename to utils/proto/test_data/cosmos_proto/operating_status.pb.go index a3dae80b5..3a9668f5e 100644 --- a/third_party/dymension/sequencer/types/operating_status.pb.go +++ b/utils/proto/test_data/cosmos_proto/operating_status.pb.go @@ -56,7 +56,7 @@ func (OperatingStatus) EnumDescriptor() ([]byte, []int) { } func init() { - proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus1", OperatingStatus_name, OperatingStatus_value) } func init() { diff --git a/third_party/dymension/sequencer/types/sequencer.pb.go b/utils/proto/test_data/cosmos_proto/sequencer.pb.go similarity index 100% rename from third_party/dymension/sequencer/types/sequencer.pb.go rename to utils/proto/test_data/cosmos_proto/sequencer.pb.go diff --git a/utils/proto/test_data/gogo_proto/metadata.pb.go b/utils/proto/test_data/gogo_proto/metadata.pb.go new file mode 100644 index 000000000..fb35f4f5a --- /dev/null +++ b/utils/proto/test_data/gogo_proto/metadata.pb.go @@ -0,0 +1,1494 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/metadata.proto + +package sequencer + +import ( + fmt "fmt" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + io "io" + math "math" + math_bits "math/bits" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Metadata defines rollapp/sequencer extra information. +type SequencerMetadata struct { + // moniker defines a human-readable name for the sequencer. + Moniker string `protobuf:"bytes,1,opt,name=moniker,proto3" json:"moniker,omitempty"` + // details define other optional details. + Details string `protobuf:"bytes,5,opt,name=details,proto3" json:"details,omitempty"` + // bootstrap nodes list + P2PSeeds []string `protobuf:"bytes,6,rep,name=p2p_seeds,json=p2pSeeds,proto3" json:"p2p_seeds,omitempty"` + // RPCs list + Rpcs []string `protobuf:"bytes,7,rep,name=rpcs,proto3" json:"rpcs,omitempty"` + // evm RPCs list + EvmRpcs []string `protobuf:"bytes,8,rep,name=evm_rpcs,json=evmRpcs,proto3" json:"evm_rpcs,omitempty"` + // REST API URLs + RestApiUrls []string `protobuf:"bytes,9,rep,name=rest_api_urls,json=restApiUrls,proto3" json:"rest_api_urls,omitempty"` + // block explorer URL + ExplorerUrl string `protobuf:"bytes,10,opt,name=explorer_url,json=explorerUrl,proto3" json:"explorer_url,omitempty"` + // genesis URLs + GenesisUrls []string `protobuf:"bytes,11,rep,name=genesis_urls,json=genesisUrls,proto3" json:"genesis_urls,omitempty"` + // contact details + ContactDetails *ContactDetails `protobuf:"bytes,12,opt,name=contact_details,json=contactDetails,proto3" json:"contact_details,omitempty"` + // json dump the sequencer can add (limited by size) + ExtraData []byte `protobuf:"bytes,13,opt,name=extra_data,json=extraData,proto3" json:"extra_data,omitempty"` + // snapshots of the sequencer + Snapshots []*SnapshotInfo `protobuf:"bytes,14,rep,name=snapshots,proto3" json:"snapshots,omitempty"` + // gas_price defines the value for each gas unit + GasPrice *github_com_cosmos_cosmos_sdk_types.Int `protobuf:"bytes,15,opt,name=gas_price,json=gasPrice,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Int" json:"gas_price,omitempty"` +} + +func (m *SequencerMetadata) Reset() { *m = SequencerMetadata{} } +func (m *SequencerMetadata) String() string { return proto.CompactTextString(m) } +func (*SequencerMetadata) ProtoMessage() {} +func (*SequencerMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{0} +} +func (m *SequencerMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SequencerMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SequencerMetadata.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SequencerMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_SequencerMetadata.Merge(m, src) +} +func (m *SequencerMetadata) XXX_Size() int { + return m.Size() +} +func (m *SequencerMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_SequencerMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_SequencerMetadata proto.InternalMessageInfo + +func (m *SequencerMetadata) GetMoniker() string { + if m != nil { + return m.Moniker + } + return "" +} + +func (m *SequencerMetadata) GetDetails() string { + if m != nil { + return m.Details + } + return "" +} + +func (m *SequencerMetadata) GetP2PSeeds() []string { + if m != nil { + return m.P2PSeeds + } + return nil +} + +func (m *SequencerMetadata) GetRpcs() []string { + if m != nil { + return m.Rpcs + } + return nil +} + +func (m *SequencerMetadata) GetEvmRpcs() []string { + if m != nil { + return m.EvmRpcs + } + return nil +} + +func (m *SequencerMetadata) GetRestApiUrls() []string { + if m != nil { + return m.RestApiUrls + } + return nil +} + +func (m *SequencerMetadata) GetExplorerUrl() string { + if m != nil { + return m.ExplorerUrl + } + return "" +} + +func (m *SequencerMetadata) GetGenesisUrls() []string { + if m != nil { + return m.GenesisUrls + } + return nil +} + +func (m *SequencerMetadata) GetContactDetails() *ContactDetails { + if m != nil { + return m.ContactDetails + } + return nil +} + +func (m *SequencerMetadata) GetExtraData() []byte { + if m != nil { + return m.ExtraData + } + return nil +} + +func (m *SequencerMetadata) GetSnapshots() []*SnapshotInfo { + if m != nil { + return m.Snapshots + } + return nil +} + +type ContactDetails struct { + // website URL + Website string `protobuf:"bytes,11,opt,name=website,proto3" json:"website,omitempty"` + // telegram link + Telegram string `protobuf:"bytes,1,opt,name=telegram,proto3" json:"telegram,omitempty"` + // twitter link + X string `protobuf:"bytes,2,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *ContactDetails) Reset() { *m = ContactDetails{} } +func (m *ContactDetails) String() string { return proto.CompactTextString(m) } +func (*ContactDetails) ProtoMessage() {} +func (*ContactDetails) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{1} +} +func (m *ContactDetails) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ContactDetails) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ContactDetails.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ContactDetails) XXX_Merge(src proto.Message) { + xxx_messageInfo_ContactDetails.Merge(m, src) +} +func (m *ContactDetails) XXX_Size() int { + return m.Size() +} +func (m *ContactDetails) XXX_DiscardUnknown() { + xxx_messageInfo_ContactDetails.DiscardUnknown(m) +} + +var xxx_messageInfo_ContactDetails proto.InternalMessageInfo + +func (m *ContactDetails) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *ContactDetails) GetTelegram() string { + if m != nil { + return m.Telegram + } + return "" +} + +func (m *ContactDetails) GetX() string { + if m != nil { + return m.X + } + return "" +} + +type SnapshotInfo struct { + // the snapshot url + SnapshotUrl string `protobuf:"bytes,1,opt,name=snapshot_url,json=snapshotUrl,proto3" json:"snapshot_url,omitempty"` + // The snapshot height + Height uint64 `protobuf:"varint,2,opt,name=height,proto3" json:"height,omitempty"` + // sha-256 checksum value for the snapshot file + Checksum string `protobuf:"bytes,3,opt,name=checksum,proto3" json:"checksum,omitempty"` +} + +func (m *SnapshotInfo) Reset() { *m = SnapshotInfo{} } +func (m *SnapshotInfo) String() string { return proto.CompactTextString(m) } +func (*SnapshotInfo) ProtoMessage() {} +func (*SnapshotInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_6045a4988478e768, []int{2} +} +func (m *SnapshotInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SnapshotInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SnapshotInfo.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *SnapshotInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_SnapshotInfo.Merge(m, src) +} +func (m *SnapshotInfo) XXX_Size() int { + return m.Size() +} +func (m *SnapshotInfo) XXX_DiscardUnknown() { + xxx_messageInfo_SnapshotInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_SnapshotInfo proto.InternalMessageInfo + +func (m *SnapshotInfo) GetSnapshotUrl() string { + if m != nil { + return m.SnapshotUrl + } + return "" +} + +func (m *SnapshotInfo) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *SnapshotInfo) GetChecksum() string { + if m != nil { + return m.Checksum + } + return "" +} + +func init() { + proto.RegisterType((*SequencerMetadata)(nil), "dymensionxyz.dymension.sequencer.SequencerMetadata") + proto.RegisterType((*ContactDetails)(nil), "dymensionxyz.dymension.sequencer.ContactDetails") + proto.RegisterType((*SnapshotInfo)(nil), "dymensionxyz.dymension.sequencer.SnapshotInfo") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/metadata.proto", fileDescriptor_6045a4988478e768) +} + +var fileDescriptor_6045a4988478e768 = []byte{ + // 539 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0xad, 0xdb, 0x34, 0xb1, 0xc7, 0x69, 0xfa, 0x9e, 0x85, 0xd0, 0x50, 0x84, 0x31, 0x59, 0xa0, + 0x08, 0x09, 0x1b, 0x05, 0xf1, 0x01, 0x94, 0x4a, 0x50, 0x04, 0x12, 0x72, 0xe8, 0x02, 0x36, 0x96, + 0xe3, 0x5c, 0x1c, 0x2b, 0xb6, 0x67, 0x98, 0x3b, 0x29, 0x09, 0x5f, 0xc1, 0x82, 0x8f, 0x62, 0xd9, + 0x25, 0x62, 0x81, 0x50, 0xf2, 0x23, 0x68, 0xc6, 0x76, 0x9a, 0xb2, 0xc9, 0xca, 0x3e, 0xe7, 0xde, + 0x73, 0x66, 0xe6, 0xdc, 0x19, 0xf2, 0x4c, 0x2e, 0x39, 0x60, 0x30, 0x59, 0x16, 0x50, 0x62, 0xc6, + 0xca, 0xc5, 0xf2, 0xeb, 0x35, 0x08, 0x10, 0x3e, 0xcf, 0xa1, 0x4c, 0x40, 0x04, 0x05, 0xc8, 0x78, + 0x12, 0xcb, 0xd8, 0xe7, 0x82, 0x49, 0xe6, 0x78, 0xdb, 0x02, 0x7f, 0x03, 0xfc, 0x8d, 0xe0, 0xe4, + 0x56, 0xca, 0x52, 0xa6, 0x9b, 0x03, 0xf5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 0x7e, 0xae, 0xdd, 0xbd, 0x8f, 0xaf, 0xb6, 0xe2, 0xf8, 0xf7, 0x85, 0x65, + 0xa5, 0xac, 0x02, 0x09, 0xf8, 0x78, 0xe7, 0xf3, 0x1b, 0xb7, 0xf5, 0xf3, 0x79, 0xfa, 0x37, 0x00, + 0x00, 0xff, 0xff, 0xef, 0x23, 0x73, 0xc5, 0xaf, 0x03, 0x00, 0x00, +} + +func (m *SequencerMetadata) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SequencerMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SequencerMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.GasPrice != nil { + { + size := m.GasPrice.Size() + i -= size + if _, err := m.GasPrice.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.Snapshots) > 0 { + for iNdEx := len(m.Snapshots) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Snapshots[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + } + if len(m.ExtraData) > 0 { + i -= len(m.ExtraData) + copy(dAtA[i:], m.ExtraData) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExtraData))) + i-- + dAtA[i] = 0x6a + } + if m.ContactDetails != nil { + { + size, err := m.ContactDetails.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintMetadata(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x62 + } + if len(m.GenesisUrls) > 0 { + for iNdEx := len(m.GenesisUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.GenesisUrls[iNdEx]) + copy(dAtA[i:], m.GenesisUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.GenesisUrls[iNdEx]))) + i-- + dAtA[i] = 0x5a + } + } + if len(m.ExplorerUrl) > 0 { + i -= len(m.ExplorerUrl) + copy(dAtA[i:], m.ExplorerUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.ExplorerUrl))) + i-- + dAtA[i] = 0x52 + } + if len(m.RestApiUrls) > 0 { + for iNdEx := len(m.RestApiUrls) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RestApiUrls[iNdEx]) + copy(dAtA[i:], m.RestApiUrls[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.RestApiUrls[iNdEx]))) + i-- + dAtA[i] = 0x4a + } + } + if len(m.EvmRpcs) > 0 { + for iNdEx := len(m.EvmRpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.EvmRpcs[iNdEx]) + copy(dAtA[i:], m.EvmRpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.EvmRpcs[iNdEx]))) + i-- + dAtA[i] = 0x42 + } + } + if len(m.Rpcs) > 0 { + for iNdEx := len(m.Rpcs) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Rpcs[iNdEx]) + copy(dAtA[i:], m.Rpcs[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Rpcs[iNdEx]))) + i-- + dAtA[i] = 0x3a + } + } + if len(m.P2PSeeds) > 0 { + for iNdEx := len(m.P2PSeeds) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.P2PSeeds[iNdEx]) + copy(dAtA[i:], m.P2PSeeds[iNdEx]) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.P2PSeeds[iNdEx]))) + i-- + dAtA[i] = 0x32 + } + } + if len(m.Details) > 0 { + i -= len(m.Details) + copy(dAtA[i:], m.Details) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Details))) + i-- + dAtA[i] = 0x2a + } + if len(m.Moniker) > 0 { + i -= len(m.Moniker) + copy(dAtA[i:], m.Moniker) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Moniker))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *ContactDetails) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ContactDetails) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ContactDetails) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Website) > 0 { + i -= len(m.Website) + copy(dAtA[i:], m.Website) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Website))) + i-- + dAtA[i] = 0x5a + } + if len(m.X) > 0 { + i -= len(m.X) + copy(dAtA[i:], m.X) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.X))) + i-- + dAtA[i] = 0x12 + } + if len(m.Telegram) > 0 { + i -= len(m.Telegram) + copy(dAtA[i:], m.Telegram) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Telegram))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SnapshotInfo) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *SnapshotInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SnapshotInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Checksum) > 0 { + i -= len(m.Checksum) + copy(dAtA[i:], m.Checksum) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Checksum))) + i-- + dAtA[i] = 0x1a + } + if m.Height != 0 { + i = encodeVarintMetadata(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x10 + } + if len(m.SnapshotUrl) > 0 { + i -= len(m.SnapshotUrl) + copy(dAtA[i:], m.SnapshotUrl) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.SnapshotUrl))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintMetadata(dAtA []byte, offset int, v uint64) int { + offset -= sovMetadata(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *SequencerMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Moniker) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Details) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.P2PSeeds) > 0 { + for _, s := range m.P2PSeeds { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.Rpcs) > 0 { + for _, s := range m.Rpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.EvmRpcs) > 0 { + for _, s := range m.EvmRpcs { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if len(m.RestApiUrls) > 0 { + for _, s := range m.RestApiUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + l = len(m.ExplorerUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.GenesisUrls) > 0 { + for _, s := range m.GenesisUrls { + l = len(s) + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.ContactDetails != nil { + l = m.ContactDetails.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.ExtraData) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if len(m.Snapshots) > 0 { + for _, e := range m.Snapshots { + l = e.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + } + if m.GasPrice != nil { + l = m.GasPrice.Size() + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *ContactDetails) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Telegram) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.X) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Website) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func (m *SnapshotInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SnapshotUrl) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + if m.Height != 0 { + n += 1 + sovMetadata(uint64(m.Height)) + } + l = len(m.Checksum) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + return n +} + +func sovMetadata(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozMetadata(x uint64) (n int) { + return sovMetadata(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *SequencerMetadata) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SequencerMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SequencerMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Moniker", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Moniker = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Details", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Details = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field P2PSeeds", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.P2PSeeds = append(m.P2PSeeds, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Rpcs = append(m.Rpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field EvmRpcs", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.EvmRpcs = append(m.EvmRpcs, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RestApiUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RestApiUrls = append(m.RestApiUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExplorerUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExplorerUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisUrls", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisUrls = append(m.GenesisUrls, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ContactDetails", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.ContactDetails == nil { + m.ContactDetails = &ContactDetails{} + } + if err := m.ContactDetails.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ExtraData", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ExtraData = append(m.ExtraData[:0], dAtA[iNdEx:postIndex]...) + if m.ExtraData == nil { + m.ExtraData = []byte{} + } + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Snapshots", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Snapshots = append(m.Snapshots, &SnapshotInfo{}) + if err := m.Snapshots[len(m.Snapshots)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GasPrice", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + var v github_com_cosmos_cosmos_sdk_types.Int + m.GasPrice = &v + if err := m.GasPrice.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *ContactDetails) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ContactDetails: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ContactDetails: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Telegram", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Telegram = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field X", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.X = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Website", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Website = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SnapshotInfo) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: SnapshotInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SnapshotInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SnapshotUrl", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SnapshotUrl = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Height", wireType) + } + m.Height = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Checksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowMetadata + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthMetadata + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthMetadata + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Checksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipMetadata(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthMetadata + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipMetadata(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowMetadata + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthMetadata + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupMetadata + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthMetadata + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthMetadata = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowMetadata = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupMetadata = fmt.Errorf("proto: unexpected end of group") +) diff --git a/utils/proto/test_data/gogo_proto/operating_status.pb.go b/utils/proto/test_data/gogo_proto/operating_status.pb.go new file mode 100644 index 000000000..e5fbe5cea --- /dev/null +++ b/utils/proto/test_data/gogo_proto/operating_status.pb.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/operating_status.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + math "math" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// OperatingStatus defines the operating status of a sequencer +type OperatingStatus int32 + +const ( + // OPERATING_STATUS_UNBONDED defines a sequencer that is not active and won't + // be scheduled + Unbonded OperatingStatus = 0 + // UNBONDING defines a sequencer that is currently unbonding. + Unbonding OperatingStatus = 1 + // OPERATING_STATUS_BONDED defines a sequencer that is bonded and can be + // scheduled + Bonded OperatingStatus = 2 +) + +var OperatingStatus_name = map[int32]string{ + 0: "OPERATING_STATUS_UNBONDED", + 1: "OPERATING_STATUS_UNBONDING", + 2: "OPERATING_STATUS_BONDED", +} + +var OperatingStatus_value = map[string]int32{ + "OPERATING_STATUS_UNBONDED": 0, + "OPERATING_STATUS_UNBONDING": 1, + "OPERATING_STATUS_BONDED": 2, +} + +func (x OperatingStatus) String() string { + return proto.EnumName(OperatingStatus_name, int32(x)) +} + +func (OperatingStatus) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_d854b24b5c08f0d1, []int{0} +} + +func init() { + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/operating_status.proto", fileDescriptor_d854b24b5c08f0d1) +} + +var fileDescriptor_d854b24b5c08f0d1 = []byte{ + // 263 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xb2, 0x2d, 0xa9, 0x2c, 0x48, + 0x2d, 0xd6, 0x4f, 0xa9, 0xcc, 0x4d, 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xab, 0xa8, 0xac, 0x42, 0x70, + 0xf4, 0x8b, 0x53, 0x0b, 0x4b, 0x53, 0xf3, 0x92, 0x53, 0x8b, 0xf4, 0xf3, 0x0b, 0x52, 0x8b, 0x12, + 0x4b, 0x32, 0xf3, 0xd2, 0xe3, 0x8b, 0x4b, 0x12, 0x4b, 0x4a, 0x8b, 0xf5, 0x0a, 0x8a, 0xf2, 0x4b, + 0xf2, 0x85, 0x14, 0x90, 0x35, 0xea, 0xc1, 0x39, 0x7a, 0x70, 0x8d, 0x52, 0x22, 0xe9, 0xf9, 0xe9, + 0xf9, 0x60, 0xc5, 0xfa, 0x20, 0x16, 0x44, 0x9f, 0xd6, 0x1c, 0x46, 0x2e, 0x7e, 0x7f, 0x98, 0x91, + 0xc1, 0x60, 0x13, 0x85, 0xb4, 0xb9, 0x24, 0xfd, 0x03, 0x5c, 0x83, 0x1c, 0x43, 0x3c, 0xfd, 0xdc, + 0xe3, 0x83, 0x43, 0x1c, 0x43, 0x42, 0x83, 0xe3, 0x43, 0xfd, 0x9c, 0xfc, 0xfd, 0x5c, 0x5c, 0x5d, + 0x04, 0x18, 0xa4, 0x78, 0xba, 0xe6, 0x2a, 0x70, 0x84, 0xe6, 0x25, 0xe5, 0xe7, 0xa5, 0xa4, 0xa6, + 0x08, 0xe9, 0x72, 0x49, 0xe1, 0x50, 0xec, 0xe9, 0xe7, 0x2e, 0xc0, 0x28, 0xc5, 0xdb, 0x35, 0x57, + 0x81, 0x13, 0xa2, 0x3a, 0x33, 0x2f, 0x5d, 0x48, 0x9d, 0x4b, 0x1c, 0x43, 0x39, 0xd4, 0x64, 0x26, + 0x29, 0xae, 0xae, 0xb9, 0x0a, 0x6c, 0x4e, 0x60, 0x73, 0xa5, 0x58, 0x3a, 0x16, 0xcb, 0x31, 0x38, + 0x25, 0x9d, 0x78, 0x24, 0xc7, 0x78, 0xe1, 0x91, 0x1c, 0xe3, 0x83, 0x47, 0x72, 0x8c, 0x13, 0x1e, + 0xcb, 0x31, 0x5c, 0x78, 0x2c, 0xc7, 0x70, 0xe3, 0xb1, 0x1c, 0x43, 0x94, 0x47, 0x7a, 0x66, 0x49, + 0x46, 0x69, 0x92, 0x5e, 0x72, 0x7e, 0x2e, 0x46, 0xa0, 0x65, 0xe6, 0x95, 0xe8, 0x43, 0x82, 0xb3, + 0x20, 0x89, 0x60, 0x88, 0x26, 0xb1, 0x81, 0x43, 0xc2, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x10, + 0x0f, 0x7d, 0xbc, 0x82, 0x01, 0x00, 0x00, +} diff --git a/utils/proto/test_data/gogo_proto/sequencer.pb.go b/utils/proto/test_data/gogo_proto/sequencer.pb.go new file mode 100644 index 000000000..c8e662fba --- /dev/null +++ b/utils/proto/test_data/gogo_proto/sequencer.pb.go @@ -0,0 +1,1241 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: types/dymensionxyz/dymension/sequencer/sequencer.proto + +package sequencer + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + github_com_cosmos_cosmos_sdk_types "github.com/cosmos/cosmos-sdk/types" + types1 "github.com/cosmos/cosmos-sdk/types" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + proto "github.com/gogo/protobuf/proto" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + types "github.com/gogo/protobuf/types" + _ "google.golang.org/protobuf/types/known/timestamppb" + io "io" + math "math" + math_bits "math/bits" + time "time" +) + +// Reference imports to suppress errors if they are not otherwise used. +var _ = proto.Marshal +var _ = fmt.Errorf +var _ = math.Inf +var _ = time.Kitchen + +// This is a compile-time assertion to ensure that this generated file +// is compatible with the proto package it is being compiled against. +// A compilation error at this line likely means your copy of the +// proto package needs to be updated. +const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package + +// Sequencer defines a sequencer identified by its' address (sequencerAddress). +// The sequencer could be attached to only one rollapp (rollappId). +type Sequencer struct { + // address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + // pubkey is the public key of the sequencers' dymint client, as a Protobuf Any. + DymintPubKey *types.Any `protobuf:"bytes,2,opt,name=dymintPubKey,proto3" json:"dymintPubKey,omitempty"` + // rollappId defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,3,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // metadata defines the extra information for the sequencer. + Metadata SequencerMetadata `protobuf:"bytes,4,opt,name=metadata,proto3" json:"metadata"` + // jailed defined whether the sequencer has been jailed from bonded status or not. + Jailed bool `protobuf:"varint,5,opt,name=jailed,proto3" json:"jailed,omitempty"` + Proposer bool `protobuf:"varint,6,opt,name=proposer,proto3" json:"proposer,omitempty"` // Deprecated: Do not use. + // status is the sequencer status (bonded/unbonding/unbonded). + Status OperatingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=dymensionxyz.dymension.sequencer.OperatingStatus" json:"status,omitempty"` + // tokens define the delegated tokens (incl. self-delegation). + Tokens github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,8,rep,name=tokens,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"tokens"` + // unbond_request_height stores the height at which this sequencer has + // requested to unbond. + UnbondRequestHeight int64 `protobuf:"varint,9,opt,name=unbond_request_height,json=unbondRequestHeight,proto3" json:"unbond_request_height,omitempty"` + // unbond_time defines the time when the sequencer will complete unbonding. + UnbondTime time.Time `protobuf:"bytes,10,opt,name=unbond_time,json=unbondTime,proto3,stdtime" json:"unbond_time"` + // notice_period_time defines the time when the sequencer will finish it's notice period if started + NoticePeriodTime time.Time `protobuf:"bytes,11,opt,name=notice_period_time,json=noticePeriodTime,proto3,stdtime" json:"notice_period_time"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,12,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,13,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` +} + +func (m *Sequencer) Reset() { *m = Sequencer{} } +func (m *Sequencer) String() string { return proto.CompactTextString(m) } +func (*Sequencer) ProtoMessage() {} +func (*Sequencer) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{0} +} +func (m *Sequencer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Sequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Sequencer.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *Sequencer) XXX_Merge(src proto.Message) { + xxx_messageInfo_Sequencer.Merge(m, src) +} +func (m *Sequencer) XXX_Size() int { + return m.Size() +} +func (m *Sequencer) XXX_DiscardUnknown() { + xxx_messageInfo_Sequencer.DiscardUnknown(m) +} + +var xxx_messageInfo_Sequencer proto.InternalMessageInfo + +func (m *Sequencer) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *Sequencer) GetDymintPubKey() *types.Any { + if m != nil { + return m.DymintPubKey + } + return nil +} + +func (m *Sequencer) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *Sequencer) GetMetadata() SequencerMetadata { + if m != nil { + return m.Metadata + } + return SequencerMetadata{} +} + +func (m *Sequencer) GetJailed() bool { + if m != nil { + return m.Jailed + } + return false +} + +// Deprecated: Do not use. +func (m *Sequencer) GetProposer() bool { + if m != nil { + return m.Proposer + } + return false +} + +func (m *Sequencer) GetStatus() OperatingStatus { + if m != nil { + return m.Status + } + return Unbonded +} + +func (m *Sequencer) GetTokens() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.Tokens + } + return nil +} + +func (m *Sequencer) GetUnbondRequestHeight() int64 { + if m != nil { + return m.UnbondRequestHeight + } + return 0 +} + +func (m *Sequencer) GetUnbondTime() time.Time { + if m != nil { + return m.UnbondTime + } + return time.Time{} +} + +func (m *Sequencer) GetNoticePeriodTime() time.Time { + if m != nil { + return m.NoticePeriodTime + } + return time.Time{} +} + +func (m *Sequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *Sequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + +// BondReduction defines an object which holds the information about the sequencer and its queued unbonding amount +type BondReduction struct { + // sequencer_address is the bech32-encoded address of the sequencer account which is the account that the message was sent from. + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencer_address,json=sequencerAddress,proto3" json:"sequencer_address,omitempty"` + // decrease_bond_amount is the amount of tokens to be unbonded. + DecreaseBondAmount types1.Coin `protobuf:"bytes,2,opt,name=decrease_bond_amount,json=decreaseBondAmount,proto3" json:"decrease_bond_amount"` + // decrease_bond_time defines, if unbonding, the min time for the sequencer to complete unbonding. + DecreaseBondTime time.Time `protobuf:"bytes,3,opt,name=decrease_bond_time,json=decreaseBondTime,proto3,stdtime" json:"decrease_bond_time"` +} + +func (m *BondReduction) Reset() { *m = BondReduction{} } +func (m *BondReduction) String() string { return proto.CompactTextString(m) } +func (*BondReduction) ProtoMessage() {} +func (*BondReduction) Descriptor() ([]byte, []int) { + return fileDescriptor_0c9d1421effe42e1, []int{1} +} +func (m *BondReduction) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BondReduction) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BondReduction.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *BondReduction) XXX_Merge(src proto.Message) { + xxx_messageInfo_BondReduction.Merge(m, src) +} +func (m *BondReduction) XXX_Size() int { + return m.Size() +} +func (m *BondReduction) XXX_DiscardUnknown() { + xxx_messageInfo_BondReduction.DiscardUnknown(m) +} + +var xxx_messageInfo_BondReduction proto.InternalMessageInfo + +func (m *BondReduction) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +func (m *BondReduction) GetDecreaseBondAmount() types1.Coin { + if m != nil { + return m.DecreaseBondAmount + } + return types1.Coin{} +} + +func (m *BondReduction) GetDecreaseBondTime() time.Time { + if m != nil { + return m.DecreaseBondTime + } + return time.Time{} +} + +func init() { + proto.RegisterType((*Sequencer)(nil), "dymensionxyz.dymension.sequencer.Sequencer") + proto.RegisterType((*BondReduction)(nil), "dymensionxyz.dymension.sequencer.BondReduction") +} + +func init() { + proto.RegisterFile("types/dymensionxyz/dymension/sequencer/sequencer.proto", fileDescriptor_0c9d1421effe42e1) +} + +var fileDescriptor_0c9d1421effe42e1 = []byte{ + // 706 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x41, 0x4f, 0xdb, 0x48, + 0x18, 0x8d, 0x09, 0x84, 0x64, 0x02, 0x2b, 0x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7d, 0x98, 0x17, 0x95, 0xe5, 0x47, 0x92, 0xe8, 0x69, 0x01, 0x18, 0x82, + 0x86, 0xa0, 0xc7, 0x98, 0x70, 0xb3, 0x69, 0xd5, 0xed, 0xf6, 0x60, 0xcb, 0xd1, 0x66, 0x95, 0xc9, + 0x71, 0x74, 0x72, 0x9c, 0x27, 0x34, 0x21, 0xa3, 0x07, 0xe5, 0xf4, 0x9f, 0x2e, 0x7b, 0x76, 0x9c, + 0x88, 0x71, 0x1e, 0x38, 0x21, 0x4d, 0xab, 0x00, 0xa9, 0xc7, 0x2e, 0x8f, 0x8e, 0x5d, 0x19, 0x01, + 0x49, 0xe0, 0x9e, 0x96, 0x86, 0x03, 0xf0, 0x57, 0x4e, 0x02, 0x4a, 0x22, 0x9f, 0x95, 0x03, 0x71, + 0xe1, 0x8f, 0x71, 0x12, 0x8f, 0x85, 0xd9, 0xb2, 0x0c, 0xbb, 0xee, 0x6d, 0x2a, 0xd0, 0x53, 0xd8, + 0xbe, 0x84, 0xe0, 0x53, 0xd0, 0xd6, 0x9c, 0x32, 0xe1, 0x26, 0x90, 0xae, 0x6f, 0xff, 0x72, 0xc6, + 0xaf, 0xaa, 0xf8, 0x8f, 0x9a, 0xe5, 0x78, 0x67, 0x97, 0x3d, 0xc3, 0x03, 0x8a, 0x58, 0x42, 0xd0, + 0x03, 0x90, 0x50, 0x91, 0x84, 0xd8, 0xcf, 0x30, 0x4b, 0xa8, 0x56, 0x6b, 0xdf, 0x43, 0x6d, 0x43, + 0xf1, 0x0f, 0x25, 0x5d, 0x6a, 0xf6, 0x40, 0x9b, 0xe1, 0x53, 0xc4, 0x22, 0xbf, 0x4c, 0xa4, 0xb9, + 0x26, 0xd3, 0x02, 0xd4, 0xd2, 0x30, 0x8a, 0x18, 0xec, 0x83, 0xce, 0xe9, 0x38, 0x11, 0x78, 0x92, + 0x70, 0x81, 0xcb, 0x4d, 0x4f, 0x50, 0x81, 0x19, 0x37, 0xd7, 0xad, 0xba, 0xdd, 0xf2, 0x36, 0xe7, + 0x30, 0x4f, 0x43, 0x3b, 0x53, 0x03, 0xac, 0x8f, 0xa4, 0x09, 0x51, 0x1e, 0x8a, 0x84, 0x12, 0xf8, + 0x3f, 0xf8, 0x73, 0x76, 0x7c, 0xfe, 0xe2, 0x4d, 0xd8, 0x98, 0x01, 0x43, 0x7d, 0x25, 0x5e, 0x82, + 0x4e, 0x84, 0x43, 0x86, 0x11, 0xc7, 0xbe, 0x34, 0x0d, 0xa5, 0x34, 0x27, 0x42, 0x5f, 0x8d, 0xdf, + 0x1c, 0xaa, 0x8a, 0x24, 0xac, 0xc8, 0xe5, 0x08, 0x43, 0x49, 0x2d, 0x9d, 0x5b, 0x94, 0x94, 0xce, + 0xd5, 0xef, 0xe3, 0xdc, 0xbc, 0x6a, 0xd9, 0x30, 0x0a, 0xce, 0xaf, 0xba, 0xc6, 0xc5, 0x55, 0xd7, + 0xf8, 0x7e, 0xd5, 0x35, 0xce, 0xa6, 0xdd, 0xda, 0xc5, 0xb4, 0x5b, 0xfb, 0x3a, 0xed, 0xd6, 0xde, + 0xec, 0xcf, 0x85, 0xea, 0xe6, 0xff, 0x23, 0x21, 0x42, 0xc5, 0xca, 0xcd, 0x82, 0x5b, 0x7f, 0x2e, + 0x41, 0x43, 0xce, 0xb4, 0xf7, 0x33, 0x00, 0x00, 0xff, 0xff, 0xa2, 0xd8, 0xa4, 0x12, 0xd0, 0x05, + 0x00, 0x00, +} + +func (m *Sequencer) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *Sequencer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x6a + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x62 + } + n1, err1 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.NoticePeriodTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintSequencer(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x5a + n2, err2 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.UnbondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintSequencer(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x52 + if m.UnbondRequestHeight != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.UnbondRequestHeight)) + i-- + dAtA[i] = 0x48 + } + if len(m.Tokens) > 0 { + for iNdEx := len(m.Tokens) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Tokens[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x42 + } + } + if m.Status != 0 { + i = encodeVarintSequencer(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x38 + } + if m.Proposer { + i-- + if m.Proposer { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x30 + } + if m.Jailed { + i-- + if m.Jailed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x28 + } + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x1a + } + if m.DymintPubKey != nil { + { + size, err := m.DymintPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *BondReduction) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *BondReduction) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BondReduction) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.DecreaseBondTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime):]) + if err5 != nil { + return 0, err5 + } + i -= n5 + i = encodeVarintSequencer(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0x1a + { + size, err := m.DecreaseBondAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintSequencer(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintSequencer(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintSequencer(dAtA []byte, offset int, v uint64) int { + offset -= sovSequencer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Sequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if m.DymintPubKey != nil { + l = m.DymintPubKey.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovSequencer(uint64(l)) + if m.Jailed { + n += 2 + } + if m.Proposer { + n += 2 + } + if m.Status != 0 { + n += 1 + sovSequencer(uint64(m.Status)) + } + if len(m.Tokens) > 0 { + for _, e := range m.Tokens { + l = e.Size() + n += 1 + l + sovSequencer(uint64(l)) + } + } + if m.UnbondRequestHeight != 0 { + n += 1 + sovSequencer(uint64(m.UnbondRequestHeight)) + } + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.UnbondTime) + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.NoticePeriodTime) + n += 1 + l + sovSequencer(uint64(l)) + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovSequencer(uint64(l)) + } + } + return n +} + +func (m *BondReduction) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovSequencer(uint64(l)) + } + l = m.DecreaseBondAmount.Size() + n += 1 + l + sovSequencer(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.DecreaseBondTime) + n += 1 + l + sovSequencer(uint64(l)) + return n +} + +func sovSequencer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozSequencer(x uint64) (n int) { + return sovSequencer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Sequencer) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: Sequencer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Sequencer: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Address", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Address = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DymintPubKey", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.DymintPubKey == nil { + m.DymintPubKey = &types.Any{} + } + if err := m.DymintPubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Jailed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Jailed = bool(v != 0) + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Proposer = bool(v != 0) + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Status", wireType) + } + m.Status = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= OperatingStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Tokens", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Tokens = append(m.Tokens, types1.Coin{}) + if err := m.Tokens[len(m.Tokens)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondRequestHeight", wireType) + } + m.UnbondRequestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.UnbondRequestHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.UnbondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoticePeriodTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.NoticePeriodTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BondReduction) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: BondReduction: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BondReduction: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerAddress", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondAmount", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.DecreaseBondAmount.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DecreaseBondTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowSequencer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthSequencer + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthSequencer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.DecreaseBondTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipSequencer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthSequencer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipSequencer(dAtA []byte) (n int, err error) { + l := len(dAtA) + iNdEx := 0 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= (uint64(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + wireType := int(wire & 0x7) + switch wireType { + case 0: + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + iNdEx++ + if dAtA[iNdEx-1] < 0x80 { + break + } + } + case 1: + iNdEx += 8 + case 2: + var length int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowSequencer + } + if iNdEx >= l { + return 0, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + length |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + if length < 0 { + return 0, ErrInvalidLengthSequencer + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupSequencer + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthSequencer + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthSequencer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowSequencer = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupSequencer = fmt.Errorf("proto: unexpected end of group") +) From 05b493026cfe1aee9262402c55a944498dea84b6 Mon Sep 17 00:00:00 2001 From: keruch Date: Tue, 15 Oct 2024 09:54:58 +0200 Subject: [PATCH 22/27] fix build --- settlement/dymension/dymension.go | 3 --- settlement/dymension/dymension_test.go | 4 ---- 2 files changed, 7 deletions(-) diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index 36c7d9576..201006f31 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -22,9 +22,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" - protoutils "github.com/dymensionxyz/dymint/utils/proto" - "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/types" diff --git a/settlement/dymension/dymension_test.go b/settlement/dymension/dymension_test.go index 74b0ceeb8..fdd712914 100644 --- a/settlement/dymension/dymension_test.go +++ b/settlement/dymension/dymension_test.go @@ -22,10 +22,6 @@ import ( "google.golang.org/grpc/codes" "google.golang.org/grpc/status" - sequencertypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" - sequencertypes "github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/sequencer" - protoutils "github.com/dymensionxyz/dymint/utils/proto" - "github.com/dymensionxyz/dymint/da" dymensionmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/settlement/dymension" rollapptypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/types/pb/dymensionxyz/dymension/rollapp" From e3fc776dc922ec2f6056b77f15424a27f7809d90 Mon Sep 17 00:00:00 2001 From: keruch Date: Wed, 16 Oct 2024 15:31:01 +0200 Subject: [PATCH 23/27] threads --- block/consensus.go | 46 ++++++++++++++++++++++++++++++ block/produce.go | 65 ++++++++---------------------------------- block/sequencers.go | 14 ++++----- types/sequencer_set.go | 12 ++++++++ 4 files changed, 76 insertions(+), 61 deletions(-) diff --git a/block/consensus.go b/block/consensus.go index 1078fa1ee..834cf822c 100644 --- a/block/consensus.go +++ b/block/consensus.go @@ -1,9 +1,55 @@ package block import ( + "fmt" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/gogo/protobuf/proto" + + rdktypes "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers/types" + protoutils "github.com/dymensionxyz/dymint/utils/proto" ) type ConsensusMessagesStream interface { GetConsensusMessages() ([]proto.Message, error) } + +// consensusMsgsOnCreateBlock forms a list of consensus messages that need execution on rollapp's BeginBlock. +// Currently, we need to create a sequencer in the rollapp if it doesn't exist in the following cases: +// - On the very first block after the genesis or +// - On the last block of the current sequencer (eg, during the rotation). +func (m *Manager) consensusMsgsOnCreateBlock( + nextProposerSettlementAddr string, + lastSeqBlock bool, // Indicates that the block is the last for the current seq. True during the rotation. +) ([]proto.Message, error) { + if !m.State.IsGenesis() && !lastSeqBlock { + return nil, nil + } + + nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) + // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. + if nextSeq == nil { + return nil, fmt.Errorf("no sequencer found for address while creating a new block: %s", nextProposerSettlementAddr) + } + + // Get proposer's consensus public key and convert it to proto.Any + val, err := nextSeq.TMValidator() + if err != nil { + return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) + } + pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + if err != nil { + return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) + } + anyPK, err := codectypes.NewAnyWithValue(pubKey) + if err != nil { + return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) + } + + return []proto.Message{&rdktypes.ConsensusMsgUpsertSequencer{ + Operator: nextProposerSettlementAddr, + ConsPubKey: protoutils.CosmosToGogo(anyPK), + RewardAddr: nextProposerSettlementAddr, + }}, nil +} diff --git a/block/produce.go b/block/produce.go index ff458887e..599b72ad4 100644 --- a/block/produce.go +++ b/block/produce.go @@ -6,22 +6,16 @@ import ( "fmt" "time" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/dymensionxyz/gerr-cosmos/gerrc" - "github.com/gogo/protobuf/proto" tmed25519 "github.com/tendermint/tendermint/crypto/ed25519" cmtproto "github.com/tendermint/tendermint/proto/tendermint/types" tmtypes "github.com/tendermint/tendermint/types" tmtime "github.com/tendermint/tendermint/types/time" - sequencertypes "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers/types" - "github.com/dymensionxyz/dymint/node/events" "github.com/dymensionxyz/dymint/store" "github.com/dymensionxyz/dymint/types" uevent "github.com/dymensionxyz/dymint/utils/event" - protoutils "github.com/dymensionxyz/dymint/utils/proto" ) // ProduceBlockLoop is calling publishBlock in a loop as long as we're synced. @@ -109,8 +103,8 @@ type nextProposerInfo struct { } // ProduceApplyGossipLastBlock produces and applies a block with the given nextProposerHash. -func (m *Manager) ProduceApplyGossipLastBlock(ctx context.Context, nextProposerInfo nextProposerInfo) (err error) { - _, _, err = m.produceApplyGossip(ctx, true, &nextProposerInfo) +func (m *Manager) ProduceApplyGossipLastBlock(ctx context.Context, nextProposerHash [32]byte) (err error) { + _, _, err = m.produceApplyGossip(ctx, true, &nextProposerHash) return err } @@ -118,8 +112,8 @@ func (m *Manager) ProduceApplyGossipBlock(ctx context.Context, allowEmpty bool) return m.produceApplyGossip(ctx, allowEmpty, nil) } -func (m *Manager) produceApplyGossip(ctx context.Context, allowEmpty bool, nextProposerInfo *nextProposerInfo) (block *types.Block, commit *types.Commit, err error) { - block, commit, err = m.produceBlock(allowEmpty, nextProposerInfo) +func (m *Manager) produceApplyGossip(ctx context.Context, allowEmpty bool, nextProposerHash *[32]byte) (block *types.Block, commit *types.Commit, err error) { + block, commit, err = m.produceBlock(allowEmpty, nextProposerHash) if err != nil { return nil, nil, fmt.Errorf("produce block: %w", err) } @@ -135,7 +129,7 @@ func (m *Manager) produceApplyGossip(ctx context.Context, allowEmpty bool, nextP return block, commit, nil } -func (m *Manager) produceBlock(allowEmpty bool, nextProposerInfo *nextProposerInfo) (*types.Block, *types.Commit, error) { +func (m *Manager) produceBlock(allowEmpty bool, nextProposerHash *[32]byte) (*types.Block, *types.Commit, error) { newHeight := m.State.NextHeight() lastHeaderHash, lastCommit, err := m.GetPreviousBlockHashes(newHeight) if err != nil { @@ -167,10 +161,14 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerInfo *nextProposerIn lastProposerBlock = false // Indicates that the block is the last for the current seq. True during the rotation. ) // if nextProposerInfo is set, we create a last block - if nextProposerInfo != nil { + if nextProposerHash != nil { + nextSeq, err := m.State.Sequencers.GetByHash(nextProposerHash[:]) + if err != nil { + return nil, nil, fmt.Errorf("get next sequencer by hash: %w", err) + } maxBlockDataSize = 0 - proposerHashForBlock = nextProposerInfo.nextProposerHash - nextProposerAddr = nextProposerInfo.nextProposerAddr + proposerHashForBlock = *nextProposerHash + nextProposerAddr = nextSeq.SettlementAddress lastProposerBlock = true } // TODO: Ideally, there should be only one point for adding consensus messages. Given that they come from @@ -197,45 +195,6 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerInfo *nextProposerIn return block, commit, nil } -// consensusMsgsOnCreateBlock forms a list of consensus messages that need execution on rollapp's BeginBlock. -// Currently, we need to create a sequencer in the rollapp if it doesn't exist in the following cases: -// - On the very first block after the genesis or -// - On the last block of the current sequencer (eg, during the rotation). -func (m *Manager) consensusMsgsOnCreateBlock( - nextProposerSettlementAddr string, - lastSeqBlock bool, // Indicates that the block is the last for the current seq. True during the rotation. -) ([]proto.Message, error) { - if !m.State.IsGenesis() && !lastSeqBlock { - return nil, nil - } - - nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) - // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. - if nextSeq == nil { - return nil, fmt.Errorf("no sequencer found for address while creating a new block: %s", nextProposerSettlementAddr) - } - - // Get proposer's consensus public key and convert it to proto.Any - val, err := nextSeq.TMValidator() - if err != nil { - return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) - } - pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - if err != nil { - return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) - } - anyPK, err := codectypes.NewAnyWithValue(pubKey) - if err != nil { - return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) - } - - return []proto.Message{&sequencertypes.ConsensusMsgUpsertSequencer{ - Operator: nextProposerSettlementAddr, - ConsPubKey: protoutils.CosmosToGogo(anyPK), - RewardAddr: nextProposerSettlementAddr, - }}, nil -} - // create commit for block func (m *Manager) createCommit(block *types.Block) (*types.Commit, error) { abciHeaderPb := types.ToABCIHeaderPB(&block.Header) diff --git a/block/sequencers.go b/block/sequencers.go index 671e92d11..f120c4b33 100644 --- a/block/sequencers.go +++ b/block/sequencers.go @@ -6,9 +6,10 @@ import ( "fmt" "time" + "github.com/tendermint/tendermint/libs/pubsub" + "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/types" - "github.com/tendermint/tendermint/libs/pubsub" ) func (m *Manager) MonitorSequencerRotation(ctx context.Context, rotateC chan string) error { @@ -120,10 +121,7 @@ func (m *Manager) CompleteRotation(ctx context.Context, nextSeqAddr string) erro copy(nextSeqHash[:], seq.Hash()) } - err := m.CreateAndPostLastBatch(ctx, nextProposerInfo{ - nextProposerHash: nextSeqHash, - nextProposerAddr: nextSeqAddr, - }) + err := m.CreateAndPostLastBatch(ctx, nextSeqHash) if err != nil { return fmt.Errorf("create and post last batch: %w", err) } @@ -134,7 +132,7 @@ func (m *Manager) CompleteRotation(ctx context.Context, nextSeqAddr string) erro // CreateAndPostLastBatch creates and posts the last batch to the hub // this called after manager shuts down the block producer and submitter -func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextProposerInfo nextProposerInfo) error { +func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextSeqHash [32]byte) error { h := m.State.Height() block, err := m.Store.LoadBlock(h) if err != nil { @@ -142,10 +140,10 @@ func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextProposerInfo n } // check if the last block already produced with nextProposerHash set - if bytes.Equal(block.Header.NextSequencersHash[:], nextProposerInfo.nextProposerHash[:]) { + if bytes.Equal(block.Header.NextSequencersHash[:], nextSeqHash[:]) { m.logger.Debug("Last block already produced and applied.") } else { - err := m.ProduceApplyGossipLastBlock(ctx, nextProposerInfo) + err := m.ProduceApplyGossipLastBlock(ctx, nextSeqHash) if err != nil { return fmt.Errorf("produce apply gossip last block: %w", err) } diff --git a/types/sequencer_set.go b/types/sequencer_set.go index b557147a0..27df2a12e 100644 --- a/types/sequencer_set.go +++ b/types/sequencer_set.go @@ -97,6 +97,18 @@ func (s *SequencerSet) SetProposerByHash(hash []byte) error { return ErrMissingProposerPubKey } +// GetByHash gets the sequencer by hash. It returns an error if the hash is not found in the sequencer set. +func (s *SequencerSet) GetByHash(hash []byte) (Sequencer, error) { + for _, seq := range s.Sequencers { + if bytes.Equal(seq.Hash(), hash) { + return seq, nil + } + } + // can't find the proposer in the sequencer set + // can happen in cases where the node is not synced with the SL and the sequencer array in the set is not updated + return Sequencer{}, ErrMissingProposerPubKey +} + // SetProposer sets the proposer and adds it to the sequencer set if not already present. func (s *SequencerSet) SetProposer(proposer *Sequencer) { if proposer == nil { From 3a7aebd4e000782a8647ea6ec20c63dc3699e2c6 Mon Sep 17 00:00:00 2001 From: keruch Date: Wed, 16 Oct 2024 15:50:50 +0200 Subject: [PATCH 24/27] threads 1 --- block/produce.go | 8 -------- buf.yaml | 1 + go.mod | 8 ++++---- go.sum | 12 ++++++------ p2p/client_test.go | 1 + 5 files changed, 12 insertions(+), 18 deletions(-) diff --git a/block/produce.go b/block/produce.go index 599b72ad4..99a00e852 100644 --- a/block/produce.go +++ b/block/produce.go @@ -94,14 +94,6 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) } } -// nextProposerInfo holds information about the next proposer. -type nextProposerInfo struct { - // nextProposerHash is a tendermint-compatible hash of the sequencer. - nextProposerHash [32]byte - // nextProposerAddr is a sequencer's settlement address. - nextProposerAddr string -} - // ProduceApplyGossipLastBlock produces and applies a block with the given nextProposerHash. func (m *Manager) ProduceApplyGossipLastBlock(ctx context.Context, nextProposerHash [32]byte) (err error) { _, _, err = m.produceApplyGossip(ctx, true, &nextProposerHash) diff --git a/buf.yaml b/buf.yaml index ddd1a9051..6ed37d3af 100644 --- a/buf.yaml +++ b/buf.yaml @@ -3,6 +3,7 @@ version: v1beta1 build: roots: - proto + - third_party/proto lint: use: - DEFAULT diff --git a/go.mod b/go.mod index b0d841944..1be30661b 100644 --- a/go.mod +++ b/go.mod @@ -46,14 +46,13 @@ require ( cloud.google.com/go/storage v1.38.0 // indirect github.com/celestiaorg/go-square v1.0.1 // indirect github.com/celestiaorg/go-square/merkle v0.0.0-20240429192549-dea967e1533b // indirect - github.com/cosmos/ibc-go/v6 v6.2.1 // indirect github.com/cskr/pubsub v1.0.2 // indirect github.com/dgraph-io/badger/v3 v3.2103.3 // indirect github.com/felixge/httpsnoop v1.0.4 // indirect github.com/hashicorp/go-getter v1.7.5 // indirect github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect - github.com/tklauser/numcpus v0.6.0 // indirect + github.com/tklauser/go-sysconf v0.3.11 // indirect google.golang.org/api v0.169.0 // indirect ) @@ -258,7 +257,7 @@ require ( require ( cosmossdk.io/math v1.3.0 // indirect - github.com/DataDog/zstd v1.5.5 // indirect + github.com/DataDog/zstd v1.5.2 // indirect github.com/Jorropo/jsync v1.0.1 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect @@ -268,9 +267,10 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect + github.com/cosmos/ibc-go/v6 v6.2.1 // indirect github.com/danwt/gerr v1.0.0 // indirect github.com/evmos/evmos/v12 v12.1.6 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.18.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect github.com/holiman/uint256 v1.2.2 // indirect github.com/ipfs/bbloom v0.0.4 // indirect diff --git a/go.sum b/go.sum index 38fdd11b2..cba754ced 100644 --- a/go.sum +++ b/go.sum @@ -212,8 +212,8 @@ github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym github.com/ChainSafe/go-schnorrkel v1.0.0 h1:3aDA67lAykLaG1y3AOjs88dMxC88PgUuHRrLeDnvGIM= github.com/ChainSafe/go-schnorrkel v1.0.0/go.mod h1:dpzHYVxLZcp8pjlV+O+UR8K0Hp/z7vcchBSbMBEhCw4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= -github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= -github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= +github.com/DataDog/zstd v1.5.2 h1:vUG4lAyuPCXO0TLbXvPv7EB7cNK1QV/luu55UHLrrn8= +github.com/DataDog/zstd v1.5.2/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= github.com/Jorropo/jsync v1.0.1 h1:6HgRolFZnsdfzRUj+ImB9og1JYOxQoReSywkHOGSaUU= github.com/Jorropo/jsync v1.0.1/go.mod h1:jCOZj3vrBCri3bSU3ErUYvevKlnbssrXeCivybS5ABQ= github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow= @@ -509,8 +509,8 @@ github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4 github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff h1:tY80oXqGNY4FhTFhk+o9oFHGINQ/+vhlm8HFzi6znCI= github.com/gballet/go-libpcsclite v0.0.0-20190607065134-2772fd86a8ff/go.mod h1:x7DCsMOv1taUwEWCzT4cmDeAkigA5/QCwUodaVOe8Ww= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.18.0 h1:MtBW5H9QgdcJabtZcuJG80BMOwaBpkRDZkxRkNC1sN0= +github.com/getsentry/sentry-go v0.18.0/go.mod h1:Kgon4Mby+FJ7ZWHFUAZgVaIa8sxHtnRJRLTXZr51aKQ= github.com/ghodss/yaml v1.0.0 h1:wQHKEahhL6wmXdzwWG11gIVCkOv05bNOh+Rxn0yngAk= github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= github.com/gliderlabs/ssh v0.1.1/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= @@ -1200,8 +1200,8 @@ github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso github.com/tidwall/sjson v1.2.5 h1:kLy8mja+1c9jlljvWTlSazM7cKDRfJuR/bOJhcY5NcY= github.com/tidwall/sjson v1.2.5/go.mod h1:Fvgq9kS/6ociJEDnK0Fk1cpYF4FIW6ZF7LAe+6jwd28= github.com/tinylib/msgp v1.1.5/go.mod h1:eQsjooMTnV42mHu917E26IogZ2930nFyBQdofk10Udg= -github.com/tklauser/go-sysconf v0.3.10 h1:IJ1AZGZRWbY8T5Vfk04D9WOA5WSejdflXxP03OUqALw= -github.com/tklauser/go-sysconf v0.3.10/go.mod h1:C8XykCvCb+Gn0oNCWPIlcb0RuglQTYaQ2hGm7jmxEFk= +github.com/tklauser/go-sysconf v0.3.11 h1:89WgdJhk5SNwJfu+GKyYveZ4IaJ7xAkecBo+KdJV0CM= +github.com/tklauser/go-sysconf v0.3.11/go.mod h1:GqXfhXY3kiPa0nAXPDIQIWzJbMCB7AmcWpGR8lSZfqI= github.com/tklauser/numcpus v0.6.0 h1:kebhY2Qt+3U6RNK7UqpYNA+tJ23IBEGKkB7JQBfDYms= github.com/tklauser/numcpus v0.6.0/go.mod h1:FEZLMke0lhOUG6w2JadTzp0a+Nl8PF/GFkQ5UVIcaL4= github.com/ttacon/chalk v0.0.0-20160626202418-22c06c80ed31/go.mod h1:onvgF043R+lC5RZ8IT9rBXDaEDnpnw/Cl+HFiw+v/7Q= diff --git a/p2p/client_test.go b/p2p/client_test.go index fcf2ab293..41661f5d5 100644 --- a/p2p/client_test.go +++ b/p2p/client_test.go @@ -51,6 +51,7 @@ func TestClientStartup(t *testing.T) { } // TestBootstrapping TODO: this test is flaky in main. Try running it 100 times to reproduce. +// https://github.com/dymensionxyz/dymint/issues/869 func TestBootstrapping(t *testing.T) { assert := assert.New(t) logger := log.TestingLogger() From c1b5049897bb8cf3b3c489c6b388f95e855d0841 Mon Sep 17 00:00:00 2001 From: keruch Date: Wed, 16 Oct 2024 20:13:25 +0200 Subject: [PATCH 25/27] feat: added sequencer set polling and consensus msgs queue --- block/consensus.go | 85 ++-- block/executor.go | 8 +- block/executor_test.go | 10 +- block/manager.go | 5 +- block/produce.go | 18 +- block/sequencers.go | 56 ++- block/submit_test.go | 7 +- proto/types/dymint/dymint.proto | 4 + proto/types/rollapp/sequencers/types/tx.proto | 26 +- settlement/dymension/dymension.go | 23 +- settlement/grpc/grpc.go | 7 +- settlement/local/local.go | 7 +- testutil/types.go | 16 +- types/pb/dymint/dymint.pb.go | 219 ++++++--- types/pb/rollapp/sequencers/types/tx.pb.go | 432 +++++++++--------- types/sequencer_set.go | 67 ++- types/sequencer_set_test.go | 86 ++++ types/serialization.go | 78 ++-- types/serialization_test.go | 9 +- utils/queue/queue.go | 50 ++ utils/queue/queue_test.go | 59 +++ 21 files changed, 850 insertions(+), 422 deletions(-) create mode 100644 types/sequencer_set_test.go create mode 100644 utils/queue/queue.go create mode 100644 utils/queue/queue_test.go diff --git a/block/consensus.go b/block/consensus.go index 834cf822c..b60deab33 100644 --- a/block/consensus.go +++ b/block/consensus.go @@ -2,54 +2,71 @@ package block import ( "fmt" + "sync" codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/gogo/protobuf/proto" + "github.com/dymensionxyz/dymint/types" rdktypes "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers/types" protoutils "github.com/dymensionxyz/dymint/utils/proto" + "github.com/dymensionxyz/dymint/utils/queue" ) type ConsensusMessagesStream interface { - GetConsensusMessages() ([]proto.Message, error) + Add(...proto.Message) + Get() []proto.Message } -// consensusMsgsOnCreateBlock forms a list of consensus messages that need execution on rollapp's BeginBlock. -// Currently, we need to create a sequencer in the rollapp if it doesn't exist in the following cases: -// - On the very first block after the genesis or -// - On the last block of the current sequencer (eg, during the rotation). -func (m *Manager) consensusMsgsOnCreateBlock( - nextProposerSettlementAddr string, - lastSeqBlock bool, // Indicates that the block is the last for the current seq. True during the rotation. -) ([]proto.Message, error) { - if !m.State.IsGenesis() && !lastSeqBlock { - return nil, nil - } +type ConsensusMessagesQueue struct { + mu sync.Mutex + queue *queue.Queue[proto.Message] +} - nextSeq := m.State.Sequencers.GetByAddress(nextProposerSettlementAddr) - // Sanity check. Must never happen in practice. The sequencer's existence is verified beforehand in Manager.CompleteRotation. - if nextSeq == nil { - return nil, fmt.Errorf("no sequencer found for address while creating a new block: %s", nextProposerSettlementAddr) +func NewConsensusMessagesQueue() *ConsensusMessagesQueue { + return &ConsensusMessagesQueue{ + mu: sync.Mutex{}, + queue: queue.New[proto.Message](), } +} - // Get proposer's consensus public key and convert it to proto.Any - val, err := nextSeq.TMValidator() - if err != nil { - return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) - } - pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - if err != nil { - return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) - } - anyPK, err := codectypes.NewAnyWithValue(pubKey) - if err != nil { - return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) - } +func (q *ConsensusMessagesQueue) Add(message ...proto.Message) { + q.mu.Lock() + defer q.mu.Unlock() + q.queue.Enqueue(message...) +} + +func (q *ConsensusMessagesQueue) Get() []proto.Message { + q.mu.Lock() + defer q.mu.Unlock() + return q.queue.DequeueAll() +} - return []proto.Message{&rdktypes.ConsensusMsgUpsertSequencer{ - Operator: nextProposerSettlementAddr, - ConsPubKey: protoutils.CosmosToGogo(anyPK), - RewardAddr: nextProposerSettlementAddr, - }}, nil +// ConsensusMsgsOnSequencerSetUpdate forms a list of consensus messages to handle the sequencer set update. +func ConsensusMsgsOnSequencerSetUpdate(newSequencers []types.Sequencer) ([]proto.Message, error) { + msgs := make([]proto.Message, 0, len(newSequencers)) + for _, s := range newSequencers { + // Get proposer's consensus public key and convert it to proto.Any + val, err := s.TMValidator() + if err != nil { + return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) + } + pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + if err != nil { + return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) + } + anyPK, err := codectypes.NewAnyWithValue(pubKey) + if err != nil { + return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) + } + + msgs = append(msgs, &rdktypes.ConsensusMsgUpsertSequencer{ + Operator: s.SettlementAddress, + ConsPubKey: protoutils.CosmosToGogo(anyPK), + RewardAddr: s.RewardAddr, + Relayers: s.WhitelistedRelayers, + }) + } + return msgs, nil } diff --git a/block/executor.go b/block/executor.go index feeaadd18..33de64dc1 100644 --- a/block/executor.go +++ b/block/executor.go @@ -111,17 +111,13 @@ func (e *Executor) CreateBlock( lastHeaderHash, nextSeqHash [32]byte, state *types.State, maxBlockDataSizeBytes uint64, - consensusMsgs ...proto2.Message, ) *types.Block { maxBlockDataSizeBytes = min(maxBlockDataSizeBytes, uint64(max(minBlockMaxBytes, state.ConsensusParams.Block.MaxBytes))) mempoolTxs := e.mempool.ReapMaxBytesMaxGas(int64(maxBlockDataSizeBytes), state.ConsensusParams.Block.MaxGas) + var consensusMsgs []proto2.Message if e.consensusMessagesStream != nil { - consensusMessages, err := e.consensusMessagesStream.GetConsensusMessages() - if err != nil { - e.logger.Error("Failed to get consensus messages", "error", err) - } - consensusMsgs = append(consensusMsgs, consensusMessages...) + consensusMsgs = e.consensusMessagesStream.Get() } block := &types.Block{ diff --git a/block/executor_test.go b/block/executor_test.go index e7888576e..c6b816eea 100644 --- a/block/executor_test.go +++ b/block/executor_test.go @@ -117,7 +117,7 @@ func TestCreateBlockWithConsensusMessages(t *testing.T) { // Create a mock ConsensusMessagesStream mockStream := &MockConsensusMessagesStream{} - mockStream.On("GetConsensusMessages").Return([]proto.Message{ + mockStream.On("Get").Return([]proto.Message{ theMsg1, theMsg2, }, nil) @@ -172,9 +172,13 @@ type MockConsensusMessagesStream struct { mock.Mock } -func (m *MockConsensusMessagesStream) GetConsensusMessages() ([]proto.Message, error) { +func (m *MockConsensusMessagesStream) Get() []proto.Message { args := m.Called() - return args.Get(0).([]proto.Message), args.Error(1) + return args.Get(0).([]proto.Message) +} + +func (m *MockConsensusMessagesStream) Add(msgs ...proto.Message) { + m.Called(msgs) } func TestApplyBlock(t *testing.T) { diff --git a/block/manager.go b/block/manager.go index e89b4db87..150b7387b 100644 --- a/block/manager.go +++ b/block/manager.go @@ -112,7 +112,7 @@ func NewManager( mempool, proxyApp, eventBus, - nil, // TODO add ConsensusMessagesStream: https://github.com/dymensionxyz/dymint/issues/1125 + NewConsensusMessagesQueue(), // TODO properly specify ConsensusMessagesStream: https://github.com/dymensionxyz/dymint/issues/1125 logger, ) if err != nil { @@ -181,9 +181,6 @@ func (m *Manager) Start(ctx context.Context) error { return m.PruningLoop(ctx) }) - // listen to new bonded sequencers events to add them in the sequencer set - go uevent.MustSubscribe(ctx, m.Pubsub, "newBondedSequencer", settlement.EventQueryNewBondedSequencer, m.UpdateSequencerSet, m.logger) - /* ----------------------------- full node mode ----------------------------- */ if !isProposer { // Full-nodes can sync from DA but it is not necessary to wait for it, since it can sync from P2P as well in parallel. diff --git a/block/produce.go b/block/produce.go index 99a00e852..63436177d 100644 --- a/block/produce.go +++ b/block/produce.go @@ -149,29 +149,13 @@ func (m *Manager) produceBlock(allowEmpty bool, nextProposerHash *[32]byte) (*ty var ( maxBlockDataSize = uint64(float64(m.Conf.BatchSubmitBytes) * types.MaxBlockSizeAdjustment) proposerHashForBlock = [32]byte(m.State.Sequencers.ProposerHash()) - nextProposerAddr = m.State.Sequencers.Proposer.SettlementAddress - lastProposerBlock = false // Indicates that the block is the last for the current seq. True during the rotation. ) // if nextProposerInfo is set, we create a last block if nextProposerHash != nil { - nextSeq, err := m.State.Sequencers.GetByHash(nextProposerHash[:]) - if err != nil { - return nil, nil, fmt.Errorf("get next sequencer by hash: %w", err) - } maxBlockDataSize = 0 proposerHashForBlock = *nextProposerHash - nextProposerAddr = nextSeq.SettlementAddress - lastProposerBlock = true - } - // TODO: Ideally, there should be only one point for adding consensus messages. Given that they come from - // ConsensusMessagesStream, this should send them there instead of having to ways of sending consensusMessages. - // There is no implementation of the stream as of now. Unify the approach of adding consensus messages when - // the stream is implemented! https://github.com/dymensionxyz/dymint/issues/1125 - consensusMsgs, err := m.consensusMsgsOnCreateBlock(nextProposerAddr, lastProposerBlock) - if err != nil { - return nil, nil, fmt.Errorf("create consensus msgs for create block: last proposer block: %v, height: %d, next proposer addr: %s: %w: %w", lastProposerBlock, newHeight, nextProposerAddr, err, ErrNonRecoverable) } - block = m.Executor.CreateBlock(newHeight, lastCommit, lastHeaderHash, proposerHashForBlock, m.State, maxBlockDataSize, consensusMsgs...) + block = m.Executor.CreateBlock(newHeight, lastCommit, lastHeaderHash, proposerHashForBlock, m.State, maxBlockDataSize) if !allowEmpty && len(block.Data.Txs) == 0 { return nil, nil, fmt.Errorf("%w: %w", types.ErrEmptyBlock, ErrRecoverable) } diff --git a/block/sequencers.go b/block/sequencers.go index f120c4b33..6632ee51c 100644 --- a/block/sequencers.go +++ b/block/sequencers.go @@ -6,8 +6,6 @@ import ( "fmt" "time" - "github.com/tendermint/tendermint/libs/pubsub" - "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/types" ) @@ -52,6 +50,37 @@ func (m *Manager) MonitorSequencerRotation(ctx context.Context, rotateC chan str return fmt.Errorf("sequencer rotation started. signal to stop production") } +func (m *Manager) MonitorSequencerSetUpdates(ctx context.Context, updatesC chan []types.Sequencer) error { + ticker := time.NewTicker(3 * time.Minute) // TODO: make this configurable + defer ticker.Stop() + + for { + select { + case <-ctx.Done(): + return nil + case <-ticker.C: + currentSLSet, err := m.SLClient.GetBondedSequencers() + if err != nil { + m.logger.Error("Get bonded sequencers", "err", err) + continue + } + updatesC <- currentSLSet + } + } +} + +func (m *Manager) handleSequencerSetUpdate(ctx context.Context, newSet []types.Sequencer) error { + newSequencers := types.SequencerListRightOuterJoin(m.State.Sequencers.Sequencers, newSet) + msgs, err := ConsensusMsgsOnSequencerSetUpdate(newSequencers) + if err != nil { + return fmt.Errorf("consensus msgs on sequencers set update: %w", err) + } + // TODO: make this update thread safe! + m.State.Sequencers.SetSequencers(newSequencers) + m.Executor.consensusMessagesStream.Add(msgs...) + return nil +} + // IsProposer checks if the local node is the proposer // In case of sequencer rotation, there's a phase where proposer rotated on L2 but hasn't yet rotated on hub. // for this case, the old proposer counts as "sequencer" as well, so he'll be able to submit the last state update. @@ -181,26 +210,3 @@ func (m *Manager) UpdateProposer() error { m.State.Sequencers.SetProposer(m.SLClient.GetProposer()) return nil } - -// UpdateLastSubmittedHeight will update last height submitted height upon events. -// This may be necessary in case we crashed/restarted before getting response for our submission to the settlement layer. -func (m *Manager) UpdateSequencerSet(event pubsub.Message) { - eventData, ok := event.Data().(*settlement.EventDataNewBondedSequencer) - if !ok { - m.logger.Error("onReceivedBatch", "err", "wrong event data received") - return - } - - if m.State.Sequencers.GetByAddress(eventData.SeqAddr) != nil { - m.logger.Debug("Sequencer not added from new bonded sequencer event because already in the list.") - return - } - - newSequencer, err := m.SLClient.GetSequencerByAddress(eventData.SeqAddr) - if err != nil { - m.logger.Error("Unable to add new sequencer from event. err:%w", err) - return - } - sequencers := append(m.State.Sequencers.Sequencers, newSequencer) - m.State.Sequencers.SetSequencers(sequencers) -} diff --git a/block/submit_test.go b/block/submit_test.go index 7f2713787..2021f7310 100644 --- a/block/submit_test.go +++ b/block/submit_test.go @@ -174,7 +174,12 @@ func TestBatchSubmissionFailedSubmission(t *testing.T) { require.NoError(err) proposerKey := tmed25519.PrivKey(priv) - proposer := *types.NewSequencer(proposerKey.PubKey(), "") + proposer := *types.NewSequencer( + proposerKey.PubKey(), + testutil.GenerateSettlementAddress(), + testutil.GenerateSettlementAddress(), + []string{testutil.GenerateSettlementAddress()}, + ) // Create a new mock ClientI slmock := &slmocks.MockClientI{} diff --git a/proto/types/dymint/dymint.proto b/proto/types/dymint/dymint.proto index dd6e051f7..cbf10a372 100755 --- a/proto/types/dymint/dymint.proto +++ b/proto/types/dymint/dymint.proto @@ -95,6 +95,10 @@ message Batch { message Sequencer { string settlement_address = 1; tendermint.types.Validator validator = 2; + // RewardAddr is the bech32-encoded sequencer's reward address. + string reward_addr = 3; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string whitelisted_relayers = 4; } message SequencerSet { diff --git a/proto/types/rollapp/sequencers/types/tx.proto b/proto/types/rollapp/sequencers/types/tx.proto index 1c32bdccd..757d715bd 100644 --- a/proto/types/rollapp/sequencers/types/tx.proto +++ b/proto/types/rollapp/sequencers/types/tx.proto @@ -7,29 +7,25 @@ import "google/protobuf/any.proto"; option go_package = "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers"; -message MsgCreateSequencer { +message MsgUpdateRewardAddress { option (cosmos.msg.v1.signer) = "operator"; - // Operator is the bech32-encoded address of the actor sending the update - must be val addr + // Operator is the bech32-encoded address of the actor sending the update string operator = 1; - // PubKey is a tendermint consensus pub key - google.protobuf.Any pub_key = 2; - // Signature is operator signed with the private key of pub_key - bytes signature = 3; + // RewardAddr is a bech32 encoded sdk acc address + string reward_addr = 2; } -message MsgCreateSequencerResponse {} +message MsgUpdateRewardAddressResponse {} -message MsgUpdateSequencer { +message MsgUpdateWhitelistedRelayers { option (cosmos.msg.v1.signer) = "operator"; - // Operator is the bech32-encoded address of the actor sending the update - must be val addr + // Operator is the bech32-encoded address of the actor sending the update string operator = 1; - // Field no.2 is missing - reserved 2; - // RewardAddr is a bech32 encoded sdk acc address - string reward_addr = 3; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 2; } -message MsgUpdateSequencerResponse {} +message MsgUpdateWhitelistedRelayersResponse {} // ConsensusMsgUpsertSequencer is a consensus message to upsert the sequencer. message ConsensusMsgUpsertSequencer { @@ -40,6 +36,8 @@ message ConsensusMsgUpsertSequencer { google.protobuf.Any cons_pub_key = 2; // RewardAddr is the bech32-encoded sequencer's reward address string reward_addr = 3; + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + repeated string relayers = 4; } message ConsensusMsgUpsertSequencerResponse {} diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index 201006f31..173ecb8d1 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -354,9 +354,12 @@ func (c *Client) GetSequencerByAddress(address string) (types.Sequencer, error) return types.Sequencer{}, err } - sequencer := *types.NewSequencer(tmPubKey, res.Sequencer.Address) - - return sequencer, nil + return *types.NewSequencer( + tmPubKey, + res.Sequencer.Address, + res.Sequencer.RewardAddr, + res.Sequencer.WhitelistedRelayers, + ), nil } // GetAllSequencers returns all sequencers of the given rollapp. @@ -401,7 +404,12 @@ func (c *Client) GetAllSequencers() ([]types.Sequencer, error) { return nil, err } - sequencerList = append(sequencerList, *types.NewSequencer(tmPubKey, sequencer.Address)) + sequencerList = append(sequencerList, *types.NewSequencer( + tmPubKey, + sequencer.Address, + sequencer.RewardAddr, + sequencer.WhitelistedRelayers, + )) } return sequencerList, nil @@ -449,7 +457,12 @@ func (c *Client) GetBondedSequencers() ([]types.Sequencer, error) { if err != nil { return nil, err } - sequencerList = append(sequencerList, *types.NewSequencer(tmPubKey, sequencer.Address)) + sequencerList = append(sequencerList, *types.NewSequencer( + tmPubKey, + sequencer.Address, + sequencer.RewardAddr, + sequencer.WhitelistedRelayers, + )) } return sequencerList, nil diff --git a/settlement/grpc/grpc.go b/settlement/grpc/grpc.go index 1056fd634..4cb62bac1 100644 --- a/settlement/grpc/grpc.go +++ b/settlement/grpc/grpc.go @@ -235,7 +235,12 @@ func (c *Client) GetProposer() *types.Sequencer { c.logger.Error("Error converting pubkey to settlement address", "err", err) return nil } - return types.NewSequencer(tmPubKey, settlementAddr) + return types.NewSequencer( + tmPubKey, + settlementAddr, + settlementAddr, + []string{}, + ) } // GetSequencerByAddress returns all sequencer information by its address. Not implemented since it will not be used in grpc SL diff --git a/settlement/local/local.go b/settlement/local/local.go index 3c39210b1..3e16bc3c3 100644 --- a/settlement/local/local.go +++ b/settlement/local/local.go @@ -212,7 +212,12 @@ func (c *Client) GetProposer() *types.Sequencer { c.logger.Error("Error converting pubkey to settlement address", "err", err) return nil } - return types.NewSequencer(tmPubKey, settlementAddr) + return types.NewSequencer( + tmPubKey, + settlementAddr, + settlementAddr, + []string{}, + ) } // GetSequencerByAddress returns all sequencer information by its address. Not implemented since it will not be used in mock SL diff --git a/testutil/types.go b/testutil/types.go index 0952a8456..41666e79f 100644 --- a/testutil/types.go +++ b/testutil/types.go @@ -235,6 +235,15 @@ func GenerateRandomValidatorSet() *tmtypes.ValidatorSet { }) } +func GenerateSequencer() *types.Sequencer { + return types.NewSequencer( + tmtypes.NewValidator(ed25519.GenPrivKey().PubKey(), 1).PubKey, + GenerateSettlementAddress(), + GenerateSettlementAddress(), + []string{GenerateSettlementAddress(), GenerateSettlementAddress()}, + ) +} + // GenerateStateWithSequencer generates an initial state for testing. func GenerateStateWithSequencer(initialHeight int64, lastBlockHeight int64, pubkey tmcrypto.PubKey) *types.State { s := &types.State{ @@ -260,7 +269,12 @@ func GenerateStateWithSequencer(initialHeight int64, lastBlockHeight int64, pubk }, }, } - s.Sequencers.SetProposer(types.NewSequencer(pubkey, GenerateSettlementAddress())) + s.Sequencers.SetProposer(types.NewSequencer( + pubkey, + GenerateSettlementAddress(), + GenerateSettlementAddress(), + []string{GenerateSettlementAddress()}, + )) s.SetHeight(uint64(lastBlockHeight)) return s } diff --git a/types/pb/dymint/dymint.pb.go b/types/pb/dymint/dymint.pb.go index eb1bb5942..d2e802dfb 100644 --- a/types/pb/dymint/dymint.pb.go +++ b/types/pb/dymint/dymint.pb.go @@ -518,6 +518,10 @@ func (m *Batch) GetCommits() []*Commit { type Sequencer struct { SettlementAddress string `protobuf:"bytes,1,opt,name=settlement_address,json=settlementAddress,proto3" json:"settlement_address,omitempty"` Validator *types.Validator `protobuf:"bytes,2,opt,name=validator,proto3" json:"validator,omitempty"` + // RewardAddr is the bech32-encoded sequencer's reward address. + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,4,rep,name=whitelisted_relayers,json=whitelistedRelayers,proto3" json:"whitelisted_relayers,omitempty"` } func (m *Sequencer) Reset() { *m = Sequencer{} } @@ -567,6 +571,20 @@ func (m *Sequencer) GetValidator() *types.Validator { return nil } +func (m *Sequencer) GetRewardAddr() string { + if m != nil { + return m.RewardAddr + } + return "" +} + +func (m *Sequencer) GetWhitelistedRelayers() []string { + if m != nil { + return m.WhitelistedRelayers + } + return nil +} + type SequencerSet struct { Sequencers []*Sequencer `protobuf:"bytes,1,rep,name=sequencers,proto3" json:"sequencers,omitempty"` Proposer *Sequencer `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` @@ -678,61 +696,64 @@ func init() { func init() { proto.RegisterFile("types/dymint/dymint.proto", fileDescriptor_fe69c538ded4b87f) } var fileDescriptor_fe69c538ded4b87f = []byte{ - // 864 bytes of a gzipped FileDescriptorProto + // 908 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, - 0x01, 0x01, 0x3d, 0x5e, 0x55, 0x64, 0x7d, 0x05, 0x23, 0x0a, 0xa4, 0x46, 0xb9, 0x59, 0x2b, 0xbb, - 0x09, 0x10, 0x73, 0x4f, 0x1b, 0xb1, 0xd1, 0x89, 0x7d, 0x06, 0x27, 0x55, 0x5d, 0x56, 0xa5, 0xc4, - 0x7a, 0xc1, 0xd3, 0xb4, 0x46, 0x29, 0x03, 0xdf, 0xa0, 0x4e, 0x7f, 0x69, 0x64, 0x1d, 0x98, 0xc4, - 0x5f, 0x37, 0x28, 0x12, 0x97, 0x87, 0xa1, 0x09, 0xac, 0x51, 0x69, 0xc7, 0x08, 0xbe, 0x10, 0x78, - 0xad, 0x16, 0x9f, 0xb0, 0xc7, 0xc4, 0x8e, 0xb4, 0x35, 0xff, 0x88, 0x1f, 0x43, 0x3f, 0xc9, 0x78, - 0x2e, 0x74, 0xbd, 0x8e, 0x4e, 0xbd, 0xf3, 0x41, 0xdc, 0xa3, 0xf5, 0x9b, 0x34, 0xfc, 0xd3, 0x83, - 0xae, 0x49, 0x5b, 0xab, 0x64, 0xde, 0x47, 0x25, 0x7b, 0x0c, 0x7e, 0xbb, 0x32, 0x54, 0xf0, 0x18, - 0xb2, 0x5d, 0x55, 0x26, 0x00, 0x32, 0x5f, 0x09, 0xae, 0x36, 0x35, 0x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0x11, 0xd0, 0x11, 0x45, 0x41, 0xd6, 0x97, 0x30, 0xa0, 0x40, 0x4a, 0x54, 0xeb, 0x95, 0x76, + 0x93, 0x00, 0x31, 0xf7, 0x8c, 0xc1, 0xad, 0x4e, 0xec, 0x33, 0x38, 0x2a, 0xca, 0xbc, 0xc8, 0x15, + 0x96, 0x33, 0x11, 0xc7, 0x25, 0x2a, 0x15, 0xf8, 0x16, 0xad, 0xf4, 0x17, 0x56, 0x36, 0x81, 0x29, + 0xfc, 0x65, 0x8d, 0x72, 0x51, 0xe5, 0xa1, 0x6f, 0x03, 0xab, 0x55, 0x9a, 0x31, 0x82, 0xfb, 0x12, + 0xaf, 0xf5, 0xec, 0x13, 0xf6, 0x90, 0xd8, 0x81, 0xb1, 0xa6, 0x1f, 0xf1, 0x43, 0xe8, 0x2e, 0x12, + 0x91, 0x4a, 0x73, 0x5e, 0x07, 0x27, 0xde, 0x59, 0x8f, 0x77, 0x68, 0xfc, 0x3a, 0x0e, 0xff, 0xf0, + 0xa0, 0x6d, 0xd3, 0xd6, 0x38, 0x32, 0xef, 0xa3, 0x23, 0x7b, 0x0c, 0x7e, 0xf3, 0x64, 0xe8, 0xc0, + 0x39, 0x24, 0xdb, 0x53, 0x19, 0x01, 0xa8, 0x74, 0x29, 0x85, 0x5e, 0x97, 0xa8, 0x82, 0xbd, 0x93, + 0x3d, 0xe3, 0x6f, 0x15, 0xf6, 0x1d, 0xf4, 0x75, 0x36, 0xab, 0x05, 0x3a, 0x7b, 0x7f, 0xf2, 0x28, + 0xda, 0xd6, 0x7b, 0x64, 0xbb, 0xc1, 0x06, 0x32, 0x4d, 0x97, 0xdc, 0xd7, 0xd9, 0xb4, 0xe2, 0xc3, + 0xbf, 0x3d, 0x68, 0x7d, 0x2f, 0xb4, 0x30, 0x35, 0xac, 0xaf, 0x55, 0xe0, 0xd1, 0x0a, 0xe6, 0x91, + 0x7d, 0x03, 0x41, 0x2a, 0x35, 0x96, 0x19, 0xc6, 0xa9, 0x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0xa9, 0x98, 0xbb, 0xf1, 0xbc, 0x4d, 0xb5, 0xfe, 0xd5, 0x7f, 0x01, + 0x00, 0x00, 0xff, 0xff, 0x88, 0x26, 0x12, 0xcc, 0x2d, 0x07, 0x00, 0x00, } func (m *Version) Marshal() (dAtA []byte, err error) { @@ -1155,6 +1176,22 @@ func (m *Sequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.WhitelistedRelayers) > 0 { + for iNdEx := len(m.WhitelistedRelayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.WhitelistedRelayers[iNdEx]) + copy(dAtA[i:], m.WhitelistedRelayers[iNdEx]) + i = encodeVarintDymint(dAtA, i, uint64(len(m.WhitelistedRelayers[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintDymint(dAtA, i, uint64(len(m.RewardAddr))) + i-- + dAtA[i] = 0x1a + } if m.Validator != nil { { size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) @@ -1468,6 +1505,16 @@ func (m *Sequencer) Size() (n int) { l = m.Validator.Size() n += 1 + l + sovDymint(uint64(l)) } + l = len(m.RewardAddr) + if l > 0 { + n += 1 + l + sovDymint(uint64(l)) + } + if len(m.WhitelistedRelayers) > 0 { + for _, s := range m.WhitelistedRelayers { + l = len(s) + n += 1 + l + sovDymint(uint64(l)) + } + } return n } @@ -2859,6 +2906,70 @@ func (m *Sequencer) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDymint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDymint + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDymint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field WhitelistedRelayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDymint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthDymint + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthDymint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.WhitelistedRelayers = append(m.WhitelistedRelayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDymint(dAtA[iNdEx:]) diff --git a/types/pb/rollapp/sequencers/types/tx.pb.go b/types/pb/rollapp/sequencers/types/tx.pb.go index 153860f64..fd6323dfa 100644 --- a/types/pb/rollapp/sequencers/types/tx.pb.go +++ b/types/pb/rollapp/sequencers/types/tx.pb.go @@ -25,27 +25,25 @@ var _ = math.Inf // proto package needs to be updated. const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package -type MsgCreateSequencer struct { - // Operator is the bech32-encoded address of the actor sending the update - must be val addr +type MsgUpdateRewardAddress struct { + // Operator is the bech32-encoded address of the actor sending the update Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` - // PubKey is a tendermint consensus pub key - PubKey *types.Any `protobuf:"bytes,2,opt,name=pub_key,json=pubKey,proto3" json:"pub_key,omitempty"` - // Signature is operator signed with the private key of pub_key - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` + // RewardAddr is a bech32 encoded sdk acc address + RewardAddr string `protobuf:"bytes,2,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` } -func (m *MsgCreateSequencer) Reset() { *m = MsgCreateSequencer{} } -func (m *MsgCreateSequencer) String() string { return proto.CompactTextString(m) } -func (*MsgCreateSequencer) ProtoMessage() {} -func (*MsgCreateSequencer) Descriptor() ([]byte, []int) { +func (m *MsgUpdateRewardAddress) Reset() { *m = MsgUpdateRewardAddress{} } +func (m *MsgUpdateRewardAddress) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddress) ProtoMessage() {} +func (*MsgUpdateRewardAddress) Descriptor() ([]byte, []int) { return fileDescriptor_bb27942d1c1a6ff0, []int{0} } -func (m *MsgCreateSequencer) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateRewardAddress) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateRewardAddress) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateSequencer.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateRewardAddress.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -55,54 +53,47 @@ func (m *MsgCreateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgCreateSequencer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateSequencer.Merge(m, src) +func (m *MsgUpdateRewardAddress) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddress.Merge(m, src) } -func (m *MsgCreateSequencer) XXX_Size() int { +func (m *MsgUpdateRewardAddress) XXX_Size() int { return m.Size() } -func (m *MsgCreateSequencer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateSequencer.DiscardUnknown(m) +func (m *MsgUpdateRewardAddress) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddress.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateSequencer proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateRewardAddress proto.InternalMessageInfo -func (m *MsgCreateSequencer) GetOperator() string { +func (m *MsgUpdateRewardAddress) GetOperator() string { if m != nil { return m.Operator } return "" } -func (m *MsgCreateSequencer) GetPubKey() *types.Any { - if m != nil { - return m.PubKey - } - return nil -} - -func (m *MsgCreateSequencer) GetSignature() []byte { +func (m *MsgUpdateRewardAddress) GetRewardAddr() string { if m != nil { - return m.Signature + return m.RewardAddr } - return nil + return "" } -type MsgCreateSequencerResponse struct { +type MsgUpdateRewardAddressResponse struct { } -func (m *MsgCreateSequencerResponse) Reset() { *m = MsgCreateSequencerResponse{} } -func (m *MsgCreateSequencerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgCreateSequencerResponse) ProtoMessage() {} -func (*MsgCreateSequencerResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpdateRewardAddressResponse) Reset() { *m = MsgUpdateRewardAddressResponse{} } +func (m *MsgUpdateRewardAddressResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRewardAddressResponse) ProtoMessage() {} +func (*MsgUpdateRewardAddressResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bb27942d1c1a6ff0, []int{1} } -func (m *MsgCreateSequencerResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateRewardAddressResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgCreateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateRewardAddressResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgCreateSequencerResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateRewardAddressResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -112,37 +103,37 @@ func (m *MsgCreateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgCreateSequencerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgCreateSequencerResponse.Merge(m, src) +func (m *MsgUpdateRewardAddressResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRewardAddressResponse.Merge(m, src) } -func (m *MsgCreateSequencerResponse) XXX_Size() int { +func (m *MsgUpdateRewardAddressResponse) XXX_Size() int { return m.Size() } -func (m *MsgCreateSequencerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgCreateSequencerResponse.DiscardUnknown(m) +func (m *MsgUpdateRewardAddressResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRewardAddressResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgCreateSequencerResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateRewardAddressResponse proto.InternalMessageInfo -type MsgUpdateSequencer struct { - // Operator is the bech32-encoded address of the actor sending the update - must be val addr +type MsgUpdateWhitelistedRelayers struct { + // Operator is the bech32-encoded address of the actor sending the update Operator string `protobuf:"bytes,1,opt,name=operator,proto3" json:"operator,omitempty"` - // RewardAddr is a bech32 encoded sdk acc address - RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,2,rep,name=relayers,proto3" json:"relayers,omitempty"` } -func (m *MsgUpdateSequencer) Reset() { *m = MsgUpdateSequencer{} } -func (m *MsgUpdateSequencer) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateSequencer) ProtoMessage() {} -func (*MsgUpdateSequencer) Descriptor() ([]byte, []int) { +func (m *MsgUpdateWhitelistedRelayers) Reset() { *m = MsgUpdateWhitelistedRelayers{} } +func (m *MsgUpdateWhitelistedRelayers) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayers) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayers) Descriptor() ([]byte, []int) { return fileDescriptor_bb27942d1c1a6ff0, []int{2} } -func (m *MsgUpdateSequencer) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateWhitelistedRelayers) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateWhitelistedRelayers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateSequencer.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateWhitelistedRelayers.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -152,47 +143,47 @@ func (m *MsgUpdateSequencer) XXX_Marshal(b []byte, deterministic bool) ([]byte, return b[:n], nil } } -func (m *MsgUpdateSequencer) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateSequencer.Merge(m, src) +func (m *MsgUpdateWhitelistedRelayers) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.Merge(m, src) } -func (m *MsgUpdateSequencer) XXX_Size() int { +func (m *MsgUpdateWhitelistedRelayers) XXX_Size() int { return m.Size() } -func (m *MsgUpdateSequencer) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateSequencer.DiscardUnknown(m) +func (m *MsgUpdateWhitelistedRelayers) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayers.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateSequencer proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateWhitelistedRelayers proto.InternalMessageInfo -func (m *MsgUpdateSequencer) GetOperator() string { +func (m *MsgUpdateWhitelistedRelayers) GetOperator() string { if m != nil { return m.Operator } return "" } -func (m *MsgUpdateSequencer) GetRewardAddr() string { +func (m *MsgUpdateWhitelistedRelayers) GetRelayers() []string { if m != nil { - return m.RewardAddr + return m.Relayers } - return "" + return nil } -type MsgUpdateSequencerResponse struct { +type MsgUpdateWhitelistedRelayersResponse struct { } -func (m *MsgUpdateSequencerResponse) Reset() { *m = MsgUpdateSequencerResponse{} } -func (m *MsgUpdateSequencerResponse) String() string { return proto.CompactTextString(m) } -func (*MsgUpdateSequencerResponse) ProtoMessage() {} -func (*MsgUpdateSequencerResponse) Descriptor() ([]byte, []int) { +func (m *MsgUpdateWhitelistedRelayersResponse) Reset() { *m = MsgUpdateWhitelistedRelayersResponse{} } +func (m *MsgUpdateWhitelistedRelayersResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateWhitelistedRelayersResponse) ProtoMessage() {} +func (*MsgUpdateWhitelistedRelayersResponse) Descriptor() ([]byte, []int) { return fileDescriptor_bb27942d1c1a6ff0, []int{3} } -func (m *MsgUpdateSequencerResponse) XXX_Unmarshal(b []byte) error { +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) } -func (m *MsgUpdateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { if deterministic { - return xxx_messageInfo_MsgUpdateSequencerResponse.Marshal(b, m, deterministic) + return xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Marshal(b, m, deterministic) } else { b = b[:cap(b)] n, err := m.MarshalToSizedBuffer(b) @@ -202,17 +193,17 @@ func (m *MsgUpdateSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ( return b[:n], nil } } -func (m *MsgUpdateSequencerResponse) XXX_Merge(src proto.Message) { - xxx_messageInfo_MsgUpdateSequencerResponse.Merge(m, src) +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.Merge(m, src) } -func (m *MsgUpdateSequencerResponse) XXX_Size() int { +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_Size() int { return m.Size() } -func (m *MsgUpdateSequencerResponse) XXX_DiscardUnknown() { - xxx_messageInfo_MsgUpdateSequencerResponse.DiscardUnknown(m) +func (m *MsgUpdateWhitelistedRelayersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse.DiscardUnknown(m) } -var xxx_messageInfo_MsgUpdateSequencerResponse proto.InternalMessageInfo +var xxx_messageInfo_MsgUpdateWhitelistedRelayersResponse proto.InternalMessageInfo // ConsensusMsgUpsertSequencer is a consensus message to upsert the sequencer. type ConsensusMsgUpsertSequencer struct { @@ -222,6 +213,8 @@ type ConsensusMsgUpsertSequencer struct { ConsPubKey *types.Any `protobuf:"bytes,2,opt,name=cons_pub_key,json=consPubKey,proto3" json:"cons_pub_key,omitempty"` // RewardAddr is the bech32-encoded sequencer's reward address RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // Relayers is an array of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + Relayers []string `protobuf:"bytes,4,rep,name=relayers,proto3" json:"relayers,omitempty"` } func (m *ConsensusMsgUpsertSequencer) Reset() { *m = ConsensusMsgUpsertSequencer{} } @@ -278,6 +271,13 @@ func (m *ConsensusMsgUpsertSequencer) GetRewardAddr() string { return "" } +func (m *ConsensusMsgUpsertSequencer) GetRelayers() []string { + if m != nil { + return m.Relayers + } + return nil +} + type ConsensusMsgUpsertSequencerResponse struct { } @@ -315,10 +315,10 @@ func (m *ConsensusMsgUpsertSequencerResponse) XXX_DiscardUnknown() { var xxx_messageInfo_ConsensusMsgUpsertSequencerResponse proto.InternalMessageInfo func init() { - proto.RegisterType((*MsgCreateSequencer)(nil), "rollapp.sequencers.types.MsgCreateSequencer") - proto.RegisterType((*MsgCreateSequencerResponse)(nil), "rollapp.sequencers.types.MsgCreateSequencerResponse") - proto.RegisterType((*MsgUpdateSequencer)(nil), "rollapp.sequencers.types.MsgUpdateSequencer") - proto.RegisterType((*MsgUpdateSequencerResponse)(nil), "rollapp.sequencers.types.MsgUpdateSequencerResponse") + proto.RegisterType((*MsgUpdateRewardAddress)(nil), "rollapp.sequencers.types.MsgUpdateRewardAddress") + proto.RegisterType((*MsgUpdateRewardAddressResponse)(nil), "rollapp.sequencers.types.MsgUpdateRewardAddressResponse") + proto.RegisterType((*MsgUpdateWhitelistedRelayers)(nil), "rollapp.sequencers.types.MsgUpdateWhitelistedRelayers") + proto.RegisterType((*MsgUpdateWhitelistedRelayersResponse)(nil), "rollapp.sequencers.types.MsgUpdateWhitelistedRelayersResponse") proto.RegisterType((*ConsensusMsgUpsertSequencer)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencer") proto.RegisterType((*ConsensusMsgUpsertSequencerResponse)(nil), "rollapp.sequencers.types.ConsensusMsgUpsertSequencerResponse") } @@ -328,36 +328,35 @@ func init() { } var fileDescriptor_bb27942d1c1a6ff0 = []byte{ - // 406 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x92, 0xbd, 0x8e, 0xd3, 0x40, - 0x10, 0xc7, 0xb3, 0x09, 0x0a, 0xc9, 0x26, 0x48, 0xc8, 0x4a, 0x61, 0x4c, 0x30, 0x91, 0x11, 0x22, - 0x42, 0xc2, 0x2b, 0x40, 0xa2, 0x48, 0x17, 0xd2, 0x81, 0x90, 0x90, 0x81, 0x86, 0x26, 0xf2, 0xc7, - 0x64, 0xb1, 0x88, 0x77, 0x97, 0xdd, 0x35, 0xc4, 0x94, 0x57, 0x5f, 0x71, 0xaf, 0x70, 0x6f, 0x70, - 0x8f, 0x71, 0x65, 0xca, 0x2b, 0x4f, 0x49, 0x71, 0xaf, 0x71, 0xf2, 0x47, 0x12, 0x29, 0x77, 0x3a, - 0xe5, 0x2a, 0xef, 0xcc, 0xfc, 0x3d, 0xff, 0xdf, 0x8c, 0x06, 0xbf, 0xd2, 0x99, 0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c9, 0xc2, 0xbe, 0xed, 0xe1, 0x32, 0x35, 0x8e, 0x22, 0xb9, 0xe7, 0xff, 0xe9, 0x41, - 0xab, 0xfe, 0xb8, 0x51, 0x51, 0xec, 0xf9, 0x6c, 0x29, 0x4e, 0x11, 0x7e, 0x3a, 0xc9, 0x5f, 0x4c, - 0xa5, 0xaa, 0xd0, 0x29, 0x90, 0xfa, 0x30, 0x9e, 0x0f, 0xb8, 0x1b, 0x72, 0xa6, 0xa6, 0x87, 0x2c, - 0x10, 0xe7, 0xca, 0xaf, 0xe5, 0x12, 0xef, 0x39, 0x87, 0xf3, 0x12, 0xbf, 0xb8, 0x03, 0x71, 0x33, - 0xca, 0xc7, 0xef, 0xe7, 0x2b, 0x1b, 0x2d, 0x57, 0x36, 0xba, 0x5c, 0xd9, 0xe8, 0x64, 0x6d, 0xd7, - 0x96, 0x6b, 0xbb, 0x76, 0xb1, 0xb6, 0x6b, 0x3f, 0x47, 0x34, 0xd6, 0xbf, 0xd2, 0xc0, 0x0d, 0x79, - 0x42, 0xa2, 0x2c, 0x01, 0xa6, 0x62, 0xce, 0x16, 0xd9, 0xff, 0x3c, 0x88, 0x99, 0xae, 0x0e, 0x56, - 0x04, 0xb7, 0x1c, 0x73, 0xd0, 0x2c, 0xc6, 0x78, 0x7f, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x38, 0x7c, - 0xd4, 0x90, 0xef, 0x02, 0x00, 0x00, -} - -func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { + // 400 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x92, 0xbf, 0xae, 0xd3, 0x30, + 0x14, 0xc6, 0x9b, 0x16, 0xa1, 0xe2, 0xc2, 0x52, 0x55, 0x28, 0x04, 0x08, 0x55, 0xf9, 0x2b, 0x86, + 0x58, 0x80, 0xc4, 0xd0, 0xad, 0x30, 0x22, 0x24, 0x14, 0x40, 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xab, 0x23, 0x3e, 0x6c, 0x32, 0x0d, 0x79, 0x86, 0x1a, 0x58, 0x08, 0x79, 0x64, 0x40, 0xf5, + 0xbb, 0xf1, 0xc8, 0x58, 0x35, 0x9c, 0x3b, 0x9c, 0x8f, 0x2a, 0xad, 0xad, 0x8f, 0x8d, 0x3c, 0x20, + 0xf7, 0xfa, 0x9e, 0xe9, 0xec, 0xfc, 0x76, 0xc8, 0xcd, 0x97, 0xd5, 0x8d, 0x63, 0x89, 0xb6, 0x03, + 0x41, 0xe9, 0xb7, 0xed, 0x36, 0x7a, 0xed, 0x3c, 0x27, 0x57, 0x13, 0xc1, 0x71, 0x2d, 0xcb, 0x78, + 0xfd, 0x19, 0x8c, 0x9d, 0xce, 0xe4, 0xe9, 0x2c, 0xa8, 0x97, 0x10, 0xb4, 0x4b, 0x08, 0x56, 0xdc, + 0x84, 0xa4, 0x22, 0xdf, 0x94, 0xf1, 0x2b, 0x30, 0xc7, 0x43, 0x1d, 0x1d, 0x0f, 0xf5, 0x42, 0xce, + 0x4b, 0xfd, 0x39, 0xef, 0x93, 0xbb, 0x3d, 0xf6, 0xdb, 0x98, 0x2f, 0xde, 0xfd, 0xd9, 0xfb, 0xce, + 0x6e, 0xef, 0x3b, 0xff, 0xf6, 0xbe, 0xf3, 0xf3, 0xe0, 0x0f, 0x76, 0x07, 0x7f, 0xf0, 0xf7, 0xe0, + 0x0f, 0x3e, 0x2e, 0xd3, 0x4c, 0x6f, 0xca, 0x38, 0x48, 0x44, 0x41, 0x99, 0x29, 0x80, 0x63, 0x26, + 0xf8, 0xd6, 0x7c, 0xaf, 0x8a, 0x8c, 0xeb, 0xe6, 0xc3, 0xca, 0xf8, 0xc4, 0x67, 0x8e, 0x2f, 0xdb, + 0x88, 0xcf, 0xce, 0x02, 0x00, 0x00, 0xff, 0xff, 0x30, 0x0e, 0x4d, 0x38, 0xef, 0x02, 0x00, 0x00, +} + +func (m *MsgUpdateRewardAddress) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -367,32 +366,20 @@ func (m *MsgCreateSequencer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateSequencer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddress) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddress) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.Signature) > 0 { - i -= len(m.Signature) - copy(dAtA[i:], m.Signature) - i = encodeVarintTx(dAtA, i, uint64(len(m.Signature))) - i-- - dAtA[i] = 0x1a - } - if m.PubKey != nil { - { - size, err := m.PubKey.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintTx(dAtA, i, uint64(size)) - } + if len(m.RewardAddr) > 0 { + i -= len(m.RewardAddr) + copy(dAtA[i:], m.RewardAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) i-- dAtA[i] = 0x12 } @@ -406,7 +393,7 @@ func (m *MsgCreateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgCreateSequencerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateRewardAddressResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -416,12 +403,12 @@ func (m *MsgCreateSequencerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgCreateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddressResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgCreateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateRewardAddressResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -429,7 +416,7 @@ func (m *MsgCreateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, err return len(dAtA) - i, nil } -func (m *MsgUpdateSequencer) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateWhitelistedRelayers) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -439,22 +426,24 @@ func (m *MsgUpdateSequencer) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateSequencer) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayers) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayers) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int _ = l - if len(m.RewardAddr) > 0 { - i -= len(m.RewardAddr) - copy(dAtA[i:], m.RewardAddr) - i = encodeVarintTx(dAtA, i, uint64(len(m.RewardAddr))) - i-- - dAtA[i] = 0x1a + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x12 + } } if len(m.Operator) > 0 { i -= len(m.Operator) @@ -466,7 +455,7 @@ func (m *MsgUpdateSequencer) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } -func (m *MsgUpdateSequencerResponse) Marshal() (dAtA []byte, err error) { +func (m *MsgUpdateWhitelistedRelayersResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) n, err := m.MarshalToSizedBuffer(dAtA[:size]) @@ -476,12 +465,12 @@ func (m *MsgUpdateSequencerResponse) Marshal() (dAtA []byte, err error) { return dAtA[:n], nil } -func (m *MsgUpdateSequencerResponse) MarshalTo(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalTo(dAtA []byte) (int, error) { size := m.Size() return m.MarshalToSizedBuffer(dAtA[:size]) } -func (m *MsgUpdateSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { +func (m *MsgUpdateWhitelistedRelayersResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { i := len(dAtA) _ = i var l int @@ -509,6 +498,15 @@ func (m *ConsensusMsgUpsertSequencer) MarshalToSizedBuffer(dAtA []byte) (int, er _ = i var l int _ = l + if len(m.Relayers) > 0 { + for iNdEx := len(m.Relayers) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.Relayers[iNdEx]) + copy(dAtA[i:], m.Relayers[iNdEx]) + i = encodeVarintTx(dAtA, i, uint64(len(m.Relayers[iNdEx]))) + i-- + dAtA[i] = 0x22 + } + } if len(m.RewardAddr) > 0 { i -= len(m.RewardAddr) copy(dAtA[i:], m.RewardAddr) @@ -572,7 +570,7 @@ func encodeVarintTx(dAtA []byte, offset int, v uint64) int { dAtA[offset] = uint8(v) return base } -func (m *MsgCreateSequencer) Size() (n int) { +func (m *MsgUpdateRewardAddress) Size() (n int) { if m == nil { return 0 } @@ -582,18 +580,14 @@ func (m *MsgCreateSequencer) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - if m.PubKey != nil { - l = m.PubKey.Size() - n += 1 + l + sovTx(uint64(l)) - } - l = len(m.Signature) + l = len(m.RewardAddr) if l > 0 { n += 1 + l + sovTx(uint64(l)) } return n } -func (m *MsgCreateSequencerResponse) Size() (n int) { +func (m *MsgUpdateRewardAddressResponse) Size() (n int) { if m == nil { return 0 } @@ -602,7 +596,7 @@ func (m *MsgCreateSequencerResponse) Size() (n int) { return n } -func (m *MsgUpdateSequencer) Size() (n int) { +func (m *MsgUpdateWhitelistedRelayers) Size() (n int) { if m == nil { return 0 } @@ -612,14 +606,16 @@ func (m *MsgUpdateSequencer) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } - l = len(m.RewardAddr) - if l > 0 { - n += 1 + l + sovTx(uint64(l)) + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } } return n } -func (m *MsgUpdateSequencerResponse) Size() (n int) { +func (m *MsgUpdateWhitelistedRelayersResponse) Size() (n int) { if m == nil { return 0 } @@ -646,6 +642,12 @@ func (m *ConsensusMsgUpsertSequencer) Size() (n int) { if l > 0 { n += 1 + l + sovTx(uint64(l)) } + if len(m.Relayers) > 0 { + for _, s := range m.Relayers { + l = len(s) + n += 1 + l + sovTx(uint64(l)) + } + } return n } @@ -664,7 +666,7 @@ func sovTx(x uint64) (n int) { func sozTx(x uint64) (n int) { return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) } -func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateRewardAddress) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -687,10 +689,10 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSequencer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateRewardAddress: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateRewardAddress: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -727,45 +729,9 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field PubKey", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthTx - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthTx - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.PubKey == nil { - m.PubKey = &types.Any{} - } - if err := m.PubKey.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex - case 3: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field Signature", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) } - var byteLen int + var stringLen uint64 for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowTx @@ -775,25 +741,23 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + stringLen |= uint64(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + intStringLen := int(stringLen) + if intStringLen < 0 { return ErrInvalidLengthTx } - postIndex := iNdEx + byteLen + postIndex := iNdEx + intStringLen if postIndex < 0 { return ErrInvalidLengthTx } if postIndex > l { return io.ErrUnexpectedEOF } - m.Signature = append(m.Signature[:0], dAtA[iNdEx:postIndex]...) - if m.Signature == nil { - m.Signature = []byte{} - } + m.RewardAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex default: iNdEx = preIndex @@ -816,7 +780,7 @@ func (m *MsgCreateSequencer) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateRewardAddressResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -839,10 +803,10 @@ func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgCreateSequencerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgCreateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateRewardAddressResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -866,7 +830,7 @@ func (m *MsgCreateSequencerResponse) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateWhitelistedRelayers) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -889,10 +853,10 @@ func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateSequencer: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateSequencer: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayers: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -927,9 +891,9 @@ func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { } m.Operator = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex - case 3: + case 2: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field RewardAddr", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) } var stringLen uint64 for shift := uint(0); ; shift += 7 { @@ -957,7 +921,7 @@ func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.RewardAddr = string(dAtA[iNdEx:postIndex]) + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex default: iNdEx = preIndex @@ -980,7 +944,7 @@ func (m *MsgUpdateSequencer) Unmarshal(dAtA []byte) error { } return nil } -func (m *MsgUpdateSequencerResponse) Unmarshal(dAtA []byte) error { +func (m *MsgUpdateWhitelistedRelayersResponse) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 for iNdEx < l { @@ -1003,10 +967,10 @@ func (m *MsgUpdateSequencerResponse) Unmarshal(dAtA []byte) error { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return fmt.Errorf("proto: MsgUpdateSequencerResponse: wiretype end group for non-group") + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: wiretype end group for non-group") } if fieldNum <= 0 { - return fmt.Errorf("proto: MsgUpdateSequencerResponse: illegal tag %d (wire type %d)", fieldNum, wire) + return fmt.Errorf("proto: MsgUpdateWhitelistedRelayersResponse: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { default: @@ -1159,6 +1123,38 @@ func (m *ConsensusMsgUpsertSequencer) Unmarshal(dAtA []byte) error { } m.RewardAddr = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Relayers", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Relayers = append(m.Relayers, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipTx(dAtA[iNdEx:]) diff --git a/types/sequencer_set.go b/types/sequencer_set.go index 27df2a12e..220d0772b 100644 --- a/types/sequencer_set.go +++ b/types/sequencer_set.go @@ -2,29 +2,41 @@ package types import ( "bytes" + "crypto/sha256" "fmt" tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/types" ) -// sequencer is a struct that holds the sequencer's settlement address and tendermint validator -// it's populated from the SL client -// uses tendermint's validator types for compatibility +// Sequencer is a struct that holds the sequencer's settlement address and tendermint validator. +// It's populated from the SL client. Uses tendermint's validator types for compatibility. type Sequencer struct { - // SettlementAddress is the address of the sequencer in the settlement layer (bech32 string) + // SettlementAddress is the address of the sequencer in the settlement layer (bech32 string). SettlementAddress string `json:"settlement_address"` - // tendermint validator type for compatibility. holds the public key and cons address + // RewardAddr is the bech32-encoded sequencer's reward address. + RewardAddr string `protobuf:"bytes,3,opt,name=reward_addr,json=rewardAddr,proto3" json:"reward_addr,omitempty"` + // WhitelistedRelayers is a list of the whitelisted relayer addresses. Addresses are bech32-encoded strings. + WhitelistedRelayers []string `protobuf:"bytes,4,rep,name=relayers,proto3" json:"relayers,omitempty"` + + // val is a tendermint validator type for compatibility. Holds the public key and cons address. val types.Validator } -func NewSequencer(pubKey tmcrypto.PubKey, settlementAddress string) *Sequencer { +func NewSequencer( + pubKey tmcrypto.PubKey, + settlementAddress string, + rewardAddr string, + whitelistedRelayers []string, +) *Sequencer { if pubKey == nil { return nil } return &Sequencer{ - SettlementAddress: settlementAddress, - val: *types.NewValidator(pubKey, 1), + SettlementAddress: settlementAddress, + RewardAddr: rewardAddr, + WhitelistedRelayers: whitelistedRelayers, + val: *types.NewValidator(pubKey, 1), } } @@ -38,6 +50,10 @@ func (s Sequencer) TMValidator() (*types.Validator, error) { return &s.val, nil } +func (s Sequencer) Equal(rhs Sequencer) bool { + return bytes.Equal(s.FullHash(), rhs.FullHash()) +} + func (s Sequencer) ConsAddress() string { return s.val.Address.String() } @@ -46,6 +62,18 @@ func (s Sequencer) PubKey() tmcrypto.PubKey { return s.val.PubKey } +// FullHash returns a "full" hash of the sequencer that includes all fields of the Sequencer type. +func (s Sequencer) FullHash() []byte { + h := sha256.New() + h.Write([]byte(s.SettlementAddress)) + h.Write([]byte(s.RewardAddr)) + for _, r := range s.WhitelistedRelayers { + h.Write([]byte(r)) + } + h.Write(s.Hash()) + return h.Sum(nil) +} + // Hash returns tendermint compatible hash of the sequencer func (s Sequencer) Hash() []byte { tempProposerSet := types.NewValidatorSet([]*types.Validator{&s.val}) @@ -150,6 +178,28 @@ func (s *SequencerSet) GetByConsAddress(cons_addr []byte) *Sequencer { return nil } +// SequencerListRightOuterJoin returns a set of sequencers that are in B but not in A. +// CONTRACT: both A and B do not have duplicates! +// +// Example 1: +// +// s1 = {seq1, seq2, seq3} +// s2 = { seq2, seq3, seq4} +// s1 * s2 = { seq4} +func SequencerListRightOuterJoin(A, B []Sequencer) []Sequencer { + lhsSet := make(map[string]struct{}) + for _, s := range A { + lhsSet[string(s.FullHash())] = struct{}{} + } + var diff []Sequencer + for _, s := range B { + if _, ok := lhsSet[string(s.FullHash())]; !ok { + diff = append(diff, s) + } + } + return diff +} + func (s *SequencerSet) String() string { return fmt.Sprintf("SequencerSet: %v", s.Sequencers) } @@ -157,6 +207,7 @@ func (s *SequencerSet) String() string { /* -------------------------- backward compatibility ------------------------- */ // old dymint version used tendermint.ValidatorSet for sequencers // these methods are used for backward compatibility + func NewSequencerFromValidator(val types.Validator) *Sequencer { return &Sequencer{ SettlementAddress: "", diff --git a/types/sequencer_set_test.go b/types/sequencer_set_test.go new file mode 100644 index 000000000..6aba2aae6 --- /dev/null +++ b/types/sequencer_set_test.go @@ -0,0 +1,86 @@ +package types_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/dymensionxyz/dymint/testutil" + "github.com/dymensionxyz/dymint/types" +) + +func TestSequencerListsDiff(t *testing.T) { + seq1 := *testutil.GenerateSequencer() + seq2 := *testutil.GenerateSequencer() + seq3 := *testutil.GenerateSequencer() + seq4 := *testutil.GenerateSequencer() + + testCases := []struct { + name string + A []types.Sequencer + B []types.Sequencer + exp []types.Sequencer + }{ + { + name: "no diff", + A: []types.Sequencer{seq1, seq2, seq3}, + B: []types.Sequencer{seq1, seq2, seq3}, + exp: nil, + }, + { + name: "diff", + A: []types.Sequencer{seq1, seq2}, + B: []types.Sequencer{seq2, seq3}, + exp: []types.Sequencer{seq3}, + }, + { + name: "B is larger", + A: []types.Sequencer{seq1, seq2}, + B: []types.Sequencer{seq1, seq2, seq3}, + exp: []types.Sequencer{seq3}, + }, + { + name: "A is larger", + A: []types.Sequencer{seq1, seq2, seq3}, + B: []types.Sequencer{seq2, seq4}, + exp: []types.Sequencer{seq4}, + }, + { + name: "B is a subset of A", + A: []types.Sequencer{seq1, seq2, seq3}, + B: []types.Sequencer{seq1, seq2}, + exp: nil, + }, + { + name: "A is empty", + A: []types.Sequencer{}, + B: []types.Sequencer{seq1, seq2, seq3}, + exp: []types.Sequencer{seq1, seq2, seq3}, + }, + { + name: "B is empty", + A: []types.Sequencer{seq1, seq2, seq3}, + B: []types.Sequencer{}, + exp: nil, + }, + { + name: "A is nil", + A: nil, + B: []types.Sequencer{seq1, seq2, seq3}, + exp: []types.Sequencer{seq1, seq2, seq3}, + }, + { + name: "B is nil", + A: []types.Sequencer{seq1, seq2, seq3}, + B: nil, + exp: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + actual1 := types.SequencerListRightOuterJoin(tc.A, tc.B) + require.ElementsMatch(t, tc.exp, actual1) + }) + } +} diff --git a/types/serialization.go b/types/serialization.go index 1ccabd1ff..d482a6ff1 100644 --- a/types/serialization.go +++ b/types/serialization.go @@ -292,60 +292,80 @@ func (s *State) FromProto(other *pb.State) error { return nil } +// ToProto converts Sequencer into protobuf representation and returns it. +func (s *Sequencer) ToProto() (*pb.Sequencer, error) { + protoVal, err := s.val.ToProto() + if err != nil { + return nil, fmt.Errorf("tendermint validator to proto: %w", err) + } + return &pb.Sequencer{ + SettlementAddress: s.SettlementAddress, + Validator: protoVal, + RewardAddr: s.RewardAddr, + WhitelistedRelayers: s.WhitelistedRelayers, + }, nil +} + +// SequencerFromProto fills Sequencer with data from its protobuf representation. +func SequencerFromProto(seq *pb.Sequencer) (Sequencer, error) { + val, err := types.ValidatorFromProto(seq.Validator) + if err != nil { + return Sequencer{}, fmt.Errorf("tendermint validator from proto: %w", err) + } + return Sequencer{ + SettlementAddress: seq.SettlementAddress, + RewardAddr: seq.RewardAddr, + WhitelistedRelayers: seq.WhitelistedRelayers, + val: *val, + }, nil +} + // ToProto converts SequencerSet into protobuf representation and returns it. func (s *SequencerSet) ToProto() (*pb.SequencerSet, error) { - protoSet := new(pb.SequencerSet) - - seqsProto := make([]*pb.Sequencer, len(s.Sequencers)) + sequencers := make([]*pb.Sequencer, len(s.Sequencers)) for i := 0; i < len(s.Sequencers); i++ { - valp, err := s.Sequencers[i].val.ToProto() + seq, err := s.Sequencers[i].ToProto() if err != nil { - return nil, fmt.Errorf("ToProto: SequencerSet: %w", err) + return nil, fmt.Errorf("Sequencer.ToProto: %w", err) } - seq := new(pb.Sequencer) - seq.SettlementAddress = s.Sequencers[i].SettlementAddress - seq.Validator = valp - seqsProto[i] = seq + sequencers[i] = seq } - protoSet.Sequencers = seqsProto + var proposer *pb.Sequencer if s.Proposer != nil { - valp, err := s.Proposer.val.ToProto() + prop, err := s.Proposer.ToProto() if err != nil { - return nil, fmt.Errorf("ToProto: SequencerSet: %w", err) + return nil, fmt.Errorf("Sequencer.ToProto (proposer): %w", err) } - seq := new(pb.Sequencer) - seq.Validator = valp - seq.SettlementAddress = s.Proposer.SettlementAddress - protoSet.Proposer = seq + proposer = prop } - return protoSet, nil + return &pb.SequencerSet{ + Sequencers: sequencers, + Proposer: proposer, + }, nil } // FromProto fills SequencerSet with data from its protobuf representation. func (s *SequencerSet) FromProto(protoSet pb.SequencerSet) error { - seqs := make([]Sequencer, len(protoSet.Sequencers)) + sequencers := make([]Sequencer, len(protoSet.Sequencers)) for i, seqProto := range protoSet.Sequencers { - val, err := types.ValidatorFromProto(seqProto.Validator) + seq, err := SequencerFromProto(seqProto) if err != nil { - return fmt.Errorf("fromProto: SequencerSet: %w", err) + return fmt.Errorf("SequencerFromProto: %w", err) } - seqs[i].val = *val - seqs[i].SettlementAddress = seqProto.SettlementAddress + sequencers[i] = seq } - s.Sequencers = seqs + s.Sequencers = sequencers if protoSet.Proposer != nil { - valProposer, err := types.ValidatorFromProto(protoSet.Proposer.Validator) + proposer, err := SequencerFromProto(protoSet.Proposer) if err != nil { - return fmt.Errorf("fromProto: SequencerSet proposer: %w", err) + return fmt.Errorf("SequencerFromProto (proposer): %w", err) } - proposer := new(Sequencer) - proposer.val = *valProposer - proposer.SettlementAddress = protoSet.Proposer.SettlementAddress - s.Proposer = proposer + s.Proposer = &proposer } + return nil } diff --git a/types/serialization_test.go b/types/serialization_test.go index ca1218c2e..fd7772d67 100644 --- a/types/serialization_test.go +++ b/types/serialization_test.go @@ -115,7 +115,14 @@ func TestStateRoundTrip(t *testing.T) { }, Software: "dymint", }, - ChainID: "testchain", + ChainID: "testchain", + Sequencers: types.SequencerSet{ + Sequencers: []types.Sequencer{ + *testutil.GenerateSequencer(), + *testutil.GenerateSequencer(), + }, + Proposer: testutil.GenerateSequencer(), + }, InitialHeight: 987, ConsensusParams: tmproto.ConsensusParams{ Block: tmproto.BlockParams{ diff --git a/utils/queue/queue.go b/utils/queue/queue.go new file mode 100644 index 000000000..17b760ecd --- /dev/null +++ b/utils/queue/queue.go @@ -0,0 +1,50 @@ +package queue + +import ( + "fmt" + "strings" +) + +// Queue holds elements in an array-list. +// This implementation is NOT thread-safe! +type Queue[T any] struct { + elements []T +} + +// FromSlice instantiates a new queue from the given slice. +func FromSlice[T any](s []T) *Queue[T] { + return &Queue[T]{elements: s} +} + +// New instantiates a new empty queue +func New[T any]() *Queue[T] { + return &Queue[T]{elements: make([]T, 0)} +} + +// Enqueue adds a value to the end of the queue +func (q *Queue[T]) Enqueue(values ...T) { + q.elements = append(q.elements, values...) +} + +// DequeueAll returns all queued elements (FIFO order) and cleans the entire queue. +func (q *Queue[T]) DequeueAll() []T { + values := q.elements + q.elements = make([]T, 0) + return values +} + +// Size returns number of elements within the queue. +func (q *Queue[T]) Size() int { + return len(q.elements) +} + +// String returns a string representation. +func (q *Queue[T]) String() string { + str := "Queue[" + values := []string{} + for _, value := range q.elements { + values = append(values, fmt.Sprintf("%v", value)) + } + str += strings.Join(values, ", ") + "]" + return str +} diff --git a/utils/queue/queue_test.go b/utils/queue/queue_test.go new file mode 100644 index 000000000..c26037038 --- /dev/null +++ b/utils/queue/queue_test.go @@ -0,0 +1,59 @@ +package queue_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/dymensionxyz/dymint/utils/queue" +) + +func TestDequeue(t *testing.T) { + testCases := []struct { + name string + setup func() *queue.Queue[int] + expected []int + }{ + { + name: "DequeueAll", + setup: func() *queue.Queue[int] { + q := queue.New[int]() + q.Enqueue(1, 2, 3) + return q + }, + expected: []int{1, 2, 3}, + }, + { + name: "DequeueAll empty", + setup: func() *queue.Queue[int] { + return queue.New[int]() + }, + expected: []int{}, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + q := tc.setup() + + // dequeue all + actual := q.DequeueAll() + + // check the results + require.Equal(t, tc.expected, actual) + require.Equal(t, 0, q.Size()) + + // dequeue all once again + actualEmpty := q.DequeueAll() + require.Equal(t, []int{}, actualEmpty) + require.Equal(t, 0, q.Size()) + + // add new elements to the queue + q.Enqueue(100, 101, 102) + + // check that actual is not changed + require.Equal(t, tc.expected, actual) + require.Equal(t, 3, q.Size()) + }) + } +} From d0d007692a595c44f064e00ea1d0955136825206 Mon Sep 17 00:00:00 2001 From: keruch Date: Thu, 17 Oct 2024 22:56:18 +0200 Subject: [PATCH 26/27] completed polling --- block/manager.go | 9 ++++++++- block/produce.go | 11 ++++++++++- block/production_test.go | 21 ++++++++++++++------- block/sequencers.go | 31 +++++++++++++++++++++---------- block/submit_test.go | 6 ++++-- 5 files changed, 57 insertions(+), 21 deletions(-) diff --git a/block/manager.go b/block/manager.go index 150b7387b..0a286e033 100644 --- a/block/manager.go +++ b/block/manager.go @@ -226,12 +226,18 @@ func (m *Manager) Start(ctx context.Context) error { // channel to signal sequencer rotation started rotateSequencerC := make(chan string, 1) + // channel for sequencer set updates + sequencerSetUpdatesC := make(chan []types.Sequencer) + uerrors.ErrGroupGoLog(eg, m.logger, func() error { return m.SubmitLoop(ctx, bytesProducedC) }) + uerrors.ErrGroupGoLog(eg, m.logger, func() error { + return m.MonitorSequencerSetUpdates(ctx, sequencerSetUpdatesC) + }) uerrors.ErrGroupGoLog(eg, m.logger, func() error { bytesProducedC <- m.GetUnsubmittedBytes() // load unsubmitted bytes from previous run - return m.ProduceBlockLoop(ctx, bytesProducedC) + return m.ProduceBlockLoop(ctx, bytesProducedC, sequencerSetUpdatesC) }) uerrors.ErrGroupGoLog(eg, m.logger, func() error { return m.MonitorSequencerRotation(ctx, rotateSequencerC) @@ -270,6 +276,7 @@ func (m *Manager) NextHeightToSubmit() uint64 { } // syncFromSettlement enforces the node to be synced on initial run from SL and DA. +// The method modifies the state and is not thread-safe. func (m *Manager) syncFromSettlement() error { err := m.UpdateSequencerSetFromSL() if err != nil { diff --git a/block/produce.go b/block/produce.go index 63436177d..aa978fc6d 100644 --- a/block/produce.go +++ b/block/produce.go @@ -21,7 +21,7 @@ import ( // ProduceBlockLoop is calling publishBlock in a loop as long as we're synced. // A signal will be sent to the bytesProduced channel for each block produced // In this way it's possible to pause block production by not consuming the channel -func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) error { +func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int, sequencerSetUpdates <-chan []types.Sequencer) error { m.logger.Info("Started block producer loop.") ticker := time.NewTicker(m.Conf.BlockTime) @@ -37,6 +37,15 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) select { case <-ctx.Done(): return nil + + case update := <-sequencerSetUpdates: + err := m.handleSequencerSetUpdate(update) + if err != nil { + // occurs on serialization issues and shouldn't happen in practice + uevent.MustPublish(ctx, m.Pubsub, &events.DataHealthStatus{Error: err}, events.HealthStatusList) + return err + } + case <-ticker.C: // if empty blocks are configured to be enabled, and one is scheduled... diff --git a/block/production_test.go b/block/production_test.go index 0130cb8f1..77b6a5122 100644 --- a/block/production_test.go +++ b/block/production_test.go @@ -12,19 +12,22 @@ import ( "github.com/stretchr/testify/require" "github.com/dymensionxyz/dymint/mempool" + "github.com/dymensionxyz/dymint/types" "github.com/dymensionxyz/dymint/version" + abci "github.com/tendermint/tendermint/abci/types" + tmcfg "github.com/tendermint/tendermint/config" + mempoolv1 "github.com/dymensionxyz/dymint/mempool/v1" "github.com/dymensionxyz/dymint/node/events" uchannel "github.com/dymensionxyz/dymint/utils/channel" uevent "github.com/dymensionxyz/dymint/utils/event" - abci "github.com/tendermint/tendermint/abci/types" - tmcfg "github.com/tendermint/tendermint/config" - "github.com/dymensionxyz/dymint/testutil" "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/pubsub" "github.com/tendermint/tendermint/proxy" + + "github.com/dymensionxyz/dymint/testutil" ) // TODO: test producing lastBlock @@ -78,8 +81,10 @@ func TestCreateEmptyBlocksEnableDisable(t *testing.T) { defer cancel() bytesProduced1 := make(chan int) bytesProduced2 := make(chan int) - go manager.ProduceBlockLoop(mCtx, bytesProduced1) - go managerWithEmptyBlocks.ProduceBlockLoop(mCtx, bytesProduced2) + sequencerSetUpdates1 := make(chan []types.Sequencer) + sequencerSetUpdates2 := make(chan []types.Sequencer) + go manager.ProduceBlockLoop(mCtx, bytesProduced1, sequencerSetUpdates1) + go managerWithEmptyBlocks.ProduceBlockLoop(mCtx, bytesProduced2, sequencerSetUpdates2) uchannel.DrainForever(bytesProduced1, bytesProduced2) <-mCtx.Done() @@ -161,7 +166,8 @@ func TestCreateEmptyBlocksNew(t *testing.T) { mCtx, cancel := context.WithTimeout(context.Background(), 10*time.Second) defer cancel() bytesProduced := make(chan int) - go manager.ProduceBlockLoop(mCtx, bytesProduced) + sequencerSetUpdates := make(chan []types.Sequencer) + go manager.ProduceBlockLoop(mCtx, bytesProduced, sequencerSetUpdates) uchannel.DrainForever(bytesProduced) <-time.Tick(1 * time.Second) @@ -240,9 +246,10 @@ func TestStopBlockProduction(t *testing.T) { defer cancel() bytesProducedC := make(chan int) + sequencerSetUpdates := make(chan []types.Sequencer) go func() { - manager.ProduceBlockLoop(ctx, bytesProducedC) + manager.ProduceBlockLoop(ctx, bytesProducedC, sequencerSetUpdates) wg.Done() // Decrease counter when this goroutine finishes }() diff --git a/block/sequencers.go b/block/sequencers.go index 6632ee51c..8b99bae3a 100644 --- a/block/sequencers.go +++ b/block/sequencers.go @@ -50,7 +50,7 @@ func (m *Manager) MonitorSequencerRotation(ctx context.Context, rotateC chan str return fmt.Errorf("sequencer rotation started. signal to stop production") } -func (m *Manager) MonitorSequencerSetUpdates(ctx context.Context, updatesC chan []types.Sequencer) error { +func (m *Manager) MonitorSequencerSetUpdates(ctx context.Context, updatesC chan<- []types.Sequencer) error { ticker := time.NewTicker(3 * time.Minute) // TODO: make this configurable defer ticker.Stop() @@ -59,7 +59,7 @@ func (m *Manager) MonitorSequencerSetUpdates(ctx context.Context, updatesC chan case <-ctx.Done(): return nil case <-ticker.C: - currentSLSet, err := m.SLClient.GetBondedSequencers() + currentSLSet, err := m.SLClient.GetAllSequencers() if err != nil { m.logger.Error("Get bonded sequencers", "err", err) continue @@ -69,13 +69,15 @@ func (m *Manager) MonitorSequencerSetUpdates(ctx context.Context, updatesC chan } } -func (m *Manager) handleSequencerSetUpdate(ctx context.Context, newSet []types.Sequencer) error { +// handleSequencerSetUpdate calculates the diff between hub's and current sequencer sets and +// creates consensus messages for all new sequencers. The method updates the current state +// and is not thread-safe. Returns errors on serialization issues. +func (m *Manager) handleSequencerSetUpdate(newSet []types.Sequencer) error { newSequencers := types.SequencerListRightOuterJoin(m.State.Sequencers.Sequencers, newSet) msgs, err := ConsensusMsgsOnSequencerSetUpdate(newSequencers) if err != nil { return fmt.Errorf("consensus msgs on sequencers set update: %w", err) } - // TODO: make this update thread safe! m.State.Sequencers.SetSequencers(newSequencers) m.Executor.consensusMessagesStream.Add(msgs...) return nil @@ -122,12 +124,18 @@ func (m *Manager) MissingLastBatch() (string, bool, error) { } // handleRotationReq completes the rotation flow once a signal is received from the SL -// this called after manager shuts down the block producer and submitter +// this called after manager shuts down the block producer and submitter. The method updates +// the state and is not thread-safe. func (m *Manager) handleRotationReq(ctx context.Context, nextSeqAddr string) { + err := m.UpdateSequencerSetFromSL() + if err != nil { + panic(fmt.Errorf("update sequencer set upon rotation: %w", err)) + } + m.logger.Info("Sequencer rotation started. Production stopped on this sequencer", "nextSeqAddr", nextSeqAddr) - err := m.CompleteRotation(ctx, nextSeqAddr) + err = m.CompleteRotation(ctx, nextSeqAddr) if err != nil { - panic(err) + panic(fmt.Errorf("complete sequencer rotation: %w", err)) } // TODO: graceful fallback to full node (https://github.com/dymensionxyz/dymint/issues/1008) @@ -193,14 +201,17 @@ func (m *Manager) CreateAndPostLastBatch(ctx context.Context, nextSeqHash [32]by return nil } -// UpdateSequencerSetFromSL updates the sequencer set from the SL -// proposer is not changed here +// UpdateSequencerSetFromSL updates the sequencer set from the SL proposer is not changed here. +// The method modifies the state and is not thread-safe. func (m *Manager) UpdateSequencerSetFromSL() error { seqs, err := m.SLClient.GetAllSequencers() if err != nil { return err } - m.State.Sequencers.SetSequencers(seqs) + err = m.handleSequencerSetUpdate(seqs) + if err != nil { + return err + } m.logger.Debug("Updated bonded sequencer set.", "newSet", m.State.Sequencers.String()) return nil } diff --git a/block/submit_test.go b/block/submit_test.go index 2021f7310..046e2a3da 100644 --- a/block/submit_test.go +++ b/block/submit_test.go @@ -270,8 +270,9 @@ func TestSubmissionByTime(t *testing.T) { wg.Add(2) // Add 2 because we have 2 goroutines bytesProducedC := make(chan int) + sequencerSetUpdates := make(chan []types.Sequencer) go func() { - manager.ProduceBlockLoop(mCtx, bytesProducedC) + manager.ProduceBlockLoop(mCtx, bytesProducedC, sequencerSetUpdates) wg.Done() // Decrease counter when this goroutine finishes }() @@ -348,9 +349,10 @@ func submissionByBatchSize(manager *block.Manager, assert *assert.Assertions, ex defer cancel() bytesProducedC := make(chan int) + sequencerSetUpdates := make(chan []types.Sequencer) go func() { - manager.ProduceBlockLoop(ctx, bytesProducedC) + manager.ProduceBlockLoop(ctx, bytesProducedC, sequencerSetUpdates) wg.Done() // Decrease counter when this goroutine finishes }() From 327d493433c9ed009bd1aba301299f771867f6a4 Mon Sep 17 00:00:00 2001 From: keruch Date: Fri, 18 Oct 2024 10:57:56 +0200 Subject: [PATCH 27/27] tests --- block/consensus.go | 16 +-- block/executor.go | 4 + block/produce.go | 2 +- block/production_test.go | 243 +++++++++++++++++++++++++++++++++++++-- block/sequencers.go | 12 +- block/sequencers_test.go | 106 +++++++++++++++++ types/sequencer_set.go | 19 +++ 7 files changed, 372 insertions(+), 30 deletions(-) create mode 100644 block/sequencers_test.go diff --git a/block/consensus.go b/block/consensus.go index b60deab33..4755166dc 100644 --- a/block/consensus.go +++ b/block/consensus.go @@ -4,8 +4,6 @@ import ( "fmt" "sync" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/gogo/protobuf/proto" "github.com/dymensionxyz/dymint/types" @@ -47,20 +45,10 @@ func (q *ConsensusMessagesQueue) Get() []proto.Message { func ConsensusMsgsOnSequencerSetUpdate(newSequencers []types.Sequencer) ([]proto.Message, error) { msgs := make([]proto.Message, 0, len(newSequencers)) for _, s := range newSequencers { - // Get proposer's consensus public key and convert it to proto.Any - val, err := s.TMValidator() + anyPK, err := s.AnyConsPubKey() if err != nil { - return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) + return nil, fmt.Errorf("sequencer consensus public key: %w", err) } - pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) - if err != nil { - return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) - } - anyPK, err := codectypes.NewAnyWithValue(pubKey) - if err != nil { - return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) - } - msgs = append(msgs, &rdktypes.ConsensusMsgUpsertSequencer{ Operator: s.SettlementAddress, ConsPubKey: protoutils.CosmosToGogo(anyPK), diff --git a/block/executor.go b/block/executor.go index 33de64dc1..4100a7b4a 100644 --- a/block/executor.go +++ b/block/executor.go @@ -295,6 +295,10 @@ func (e *Executor) publishEvents(resp *tmstate.ABCIResponses, block *types.Block return err } +func (e *Executor) GetConsensusMessagesStream() ConsensusMessagesStream { + return e.consensusMessagesStream +} + func toDymintTxs(txs tmtypes.Txs) types.Txs { optiTxs := make(types.Txs, len(txs)) for i := range txs { diff --git a/block/produce.go b/block/produce.go index aa978fc6d..409c64124 100644 --- a/block/produce.go +++ b/block/produce.go @@ -39,7 +39,7 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int, return nil case update := <-sequencerSetUpdates: - err := m.handleSequencerSetUpdate(update) + err := m.HandleSequencerSetUpdate(update) if err != nil { // occurs on serialization issues and shouldn't happen in practice uevent.MustPublish(ctx, m.Pubsub, &events.DataHealthStatus{Error: err}, events.HealthStatusList) diff --git a/block/production_test.go b/block/production_test.go index 77b6a5122..3dd7a959c 100644 --- a/block/production_test.go +++ b/block/production_test.go @@ -2,32 +2,37 @@ package block_test import ( "context" + "crypto/ed25519" + "crypto/rand" "fmt" "sync" "testing" "time" + "github.com/gogo/protobuf/proto" + prototypes "github.com/gogo/protobuf/types" + "github.com/libp2p/go-libp2p/core/crypto" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" - - "github.com/dymensionxyz/dymint/mempool" - "github.com/dymensionxyz/dymint/types" - "github.com/dymensionxyz/dymint/version" - abci "github.com/tendermint/tendermint/abci/types" tmcfg "github.com/tendermint/tendermint/config" - - mempoolv1 "github.com/dymensionxyz/dymint/mempool/v1" - "github.com/dymensionxyz/dymint/node/events" - uchannel "github.com/dymensionxyz/dymint/utils/channel" - uevent "github.com/dymensionxyz/dymint/utils/event" - "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/pubsub" "github.com/tendermint/tendermint/proxy" + "github.com/dymensionxyz/dymint/da" + "github.com/dymensionxyz/dymint/mempool" + mempoolv1 "github.com/dymensionxyz/dymint/mempool/v1" + slmocks "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/settlement" + "github.com/dymensionxyz/dymint/node/events" "github.com/dymensionxyz/dymint/testutil" + "github.com/dymensionxyz/dymint/types" + rdktypes "github.com/dymensionxyz/dymint/types/pb/rollapp/sequencers/types" + uchannel "github.com/dymensionxyz/dymint/utils/channel" + uevent "github.com/dymensionxyz/dymint/utils/event" + protoutils "github.com/dymensionxyz/dymint/utils/proto" + "github.com/dymensionxyz/dymint/version" ) // TODO: test producing lastBlock @@ -287,3 +292,219 @@ func TestStopBlockProduction(t *testing.T) { time.Sleep(400 * time.Millisecond) assert.Greater(manager.State.Height(), stoppedHeight) } + +func TestUpdateInitialSequencerSet(t *testing.T) { + require := require.New(t) + app := testutil.GetAppMock(testutil.EndBlock) + ctx := context.Background() + app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{ + RollappParamUpdates: &abci.RollappParams{ + Da: "mock", + Version: version.Commit, + }, + ConsensusParamUpdates: &abci.ConsensusParams{ + Block: &abci.BlockParams{ + MaxGas: 40000000, + MaxBytes: 500000, + }, + }, + }) + + // Create proxy app + clientCreator := proxy.NewLocalClientCreator(app) + proxyApp := proxy.NewAppConns(clientCreator) + err := proxyApp.Start() + require.NoError(err) + + _, priv, err := ed25519.GenerateKey(rand.Reader) + require.NoError(err) + + lib2pPrivKey, err := crypto.UnmarshalEd25519PrivateKey(priv) + require.NoError(err) + + proposer := testutil.GenerateSequencer() + sequencer := testutil.GenerateSequencer() + + // Create a new mock ClientI + slmock := &slmocks.MockClientI{} + slmock.On("Init", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + slmock.On("Start").Return(nil) + slmock.On("GetProposer").Return(proposer) + slmock.On("GetAllSequencers").Return([]types.Sequencer{*proposer, *sequencer}, nil) + + manager, err := testutil.GetManagerWithProposerKey(testutil.GetManagerConfig(), lib2pPrivKey, slmock, 1, 1, 0, proxyApp, nil) + require.NoError(err) + + manager.DAClient = testutil.GetMockDALC(log.TestingLogger()) + manager.Retriever = manager.DAClient.(da.BatchRetriever) + + // Check initial assertions + require.Zero(manager.State.Height()) + require.Zero(manager.LastSubmittedHeight.Load()) + + // Simulate updating the sequencer set from SL. + // This will add new consensus msgs to the queue. + err = manager.UpdateSequencerSetFromSL() + require.NoError(err) + + // Produce block and validate that we produced blocks + block, _, err := manager.ProduceApplyGossipBlock(ctx, true) + require.NoError(err) + assert.Greater(t, manager.State.Height(), uint64(0)) + assert.Zero(t, manager.LastSubmittedHeight.Load()) + + // Validate that the block has expected consensus msgs + require.Len(block.Data.ConsensusMessages, 2) + + // Construct expected messages + // Msg 1 + anyPK1, err := proposer.AnyConsPubKey() + require.NoError(err) + expectedConsMsg1 := &rdktypes.ConsensusMsgUpsertSequencer{ + Operator: proposer.SettlementAddress, + ConsPubKey: protoutils.CosmosToGogo(anyPK1), + RewardAddr: proposer.RewardAddr, + Relayers: proposer.WhitelistedRelayers, + } + expectedConsMsgBytes1, err := proto.Marshal(expectedConsMsg1) + require.NoError(err) + anyMsg1 := &prototypes.Any{ + TypeUrl: proto.MessageName(expectedConsMsg1), + Value: expectedConsMsgBytes1, + } + + // Msg 2 + anyPK2, err := sequencer.AnyConsPubKey() + require.NoError(err) + expectedConsMsg2 := &rdktypes.ConsensusMsgUpsertSequencer{ + Operator: sequencer.SettlementAddress, + ConsPubKey: protoutils.CosmosToGogo(anyPK2), + RewardAddr: sequencer.RewardAddr, + Relayers: sequencer.WhitelistedRelayers, + } + expectedConsMsgBytes2, err := proto.Marshal(expectedConsMsg2) + require.NoError(err) + anyMsg2 := &prototypes.Any{ + TypeUrl: proto.MessageName(expectedConsMsg2), + Value: expectedConsMsgBytes2, + } + + // Verify the result + require.True(proto.Equal(anyMsg1, block.Data.ConsensusMessages[0])) + require.True(proto.Equal(anyMsg2, block.Data.ConsensusMessages[1])) +} + +func TestUpdateExistingSequencerSet(t *testing.T) { + require := require.New(t) + app := testutil.GetAppMock(testutil.EndBlock) + ctx := context.Background() + app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{ + RollappParamUpdates: &abci.RollappParams{ + Da: "mock", + Version: version.Commit, + }, + ConsensusParamUpdates: &abci.ConsensusParams{ + Block: &abci.BlockParams{ + MaxGas: 40000000, + MaxBytes: 500000, + }, + }, + }) + + // Create proxy app + clientCreator := proxy.NewLocalClientCreator(app) + proxyApp := proxy.NewAppConns(clientCreator) + err := proxyApp.Start() + require.NoError(err) + + _, priv, err := ed25519.GenerateKey(rand.Reader) + require.NoError(err) + + lib2pPrivKey, err := crypto.UnmarshalEd25519PrivateKey(priv) + require.NoError(err) + + proposer := testutil.GenerateSequencer() + sequencer := testutil.GenerateSequencer() + + // Create a new mock ClientI + slmock := &slmocks.MockClientI{} + slmock.On("Init", mock.Anything, mock.Anything, mock.Anything, mock.Anything).Return(nil) + slmock.On("Start").Return(nil) + slmock.On("GetProposer").Return(proposer) + slmock.On("GetAllSequencers").Return([]types.Sequencer{*proposer, *sequencer}, nil) + + manager, err := testutil.GetManagerWithProposerKey(testutil.GetManagerConfig(), lib2pPrivKey, slmock, 1, 1, 0, proxyApp, nil) + require.NoError(err) + + manager.DAClient = testutil.GetMockDALC(log.TestingLogger()) + manager.Retriever = manager.DAClient.(da.BatchRetriever) + + // Set the initial sequencer set + manager.State.Sequencers.SetSequencers([]types.Sequencer{*proposer, *sequencer}) + + // Check initial assertions + require.Zero(manager.State.Height()) + require.Zero(manager.LastSubmittedHeight.Load()) + require.Len(manager.State.Sequencers.Sequencers, 2) + require.Equal(manager.State.Sequencers.Sequencers[0], *proposer) + require.Equal(manager.State.Sequencers.Sequencers[1], *sequencer) + + // Prepare produce loop + ctx, cancel := context.WithCancel(context.Background()) + produceBlockLoopWg := sync.WaitGroup{} + produceBlockLoopWg.Add(1) + bytesProducedC := make(chan int) + sequencerSetUpdates := make(chan []types.Sequencer) + + go func() { + err = manager.ProduceBlockLoop(ctx, bytesProducedC, sequencerSetUpdates) + require.NoError(err) + produceBlockLoopWg.Done() + }() + + // Update one of the sequencers and pass the update to the manager. + // We expect that the manager will update the sequencer set in the state and generate a new consensus msg. + updatedSequencer := *sequencer // sequencer is a pointer, but we want to have its copy, so we dereference it + const newSequencerRewardAddr = "dym1mk7pw34ypusacm29m92zshgxee3yreums8avur" + updatedSequencer.RewardAddr = newSequencerRewardAddr + // Now ProduceBlockLoop must be unblocked and called + sequencerSetUpdates <- []types.Sequencer{*proposer, updatedSequencer} + // Exit ProduceBlockLoop and wait until it finishes + cancel() + produceBlockLoopWg.Wait() + + // The number of sequencers is the same. However, the second sequencer is modified. + require.Len(manager.State.Sequencers.Sequencers, 2) + require.Equal(manager.State.Sequencers.Sequencers[0], *proposer) + // Now Sequencers[1] is a sequencer with the new reward address + require.NotEqual(*sequencer, manager.State.Sequencers.Sequencers[1]) + require.Equal(updatedSequencer, manager.State.Sequencers.Sequencers[1]) + + // Produce block and validate that we produced blocks + block, _, err := manager.ProduceApplyGossipBlock(ctx, true) + require.NoError(err) + assert.Greater(t, manager.State.Height(), uint64(0)) + assert.Zero(t, manager.LastSubmittedHeight.Load()) + + // Validate that the block has expected consensus msgs: one msg for one new sequencer + require.Len(block.Data.ConsensusMessages, 1) + + // Construct the expected message + anyPK, err := updatedSequencer.AnyConsPubKey() + require.NoError(err) + expectedConsMsg := &rdktypes.ConsensusMsgUpsertSequencer{ + Operator: updatedSequencer.SettlementAddress, + ConsPubKey: protoutils.CosmosToGogo(anyPK), + RewardAddr: updatedSequencer.RewardAddr, + Relayers: updatedSequencer.WhitelistedRelayers, + } + expectedConsMsgBytes, err := proto.Marshal(expectedConsMsg) + require.NoError(err) + anyMsg1 := &prototypes.Any{ + TypeUrl: proto.MessageName(expectedConsMsg), + Value: expectedConsMsgBytes, + } + + // Verify the result + require.True(proto.Equal(anyMsg1, block.Data.ConsensusMessages[0])) +} diff --git a/block/sequencers.go b/block/sequencers.go index 8b99bae3a..3785da932 100644 --- a/block/sequencers.go +++ b/block/sequencers.go @@ -69,17 +69,21 @@ func (m *Manager) MonitorSequencerSetUpdates(ctx context.Context, updatesC chan< } } -// handleSequencerSetUpdate calculates the diff between hub's and current sequencer sets and +// HandleSequencerSetUpdate calculates the diff between hub's and current sequencer sets and // creates consensus messages for all new sequencers. The method updates the current state // and is not thread-safe. Returns errors on serialization issues. -func (m *Manager) handleSequencerSetUpdate(newSet []types.Sequencer) error { +func (m *Manager) HandleSequencerSetUpdate(newSet []types.Sequencer) error { + // find new (updated) sequencers newSequencers := types.SequencerListRightOuterJoin(m.State.Sequencers.Sequencers, newSet) + // create consensus msgs for new sequencers msgs, err := ConsensusMsgsOnSequencerSetUpdate(newSequencers) if err != nil { return fmt.Errorf("consensus msgs on sequencers set update: %w", err) } - m.State.Sequencers.SetSequencers(newSequencers) + // add consensus msgs to the stream m.Executor.consensusMessagesStream.Add(msgs...) + // save the new sequencer set to the state + m.State.Sequencers.SetSequencers(newSet) return nil } @@ -208,7 +212,7 @@ func (m *Manager) UpdateSequencerSetFromSL() error { if err != nil { return err } - err = m.handleSequencerSetUpdate(seqs) + err = m.HandleSequencerSetUpdate(seqs) if err != nil { return err } diff --git a/block/sequencers_test.go b/block/sequencers_test.go new file mode 100644 index 000000000..7967bd165 --- /dev/null +++ b/block/sequencers_test.go @@ -0,0 +1,106 @@ +package block_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "github.com/dymensionxyz/dymint/block" + "github.com/dymensionxyz/dymint/testutil" + "github.com/dymensionxyz/dymint/types" +) + +func TestHandleSequencerSetUpdate(t *testing.T) { + seq1 := *testutil.GenerateSequencer() + seq2 := *testutil.GenerateSequencer() + seq3 := *testutil.GenerateSequencer() + seq4 := *testutil.GenerateSequencer() + + testCases := []struct { + name string + initial []types.Sequencer + update []types.Sequencer + diff []types.Sequencer + }{ + { + name: "no diff", + initial: []types.Sequencer{seq1, seq2, seq3}, + update: []types.Sequencer{seq1, seq2, seq3}, + diff: nil, + }, + { + name: "diff", + initial: []types.Sequencer{seq1, seq2}, + update: []types.Sequencer{seq2, seq3}, + diff: []types.Sequencer{seq3}, + }, + { + name: "update is larger", + initial: []types.Sequencer{seq1, seq2}, + update: []types.Sequencer{seq1, seq2, seq3}, + diff: []types.Sequencer{seq3}, + }, + { + name: "initial is larger", + initial: []types.Sequencer{seq1, seq2, seq3}, + update: []types.Sequencer{seq2, seq4}, + diff: []types.Sequencer{seq4}, + }, + { + name: "update is a subset of initial", + initial: []types.Sequencer{seq1, seq2, seq3}, + update: []types.Sequencer{seq1, seq2}, + diff: nil, + }, + { + name: "initial is empty", + initial: []types.Sequencer{}, + update: []types.Sequencer{seq1, seq2, seq3}, + diff: []types.Sequencer{seq1, seq2, seq3}, + }, + { + name: "update is empty", + initial: []types.Sequencer{seq1, seq2, seq3}, + update: []types.Sequencer{}, + diff: nil, + }, + { + name: "initial is nil", + initial: nil, + update: []types.Sequencer{seq1, seq2, seq3}, + diff: []types.Sequencer{seq1, seq2, seq3}, + }, + { + name: "update is nil", + initial: []types.Sequencer{seq1, seq2, seq3}, + update: nil, + diff: nil, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + // Create a manger + manager, err := testutil.GetManager(testutil.GetManagerConfig(), nil, 1, 1, 0, nil, nil) + require.NoError(t, err) + require.NotNil(t, manager) + // Set the initial set + manager.State.Sequencers.SetSequencers(tc.initial) + + // Update the set + err = manager.HandleSequencerSetUpdate(tc.update) + require.NoError(t, err) + require.ElementsMatch(t, manager.State.Sequencers.Sequencers, tc.update) + + // Get the consensus msgs queue and verify the result + // Msgs are created only for the diff + actualConsMsgs := manager.Executor.GetConsensusMessagesStream().Get() + require.Len(t, actualConsMsgs, len(tc.diff)) + + expConsMsgs, err := block.ConsensusMsgsOnSequencerSetUpdate(tc.diff) + require.NoError(t, err) + + require.ElementsMatch(t, expConsMsgs, actualConsMsgs) + }) + } +} diff --git a/types/sequencer_set.go b/types/sequencer_set.go index 220d0772b..b0dee76d9 100644 --- a/types/sequencer_set.go +++ b/types/sequencer_set.go @@ -5,6 +5,8 @@ import ( "crypto/sha256" "fmt" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/types" ) @@ -62,6 +64,23 @@ func (s Sequencer) PubKey() tmcrypto.PubKey { return s.val.PubKey } +// AnyConsPubKey returns sequencer's consensus public key represented as Cosmos proto.Any. +func (s Sequencer) AnyConsPubKey() (*codectypes.Any, error) { + val, err := s.TMValidator() + if err != nil { + return nil, fmt.Errorf("convert next squencer to tendermint validator: %w", err) + } + pubKey, err := cryptocodec.FromTmPubKeyInterface(val.PubKey) + if err != nil { + return nil, fmt.Errorf("convert tendermint pubkey to cosmos: %w", err) + } + anyPK, err := codectypes.NewAnyWithValue(pubKey) + if err != nil { + return nil, fmt.Errorf("convert cosmos pubkey to any: %w", err) + } + return anyPK, nil +} + // FullHash returns a "full" hash of the sequencer that includes all fields of the Sequencer type. func (s Sequencer) FullHash() []byte { h := sha256.New()