diff --git a/.mockery.yaml b/.mockery.yaml index e50235991..329e8b37c 100644 --- a/.mockery.yaml +++ b/.mockery.yaml @@ -10,10 +10,10 @@ packages: github.com/dymensionxyz/dymint/settlement/dymension: interfaces: CosmosClient: - github.com/dymensionxyz/dymension/v3/x/sequencer/types: + github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types: interfaces: QueryClient: - github.com/dymensionxyz/dymension/v3/x/rollapp/types: + github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types: interfaces: QueryClient: github.com/tendermint/tendermint/abci/types: @@ -32,5 +32,10 @@ packages: github.com/dymensionxyz/dymint/da: interfaces: DataAvailabilityLayerClient: + github.com/dymensionxyz/dymint/p2p: + interfaces: + GetProposerI: + + diff --git a/block/block.go b/block/block.go index 40d52158b..1f4031071 100644 --- a/block/block.go +++ b/block/block.go @@ -15,6 +15,8 @@ import ( // - block height is the expected block height on the store (height + 1). // - block height is the expected block height on the app (last block height + 1). func (m *Manager) applyBlock(block *types.Block, commit *types.Commit, blockMetaData types.BlockMetaData) error { + var retainHeight int64 + // TODO: add switch case to have defined behavior for each case. // validate block height if block.Header.Height != m.State.NextHeight() { @@ -30,66 +32,65 @@ func (m *Manager) applyBlock(block *types.Block, commit *types.Commit, blockMeta if err != nil { return fmt.Errorf("check if block is already applied: %w", err) } - // In case the following true, it means we crashed after the commit and before updating the store height. - // In that case we'll want to align the store with the app state and continue to the next block. + // In case the following true, it means we crashed after the app commit but before updating the state + // In that case we'll want to align the state with the app commit result, as if the block was applied. if isBlockAlreadyApplied { - // In this case, where the app was committed, but the state wasn't updated - // it will update the state from appInfo, saved responses and validators. err := m.UpdateStateFromApp() if err != nil { return fmt.Errorf("update state from app: %w", err) } - m.logger.Debug("Aligned with app state required. Skipping to next block", "height", block.Header.Height) - return nil - } - // Start applying the block assuming no inconsistency was found. - _, err = m.Store.SaveBlock(block, commit, nil) - if err != nil { - return fmt.Errorf("save block: %w", err) - } + m.logger.Info("updated state from app commit", "height", block.Header.Height) + } else { + var appHash []byte + // Start applying the block assuming no inconsistency was found. + _, err = m.Store.SaveBlock(block, commit, nil) + if err != nil { + return fmt.Errorf("save block: %w", err) + } - responses, err := m.Executor.ExecuteBlock(m.State, block) - if err != nil { - return fmt.Errorf("execute block: %w", err) - } + responses, err := m.Executor.ExecuteBlock(m.State, block) + if err != nil { + return fmt.Errorf("execute block: %w", err) + } - dbBatch := m.Store.NewBatch() - dbBatch, err = m.Store.SaveBlockResponses(block.Header.Height, responses, dbBatch) - if err != nil { - dbBatch.Discard() - return fmt.Errorf("save block responses: %w", err) + _, err = m.Store.SaveBlockResponses(block.Header.Height, responses, nil) + if err != nil { + return fmt.Errorf("save block responses: %w", err) + } + + // Commit block to app + appHash, retainHeight, err = m.Executor.Commit(m.State, block, responses) + if err != nil { + return fmt.Errorf("commit block: %w", err) + } + + // Update the state with the new app hash, and store height from the commit. + // Every one of those, if happens before commit, prevents us from re-executing the block in case failed during commit. + m.Executor.UpdateStateAfterCommit(m.State, responses, appHash, block.Header.Height) } - // Get the validator changes from the app - validators := m.State.NextValidators.Copy() // TODO: this will be changed when supporting multiple sequencers from the hub + // check if the proposer needs to be changed + switchRole := m.Executor.UpdateProposerFromBlock(m.State, block) - dbBatch, err = m.Store.SaveValidators(block.Header.Height, validators, dbBatch) + // save sequencers to store to be queried over RPC + batch := m.Store.NewBatch() + batch, err = m.Store.SaveSequencers(block.Header.Height, &m.State.Sequencers, batch) if err != nil { - dbBatch.Discard() - return fmt.Errorf("save validators: %w", err) + return fmt.Errorf("save sequencers: %w", err) } - err = dbBatch.Commit() + batch, err = m.Store.SaveState(m.State, batch) if err != nil { - return fmt.Errorf("commit batch to disk: %w", err) + return fmt.Errorf("update state: %w", err) } - // Commit block to app - appHash, retainHeight, err := m.Executor.Commit(m.State, block, responses) + err = batch.Commit() if err != nil { - return fmt.Errorf("commit block: %w", err) + return fmt.Errorf("commit state: %w", err) } - // If failed here, after the app committed, but before the state is updated, we'll update the state on - // UpdateStateFromApp using the saved responses and validators. + types.RollappHeightGauge.Set(float64(block.Header.Height)) - // Update the state with the new app hash, last validators and store height from the commit. - // Every one of those, if happens before commit, prevents us from re-executing the block in case failed during commit. - m.Executor.UpdateStateAfterCommit(m.State, responses, appHash, block.Header.Height, validators) - _, err = m.Store.SaveState(m.State, nil) - if err != nil { - return fmt.Errorf("update state: %w", err) - } // Prune old heights, if requested by ABCI app. if 0 < retainHeight { err = m.PruneBlocks(uint64(retainHeight)) @@ -97,6 +98,12 @@ func (m *Manager) applyBlock(block *types.Block, commit *types.Commit, blockMeta m.logger.Error("prune blocks", "retain_height", retainHeight, "err", err) } } + + if switchRole { + // TODO: graceful role change (https://github.com/dymensionxyz/dymint/issues/1008) + m.logger.Info("Node changing to proposer role") + panic("sequencer is no longer the proposer") + } return nil } @@ -125,7 +132,7 @@ func (m *Manager) attemptApplyCachedBlocks() error { if !blockExists { break } - if err := m.validateBlock(cachedBlock.Block, cachedBlock.Commit); err != nil { + if err := m.validateBlockBeforeApply(cachedBlock.Block, cachedBlock.Commit); err != nil { m.blockCache.Delete(cachedBlock.Block.Header.Height) // TODO: can we take an action here such as dropping the peer / reducing their reputation? return fmt.Errorf("block not valid at height %d, dropping it: err:%w", cachedBlock.Block.Header.Height, err) @@ -143,10 +150,7 @@ func (m *Manager) attemptApplyCachedBlocks() error { return nil } -func (m *Manager) validateBlock(block *types.Block, commit *types.Commit) error { - // Currently we're assuming proposer is never nil as it's a pre-condition for - // dymint to start - proposer := m.SLClient.GetProposer() - - return types.ValidateProposedTransition(m.State, block, commit, proposer) +// This function validates the block and commit against the state before applying it. +func (m *Manager) validateBlockBeforeApply(block *types.Block, commit *types.Commit) error { + return types.ValidateProposedTransition(m.State, block, commit, m.GetProposerPubKey()) } diff --git a/block/executor.go b/block/executor.go index cc0ce5ba5..fe424b1de 100644 --- a/block/executor.go +++ b/block/executor.go @@ -45,11 +45,12 @@ func NewExecutor(localAddress []byte, chainID string, mempool mempool.Mempool, p } // InitChain calls InitChainSync using consensus connection to app. -func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, validators []*tmtypes.Validator) (*abci.ResponseInitChain, error) { +func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, valset []*tmtypes.Validator) (*abci.ResponseInitChain, error) { params := genesis.ConsensusParams valUpates := abci.ValidatorUpdates{} - for _, validator := range validators { + // prepare the validator updates as expected by the ABCI app + for _, validator := range valset { tmkey, err := tmcrypto.PubKeyToProto(validator.PubKey) if err != nil { return nil, err @@ -88,7 +89,7 @@ func (e *Executor) InitChain(genesis *tmtypes.GenesisDoc, validators []*tmtypes. } // CreateBlock reaps transactions from mempool and builds a block. -func (e *Executor) CreateBlock(height uint64, lastCommit *types.Commit, lastHeaderHash [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 { if state.ConsensusParams.Block.MaxBytes > 0 { maxBlockDataSizeBytes = min(maxBlockDataSizeBytes, uint64(state.ConsensusParams.Block.MaxBytes)) } @@ -117,9 +118,10 @@ func (e *Executor) CreateBlock(height uint64, lastCommit *types.Commit, lastHead }, LastCommit: *lastCommit, } - copy(block.Header.LastCommitHash[:], e.getLastCommitHash(lastCommit, &block.Header)) - copy(block.Header.DataHash[:], e.getDataHash(block)) - copy(block.Header.SequencersHash[:], state.Validators.Hash()) + copy(block.Header.LastCommitHash[:], types.GetLastCommitHash(lastCommit, &block.Header)) + copy(block.Header.DataHash[:], types.GetDataHash(block)) + copy(block.Header.SequencerHash[:], state.Sequencers.ProposerHash()) + copy(block.Header.NextSequencersHash[:], nextSeqHash[:]) return block } @@ -197,8 +199,6 @@ func (e *Executor) ExecuteBlock(state *types.State, block *types.Block) (*tmstat hash := block.Hash() abciHeader := types.ToABCIHeaderPB(&block.Header) - abciHeader.ChainID = e.chainID - abciHeader.ValidatorsHash = state.Validators.Hash() abciResponses.BeginBlock, err = e.proxyAppConsensusConn.BeginBlockSync( abci.RequestBeginBlock{ Hash: hash[:], @@ -228,18 +228,6 @@ func (e *Executor) ExecuteBlock(state *types.State, block *types.Block) (*tmstat return abciResponses, nil } -func (e *Executor) getLastCommitHash(lastCommit *types.Commit, header *types.Header) []byte { - lastABCICommit := types.ToABCICommit(lastCommit, header) - return lastABCICommit.Hash() -} - -func (e *Executor) getDataHash(block *types.Block) []byte { - abciData := tmtypes.Data{ - Txs: types.ToABCIBlockDataTxs(&block.Data), - } - return abciData.Hash() -} - func (e *Executor) publishEvents(resp *tmstate.ABCIResponses, block *types.Block) error { if e.eventBus == nil { return nil diff --git a/block/executor_test.go b/block/executor_test.go index 86e42f58d..9df7272a1 100644 --- a/block/executor_test.go +++ b/block/executor_test.go @@ -8,7 +8,9 @@ import ( "github.com/dymensionxyz/dymint/block" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" @@ -28,6 +30,7 @@ import ( "github.com/dymensionxyz/dymint/types" ) +// TODO: test UpdateProposerFromBlock func TestCreateBlock(t *testing.T) { assert := assert.New(t) require := require.New(t) @@ -49,13 +52,19 @@ func TestCreateBlock(t *testing.T) { maxBytes := uint64(100) + // Create a valid proposer for the block + proposerKey := ed25519.GenPrivKey() + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(proposerKey.PubKey()) + require.NoError(err) + + // Init state state := &types.State{} + state.Sequencers.SetProposer(types.NewSequencerFromValidator(*tmtypes.NewValidator(tmPubKey, 1))) state.ConsensusParams.Block.MaxBytes = int64(maxBytes) state.ConsensusParams.Block.MaxGas = 100000 - state.Validators = tmtypes.NewValidatorSet(nil) // empty block - block := executor.CreateBlock(1, &types.Commit{}, [32]byte{}, state, maxBytes) + 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) @@ -63,7 +72,7 @@ func TestCreateBlock(t *testing.T) { // one small Tx err = mpool.CheckTx([]byte{1, 2, 3, 4}, func(r *abci.Response) {}, mempool.TxInfo{}) require.NoError(err) - block = executor.CreateBlock(2, &types.Commit{}, [32]byte{}, state, maxBytes) + block = executor.CreateBlock(2, &types.Commit{}, [32]byte{}, [32]byte(state.Sequencers.ProposerHash()), state, maxBytes) require.NotNil(block) assert.Equal(uint64(2), block.Header.Height) assert.Len(block.Data.Txs, 1) @@ -73,7 +82,7 @@ func TestCreateBlock(t *testing.T) { require.NoError(err) err = mpool.CheckTx(make([]byte, 100), func(r *abci.Response) {}, mempool.TxInfo{}) require.NoError(err) - block = executor.CreateBlock(3, &types.Commit{}, [32]byte{}, state, maxBytes) + block = executor.CreateBlock(3, &types.Commit{}, [32]byte{}, [32]byte(state.Sequencers.ProposerHash()), state, maxBytes) require.NotNil(block) assert.Len(block.Data.Txs, 2) } @@ -136,11 +145,14 @@ func TestApplyBlock(t *testing.T) { require.NoError(err) require.NotNil(headerSub) + // Create a valid proposer for the block + proposerKey := ed25519.GenPrivKey() + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(proposerKey.PubKey()) + require.NoError(err) + // Init state - state := &types.State{ - NextValidators: tmtypes.NewValidatorSet(nil), - Validators: tmtypes.NewValidatorSet(nil), - } + state := &types.State{} + state.Sequencers.SetProposer(types.NewSequencerFromValidator(*tmtypes.NewValidator(tmPubKey, 1))) state.InitialHeight = 1 state.SetHeight(0) maxBytes := uint64(100) @@ -150,16 +162,11 @@ func TestApplyBlock(t *testing.T) { // Create first block with one Tx from mempool _ = mpool.CheckTx([]byte{1, 2, 3, 4}, func(r *abci.Response) {}, mempool.TxInfo{}) require.NoError(err) - block := executor.CreateBlock(1, &types.Commit{Height: 0}, [32]byte{}, state, maxBytes) + block := executor.CreateBlock(1, &types.Commit{Height: 0}, [32]byte{}, [32]byte(state.Sequencers.ProposerHash()), state, maxBytes) require.NotNil(block) assert.Equal(uint64(1), block.Header.Height) assert.Len(block.Data.Txs, 1) - // Create proposer for the block - proposerKey := ed25519.GenPrivKey() - proposer := &types.Sequencer{ - PublicKey: proposerKey.PubKey(), - } // Create commit for the block abciHeaderPb := types.ToABCIHeaderPB(&block.Header) abciHeaderBytes, err := abciHeaderPb.Marshal() @@ -173,14 +180,15 @@ func TestApplyBlock(t *testing.T) { } // Apply the block - err = types.ValidateProposedTransition(state, block, commit, proposer) + err = types.ValidateProposedTransition(state, block, commit, state.Sequencers.GetProposerPubKey()) require.NoError(err) + resp, err := executor.ExecuteBlock(state, block) require.NoError(err) require.NotNil(resp) appHash, _, err := executor.Commit(state, block, resp) require.NoError(err) - executor.UpdateStateAfterCommit(state, resp, appHash, block.Header.Height, state.Validators) + executor.UpdateStateAfterCommit(state, resp, appHash, block.Header.Height) assert.Equal(uint64(1), state.Height()) assert.Equal(mockAppHash, state.AppHash) @@ -189,7 +197,7 @@ func TestApplyBlock(t *testing.T) { require.NoError(mpool.CheckTx([]byte{5, 6, 7, 8, 9}, func(r *abci.Response) {}, mempool.TxInfo{})) require.NoError(mpool.CheckTx([]byte{1, 2, 3, 4, 5}, func(r *abci.Response) {}, mempool.TxInfo{})) require.NoError(mpool.CheckTx(make([]byte, 90), func(r *abci.Response) {}, mempool.TxInfo{})) - block = executor.CreateBlock(2, commit, [32]byte{}, state, maxBytes) + block = executor.CreateBlock(2, commit, [32]byte{}, [32]byte(state.Sequencers.ProposerHash()), state, maxBytes) require.NotNil(block) assert.Equal(uint64(2), block.Header.Height) assert.Len(block.Data.Txs, 3) @@ -210,8 +218,7 @@ func TestApplyBlock(t *testing.T) { } // Apply the block with an invalid commit - err = types.ValidateProposedTransition(state, block, invalidCommit, proposer) - + err = types.ValidateProposedTransition(state, block, invalidCommit, state.Sequencers.GetProposerPubKey()) require.ErrorIs(err, types.ErrInvalidSignature) // Create a valid commit for the block @@ -224,15 +231,14 @@ func TestApplyBlock(t *testing.T) { } // Apply the block - err = types.ValidateProposedTransition(state, block, commit, proposer) + err = types.ValidateProposedTransition(state, block, commit, state.Sequencers.GetProposerPubKey()) require.NoError(err) resp, err = executor.ExecuteBlock(state, block) require.NoError(err) require.NotNil(resp) - vals := state.NextValidators.Copy() // TODO: this will be changed when supporting multiple sequencers from the hub _, _, err = executor.Commit(state, block, resp) require.NoError(err) - executor.UpdateStateAfterCommit(state, resp, appHash, block.Header.Height, vals) + executor.UpdateStateAfterCommit(state, resp, appHash, block.Header.Height) assert.Equal(uint64(2), state.Height()) // wait for at least 4 Tx events, for up to 3 second. diff --git a/block/initchain.go b/block/initchain.go index c7c694c1f..c068d198e 100644 --- a/block/initchain.go +++ b/block/initchain.go @@ -2,28 +2,27 @@ package block import ( "context" + "errors" - cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" tmtypes "github.com/tendermint/tendermint/types" ) func (m *Manager) RunInitChain(ctx context.Context) error { // get the proposer's consensus pubkey proposer := m.SLClient.GetProposer() - tmPubKey, err := cryptocodec.ToTmPubKeyInterface(proposer.PublicKey) + if proposer == nil { + return errors.New("failed to get proposer") + } + tmProposer, err := proposer.TMValidator() if err != nil { return err } - gensisValSet := []*tmtypes.Validator{tmtypes.NewValidator(tmPubKey, 1)} - - // call initChain with both addresses - res, err := m.Executor.InitChain(m.Genesis, gensisValSet) + res, err := m.Executor.InitChain(m.Genesis, []*tmtypes.Validator{tmProposer}) if err != nil { return err } - // update the state with only the consensus pubkey - m.Executor.UpdateStateAfterInitChain(m.State, res, gensisValSet) + m.Executor.UpdateStateAfterInitChain(m.State, res) m.Executor.UpdateMempoolAfterInitChain(m.State) if _, err := m.Store.SaveState(m.State, nil); err != nil { return err diff --git a/block/manager.go b/block/manager.go index eeac90750..3f4f0a019 100644 --- a/block/manager.go +++ b/block/manager.go @@ -1,7 +1,6 @@ package block import ( - "bytes" "context" "errors" "fmt" @@ -16,6 +15,7 @@ import ( uevent "github.com/dymensionxyz/dymint/utils/event" "github.com/libp2p/go-libp2p/core/crypto" + tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/libs/pubsub" tmtypes "github.com/tendermint/tendermint/types" @@ -46,7 +46,7 @@ type Manager struct { // Clients and servers Pubsub *pubsub.Server - p2pClient *p2p.Client + P2PClient *p2p.Client DAClient da.DataAvailabilityLayerClient SLClient settlement.ClientI @@ -102,7 +102,7 @@ func NewManager( m := &Manager{ Pubsub: pubsub, - p2pClient: p2pClient, + P2PClient: p2pClient, LocalKey: localKey, Conf: conf, Genesis: genesis, @@ -127,15 +127,6 @@ func NewManager( // Start starts the block manager. func (m *Manager) Start(ctx context.Context) error { - m.logger.Info("Starting the block manager") - - isSequencer, err := m.IsSequencerVerify() - if err != nil { - return err - } - - m.logger.Info("Starting block manager", "isSequencer", isSequencer) - // Check if InitChain flow is needed if m.State.IsGenesis() { m.logger.Info("Running InitChain") @@ -146,34 +137,17 @@ func (m *Manager) Start(ctx context.Context) error { } } - if isSequencer { - - eg, ctx := errgroup.WithContext(ctx) - - // Sequencer must wait till DA is synced to start submitting blobs - <-m.DAClient.Synced() - - err = m.syncFromSettlement() - if err != nil { - return fmt.Errorf("sync block manager from settlement: %w", err) - } - - nBytes := m.GetUnsubmittedBytes() - bytesProducedC := make(chan int) + // Check if the chain is halted + err := m.isChainHalted() + if err != nil { + return err + } - uerrors.ErrGroupGoLog(eg, m.logger, func() error { - return m.SubmitLoop(ctx, bytesProducedC) - }) - uerrors.ErrGroupGoLog(eg, m.logger, func() error { - bytesProducedC <- nBytes - return m.ProduceBlockLoop(ctx, bytesProducedC) - }) - go func() { - _ = eg.Wait() // errors are already logged - m.logger.Info("Block manager err group finished.") - }() + isProposer := m.IsProposer() + m.logger.Info("starting block manager", "proposer", isProposer) - } else { + /* ----------------------------- 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. go func() { err := m.syncFromSettlement() @@ -187,23 +161,71 @@ func (m *Manager) Start(ctx context.Context) error { // P2P Sync. Subscribe to P2P received blocks events go uevent.MustSubscribe(ctx, m.Pubsub, "applyGossipedBlocksLoop", p2p.EventQueryNewGossipedBlock, m.onReceivedBlock, m.logger) go uevent.MustSubscribe(ctx, m.Pubsub, "applyBlockSyncBlocksLoop", p2p.EventQueryNewBlockSyncBlock, m.onReceivedBlock, m.logger) + return nil } - return nil -} - -func (m *Manager) IsSequencerVerify() (bool, error) { - slProposerKey := m.SLClient.GetProposer().PublicKey.Bytes() - localProposerKey, err := m.LocalKey.GetPublic().Raw() + /* ----------------------------- sequencer mode ----------------------------- */ + // Sequencer must wait till DA is synced to start submitting blobs + <-m.DAClient.Synced() + err = m.syncFromSettlement() + if err != nil { + return fmt.Errorf("sync block manager from settlement: %w", err) + } + // check if sequencer in the middle of rotation + nextSeqAddr, missing, err := m.MissingLastBatch() if err != nil { - return false, fmt.Errorf("get local node public key: %w", err) + return fmt.Errorf("checking if missing last batch: %w", err) + } + // if sequencer is in the middle of rotation, complete rotation instead of running the main loop + if missing { + m.handleRotationReq(ctx, nextSeqAddr) + return nil } - return bytes.Equal(slProposerKey, localProposerKey), nil + + // populate the bytes produced channel + bytesProducedC := make(chan int) + + // channel to signal sequencer rotation started + rotateSequencerC := make(chan string, 1) + + eg, ctx := errgroup.WithContext(ctx) + uerrors.ErrGroupGoLog(eg, m.logger, func() error { + return m.SubmitLoop(ctx, bytesProducedC) + }) + uerrors.ErrGroupGoLog(eg, m.logger, func() error { + bytesProducedC <- m.GetUnsubmittedBytes() // load unsubmitted bytes from previous run + return m.ProduceBlockLoop(ctx, bytesProducedC) + }) + uerrors.ErrGroupGoLog(eg, m.logger, func() error { + return m.MonitorSequencerRotation(ctx, rotateSequencerC) + }) + + go func() { + _ = eg.Wait() + // Check if exited due to sequencer rotation signal + select { + case nextSeqAddr := <-rotateSequencerC: + m.handleRotationReq(ctx, nextSeqAddr) + default: + m.logger.Info("Block manager err group finished.") + } + }() + + return nil } -func (m *Manager) IsSequencer() bool { - ret, _ := m.IsSequencerVerify() - return ret +func (m *Manager) isChainHalted() error { + if m.GetProposerPubKey() == nil { + // if no proposer set in state, try to update it from the hub + err := m.UpdateProposer() + if err != nil { + return fmt.Errorf("update proposer: %w", err) + } + if m.GetProposerPubKey() == nil { + return fmt.Errorf("no proposer pubkey found. chain is halted") + } + } + return nil } func (m *Manager) NextHeightToSubmit() uint64 { @@ -212,6 +234,11 @@ func (m *Manager) NextHeightToSubmit() uint64 { // syncFromSettlement enforces the node to be synced on initial run from SL and DA. func (m *Manager) syncFromSettlement() error { + err := m.UpdateSequencerSetFromSL() + if err != nil { + return fmt.Errorf("update bonded sequencer set: %w", err) + } + res, err := m.SLClient.GetLatestBatch() if errors.Is(err, gerrc.ErrNotFound) { // The SL hasn't got any batches for this chain yet. @@ -235,6 +262,10 @@ func (m *Manager) syncFromSettlement() error { return nil } +func (m *Manager) GetProposerPubKey() tmcrypto.PubKey { + return m.State.Sequencers.GetProposerPubKey() +} + func (m *Manager) UpdateTargetHeight(h uint64) { for { currentHeight := m.TargetHeight.Load() diff --git a/block/manager_test.go b/block/manager_test.go index 58bf17f98..c0c44153c 100644 --- a/block/manager_test.go +++ b/block/manager_test.go @@ -21,6 +21,7 @@ import ( "github.com/dymensionxyz/dymint/types" abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/pubsub" "github.com/tendermint/tendermint/proxy" @@ -32,12 +33,18 @@ import ( "github.com/dymensionxyz/dymint/store" ) +// TODO: test loading sequencer while rotation in progress +// TODO: test sequencer after L2 handover but before last state update submitted +// TODO: test halt scenario func TestInitialState(t *testing.T) { var err error assert := assert.New(t) genesis := testutil.GenerateGenesis(123) - sampleState := testutil.GenerateState(1, 128) key, _, _ := crypto.GenerateEd25519Key(rand.Reader) + raw, _ := key.GetPublic().Raw() + pubkey := ed25519.PubKey(raw) + sampleState := testutil.GenerateStateWithSequencer(1, 128, pubkey) + conf := testutil.GetManagerConfig() logger := log.TestingLogger() pubsubServer := pubsub.NewServer() @@ -149,7 +156,7 @@ func TestProduceOnlyAfterSynced(t *testing.T) { go func() { errChan <- manager.Start(ctx) err := <-errChan - assert.NoError(t, err) + require.NoError(t, err) }() <-ctx.Done() assert.Equal(t, batch.EndHeight(), manager.LastSubmittedHeight.Load()) @@ -185,7 +192,7 @@ func TestProduceNewBlock(t *testing.T) { manager, err := testutil.GetManager(testutil.GetManagerConfig(), nil, nil, 1, 1, 0, proxyApp, nil) require.NoError(t, err) // Produce block - _, _, err = manager.ProduceAndGossipBlock(context.Background(), true) + _, _, err = manager.ProduceApplyGossipBlock(context.Background(), true) require.NoError(t, err) // Validate state is updated with the commit hash assert.Equal(t, uint64(1), manager.State.Height()) @@ -207,14 +214,16 @@ func TestProducePendingBlock(t *testing.T) { require.NoError(t, err) // Generate block and commit and save it to the store block := testutil.GetRandomBlock(1, 3) + copy(block.Header.SequencerHash[:], manager.State.Sequencers.ProposerHash()) + copy(block.Header.NextSequencersHash[:], manager.State.Sequencers.ProposerHash()) + _, err = manager.Store.SaveBlock(block, &block.LastCommit, nil) require.NoError(t, err) // Produce block - _, _, err = manager.ProduceAndGossipBlock(context.Background(), true) + _, _, err = manager.ProduceApplyGossipBlock(context.Background(), true) require.NoError(t, err) - // Validate state is updated with the block that was saved in the store - // TODO: fix this test + // Validate state is updated with the block that was saved in the store // hacky way to validate the block was indeed contain txs assert.NotEqual(t, manager.State.LastResultsHash, testutil.GetEmptyLastResultsHash()) } @@ -296,13 +305,13 @@ func TestProduceBlockFailAfterCommit(t *testing.T) { LastBlockHeight: tc.LastAppBlockHeight, LastBlockAppHash: tc.LastAppCommitHash[:], }) - mockStore.ShoudFailSaveState = tc.shoudFailOnSaveState - _, _, _ = manager.ProduceAndGossipBlock(context.Background(), true) + mockStore.ShouldFailUpdateStateWithBatch = tc.shoudFailOnSaveState + _, _, _ = manager.ProduceApplyGossipBlock(context.Background(), true) storeState, err := manager.Store.LoadState() assert.NoError(err) manager.State = storeState - assert.Equal(tc.expectedStoreHeight, storeState.Height(), tc.name) - assert.Equal(tc.expectedStateAppHash, storeState.AppHash, tc.name) + require.Equal(tc.expectedStoreHeight, storeState.Height(), tc.name) + require.Equal(tc.expectedStateAppHash, storeState.AppHash, tc.name) app.On("Commit", mock.Anything).Unset() app.On("Info", mock.Anything).Unset() @@ -351,7 +360,7 @@ func TestCreateNextDABatchWithBytesLimit(t *testing.T) { t.Run(tc.name, func(t *testing.T) { // Produce blocks for i := 0; i < tc.blocksToProduce; i++ { - _, _, err := manager.ProduceAndGossipBlock(ctx, true) + _, _, err := manager.ProduceApplyGossipBlock(ctx, true) assert.NoError(err) } diff --git a/block/p2p.go b/block/p2p.go index 6b42adfd4..94816337c 100644 --- a/block/p2p.go +++ b/block/p2p.go @@ -69,7 +69,7 @@ func (m *Manager) gossipBlock(ctx context.Context, block types.Block, commit typ if err != nil { return fmt.Errorf("marshal binary: %w: %w", err, ErrNonRecoverable) } - if err := m.p2pClient.GossipBlock(ctx, gossipedBlockBytes); err != nil { + if err := m.P2PClient.GossipBlock(ctx, gossipedBlockBytes); err != nil { // Although this boils down to publishing on a topic, we don't want to speculate too much on what // could cause that to fail, so we assume recoverable. return fmt.Errorf("p2p gossip block: %w: %w", err, ErrRecoverable) diff --git a/block/produce.go b/block/produce.go index 4690f8d47..bd9a3ec41 100644 --- a/block/produce.go +++ b/block/produce.go @@ -41,10 +41,10 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) return nil case <-ticker.C: // if empty blocks are configured to be enabled, and one is scheduled... - produceEmptyBlock := firstBlock || 0 == m.Conf.MaxIdleTime || nextEmptyBlock.Before(time.Now()) + produceEmptyBlock := firstBlock || m.Conf.MaxIdleTime == 0 || nextEmptyBlock.Before(time.Now()) firstBlock = false - block, commit, err := m.ProduceAndGossipBlock(ctx, produceEmptyBlock) + block, commit, err := m.ProduceApplyGossipBlock(ctx, produceEmptyBlock) if errors.Is(err, context.Canceled) { m.logger.Error("Produce and gossip: context canceled.", "error", err) return nil @@ -95,12 +95,26 @@ func (m *Manager) ProduceBlockLoop(ctx context.Context, bytesProducedC chan int) } } -func (m *Manager) ProduceAndGossipBlock(ctx context.Context, allowEmpty bool) (*types.Block, *types.Commit, error) { - block, commit, err := m.produceBlock(allowEmpty) +// 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) + return err +} + +func (m *Manager) ProduceApplyGossipBlock(ctx context.Context, allowEmpty bool) (block *types.Block, commit *types.Commit, err error) { + 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) if err != nil { return nil, nil, fmt.Errorf("produce block: %w", err) } + if err := m.applyBlock(block, commit, types.BlockMetaData{Source: types.Produced}); err != nil { + return nil, nil, fmt.Errorf("apply block: %w: %w", err, ErrNonRecoverable) + } + if err := m.gossipBlock(ctx, *block, *commit); err != nil { return nil, nil, fmt.Errorf("gossip block: %w", err) } @@ -108,27 +122,11 @@ func (m *Manager) ProduceAndGossipBlock(ctx context.Context, allowEmpty bool) (* return block, commit, nil } -func loadPrevBlock(store store.Store, height uint64) ([32]byte, *types.Commit, error) { - lastCommit, err := store.LoadCommit(height) - if err != nil { - return [32]byte{}, nil, fmt.Errorf("load commit: height: %d: %w", height, err) - } - lastBlock, err := store.LoadBlock(height) - if err != nil { - return [32]byte{}, nil, fmt.Errorf("load block after load commit: height: %d: %w", height, err) - } - return lastBlock.Header.Hash(), lastCommit, nil -} - -func (m *Manager) produceBlock(allowEmpty bool) (*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 := loadPrevBlock(m.Store, newHeight-1) + lastHeaderHash, lastCommit, err := m.GetPreviousBlockHashes(newHeight) if err != nil { - if !m.State.IsGenesis() { // allow prevBlock not to be found only on genesis - return nil, nil, fmt.Errorf("load prev block: %w: %w", err, ErrNonRecoverable) - } - lastHeaderHash = [32]byte{} - lastCommit = &types.Commit{} + return nil, nil, fmt.Errorf("load prev block: %w", err) } var block *types.Block @@ -144,55 +142,65 @@ func (m *Manager) produceBlock(allowEmpty bool) (*types.Block, *types.Commit, er return nil, nil, fmt.Errorf("load commit after load block: height: %d: %w: %w", newHeight, err, ErrNonRecoverable) } m.logger.Info("Using pending block.", "height", newHeight) + return block, commit, nil } else if !errors.Is(err, gerrc.ErrNotFound) { return nil, nil, fmt.Errorf("load block: height: %d: %w: %w", newHeight, err, ErrNonRecoverable) - } else { - // limit to the max block data, so we don't create a block that is too big to fit in a batch - maxBlockDataSize := uint64(float64(m.Conf.BatchMaxSizeBytes) * types.MaxBlockSizeAdjustment) - block = m.Executor.CreateBlock(newHeight, lastCommit, lastHeaderHash, m.State, maxBlockDataSize) - if !allowEmpty && len(block.Data.Txs) == 0 { - return nil, nil, fmt.Errorf("%w: %w", types.ErrEmptyBlock, ErrRecoverable) - } + } - abciHeaderPb := types.ToABCIHeaderPB(&block.Header) - abciHeaderBytes, err := abciHeaderPb.Marshal() - if err != nil { - return nil, nil, fmt.Errorf("marshal abci header: %w: %w", err, ErrNonRecoverable) - } - proposerAddress := block.Header.ProposerAddress - sign, err := m.LocalKey.Sign(abciHeaderBytes) - if err != nil { - return nil, nil, fmt.Errorf("sign abci header: %w: %w", err, ErrNonRecoverable) - } - voteTimestamp := tmtime.Now() - tmSignature, err := m.createTMSignature(block, proposerAddress, voteTimestamp) - if err != nil { - return nil, nil, fmt.Errorf("create tm signature: %w: %w", err, ErrNonRecoverable) - } - commit = &types.Commit{ - Height: block.Header.Height, - HeaderHash: block.Header.Hash(), - Signatures: []types.Signature{sign}, - TMSignature: tmtypes.CommitSig{ - BlockIDFlag: 2, - ValidatorAddress: proposerAddress, - Timestamp: voteTimestamp, - Signature: tmSignature, - }, - } + maxBlockDataSize := uint64(float64(m.Conf.BatchMaxSizeBytes) * types.MaxBlockSizeAdjustment) + proposerHashForBlock := [32]byte(m.State.Sequencers.ProposerHash()) + // if nextProposerHash is set, we create a last block + if nextProposerHash != nil { + maxBlockDataSize = 0 + proposerHashForBlock = *nextProposerHash + } + 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) } - if err := m.applyBlock(block, commit, types.BlockMetaData{Source: types.Produced}); err != nil { - return nil, nil, fmt.Errorf("apply block: %w: %w", err, ErrNonRecoverable) + commit, err = m.createCommit(block) + if err != nil { + return nil, nil, fmt.Errorf("create commit: %w: %w", err, ErrNonRecoverable) } m.logger.Info("Block created.", "height", newHeight, "num_tx", len(block.Data.Txs)) types.RollappBlockSizeBytesGauge.Set(float64(len(block.Data.Txs))) types.RollappBlockSizeTxsGauge.Set(float64(len(block.Data.Txs))) - types.RollappHeightGauge.Set(float64(newHeight)) return block, commit, nil } +// create commit for block +func (m *Manager) createCommit(block *types.Block) (*types.Commit, error) { + abciHeaderPb := types.ToABCIHeaderPB(&block.Header) + abciHeaderBytes, err := abciHeaderPb.Marshal() + if err != nil { + return nil, fmt.Errorf("marshal abci header: %w", err) + } + proposerAddress := block.Header.ProposerAddress + sign, err := m.LocalKey.Sign(abciHeaderBytes) + if err != nil { + return nil, fmt.Errorf("sign abci header: %w", err) + } + voteTimestamp := tmtime.Now() + tmSignature, err := m.createTMSignature(block, proposerAddress, voteTimestamp) + if err != nil { + return nil, fmt.Errorf("create tm signature: %w", err) + } + commit := &types.Commit{ + Height: block.Header.Height, + HeaderHash: block.Header.Hash(), + Signatures: []types.Signature{sign}, + TMSignature: tmtypes.CommitSig{ + BlockIDFlag: 2, + ValidatorAddress: proposerAddress, + Timestamp: voteTimestamp, + Signature: tmSignature, + }, + } + return commit, nil +} + func (m *Manager) createTMSignature(block *types.Block, proposerAddress []byte, voteTimestamp time.Time) ([]byte, error) { headerHash := block.Header.Hash() vote := tmtypes.Vote{ @@ -228,3 +236,29 @@ func (m *Manager) createTMSignature(block *types.Block, proposerAddress []byte, } return vote.Signature, nil } + +// GetPreviousBlockHashes returns the hash of the last block and the commit for the last block +// to be used as the previous block hash and commit for the next block +func (m *Manager) GetPreviousBlockHashes(forHeight uint64) (lastHeaderHash [32]byte, lastCommit *types.Commit, err error) { + lastHeaderHash, lastCommit, err = loadPrevBlock(m.Store, forHeight-1) // prev height = forHeight - 1 + if err != nil { + if !m.State.IsGenesis() { // allow prevBlock not to be found only on genesis + return [32]byte{}, nil, fmt.Errorf("load prev block: %w: %w", err, ErrNonRecoverable) + } + lastHeaderHash = [32]byte{} + lastCommit = &types.Commit{} + } + return lastHeaderHash, lastCommit, nil +} + +func loadPrevBlock(store store.Store, height uint64) ([32]byte, *types.Commit, error) { + lastCommit, err := store.LoadCommit(height) + if err != nil { + return [32]byte{}, nil, fmt.Errorf("load commit: height: %d: %w", height, err) + } + lastBlock, err := store.LoadBlock(height) + if err != nil { + return [32]byte{}, nil, fmt.Errorf("load block after load commit: height: %d: %w", height, err) + } + return lastBlock.Header.Hash(), lastCommit, nil +} diff --git a/block/production_test.go b/block/production_test.go index a1589f409..d5dba3086 100644 --- a/block/production_test.go +++ b/block/production_test.go @@ -23,6 +23,8 @@ import ( "github.com/tendermint/tendermint/proxy" ) +// TODO: test producing lastBlock +// TODO: test using already produced lastBlock func TestCreateEmptyBlocksEnableDisable(t *testing.T) { const blockTime = 200 * time.Millisecond const MaxIdleTime = blockTime * 10 @@ -101,7 +103,7 @@ func TestCreateEmptyBlocksEnableDisable(t *testing.T) { func TestCreateEmptyBlocksNew(t *testing.T) { // TODO(https://github.com/dymensionxyz/dymint/issues/352) - t.Skip("FIXME: fails to submit tx to test the empty blocks feature") + t.Skip("TODO: fails to submit tx to test the empty blocks feature") assert := assert.New(t) require := require.New(t) app := testutil.GetAppMock() diff --git a/block/pruning.go b/block/pruning.go index 5de96960d..daa3b3dcf 100644 --- a/block/pruning.go +++ b/block/pruning.go @@ -8,14 +8,14 @@ import ( ) func (m *Manager) PruneBlocks(retainHeight uint64) error { - if m.IsSequencer() && m.NextHeightToSubmit() < retainHeight { // do not delete anything that we might submit in future + if m.IsProposer() && m.NextHeightToSubmit() < retainHeight { // do not delete anything that we might submit in future return fmt.Errorf("cannot prune blocks before they have been submitted: retain height %d: next height to submit: %d: %w", retainHeight, m.NextHeightToSubmit(), gerrc.ErrInvalidArgument) } - err := m.p2pClient.RemoveBlocks(context.TODO(), m.State.BaseHeight, retainHeight) + err := m.P2PClient.RemoveBlocks(context.Background(), m.State.BaseHeight, retainHeight) if err != nil { m.logger.Error("pruning blocksync store", "retain_height", retainHeight, "err", err) } diff --git a/block/pruning_test.go b/block/pruning_test.go index 50346eb88..25de1f168 100644 --- a/block/pruning_test.go +++ b/block/pruning_test.go @@ -31,18 +31,18 @@ func TestPruningRetainHeight(t *testing.T) { // Produce blocks for i := 0; i < batchSize; i++ { - _, _, err = manager.ProduceAndGossipBlock(ctx, true) + _, _, err = manager.ProduceApplyGossipBlock(ctx, true) require.NoError(err) } // submit and validate sync target - manager.CreateAndSubmitBatch(100000000) + manager.CreateAndSubmitBatch(100000000, false) lastSubmitted := manager.LastSubmittedHeight.Load() assert.EqualValues(t, manager.State.Height(), lastSubmitted) assert.Equal(t, lastSubmitted, uint64(batchSize)) // Produce new blocks for i := 0; i < batchSize; i++ { - _, _, err = manager.ProduceAndGossipBlock(ctx, true) + _, _, err = manager.ProduceApplyGossipBlock(ctx, true) require.NoError(err) } diff --git a/block/retriever.go b/block/retriever.go index e07bcfa61..158dcee43 100644 --- a/block/retriever.go +++ b/block/retriever.go @@ -48,6 +48,11 @@ func (m *Manager) syncToTargetHeight(targetHeight uint64) error { if err != nil { return fmt.Errorf("process next DA batch: %w", err) } + + // if height havent been updated, we are stuck + if m.State.NextHeight() == currH { + return fmt.Errorf("stuck at height %d", currH) + } m.logger.Info("Synced from DA", "store height", m.State.Height(), "target height", targetHeight) } @@ -73,9 +78,15 @@ func (m *Manager) syncFromDABatch() error { if err != nil { return fmt.Errorf("retrieve batch: %w", err) } - m.logger.Info("Retrieved batch.", "state_index", stateIndex) + // update the proposer when syncing from the settlement layer + proposer := m.State.Sequencers.GetByAddress(settlementBatch.Batch.Sequencer) + if proposer == nil { + return fmt.Errorf("proposer not found: batch: %d: %s", stateIndex, settlementBatch.Batch.Sequencer) + } + m.State.Sequencers.SetProposer(proposer) + err = m.ProcessNextDABatch(settlementBatch.MetaData.DA) if err != nil { return fmt.Errorf("process next DA batch: %w", err) @@ -92,7 +103,7 @@ func (m *Manager) applyLocalBlock(height uint64) error { if err != nil { return fmt.Errorf("load commit: %w", gerrc.ErrNotFound) } - if err := m.validateBlock(block, commit); err != nil { + if err := m.validateBlockBeforeApply(block, commit); err != nil { return fmt.Errorf("validate block from local store: height: %d: %w", height, err) } @@ -124,7 +135,7 @@ func (m *Manager) ProcessNextDABatch(daMetaData *da.DASubmitMetaData) error { if block.Header.Height != m.State.NextHeight() { continue } - if err := m.validateBlock(block, batch.Commits[i]); err != nil { + if err := m.validateBlockBeforeApply(block, batch.Commits[i]); err != nil { m.logger.Error("validate block from DA", "height", block.Header.Height, "err", err) continue } diff --git a/block/sequencers.go b/block/sequencers.go new file mode 100644 index 000000000..c37c8bc18 --- /dev/null +++ b/block/sequencers.go @@ -0,0 +1,181 @@ +package block + +import ( + "bytes" + "context" + "fmt" + "time" + + "github.com/dymensionxyz/dymint/settlement" + "github.com/dymensionxyz/dymint/types" +) + +func (m *Manager) MonitorSequencerRotation(ctx context.Context, rotateC chan string) error { + sequencerRotationEventClient := "sequencer_rotation" + subscription, err := m.Pubsub.Subscribe(ctx, sequencerRotationEventClient, settlement.EventQueryRotationStarted) + if err != nil { + panic("Error subscribing to events") + } + defer m.Pubsub.UnsubscribeAll(ctx, sequencerRotationEventClient) //nolint:errcheck + + ticker := time.NewTicker(3 * time.Minute) // TODO: make this configurable + defer ticker.Stop() + + var nextSeqAddr string + for { + select { + case <-ctx.Done(): + return nil + case <-ticker.C: + next, err := m.SLClient.CheckRotationInProgress() + if err != nil { + m.logger.Error("Check rotation in progress", "err", err) + continue + } + if next == nil { + continue + } + nextSeqAddr = next.SettlementAddress + case event := <-subscription.Out(): + eventData, _ := event.Data().(*settlement.EventDataRotationStarted) + nextSeqAddr = eventData.NextSeqAddr + } + break // break out of the loop after getting the next sequencer address + } + // we get here once a sequencer rotation signal is received + m.logger.Info("Sequencer rotation started.", "next_seq", nextSeqAddr) + go func() { + rotateC <- nextSeqAddr + }() + return fmt.Errorf("sequencer rotation started. signal to stop production") +} + +// 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. +func (m *Manager) IsProposer() bool { + localProposerKey, _ := m.LocalKey.GetPublic().Raw() + l2Proposer := m.GetProposerPubKey().Bytes() + + var expectedHubProposer []byte + hubProposer := m.SLClient.GetProposer() + if hubProposer != nil { + expectedHubProposer = hubProposer.PubKey().Bytes() + } + + // check if recovering from halt + if l2Proposer == nil && hubProposer != nil { + m.State.Sequencers.SetProposer(hubProposer) + } + + // we run sequencer flow if we're proposer on L2 or hub (can be different during rotation phase, before hub receives the last state update) + return bytes.Equal(l2Proposer, localProposerKey) || bytes.Equal(expectedHubProposer, localProposerKey) +} + +// MissingLastBatch checks if the sequencer is in the middle of rotation (I'm the proposer, but needs to complete rotation) +// returns the next sequencer address and a flag if the sequencer is the old proposer and the hub waits for the last batch +func (m *Manager) MissingLastBatch() (string, bool, error) { + localProposerKey, _ := m.LocalKey.GetPublic().Raw() + next, err := m.SLClient.CheckRotationInProgress() + if err != nil { + return "", false, err + } + if next == nil { + return "", false, nil + } + // rotation in progress, + // check if we're the old proposer and needs to complete rotation + curr := m.SLClient.GetProposer() + isProposer := bytes.Equal(curr.PubKey().Bytes(), localProposerKey) + return next.SettlementAddress, isProposer, nil +} + +// handleRotationReq completes the rotation flow once a signal is received from the SL +// this called after manager shuts down the block producer and submitter +func (m *Manager) handleRotationReq(ctx context.Context, nextSeqAddr string) { + m.logger.Info("Sequencer rotation started. Production stopped on this sequencer", "nextSeqAddr", nextSeqAddr) + err := m.CompleteRotation(ctx, nextSeqAddr) + if err != nil { + panic(err) + } + + // TODO: graceful fallback to full node (https://github.com/dymensionxyz/dymint/issues/1008) + m.logger.Info("Sequencer is no longer the proposer") + panic("sequencer is no longer the proposer") +} + +// CompleteRotation completes the sequencer rotation flow +// the sequencer will create his last block, with the next sequencer's hash, to handover the proposer role +// then it will submit all the data accumulated thus far and mark the last state update +// if nextSeqAddr is empty, the nodes will halt after applying the block produced +func (m *Manager) CompleteRotation(ctx context.Context, nextSeqAddr string) error { + // validate nextSeq is in the bonded set + var nextSeqHash [32]byte + if nextSeqAddr != "" { + seq := m.State.Sequencers.GetByAddress(nextSeqAddr) + if seq == nil { + return types.ErrMissingProposerPubKey + } + copy(nextSeqHash[:], seq.Hash()) + } + + err := m.CreateAndPostLastBatch(ctx, nextSeqHash) + if err != nil { + return fmt.Errorf("create and post last batch: %w", err) + } + + m.logger.Info("Sequencer rotation completed. sequencer is no longer the proposer", "nextSeqAddr", nextSeqAddr) + return nil +} + +// 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 { + h := m.State.Height() + block, err := m.Store.LoadBlock(h) + if err != nil { + return fmt.Errorf("load block: height: %d: %w", h, err) + } + + // check if the last block already produced with nextProposerHash set + if bytes.Equal(block.Header.NextSequencersHash[:], nextSeqHash[:]) { + m.logger.Debug("Last block already produced and applied.") + } else { + err := m.ProduceApplyGossipLastBlock(ctx, nextSeqHash) + if err != nil { + return fmt.Errorf("produce apply gossip last block: %w", err) + } + } + + // Submit all data accumulated thus far and the last state update + for { + b, err := m.CreateAndSubmitBatch(m.Conf.BatchMaxSizeBytes, true) + if err != nil { + return fmt.Errorf("CreateAndSubmitBatch last batch: %w", err) + } + + if b.LastBatch { + break + } + } + + return nil +} + +// UpdateSequencerSetFromSL updates the sequencer set from the SL +// proposer is not changed here +func (m *Manager) UpdateSequencerSetFromSL() error { + seqs, err := m.SLClient.GetAllSequencers() + if err != nil { + return err + } + m.State.Sequencers.SetSequencers(seqs) + m.logger.Debug("Updated bonded sequencer set.", "newSet", m.State.Sequencers.String()) + return nil +} + +// UpdateProposer updates the proposer from the hub +func (m *Manager) UpdateProposer() error { + m.State.Sequencers.SetProposer(m.SLClient.GetProposer()) + return nil +} diff --git a/block/state.go b/block/state.go index ef8e2a8c9..cb6f4cc1e 100644 --- a/block/state.go +++ b/block/state.go @@ -1,6 +1,7 @@ package block import ( + "bytes" "errors" "fmt" @@ -55,13 +56,11 @@ func NewStateFromGenesis(genDoc *tmtypes.GenesisDoc) (*types.State, error) { } s := types.State{ - Version: InitStateVersion, - ChainID: genDoc.ChainID, - InitialHeight: uint64(genDoc.InitialHeight), - - BaseHeight: uint64(genDoc.InitialHeight), + Version: InitStateVersion, + ChainID: genDoc.ChainID, - LastHeightValidatorsChanged: genDoc.InitialHeight, + InitialHeight: uint64(genDoc.InitialHeight), + BaseHeight: uint64(genDoc.InitialHeight), ConsensusParams: *genDoc.ConsensusParams, LastHeightConsensusParamsChanged: genDoc.InitialHeight, @@ -84,21 +83,13 @@ func (m *Manager) UpdateStateFromApp() error { if err != nil { return errorsmod.Wrap(err, "load block responses") } - vals, err := m.Store.LoadValidators(appHeight) - if err != nil { - return errorsmod.Wrap(err, "load validators") - } - // update the state with the hash, last store height and last validators. - m.Executor.UpdateStateAfterCommit(m.State, resp, proxyAppInfo.LastBlockAppHash, appHeight, vals) - _, err = m.Store.SaveState(m.State, nil) - if err != nil { - return errorsmod.Wrap(err, "update state") - } + // update the state with the app hashes created on the app commit + m.Executor.UpdateStateAfterCommit(m.State, resp, proxyAppInfo.LastBlockAppHash, appHeight) return nil } -func (e *Executor) UpdateStateAfterInitChain(s *types.State, res *abci.ResponseInitChain, validators []*tmtypes.Validator) { +func (e *Executor) UpdateStateAfterInitChain(s *types.State, res *abci.ResponseInitChain) { // If the app did not return an app hash, we keep the one set from the genesis doc in // the state. We don't set appHash since we don't want the genesis doc app hash // recorded in the genesis block. We should probably just remove GenesisDoc.AppHash. @@ -106,11 +97,6 @@ func (e *Executor) UpdateStateAfterInitChain(s *types.State, res *abci.ResponseI copy(s.AppHash[:], res.AppHash) } - // The validators after initChain must be greater than zero, otherwise this state is not loadable - if len(validators) <= 0 { - panic("Validators must be greater than zero") - } - if res.ConsensusParams != nil { params := res.ConsensusParams if params.Block != nil { @@ -134,10 +120,6 @@ func (e *Executor) UpdateStateAfterInitChain(s *types.State, res *abci.ResponseI } // We update the last results hash with the empty hash, to conform with RFC-6962. copy(s.LastResultsHash[:], merkle.HashFromByteSlices(nil)) - - // Set the validators in the state - s.Validators = tmtypes.NewValidatorSet(validators).CopyIncrementProposerPriority(1) - s.NextValidators = s.Validators.Copy() } func (e *Executor) UpdateMempoolAfterInitChain(s *types.State) { @@ -145,15 +127,46 @@ func (e *Executor) UpdateMempoolAfterInitChain(s *types.State) { e.mempool.SetPostCheckFn(mempool.PostCheckMaxGas(s.ConsensusParams.Block.MaxGas)) } -// UpdateStateAfterCommit using commit response -func (e *Executor) UpdateStateAfterCommit(s *types.State, resp *tmstate.ABCIResponses, appHash []byte, height uint64, valSet *tmtypes.ValidatorSet) { +// UpdateStateAfterCommit updates the state with the app hash and last results hash +func (e *Executor) UpdateStateAfterCommit(s *types.State, resp *tmstate.ABCIResponses, appHash []byte, height uint64) { copy(s.AppHash[:], appHash[:]) copy(s.LastResultsHash[:], tmtypes.NewResults(resp.DeliverTxs).Hash()) // TODO: load consensus params from endblock? - s.Validators = s.NextValidators.Copy() - s.NextValidators = valSet.Copy() - s.SetHeight(height) } + +// UpdateProposerFromBlock updates the proposer from the block +// The next proposer is defined in the block header (NextSequencersHash) +// In case of a node that a becomes the proposer, we return true to mark the role change +// currently the node will rebooted to apply the new role +// TODO: (https://github.com/dymensionxyz/dymint/issues/1008) +func (e *Executor) UpdateProposerFromBlock(s *types.State, block *types.Block) bool { + // no sequencer change + if bytes.Equal(block.Header.SequencerHash[:], block.Header.NextSequencersHash[:]) { + return false + } + + if block.Header.NextSequencersHash == [32]byte{} { + // the chain will be halted until proposer is set + // TODO: recover from halt (https://github.com/dymensionxyz/dymint/issues/1021) + e.logger.Info("rollapp left with no proposer. chain is halted") + s.Sequencers.SetProposer(nil) + return false + } + + // if hash changed, update the active sequencer + err := s.Sequencers.SetProposerByHash(block.Header.NextSequencersHash[:]) + if err != nil { + e.logger.Error("update new proposer", "err", err) + panic(fmt.Sprintf("failed to update new proposer: %v", err)) + } + + localSeq := s.Sequencers.GetByConsAddress(e.localAddress) + if localSeq != nil && bytes.Equal(localSeq.Hash(), block.Header.NextSequencersHash[:]) { + return true + } + + return false +} diff --git a/block/submit.go b/block/submit.go index 890befe27..0409c601f 100644 --- a/block/submit.go +++ b/block/submit.go @@ -125,7 +125,7 @@ func SubmitLoopInner( // Returns size of block and commit bytes // max size bytes is the maximum size of the serialized batch type func (m *Manager) CreateAndSubmitBatchGetSizeBlocksCommits(maxSize uint64) (uint64, error) { - b, err := m.CreateAndSubmitBatch(maxSize) + b, err := m.CreateAndSubmitBatch(maxSize, false) if b == nil { return 0, err } @@ -134,7 +134,7 @@ func (m *Manager) CreateAndSubmitBatchGetSizeBlocksCommits(maxSize uint64) (uint // CreateAndSubmitBatch creates and submits a batch to the DA and SL. // max size bytes is the maximum size of the serialized batch type -func (m *Manager) CreateAndSubmitBatch(maxSizeBytes uint64) (*types.Batch, error) { +func (m *Manager) CreateAndSubmitBatch(maxSizeBytes uint64, lastBatch bool) (*types.Batch, error) { startHeight := m.NextHeightToSubmit() endHeightInclusive := m.State.Height() @@ -152,8 +152,12 @@ func (m *Manager) CreateAndSubmitBatch(maxSizeBytes uint64) (*types.Batch, error if err != nil { return nil, fmt.Errorf("create batch: %w", err) } + // This is the last batch, so we need to mark it as such + if lastBatch && b.EndHeight() == endHeightInclusive { + b.LastBatch = true + } - m.logger.Info("Created batch.", "start height", startHeight, "end height", endHeightInclusive, "size", b.SizeBytes()) + m.logger.Info("Created batch.", "start height", startHeight, "end height", endHeightInclusive, "size", b.SizeBytes(), "last batch", b.LastBatch) types.LastBatchSubmittedBytes.Set(float64(b.SizeBytes())) if err := m.SubmitBatch(b); err != nil { diff --git a/block/submit_test.go b/block/submit_test.go index 37596fff8..ed912015c 100644 --- a/block/submit_test.go +++ b/block/submit_test.go @@ -9,12 +9,13 @@ import ( "testing" "time" + tmed25519 "github.com/tendermint/tendermint/crypto/ed25519" + "github.com/stretchr/testify/assert" "github.com/stretchr/testify/mock" "github.com/stretchr/testify/require" "github.com/tendermint/tendermint/proxy" - cosmosed25519 "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/libp2p/go-libp2p/core/crypto" "github.com/dymensionxyz/dymint/block" @@ -116,13 +117,13 @@ func TestBatchSubmissionHappyFlow(t *testing.T) { require.Zero(manager.LastSubmittedHeight.Load()) // Produce block and validate that we produced blocks - _, _, err = manager.ProduceAndGossipBlock(ctx, true) + _, _, err = manager.ProduceApplyGossipBlock(ctx, true) require.NoError(err) assert.Greater(t, manager.State.Height(), initialHeight) assert.Zero(t, manager.LastSubmittedHeight.Load()) // submit and validate sync target - manager.CreateAndSubmitBatch(manager.Conf.BatchMaxSizeBytes) + manager.CreateAndSubmitBatch(manager.Conf.BatchMaxSizeBytes, false) assert.EqualValues(t, manager.State.Height(), manager.LastSubmittedHeight.Load()) } @@ -143,10 +144,8 @@ func TestBatchSubmissionFailedSubmission(t *testing.T) { lib2pPrivKey, err := crypto.UnmarshalEd25519PrivateKey(priv) require.NoError(err) - cosmosPrivKey := cosmosed25519.PrivKey{Key: priv} - proposer := &types.Sequencer{ - PublicKey: cosmosPrivKey.PubKey(), - } + proposerKey := tmed25519.PrivKey(priv) + proposer := *types.NewSequencer(proposerKey.PubKey(), "") // Create a new mock ClientI slmock := &slmocks.MockClientI{} @@ -163,19 +162,19 @@ func TestBatchSubmissionFailedSubmission(t *testing.T) { require.Zero(manager.LastSubmittedHeight.Load()) // Produce block and validate that we produced blocks - _, _, err = manager.ProduceAndGossipBlock(ctx, true) + _, _, err = manager.ProduceApplyGossipBlock(ctx, true) require.NoError(err) assert.Greater(t, manager.State.Height(), initialHeight) assert.Zero(t, manager.LastSubmittedHeight.Load()) // try to submit, we expect failure slmock.On("SubmitBatch", mock.Anything, mock.Anything, mock.Anything).Return(fmt.Errorf("submit batch")).Once() - _, err = manager.CreateAndSubmitBatch(manager.Conf.BatchMaxSizeBytes) + _, err = manager.CreateAndSubmitBatch(manager.Conf.BatchMaxSizeBytes, false) assert.Error(t, err) // try to submit again, we expect success slmock.On("SubmitBatch", mock.Anything, mock.Anything, mock.Anything).Return(nil).Once() - manager.CreateAndSubmitBatch(manager.Conf.BatchMaxSizeBytes) + manager.CreateAndSubmitBatch(manager.Conf.BatchMaxSizeBytes, false) assert.EqualValues(t, manager.State.Height(), manager.LastSubmittedHeight.Load()) } diff --git a/conv/crypto.go b/conv/crypto.go index f42ab1b76..b2c49e18a 100644 --- a/conv/crypto.go +++ b/conv/crypto.go @@ -17,7 +17,7 @@ func GetNodeKey(nodeKey *p2p.NodeKey) (crypto.PrivKey, error) { case "ed25519": privKey, err := crypto.UnmarshalEd25519PrivateKey(nodeKey.PrivKey.Bytes()) if err != nil { - return nil, fmt.Errorf("node private key unmarshaling error: %w", err) + return nil, fmt.Errorf("node private key unmarshaling: %w", err) } return privKey, nil default: diff --git a/da/grpc/grpc.go b/da/grpc/grpc.go index 998e970ca..b633d7f69 100644 --- a/da/grpc/grpc.go +++ b/da/grpc/grpc.go @@ -46,11 +46,11 @@ var ( // Init sets the configuration options. func (d *DataAvailabilityLayerClient) Init(config []byte, _ *pubsub.Server, _ store.KV, logger types.Logger, options ...da.Option) error { d.logger = logger + d.synced = make(chan struct{}, 1) if len(config) == 0 { d.config = DefaultConfig return nil } - d.synced = make(chan struct{}, 1) return json.Unmarshal(config, &d.config) } diff --git a/go.mod b/go.mod index a8021c193..f0b3812de 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.12 github.com/cosmos/cosmos-sdk v0.46.16 github.com/dgraph-io/badger/v3 v3.2103.3 - github.com/dymensionxyz/cosmosclient v0.4.2-beta + github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240411195658-f7cd96f53b56 github.com/dymensionxyz/gerr-cosmos v1.0.0 github.com/go-kit/kit v0.12.0 @@ -21,7 +21,6 @@ require ( github.com/gorilla/mux v1.8.1 github.com/gorilla/rpc v1.2.0 github.com/gorilla/websocket v1.5.1 - github.com/hashicorp/go-multierror v1.1.1 github.com/ignite/cli v0.26.1 github.com/informalsystems/tm-load-test v1.3.0 github.com/ipfs/boxo v0.18.0 @@ -45,6 +44,7 @@ require ( require ( github.com/cskr/pubsub v1.0.2 // indirect + github.com/hashicorp/go-multierror v1.1.1 // indirect github.com/ipfs/go-block-format v0.2.0 // indirect ) @@ -69,7 +69,7 @@ require ( github.com/cometbft/cometbft v0.37.2 github.com/cometbft/cometbft-db v0.11.0 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.3 - github.com/cosmos/gogoproto v1.4.11 // indirect + github.com/cosmos/gogoproto v1.5.0 // indirect github.com/creachadair/taskgroup v0.3.2 // indirect github.com/deckarep/golang-set v1.8.0 // indirect github.com/decred/base58 v1.0.4 // indirect @@ -112,7 +112,7 @@ require ( go.uber.org/fx v1.20.1 // indirect golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 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 @@ -150,13 +150,13 @@ require ( 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/protobuf v1.5.4 // indirect + 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 github.com/google/flatbuffers v2.0.8+incompatible // indirect github.com/google/gopacket v1.1.19 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect - github.com/grpc-ecosystem/grpc-gateway v1.16.0 // indirect + github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/gtank/merlin v0.1.1 // indirect github.com/gtank/ristretto255 v0.1.2 // indirect @@ -241,9 +241,9 @@ require ( golang.org/x/sys v0.19.0 // indirect golang.org/x/term v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac // indirect + google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 // indirect gopkg.in/ini.v1 v1.67.0 // indirect - gopkg.in/yaml.v2 v2.4.0 // indirect + gopkg.in/yaml.v2 v2.4.0 gopkg.in/yaml.v3 v3.0.1 // indirect lukechampine.com/blake3 v1.2.1 // indirect ) @@ -252,7 +252,6 @@ require ( cosmossdk.io/math v1.3.0 // indirect github.com/DataDog/zstd v1.5.2 // indirect github.com/Jorropo/jsync v1.0.1 // indirect - github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 // indirect github.com/blang/semver/v4 v4.0.0 // indirect github.com/btcsuite/btcd/btcutil v1.1.3 // indirect github.com/cenkalti/backoff v2.2.1+incompatible // indirect @@ -263,7 +262,6 @@ require ( 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/decred/dcrd/dcrec/edwards v1.0.0 // indirect github.com/evmos/evmos/v12 v12.1.6 // indirect github.com/getsentry/sentry-go v0.18.0 // indirect github.com/gopherjs/gopherjs v0.0.0-20190812055157-5d271430af9f // indirect @@ -296,7 +294,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/cometbft/cometbft v0.34.28 + github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20240807121422-5299b866061c ) 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 c4673db35..931a94a9c 100644 --- a/go.sum +++ b/go.sum @@ -19,8 +19,8 @@ cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHOb cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go v0.75.0/go.mod h1:VGuuCn7PG0dwsd5XPVm2Mm3wlh3EL55/79EKB6hlPTY= -cloud.google.com/go v0.111.0 h1:YHLKNupSD1KqjDbQ3+LVdQ81h/UJbJyZG203cEfnQgM= -cloud.google.com/go v0.111.0/go.mod h1:0mibmpKP1TyOOFYQY5izo0LnT+ecvOQ0Sg3OdmMiNRU= +cloud.google.com/go v0.112.0 h1:tpFCD7hpHFlQ8yPwT3x+QeXqc2T6+n6T+hmABHfDUSM= +cloud.google.com/go v0.112.0/go.mod h1:3jEEVwZ/MHU4djK5t5RHuKOA/GbLddgTdVubX1qnPD4= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= @@ -91,8 +91,6 @@ github.com/Workiva/go-datastructures v1.0.53/go.mod h1:1yZL+zfsztete+ePzZz/Zb1/t github.com/adlio/schema v1.3.3 h1:oBJn8I02PyTB466pZO1UZEn1TV5XLlifBSyMrmHl/1I= github.com/adlio/schema v1.3.3/go.mod h1:1EsRssiv9/Ce2CMzq5DoL7RiMshhuigQxrR4DMV9fHg= github.com/aead/siphash v1.0.1/go.mod h1:Nywa3cDsYNNK3gaciGTWPwHt0wlpNV15vwmswBAUSII= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412 h1:w1UutsfOrms1J05zt7ISrnJIXKzwaspym5BTKGx93EI= -github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/template v0.0.0-20190718012654-fb15b899a751/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= @@ -203,8 +201,6 @@ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAK github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/coinbase/rosetta-sdk-go v0.7.9 h1:lqllBjMnazTjIqYrOGv8h8jxjg9+hJazIGZr9ZvoCcA= github.com/coinbase/rosetta-sdk-go v0.7.9/go.mod h1:0/knutI7XGVqXmmH4OQD8OckFrbQ8yMsUZTG7FXCR2M= -github.com/cometbft/cometbft v0.34.28 h1:gwryf55P1SWMUP4nOXpRVI2D0yPoYEzN+IBqmRBOsDc= -github.com/cometbft/cometbft v0.34.28/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/cometbft/cometbft v0.37.2 h1:XB0yyHGT0lwmJlFmM4+rsRnczPlHoAKFX6K8Zgc2/Jc= github.com/cometbft/cometbft v0.37.2/go.mod h1:Y2MMMN//O5K4YKd8ze4r9jmk4Y7h0ajqILXbH5JQFVs= github.com/cometbft/cometbft-db v0.11.0 h1:M3Lscmpogx5NTbb1EGyGDaFRdsoLWrUWimFEyf7jej8= @@ -232,8 +228,8 @@ github.com/cosmos/cosmos-sdk v0.46.16/go.mod h1:05U50tAsOzQ8JOAePshJCbJQw5ib1YJR github.com/cosmos/go-bip39 v0.0.0-20180819234021-555e2067c45d/go.mod h1:tSxLoYXyBmiFeKpvmq4dzayMdCjCnu8uqmCysIGBT2Y= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= +github.com/cosmos/gogoproto v1.5.0 h1:SDVwzEqZDDBoslaeZg+dGE55hdzHfgUA40pEanMh52o= +github.com/cosmos/gogoproto v1.5.0/go.mod h1:iUM31aofn3ymidYG6bUR5ZFrk+Om8p5s754eMUcyp8I= github.com/cosmos/gorocksdb v1.2.0 h1:d0l3jJG8M4hBouIZq0mDUHZ+zjOx044J3nGRskwTb4Y= github.com/cosmos/gorocksdb v1.2.0/go.mod h1:aaKvKItm514hKfNJpUJXnnOWeBnk2GL4+Qw9NHizILw= github.com/cosmos/iavl v0.19.6 h1:XY78yEeNPrEYyNCKlqr9chrwoeSDJ0bV2VjocTk//OU= @@ -270,8 +266,6 @@ github.com/decred/base58 v1.0.4/go.mod h1:jJswKPEdvpFpvf7dsDvFZyLT22xZ9lWqEByX38 github.com/decred/dcrd/crypto/blake256 v1.0.0/go.mod h1:sQl2p6Y26YV+ZOcSTP6thNdn47hh8kt6rqSlvmrXFAc= github.com/decred/dcrd/crypto/blake256 v1.0.1 h1:7PltbUIQB7u/FfZ39+DGa/ShuMyJ5ilcvdfma9wOH6Y= github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo= -github.com/decred/dcrd/dcrec/edwards v1.0.0 h1:UDcPNzclKiJlWqV3x1Fl8xMCJrolo4PB4X9t8LwKDWU= -github.com/decred/dcrd/dcrec/edwards v1.0.0/go.mod h1:HblVh1OfMt7xSxUL1ufjToaEvpbjpWvvTAUx4yem8BI= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1/go.mod h1:hyedUtir6IdtD/7lIxGeCxkaw7y45JueMRL4DIyJDKs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs= github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= @@ -306,8 +300,10 @@ 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/cosmosclient v0.4.2-beta h1:sokBefcN1tIOlUKmB8Q2E9XMJ93LueqtFThiM/kA4DI= -github.com/dymensionxyz/cosmosclient v0.4.2-beta/go.mod h1:GQQu3ITEjWfi5ULR2B6X2i2YZNennY1yzcT5qdL4MGI= +github.com/dymensionxyz/cometbft v0.34.29-0.20240807121422-5299b866061c h1:urXou6bq/jDqW+g4ZaW63VHjD46OIJDuiRemrtJpnVs= +github.com/dymensionxyz/cometbft v0.34.29-0.20240807121422-5299b866061c/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= github.com/dymensionxyz/dymension/v3 v3.1.0-rc03.0.20240411195658-f7cd96f53b56/go.mod h1:3Pfrr8j/BR9ztNKztGfC5PqDiO6CcrzMLCJtFtPEVW4= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.3 h1:vmAdUGUc4rTIiO3Phezr7vGq+0uPDVKSA4WAe8+yl6w= @@ -1477,8 +1473,8 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac h1:ZL/Teoy/ZGnzyrqK/Optxxp2pmVh+fmJ97slxSRyzUg= -google.golang.org/genproto v0.0.0-20240116215550-a9fa1716bcac/go.mod h1:+Rvu7ElI+aLzyDQhpHMFMMltsD6m7nqpuWDd2CwJw3k= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80 h1:KAeGQVN3M9nD0/bQXnr/ClcEMJ968gUXJQ9pwfSynuQ= +google.golang.org/genproto v0.0.0-20240123012728-ef4313101c80/go.mod h1:cc8bqMqtv9gMOr0zHg2Vzff5ULhhL2IXP4sbcn32Dro= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237 h1:RFiFrvy37/mpSpdySBDrUdipW/dHwsRwh3J3+A9VgT4= google.golang.org/genproto/googleapis/api v0.0.0-20240318140521-94a12d6c2237/go.mod h1:Z5Iiy3jtmioajWHDGFk7CeugTyHtPvMHA4UTmUkyalE= google.golang.org/genproto/googleapis/rpc v0.0.0-20240318140521-94a12d6c2237 h1:NnYq6UN9ReLM9/Y01KWNOWyI5xQ9kbIms5GGJVwS/Yc= diff --git a/mocks/github.com/dymensionxyz/dymension/v3/x/rollapp/types/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymension/v3/x/rollapp/types/mock_QueryClient.go index 34778c1f1..c984e622c 100644 --- a/mocks/github.com/dymensionxyz/dymension/v3/x/rollapp/types/mock_QueryClient.go +++ b/mocks/github.com/dymensionxyz/dymension/v3/x/rollapp/types/mock_QueryClient.go @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - types "github.com/dymensionxyz/dymension/v3/x/rollapp/types" + types "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" ) // MockQueryClient is an autogenerated mock type for the QueryClient type @@ -25,6 +25,80 @@ func (_m *MockQueryClient) EXPECT() *MockQueryClient_Expecter { return &MockQueryClient_Expecter{mock: &_m.Mock} } +// LatestHeight provides a mock function with given fields: ctx, in, opts +func (_m *MockQueryClient) LatestHeight(ctx context.Context, in *types.QueryGetLatestHeightRequest, opts ...grpc.CallOption) (*types.QueryGetLatestHeightResponse, 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 LatestHeight") + } + + var r0 *types.QueryGetLatestHeightResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryGetLatestHeightRequest, ...grpc.CallOption) (*types.QueryGetLatestHeightResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryGetLatestHeightRequest, ...grpc.CallOption) *types.QueryGetLatestHeightResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryGetLatestHeightResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.QueryGetLatestHeightRequest, ...grpc.CallOption) error); ok { + r1 = rf(ctx, in, opts...) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockQueryClient_LatestHeight_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LatestHeight' +type MockQueryClient_LatestHeight_Call struct { + *mock.Call +} + +// LatestHeight is a helper method to define mock.On call +// - ctx context.Context +// - in *types.QueryGetLatestHeightRequest +// - opts ...grpc.CallOption +func (_e *MockQueryClient_Expecter) LatestHeight(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_LatestHeight_Call { + return &MockQueryClient_LatestHeight_Call{Call: _e.mock.On("LatestHeight", + append([]interface{}{ctx, in}, opts...)...)} +} + +func (_c *MockQueryClient_LatestHeight_Call) Run(run func(ctx context.Context, in *types.QueryGetLatestHeightRequest, opts ...grpc.CallOption)) *MockQueryClient_LatestHeight_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].(*types.QueryGetLatestHeightRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_LatestHeight_Call) Return(_a0 *types.QueryGetLatestHeightResponse, _a1 error) *MockQueryClient_LatestHeight_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_LatestHeight_Call) RunAndReturn(run func(context.Context, *types.QueryGetLatestHeightRequest, ...grpc.CallOption) (*types.QueryGetLatestHeightResponse, error)) *MockQueryClient_LatestHeight_Call { + _c.Call.Return(run) + return _c +} + // LatestStateIndex provides a mock function with given fields: ctx, in, opts func (_m *MockQueryClient) LatestStateIndex(ctx context.Context, in *types.QueryGetLatestStateIndexRequest, opts ...grpc.CallOption) (*types.QueryGetLatestStateIndexResponse, error) { _va := make([]interface{}, len(opts)) @@ -469,80 +543,6 @@ func (_c *MockQueryClient_StateInfo_Call) RunAndReturn(run func(context.Context, return _c } -// StateInfoAll provides a mock function with given fields: ctx, in, opts -func (_m *MockQueryClient) StateInfoAll(ctx context.Context, in *types.QueryAllStateInfoRequest, opts ...grpc.CallOption) (*types.QueryAllStateInfoResponse, 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 StateInfoAll") - } - - var r0 *types.QueryAllStateInfoResponse - var r1 error - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryAllStateInfoRequest, ...grpc.CallOption) (*types.QueryAllStateInfoResponse, error)); ok { - return rf(ctx, in, opts...) - } - if rf, ok := ret.Get(0).(func(context.Context, *types.QueryAllStateInfoRequest, ...grpc.CallOption) *types.QueryAllStateInfoResponse); ok { - r0 = rf(ctx, in, opts...) - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.QueryAllStateInfoResponse) - } - } - - if rf, ok := ret.Get(1).(func(context.Context, *types.QueryAllStateInfoRequest, ...grpc.CallOption) error); ok { - r1 = rf(ctx, in, opts...) - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockQueryClient_StateInfoAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'StateInfoAll' -type MockQueryClient_StateInfoAll_Call struct { - *mock.Call -} - -// StateInfoAll is a helper method to define mock.On call -// - ctx context.Context -// - in *types.QueryAllStateInfoRequest -// - opts ...grpc.CallOption -func (_e *MockQueryClient_Expecter) StateInfoAll(ctx interface{}, in interface{}, opts ...interface{}) *MockQueryClient_StateInfoAll_Call { - return &MockQueryClient_StateInfoAll_Call{Call: _e.mock.On("StateInfoAll", - append([]interface{}{ctx, in}, opts...)...)} -} - -func (_c *MockQueryClient_StateInfoAll_Call) Run(run func(ctx context.Context, in *types.QueryAllStateInfoRequest, opts ...grpc.CallOption)) *MockQueryClient_StateInfoAll_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].(*types.QueryAllStateInfoRequest), variadicArgs...) - }) - return _c -} - -func (_c *MockQueryClient_StateInfoAll_Call) Return(_a0 *types.QueryAllStateInfoResponse, _a1 error) *MockQueryClient_StateInfoAll_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockQueryClient_StateInfoAll_Call) RunAndReturn(run func(context.Context, *types.QueryAllStateInfoRequest, ...grpc.CallOption) (*types.QueryAllStateInfoResponse, error)) *MockQueryClient_StateInfoAll_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 { diff --git a/mocks/github.com/dymensionxyz/dymension/v3/x/sequencer/types/mock_QueryClient.go b/mocks/github.com/dymensionxyz/dymension/v3/x/sequencer/types/mock_QueryClient.go index c130f0bdd..5fb08fa98 100644 --- a/mocks/github.com/dymensionxyz/dymension/v3/x/sequencer/types/mock_QueryClient.go +++ b/mocks/github.com/dymensionxyz/dymension/v3/x/sequencer/types/mock_QueryClient.go @@ -9,7 +9,7 @@ import ( mock "github.com/stretchr/testify/mock" - types "github.com/dymensionxyz/dymension/v3/x/sequencer/types" + types "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" ) // MockQueryClient is an autogenerated mock type for the QueryClient type @@ -25,6 +25,154 @@ 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 *types.QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption) (*types.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 *types.QueryGetNextProposerByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) (*types.QueryGetNextProposerByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) *types.QueryGetNextProposerByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryGetNextProposerByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.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 *types.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 *types.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].(*types.QueryGetNextProposerByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) Return(_a0 *types.QueryGetNextProposerByRollappResponse, _a1 error) *MockQueryClient_GetNextProposerByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_GetNextProposerByRollapp_Call) RunAndReturn(run func(context.Context, *types.QueryGetNextProposerByRollappRequest, ...grpc.CallOption) (*types.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 *types.QueryGetProposerByRollappRequest, opts ...grpc.CallOption) (*types.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 *types.QueryGetProposerByRollappResponse + var r1 error + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryGetProposerByRollappRequest, ...grpc.CallOption) (*types.QueryGetProposerByRollappResponse, error)); ok { + return rf(ctx, in, opts...) + } + if rf, ok := ret.Get(0).(func(context.Context, *types.QueryGetProposerByRollappRequest, ...grpc.CallOption) *types.QueryGetProposerByRollappResponse); ok { + r0 = rf(ctx, in, opts...) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.QueryGetProposerByRollappResponse) + } + } + + if rf, ok := ret.Get(1).(func(context.Context, *types.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 *types.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 *types.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].(*types.QueryGetProposerByRollappRequest), variadicArgs...) + }) + return _c +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) Return(_a0 *types.QueryGetProposerByRollappResponse, _a1 error) *MockQueryClient_GetProposerByRollapp_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockQueryClient_GetProposerByRollapp_Call) RunAndReturn(run func(context.Context, *types.QueryGetProposerByRollappRequest, ...grpc.CallOption) (*types.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 *types.QueryParamsRequest, opts ...grpc.CallOption) (*types.QueryParamsResponse, error) { _va := make([]interface{}, len(opts)) diff --git a/mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go b/mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go new file mode 100644 index 000000000..22bf320ac --- /dev/null +++ b/mocks/github.com/dymensionxyz/dymint/p2p/mock_GetProposerI.go @@ -0,0 +1,82 @@ +// Code generated by mockery v2.43.0. DO NOT EDIT. + +package p2p + +import ( + mock "github.com/stretchr/testify/mock" + crypto "github.com/tendermint/tendermint/crypto" +) + +// MockGetProposerI is an autogenerated mock type for the GetProposerI type +type MockGetProposerI struct { + mock.Mock +} + +type MockGetProposerI_Expecter struct { + mock *mock.Mock +} + +func (_m *MockGetProposerI) EXPECT() *MockGetProposerI_Expecter { + return &MockGetProposerI_Expecter{mock: &_m.Mock} +} + +// GetProposerPubKey provides a mock function with given fields: +func (_m *MockGetProposerI) GetProposerPubKey() crypto.PubKey { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetProposerPubKey") + } + + var r0 crypto.PubKey + if rf, ok := ret.Get(0).(func() crypto.PubKey); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(crypto.PubKey) + } + } + + return r0 +} + +// MockGetProposerI_GetProposerPubKey_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetProposerPubKey' +type MockGetProposerI_GetProposerPubKey_Call struct { + *mock.Call +} + +// GetProposerPubKey is a helper method to define mock.On call +func (_e *MockGetProposerI_Expecter) GetProposerPubKey() *MockGetProposerI_GetProposerPubKey_Call { + return &MockGetProposerI_GetProposerPubKey_Call{Call: _e.mock.On("GetProposerPubKey")} +} + +func (_c *MockGetProposerI_GetProposerPubKey_Call) Run(run func()) *MockGetProposerI_GetProposerPubKey_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockGetProposerI_GetProposerPubKey_Call) Return(_a0 crypto.PubKey) *MockGetProposerI_GetProposerPubKey_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockGetProposerI_GetProposerPubKey_Call) RunAndReturn(run func() crypto.PubKey) *MockGetProposerI_GetProposerPubKey_Call { + _c.Call.Return(run) + return _c +} + +// NewMockGetProposerI creates a new instance of MockGetProposerI. 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 NewMockGetProposerI(t interface { + mock.TestingT + Cleanup(func()) +}) *MockGetProposerI { + mock := &MockGetProposerI{} + mock.Mock.Test(t) + + t.Cleanup(func() { mock.AssertExpectations(t) }) + + return mock +} 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 f31ee7fe3..6a8835f12 100644 --- a/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go +++ b/mocks/github.com/dymensionxyz/dymint/settlement/dymension/mock_CosmosClient.go @@ -15,9 +15,9 @@ import ( mock "github.com/stretchr/testify/mock" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" - sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types" + sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" types "github.com/cosmos/cosmos-sdk/types" ) @@ -513,6 +513,53 @@ func (_c *MockCosmosClient_SubscribeToEvents_Call) RunAndReturn(run func(context return _c } +// UnsubscribeAll provides a mock function with given fields: ctx, subscriber +func (_m *MockCosmosClient) UnsubscribeAll(ctx context.Context, subscriber string) error { + ret := _m.Called(ctx, subscriber) + + if len(ret) == 0 { + panic("no return value specified for UnsubscribeAll") + } + + var r0 error + if rf, ok := ret.Get(0).(func(context.Context, string) error); ok { + r0 = rf(ctx, subscriber) + } else { + r0 = ret.Error(0) + } + + return r0 +} + +// MockCosmosClient_UnsubscribeAll_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'UnsubscribeAll' +type MockCosmosClient_UnsubscribeAll_Call struct { + *mock.Call +} + +// UnsubscribeAll is a helper method to define mock.On call +// - ctx context.Context +// - subscriber string +func (_e *MockCosmosClient_Expecter) UnsubscribeAll(ctx interface{}, subscriber interface{}) *MockCosmosClient_UnsubscribeAll_Call { + return &MockCosmosClient_UnsubscribeAll_Call{Call: _e.mock.On("UnsubscribeAll", ctx, subscriber)} +} + +func (_c *MockCosmosClient_UnsubscribeAll_Call) Run(run func(ctx context.Context, subscriber string)) *MockCosmosClient_UnsubscribeAll_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(context.Context), args[1].(string)) + }) + return _c +} + +func (_c *MockCosmosClient_UnsubscribeAll_Call) Return(_a0 error) *MockCosmosClient_UnsubscribeAll_Call { + _c.Call.Return(_a0) + return _c +} + +func (_c *MockCosmosClient_UnsubscribeAll_Call) RunAndReturn(run func(context.Context, string) error) *MockCosmosClient_UnsubscribeAll_Call { + _c.Call.Return(run) + return _c +} + // NewMockCosmosClient creates a new instance of MockCosmosClient. 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 NewMockCosmosClient(t interface { diff --git a/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go b/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go index 7c980a17e..27f71c95e 100644 --- a/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go +++ b/mocks/github.com/dymensionxyz/dymint/settlement/mock_ClientI.go @@ -26,6 +26,120 @@ func (_m *MockClientI) EXPECT() *MockClientI_Expecter { return &MockClientI_Expecter{mock: &_m.Mock} } +// CheckRotationInProgress provides a mock function with given fields: +func (_m *MockClientI) CheckRotationInProgress() (*types.Sequencer, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for CheckRotationInProgress") + } + + var r0 *types.Sequencer + var r1 error + if rf, ok := ret.Get(0).(func() (*types.Sequencer, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() *types.Sequencer); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(*types.Sequencer) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClientI_CheckRotationInProgress_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'CheckRotationInProgress' +type MockClientI_CheckRotationInProgress_Call struct { + *mock.Call +} + +// CheckRotationInProgress is a helper method to define mock.On call +func (_e *MockClientI_Expecter) CheckRotationInProgress() *MockClientI_CheckRotationInProgress_Call { + return &MockClientI_CheckRotationInProgress_Call{Call: _e.mock.On("CheckRotationInProgress")} +} + +func (_c *MockClientI_CheckRotationInProgress_Call) Run(run func()) *MockClientI_CheckRotationInProgress_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClientI_CheckRotationInProgress_Call) Return(_a0 *types.Sequencer, _a1 error) *MockClientI_CheckRotationInProgress_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClientI_CheckRotationInProgress_Call) RunAndReturn(run func() (*types.Sequencer, error)) *MockClientI_CheckRotationInProgress_Call { + _c.Call.Return(run) + return _c +} + +// GetAllSequencers provides a mock function with given fields: +func (_m *MockClientI) GetAllSequencers() ([]types.Sequencer, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetAllSequencers") + } + + var r0 []types.Sequencer + var r1 error + if rf, ok := ret.Get(0).(func() ([]types.Sequencer, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []types.Sequencer); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]types.Sequencer) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClientI_GetAllSequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetAllSequencers' +type MockClientI_GetAllSequencers_Call struct { + *mock.Call +} + +// GetAllSequencers is a helper method to define mock.On call +func (_e *MockClientI_Expecter) GetAllSequencers() *MockClientI_GetAllSequencers_Call { + return &MockClientI_GetAllSequencers_Call{Call: _e.mock.On("GetAllSequencers")} +} + +func (_c *MockClientI_GetAllSequencers_Call) Run(run func()) *MockClientI_GetAllSequencers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClientI_GetAllSequencers_Call) Return(_a0 []types.Sequencer, _a1 error) *MockClientI_GetAllSequencers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClientI_GetAllSequencers_Call) RunAndReturn(run func() ([]types.Sequencer, error)) *MockClientI_GetAllSequencers_Call { + _c.Call.Return(run) + return _c +} + // GetBatchAtIndex provides a mock function with given fields: index func (_m *MockClientI) GetBatchAtIndex(index uint64) (*settlement.ResultRetrieveBatch, error) { ret := _m.Called(index) @@ -84,6 +198,63 @@ func (_c *MockClientI_GetBatchAtIndex_Call) RunAndReturn(run func(uint64) (*sett return _c } +// GetBondedSequencers provides a mock function with given fields: +func (_m *MockClientI) GetBondedSequencers() ([]types.Sequencer, error) { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for GetBondedSequencers") + } + + var r0 []types.Sequencer + var r1 error + if rf, ok := ret.Get(0).(func() ([]types.Sequencer, error)); ok { + return rf() + } + if rf, ok := ret.Get(0).(func() []types.Sequencer); ok { + r0 = rf() + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).([]types.Sequencer) + } + } + + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockClientI_GetBondedSequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetBondedSequencers' +type MockClientI_GetBondedSequencers_Call struct { + *mock.Call +} + +// GetBondedSequencers is a helper method to define mock.On call +func (_e *MockClientI_Expecter) GetBondedSequencers() *MockClientI_GetBondedSequencers_Call { + return &MockClientI_GetBondedSequencers_Call{Call: _e.mock.On("GetBondedSequencers")} +} + +func (_c *MockClientI_GetBondedSequencers_Call) Run(run func()) *MockClientI_GetBondedSequencers_Call { + _c.Call.Run(func(args mock.Arguments) { + run() + }) + return _c +} + +func (_c *MockClientI_GetBondedSequencers_Call) Return(_a0 []types.Sequencer, _a1 error) *MockClientI_GetBondedSequencers_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockClientI_GetBondedSequencers_Call) RunAndReturn(run func() ([]types.Sequencer, error)) *MockClientI_GetBondedSequencers_Call { + _c.Call.Return(run) + return _c +} + // GetHeightState provides a mock function with given fields: _a0 func (_m *MockClientI) GetHeightState(_a0 uint64) (*settlement.ResultGetHeightState, error) { ret := _m.Called(_a0) @@ -246,63 +417,6 @@ func (_c *MockClientI_GetProposer_Call) RunAndReturn(run func() *types.Sequencer return _c } -// GetSequencers provides a mock function with given fields: -func (_m *MockClientI) GetSequencers() ([]*types.Sequencer, error) { - ret := _m.Called() - - if len(ret) == 0 { - panic("no return value specified for GetSequencers") - } - - var r0 []*types.Sequencer - var r1 error - if rf, ok := ret.Get(0).(func() ([]*types.Sequencer, error)); ok { - return rf() - } - if rf, ok := ret.Get(0).(func() []*types.Sequencer); ok { - r0 = rf() - } else { - if ret.Get(0) != nil { - r0 = ret.Get(0).([]*types.Sequencer) - } - } - - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() - } else { - r1 = ret.Error(1) - } - - return r0, r1 -} - -// MockClientI_GetSequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'GetSequencers' -type MockClientI_GetSequencers_Call struct { - *mock.Call -} - -// GetSequencers is a helper method to define mock.On call -func (_e *MockClientI_Expecter) GetSequencers() *MockClientI_GetSequencers_Call { - return &MockClientI_GetSequencers_Call{Call: _e.mock.On("GetSequencers")} -} - -func (_c *MockClientI_GetSequencers_Call) Run(run func()) *MockClientI_GetSequencers_Call { - _c.Call.Run(func(args mock.Arguments) { - run() - }) - return _c -} - -func (_c *MockClientI_GetSequencers_Call) Return(_a0 []*types.Sequencer, _a1 error) *MockClientI_GetSequencers_Call { - _c.Call.Return(_a0, _a1) - return _c -} - -func (_c *MockClientI_GetSequencers_Call) RunAndReturn(run func() ([]*types.Sequencer, error)) *MockClientI_GetSequencers_Call { - _c.Call.Return(run) - return _c -} - // Init provides a mock function with given fields: config, _a1, logger, options func (_m *MockClientI) Init(config settlement.Config, _a1 *pubsub.Server, logger types.Logger, options ...settlement.Option) error { _va := make([]interface{}, len(options)) diff --git a/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go b/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go index 7235d0ec5..f1a71fb4c 100644 --- a/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go +++ b/mocks/github.com/dymensionxyz/dymint/store/mock_Store.go @@ -3,11 +3,12 @@ package store import ( - store "github.com/dymensionxyz/dymint/store" + cid "github.com/ipfs/go-cid" mock "github.com/stretchr/testify/mock" + state "github.com/tendermint/tendermint/proto/tendermint/state" - tenderminttypes "github.com/tendermint/tendermint/types" + store "github.com/dymensionxyz/dymint/store" types "github.com/dymensionxyz/dymint/types" ) @@ -26,8 +27,21 @@ func (_m *MockStore) EXPECT() *MockStore_Expecter { } // Close provides a mock function with given fields: -func (_m *MockStore) Close() { - _m.Called() +func (_m *MockStore) Close() error { + ret := _m.Called() + + if len(ret) == 0 { + panic("no return value specified for Close") + } + + var r0 error + if rf, ok := ret.Get(0).(func() error); ok { + r0 = rf() + } else { + r0 = ret.Error(0) + } + + return r0 } // MockStore_Close_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Close' @@ -47,12 +61,12 @@ func (_c *MockStore_Close_Call) Run(run func()) *MockStore_Close_Call { return _c } -func (_c *MockStore_Close_Call) Return() *MockStore_Close_Call { - _c.Call.Return() +func (_c *MockStore_Close_Call) Return(_a0 error) *MockStore_Close_Call { + _c.Call.Return(_a0) return _c } -func (_c *MockStore_Close_Call) RunAndReturn(run func()) *MockStore_Close_Call { +func (_c *MockStore_Close_Call) RunAndReturn(run func() error) *MockStore_Close_Call { _c.Call.Return(run) return _c } @@ -173,6 +187,62 @@ func (_c *MockStore_LoadBlockByHash_Call) RunAndReturn(run func([32]byte) (*type return _c } +// LoadBlockCid provides a mock function with given fields: height +func (_m *MockStore) LoadBlockCid(height uint64) (cid.Cid, error) { + ret := _m.Called(height) + + if len(ret) == 0 { + panic("no return value specified for LoadBlockCid") + } + + var r0 cid.Cid + var r1 error + if rf, ok := ret.Get(0).(func(uint64) (cid.Cid, error)); ok { + return rf(height) + } + if rf, ok := ret.Get(0).(func(uint64) cid.Cid); ok { + r0 = rf(height) + } else { + r0 = ret.Get(0).(cid.Cid) + } + + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(height) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockStore_LoadBlockCid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadBlockCid' +type MockStore_LoadBlockCid_Call struct { + *mock.Call +} + +// LoadBlockCid is a helper method to define mock.On call +// - height uint64 +func (_e *MockStore_Expecter) LoadBlockCid(height interface{}) *MockStore_LoadBlockCid_Call { + return &MockStore_LoadBlockCid_Call{Call: _e.mock.On("LoadBlockCid", height)} +} + +func (_c *MockStore_LoadBlockCid_Call) Run(run func(height uint64)) *MockStore_LoadBlockCid_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64)) + }) + return _c +} + +func (_c *MockStore_LoadBlockCid_Call) Return(_a0 cid.Cid, _a1 error) *MockStore_LoadBlockCid_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockStore_LoadBlockCid_Call) RunAndReturn(run func(uint64) (cid.Cid, error)) *MockStore_LoadBlockCid_Call { + _c.Call.Return(run) + return _c +} + // LoadBlockResponses provides a mock function with given fields: height func (_m *MockStore) LoadBlockResponses(height uint64) (*state.ABCIResponses, error) { ret := _m.Called(height) @@ -347,29 +417,29 @@ func (_c *MockStore_LoadCommitByHash_Call) RunAndReturn(run func([32]byte) (*typ return _c } -// LoadState provides a mock function with given fields: -func (_m *MockStore) LoadState() (*types.State, error) { - ret := _m.Called() +// LoadSequencers provides a mock function with given fields: height +func (_m *MockStore) LoadSequencers(height uint64) (*types.SequencerSet, error) { + ret := _m.Called(height) if len(ret) == 0 { - panic("no return value specified for LoadState") + panic("no return value specified for LoadSequencers") } - var r0 *types.State + var r0 *types.SequencerSet var r1 error - if rf, ok := ret.Get(0).(func() (*types.State, error)); ok { - return rf() + if rf, ok := ret.Get(0).(func(uint64) (*types.SequencerSet, error)); ok { + return rf(height) } - if rf, ok := ret.Get(0).(func() *types.State); ok { - r0 = rf() + if rf, ok := ret.Get(0).(func(uint64) *types.SequencerSet); ok { + r0 = rf(height) } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*types.State) + r0 = ret.Get(0).(*types.SequencerSet) } } - if rf, ok := ret.Get(1).(func() error); ok { - r1 = rf() + if rf, ok := ret.Get(1).(func(uint64) error); ok { + r1 = rf(height) } else { r1 = ret.Error(1) } @@ -377,56 +447,57 @@ func (_m *MockStore) LoadState() (*types.State, error) { return r0, r1 } -// MockStore_LoadState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadState' -type MockStore_LoadState_Call struct { +// MockStore_LoadSequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadSequencers' +type MockStore_LoadSequencers_Call struct { *mock.Call } -// LoadState is a helper method to define mock.On call -func (_e *MockStore_Expecter) LoadState() *MockStore_LoadState_Call { - return &MockStore_LoadState_Call{Call: _e.mock.On("LoadState")} +// LoadSequencers is a helper method to define mock.On call +// - height uint64 +func (_e *MockStore_Expecter) LoadSequencers(height interface{}) *MockStore_LoadSequencers_Call { + return &MockStore_LoadSequencers_Call{Call: _e.mock.On("LoadSequencers", height)} } -func (_c *MockStore_LoadState_Call) Run(run func()) *MockStore_LoadState_Call { +func (_c *MockStore_LoadSequencers_Call) Run(run func(height uint64)) *MockStore_LoadSequencers_Call { _c.Call.Run(func(args mock.Arguments) { - run() + run(args[0].(uint64)) }) return _c } -func (_c *MockStore_LoadState_Call) Return(_a0 *types.State, _a1 error) *MockStore_LoadState_Call { +func (_c *MockStore_LoadSequencers_Call) Return(_a0 *types.SequencerSet, _a1 error) *MockStore_LoadSequencers_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockStore_LoadState_Call) RunAndReturn(run func() (*types.State, error)) *MockStore_LoadState_Call { +func (_c *MockStore_LoadSequencers_Call) RunAndReturn(run func(uint64) (*types.SequencerSet, error)) *MockStore_LoadSequencers_Call { _c.Call.Return(run) return _c } -// LoadValidators provides a mock function with given fields: height -func (_m *MockStore) LoadValidators(height uint64) (*tenderminttypes.ValidatorSet, error) { - ret := _m.Called(height) +// LoadState provides a mock function with given fields: +func (_m *MockStore) LoadState() (*types.State, error) { + ret := _m.Called() if len(ret) == 0 { - panic("no return value specified for LoadValidators") + panic("no return value specified for LoadState") } - var r0 *tenderminttypes.ValidatorSet + var r0 *types.State var r1 error - if rf, ok := ret.Get(0).(func(uint64) (*tenderminttypes.ValidatorSet, error)); ok { - return rf(height) + if rf, ok := ret.Get(0).(func() (*types.State, error)); ok { + return rf() } - if rf, ok := ret.Get(0).(func(uint64) *tenderminttypes.ValidatorSet); ok { - r0 = rf(height) + if rf, ok := ret.Get(0).(func() *types.State); ok { + r0 = rf() } else { if ret.Get(0) != nil { - r0 = ret.Get(0).(*tenderminttypes.ValidatorSet) + r0 = ret.Get(0).(*types.State) } } - if rf, ok := ret.Get(1).(func(uint64) error); ok { - r1 = rf(height) + if rf, ok := ret.Get(1).(func() error); ok { + r1 = rf() } else { r1 = ret.Error(1) } @@ -434,30 +505,29 @@ func (_m *MockStore) LoadValidators(height uint64) (*tenderminttypes.ValidatorSe return r0, r1 } -// MockStore_LoadValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadValidators' -type MockStore_LoadValidators_Call struct { +// MockStore_LoadState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'LoadState' +type MockStore_LoadState_Call struct { *mock.Call } -// LoadValidators is a helper method to define mock.On call -// - height uint64 -func (_e *MockStore_Expecter) LoadValidators(height interface{}) *MockStore_LoadValidators_Call { - return &MockStore_LoadValidators_Call{Call: _e.mock.On("LoadValidators", height)} +// LoadState is a helper method to define mock.On call +func (_e *MockStore_Expecter) LoadState() *MockStore_LoadState_Call { + return &MockStore_LoadState_Call{Call: _e.mock.On("LoadState")} } -func (_c *MockStore_LoadValidators_Call) Run(run func(height uint64)) *MockStore_LoadValidators_Call { +func (_c *MockStore_LoadState_Call) Run(run func()) *MockStore_LoadState_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64)) + run() }) return _c } -func (_c *MockStore_LoadValidators_Call) Return(_a0 *tenderminttypes.ValidatorSet, _a1 error) *MockStore_LoadValidators_Call { +func (_c *MockStore_LoadState_Call) Return(_a0 *types.State, _a1 error) *MockStore_LoadState_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockStore_LoadValidators_Call) RunAndReturn(run func(uint64) (*tenderminttypes.ValidatorSet, error)) *MockStore_LoadValidators_Call { +func (_c *MockStore_LoadState_Call) RunAndReturn(run func() (*types.State, error)) *MockStore_LoadState_Call { _c.Call.Return(run) return _c } @@ -626,6 +696,66 @@ func (_c *MockStore_SaveBlock_Call) RunAndReturn(run func(*types.Block, *types.C return _c } +// SaveBlockCid provides a mock function with given fields: height, _a1, batch +func (_m *MockStore) SaveBlockCid(height uint64, _a1 cid.Cid, batch store.KVBatch) (store.KVBatch, error) { + ret := _m.Called(height, _a1, batch) + + if len(ret) == 0 { + panic("no return value specified for SaveBlockCid") + } + + var r0 store.KVBatch + var r1 error + if rf, ok := ret.Get(0).(func(uint64, cid.Cid, store.KVBatch) (store.KVBatch, error)); ok { + return rf(height, _a1, batch) + } + if rf, ok := ret.Get(0).(func(uint64, cid.Cid, store.KVBatch) store.KVBatch); ok { + r0 = rf(height, _a1, batch) + } else { + if ret.Get(0) != nil { + r0 = ret.Get(0).(store.KVBatch) + } + } + + if rf, ok := ret.Get(1).(func(uint64, cid.Cid, store.KVBatch) error); ok { + r1 = rf(height, _a1, batch) + } else { + r1 = ret.Error(1) + } + + return r0, r1 +} + +// MockStore_SaveBlockCid_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveBlockCid' +type MockStore_SaveBlockCid_Call struct { + *mock.Call +} + +// SaveBlockCid is a helper method to define mock.On call +// - height uint64 +// - _a1 cid.Cid +// - batch store.KVBatch +func (_e *MockStore_Expecter) SaveBlockCid(height interface{}, _a1 interface{}, batch interface{}) *MockStore_SaveBlockCid_Call { + return &MockStore_SaveBlockCid_Call{Call: _e.mock.On("SaveBlockCid", height, _a1, batch)} +} + +func (_c *MockStore_SaveBlockCid_Call) Run(run func(height uint64, _a1 cid.Cid, batch store.KVBatch)) *MockStore_SaveBlockCid_Call { + _c.Call.Run(func(args mock.Arguments) { + run(args[0].(uint64), args[1].(cid.Cid), args[2].(store.KVBatch)) + }) + return _c +} + +func (_c *MockStore_SaveBlockCid_Call) Return(_a0 store.KVBatch, _a1 error) *MockStore_SaveBlockCid_Call { + _c.Call.Return(_a0, _a1) + return _c +} + +func (_c *MockStore_SaveBlockCid_Call) RunAndReturn(run func(uint64, cid.Cid, store.KVBatch) (store.KVBatch, error)) *MockStore_SaveBlockCid_Call { + _c.Call.Return(run) + return _c +} + // SaveBlockResponses provides a mock function with given fields: height, responses, batch func (_m *MockStore) SaveBlockResponses(height uint64, responses *state.ABCIResponses, batch store.KVBatch) (store.KVBatch, error) { ret := _m.Called(height, responses, batch) @@ -686,29 +816,29 @@ func (_c *MockStore_SaveBlockResponses_Call) RunAndReturn(run func(uint64, *stat return _c } -// SaveState provides a mock function with given fields: _a0, batch -func (_m *MockStore) SaveState(_a0 *types.State, batch store.KVBatch) (store.KVBatch, error) { - ret := _m.Called(_a0, batch) +// SaveSequencers provides a mock function with given fields: height, seqSet, batch +func (_m *MockStore) SaveSequencers(height uint64, seqSet *types.SequencerSet, batch store.KVBatch) (store.KVBatch, error) { + ret := _m.Called(height, seqSet, batch) if len(ret) == 0 { - panic("no return value specified for SaveState") + panic("no return value specified for SaveSequencers") } var r0 store.KVBatch var r1 error - if rf, ok := ret.Get(0).(func(*types.State, store.KVBatch) (store.KVBatch, error)); ok { - return rf(_a0, batch) + if rf, ok := ret.Get(0).(func(uint64, *types.SequencerSet, store.KVBatch) (store.KVBatch, error)); ok { + return rf(height, seqSet, batch) } - if rf, ok := ret.Get(0).(func(*types.State, store.KVBatch) store.KVBatch); ok { - r0 = rf(_a0, batch) + if rf, ok := ret.Get(0).(func(uint64, *types.SequencerSet, store.KVBatch) store.KVBatch); ok { + r0 = rf(height, seqSet, batch) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(store.KVBatch) } } - if rf, ok := ret.Get(1).(func(*types.State, store.KVBatch) error); ok { - r1 = rf(_a0, batch) + if rf, ok := ret.Get(1).(func(uint64, *types.SequencerSet, store.KVBatch) error); ok { + r1 = rf(height, seqSet, batch) } else { r1 = ret.Error(1) } @@ -716,58 +846,59 @@ func (_m *MockStore) SaveState(_a0 *types.State, batch store.KVBatch) (store.KVB return r0, r1 } -// MockStore_SaveState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveState' -type MockStore_SaveState_Call struct { +// MockStore_SaveSequencers_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveSequencers' +type MockStore_SaveSequencers_Call struct { *mock.Call } -// SaveState is a helper method to define mock.On call -// - _a0 *types.State +// SaveSequencers is a helper method to define mock.On call +// - height uint64 +// - seqSet *types.SequencerSet // - batch store.KVBatch -func (_e *MockStore_Expecter) SaveState(_a0 interface{}, batch interface{}) *MockStore_SaveState_Call { - return &MockStore_SaveState_Call{Call: _e.mock.On("SaveState", _a0, batch)} +func (_e *MockStore_Expecter) SaveSequencers(height interface{}, seqSet interface{}, batch interface{}) *MockStore_SaveSequencers_Call { + return &MockStore_SaveSequencers_Call{Call: _e.mock.On("SaveSequencers", height, seqSet, batch)} } -func (_c *MockStore_SaveState_Call) Run(run func(_a0 *types.State, batch store.KVBatch)) *MockStore_SaveState_Call { +func (_c *MockStore_SaveSequencers_Call) Run(run func(height uint64, seqSet *types.SequencerSet, batch store.KVBatch)) *MockStore_SaveSequencers_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(*types.State), args[1].(store.KVBatch)) + run(args[0].(uint64), args[1].(*types.SequencerSet), args[2].(store.KVBatch)) }) return _c } -func (_c *MockStore_SaveState_Call) Return(_a0 store.KVBatch, _a1 error) *MockStore_SaveState_Call { +func (_c *MockStore_SaveSequencers_Call) Return(_a0 store.KVBatch, _a1 error) *MockStore_SaveSequencers_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockStore_SaveState_Call) RunAndReturn(run func(*types.State, store.KVBatch) (store.KVBatch, error)) *MockStore_SaveState_Call { +func (_c *MockStore_SaveSequencers_Call) RunAndReturn(run func(uint64, *types.SequencerSet, store.KVBatch) (store.KVBatch, error)) *MockStore_SaveSequencers_Call { _c.Call.Return(run) return _c } -// SaveValidators provides a mock function with given fields: height, validatorSet, batch -func (_m *MockStore) SaveValidators(height uint64, validatorSet *tenderminttypes.ValidatorSet, batch store.KVBatch) (store.KVBatch, error) { - ret := _m.Called(height, validatorSet, batch) +// SaveState provides a mock function with given fields: _a0, batch +func (_m *MockStore) SaveState(_a0 *types.State, batch store.KVBatch) (store.KVBatch, error) { + ret := _m.Called(_a0, batch) if len(ret) == 0 { - panic("no return value specified for SaveValidators") + panic("no return value specified for SaveState") } var r0 store.KVBatch var r1 error - if rf, ok := ret.Get(0).(func(uint64, *tenderminttypes.ValidatorSet, store.KVBatch) (store.KVBatch, error)); ok { - return rf(height, validatorSet, batch) + if rf, ok := ret.Get(0).(func(*types.State, store.KVBatch) (store.KVBatch, error)); ok { + return rf(_a0, batch) } - if rf, ok := ret.Get(0).(func(uint64, *tenderminttypes.ValidatorSet, store.KVBatch) store.KVBatch); ok { - r0 = rf(height, validatorSet, batch) + if rf, ok := ret.Get(0).(func(*types.State, store.KVBatch) store.KVBatch); ok { + r0 = rf(_a0, batch) } else { if ret.Get(0) != nil { r0 = ret.Get(0).(store.KVBatch) } } - if rf, ok := ret.Get(1).(func(uint64, *tenderminttypes.ValidatorSet, store.KVBatch) error); ok { - r1 = rf(height, validatorSet, batch) + if rf, ok := ret.Get(1).(func(*types.State, store.KVBatch) error); ok { + r1 = rf(_a0, batch) } else { r1 = ret.Error(1) } @@ -775,32 +906,31 @@ func (_m *MockStore) SaveValidators(height uint64, validatorSet *tenderminttypes return r0, r1 } -// MockStore_SaveValidators_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveValidators' -type MockStore_SaveValidators_Call struct { +// MockStore_SaveState_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'SaveState' +type MockStore_SaveState_Call struct { *mock.Call } -// SaveValidators is a helper method to define mock.On call -// - height uint64 -// - validatorSet *tenderminttypes.ValidatorSet +// SaveState is a helper method to define mock.On call +// - _a0 *types.State // - batch store.KVBatch -func (_e *MockStore_Expecter) SaveValidators(height interface{}, validatorSet interface{}, batch interface{}) *MockStore_SaveValidators_Call { - return &MockStore_SaveValidators_Call{Call: _e.mock.On("SaveValidators", height, validatorSet, batch)} +func (_e *MockStore_Expecter) SaveState(_a0 interface{}, batch interface{}) *MockStore_SaveState_Call { + return &MockStore_SaveState_Call{Call: _e.mock.On("SaveState", _a0, batch)} } -func (_c *MockStore_SaveValidators_Call) Run(run func(height uint64, validatorSet *tenderminttypes.ValidatorSet, batch store.KVBatch)) *MockStore_SaveValidators_Call { +func (_c *MockStore_SaveState_Call) Run(run func(_a0 *types.State, batch store.KVBatch)) *MockStore_SaveState_Call { _c.Call.Run(func(args mock.Arguments) { - run(args[0].(uint64), args[1].(*tenderminttypes.ValidatorSet), args[2].(store.KVBatch)) + run(args[0].(*types.State), args[1].(store.KVBatch)) }) return _c } -func (_c *MockStore_SaveValidators_Call) Return(_a0 store.KVBatch, _a1 error) *MockStore_SaveValidators_Call { +func (_c *MockStore_SaveState_Call) Return(_a0 store.KVBatch, _a1 error) *MockStore_SaveState_Call { _c.Call.Return(_a0, _a1) return _c } -func (_c *MockStore_SaveValidators_Call) RunAndReturn(run func(uint64, *tenderminttypes.ValidatorSet, store.KVBatch) (store.KVBatch, error)) *MockStore_SaveValidators_Call { +func (_c *MockStore_SaveState_Call) RunAndReturn(run func(*types.State, store.KVBatch) (store.KVBatch, error)) *MockStore_SaveState_Call { _c.Call.Return(run) return _c } diff --git a/node/node.go b/node/node.go index 7bd296f3a..e3ed06f60 100644 --- a/node/node.go +++ b/node/node.go @@ -162,16 +162,6 @@ func NewNode( mp := mempoolv1.NewTxMempool(logger, &conf.MempoolConfig, proxyApp.Mempool(), height, mempoolv1.WithMetrics(metrics)) mpIDs := nodemempool.NewMempoolIDs() - // Set p2p client and it's validators - p2pValidator := p2p.NewValidator(logger.With("module", "p2p_validator"), settlementlc) - - p2pClient, err := p2p.NewClient(conf.P2PConfig, p2pKey, genesis.ChainID, s, pubsubServer, dstore, logger.With("module", "p2p")) - if err != nil { - return nil, err - } - p2pClient.SetTxValidator(p2pValidator.TxValidator(mp, mpIDs)) - p2pClient.SetBlockValidator(p2pValidator.BlockValidator()) - blockManager, err := block.NewManager( signingKey, conf.BlockManagerConfig, @@ -183,12 +173,24 @@ func NewNode( settlementlc, eventBus, pubsubServer, - p2pClient, + nil, // p2p client is set later logger.With("module", "BlockManager"), ) if err != nil { - return nil, fmt.Errorf("BlockManager initialization error: %w", err) + return nil, fmt.Errorf("BlockManager initialization: %w", err) + } + + // Set p2p client and it's validators + p2pValidator := p2p.NewValidator(logger.With("module", "p2p_validator"), blockManager) + p2pClient, err := p2p.NewClient(conf.P2PConfig, p2pKey, genesis.ChainID, s, pubsubServer, dstore, logger.With("module", "p2p")) + if err != nil { + return nil, err } + p2pClient.SetTxValidator(p2pValidator.TxValidator(mp, mpIDs)) + p2pClient.SetBlockValidator(p2pValidator.BlockValidator()) + + // Set p2p client in block manager + blockManager.P2PClient = p2pClient ctx, cancel := context.WithCancel(ctx) node := &Node{ @@ -258,8 +260,6 @@ func (n *Node) GetGenesis() *tmtypes.GenesisDoc { // OnStop is a part of Service interface. func (n *Node) OnStop() { - n.cancel() - err := n.dalc.Stop() if err != nil { n.Logger.Error("stop data availability layer client", "error", err) @@ -279,6 +279,8 @@ func (n *Node) OnStop() { if err != nil { n.Logger.Error("close store", "error", err) } + + n.cancel() } // OnReset is a part of Service interface. diff --git a/p2p/block.go b/p2p/block.go index 099dcad53..b74f92368 100644 --- a/p2p/block.go +++ b/p2p/block.go @@ -3,7 +3,7 @@ package p2p import ( "github.com/dymensionxyz/dymint/p2p/pb" "github.com/dymensionxyz/dymint/types" - tmtypes "github.com/tendermint/tendermint/types" + tmcrypto "github.com/tendermint/tendermint/crypto" ) /* -------------------------------------------------------------------------- */ @@ -54,21 +54,15 @@ func (b *BlockData) FromProto(other *pb.BlockData) error { } // Validate run basic validation on the p2p block received -func (b *BlockData) Validate(proposer *types.Sequencer) error { +func (b *BlockData) Validate(proposerPubKey tmcrypto.PubKey) error { if err := b.Block.ValidateBasic(); err != nil { return err } if err := b.Commit.ValidateBasic(); err != nil { return err } - if err := b.Commit.ValidateWithHeader(proposer, &b.Block.Header); err != nil { + if err := b.Commit.ValidateWithHeader(proposerPubKey, &b.Block.Header); err != nil { return err } - abciData := tmtypes.Data{ - Txs: types.ToABCIBlockDataTxs(&b.Block.Data), - } - if b.Block.Header.DataHash != [32]byte(abciData.Hash()) { - return types.ErrInvalidHeaderDataHash - } return nil } diff --git a/p2p/block_sync_test.go b/p2p/block_sync_test.go index 6b61f2ebf..3237e5acb 100644 --- a/p2p/block_sync_test.go +++ b/p2p/block_sync_test.go @@ -12,7 +12,6 @@ import ( ) func TestBlockSync(t *testing.T) { - logger := log.TestingLogger() ctx := context.Background() @@ -47,17 +46,16 @@ func TestBlockSync(t *testing.T) { blocksync := p2p.SetupBlockSync(ctx, clients[0].Host, datastore.NewMapDatastore(), logger) require.NoError(t, err) - //add block to blocksync protocol client 0 + // add block to blocksync protocol client 0 cid, err := blocksync.SaveBlock(ctx, gossipedBlockbytes) require.NoError(t, err) - //get block + // get block block, err := blocksync.LoadBlock(ctx, cid) require.NoError(t, err) require.Equal(t, gossipedBlock, block) - //remove block + // remove block err = blocksync.DeleteBlock(ctx, cid) require.NoError(t, err) - } diff --git a/p2p/client_test.go b/p2p/client_test.go index e2d291a22..020d6a052 100644 --- a/p2p/client_test.go +++ b/p2p/client_test.go @@ -189,7 +189,6 @@ func TestAdvertiseBlock(t *testing.T) { receivedCid, err := clients[0].GetBlockIdFromDHT(ctx, 1) require.NoError(t, err) require.Equal(t, expectedCid, receivedCid) - } // Test that advertises an invalid CID in the DHT @@ -223,7 +222,6 @@ func TestAdvertiseWrongCid(t *testing.T) { receivedError := clients[2].DHT.PutValue(ctx, "/block-sync/"+strconv.FormatUint(1, 10), []byte("test")) require.Error(t, cid.ErrInvalidCid{}, receivedError) - } func TestSeedStringParsing(t *testing.T) { diff --git a/p2p/validator.go b/p2p/validator.go index cb8ac890f..00ebcf302 100644 --- a/p2p/validator.go +++ b/p2p/validator.go @@ -5,12 +5,16 @@ import ( "github.com/dymensionxyz/dymint/mempool" nodemempool "github.com/dymensionxyz/dymint/node/mempool" - "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/types" abci "github.com/tendermint/tendermint/abci/types" + tmcrypto "github.com/tendermint/tendermint/crypto" corep2p "github.com/tendermint/tendermint/p2p" ) +type ProposerGetter interface { + GetProposerPubKey() tmcrypto.PubKey +} + // GossipValidator is a callback function type. type GossipValidator func(*GossipMessage) bool @@ -23,17 +27,17 @@ type IValidator interface { // Validator is a validator for messages gossiped in the p2p network. type Validator struct { - logger types.Logger - slClient settlement.ClientI + logger types.Logger + proposerGetter ProposerGetter } var _ IValidator = (*Validator)(nil) // NewValidator creates a new Validator. -func NewValidator(logger types.Logger, slClient settlement.ClientI) *Validator { +func NewValidator(logger types.Logger, blockmanager ProposerGetter) *Validator { return &Validator{ - logger: logger, - slClient: slClient, + logger: logger, + proposerGetter: blockmanager, } } @@ -76,7 +80,7 @@ func (v *Validator) BlockValidator() GossipValidator { v.logger.Error("Deserialize gossiped block.", "error", err) return false } - if err := gossipedBlock.Validate(v.slClient.GetProposer()); err != nil { + if err := gossipedBlock.Validate(v.proposerGetter.GetProposerPubKey()); err != nil { v.logger.Error("Failed to validate gossiped block.", "height", gossipedBlock.Block.Header.Height, "error", err) return false } diff --git a/p2p/validator_test.go b/p2p/validator_test.go index ef8abf804..7d7160c0c 100644 --- a/p2p/validator_test.go +++ b/p2p/validator_test.go @@ -1,10 +1,8 @@ package p2p_test import ( - "encoding/hex" "testing" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" mempoolv1 "github.com/dymensionxyz/dymint/mempool/v1" "github.com/dymensionxyz/dymint/types" @@ -12,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/libs/log" - "github.com/tendermint/tendermint/libs/pubsub" "github.com/tendermint/tendermint/proxy" cfg "github.com/tendermint/tendermint/config" @@ -22,12 +20,11 @@ import ( "github.com/dymensionxyz/dymint/block" "github.com/dymensionxyz/dymint/mempool" + p2pmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymint/p2p" tmmocks "github.com/dymensionxyz/dymint/mocks/github.com/tendermint/tendermint/abci/types" nodemempool "github.com/dymensionxyz/dymint/node/mempool" "github.com/dymensionxyz/dymint/p2p" - "github.com/dymensionxyz/dymint/settlement" - "github.com/dymensionxyz/dymint/settlement/registry" ) func TestValidator_TxValidator(t *testing.T) { @@ -102,7 +99,7 @@ func TestValidator_BlockValidator(t *testing.T) { tests := []struct { name string - proposerKey *ed25519.PrivKey + proposerKey ed25519.PrivKey valid bool }{ { @@ -133,21 +130,16 @@ func TestValidator_BlockValidator(t *testing.T) { // Create state maxBytes := uint64(100) - state := types.State{} + state := &types.State{} + state.Sequencers.SetProposer(types.NewSequencerFromValidator(*tmtypes.NewValidator(proposerKey.PubKey(), 1))) state.ConsensusParams.Block.MaxBytes = int64(maxBytes) state.ConsensusParams.Block.MaxGas = 100000 - state.Validators = tmtypes.NewValidatorSet(nil) // Create empty block - block := executor.CreateBlock(1, &types.Commit{}, [32]byte{}, &state, maxBytes) + block := executor.CreateBlock(1, &types.Commit{}, [32]byte{}, [32]byte(state.Sequencers.ProposerHash()), state, maxBytes) - // Create slclient - client := registry.GetClient(registry.Local) - pubsubServer := pubsub.NewServer() - err = pubsubServer.Start() - require.NoError(t, err) - err = client.Init(settlement.Config{ProposerPubKey: hex.EncodeToString(proposerKey.PubKey().Bytes())}, pubsubServer, log.TestingLogger()) - require.NoError(t, err) + getProposer := &p2pmock.MockGetProposerI{} + getProposer.On("GetProposerPubKey").Return(proposerKey.PubKey()) // Create commit for the block abciHeaderPb := types.ToABCIHeaderPB(&block.Header) @@ -177,7 +169,7 @@ func TestValidator_BlockValidator(t *testing.T) { } // Check block validity - validateBlock := p2p.NewValidator(logger, client).BlockValidator() + validateBlock := p2p.NewValidator(logger, getProposer).BlockValidator() valid := validateBlock(blockMsg) require.Equal(t, tt.valid, valid) }) diff --git a/proto/types/dymint/dymint.proto b/proto/types/dymint/dymint.proto index 78508c47d..80e733097 100755 --- a/proto/types/dymint/dymint.proto +++ b/proto/types/dymint/dymint.proto @@ -3,6 +3,7 @@ package dymint; 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"; // Version captures the consensus rules for processing a block in the blockchain, // including all blockchain data structures and the rules of the application's @@ -52,8 +53,10 @@ message Header { // pubkey can't be recovered by the signature (e.g. ed25519). bytes proposer_address = 11; - // Hash of block sequencer set, at a time of block creation - bytes sequencers_hash = 12; + // Hash of proposer validatorSet (compatible with tendermint) + bytes sequencer_hash = 12; + // Hash of the next proposer validatorSet (compatible with tendermint) + bytes next_sequencer_hash = 14; // Chain ID the block belongs to string chain_id = 13; @@ -86,3 +89,13 @@ message Batch { repeated Commit commits = 4; } + +message Sequencer { + string settlement_address = 1; + tendermint.types.Validator validator = 2; +} + +message SequencerSet { + repeated Sequencer sequencers = 1; + Sequencer proposer = 2; +} \ No newline at end of file diff --git a/proto/types/dymint/state.proto b/proto/types/dymint/state.proto index b75f8187c..02fb2f13e 100755 --- a/proto/types/dymint/state.proto +++ b/proto/types/dymint/state.proto @@ -9,6 +9,7 @@ import "types/tendermint/types/types.proto"; import "types/tendermint/types/validator.proto"; import "types/tendermint/types/params.proto"; import "types/tendermint/state/types.proto"; +import "types/dymint/dymint.proto"; message State { @@ -23,11 +24,13 @@ message State { google.protobuf.Timestamp last_block_time = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; reserved 7; + reserved 8; + tendermint.types.ValidatorSet validators = 9 [deprecated = true]; + reserved 10; + - tendermint.types.ValidatorSet next_validators = 8; - tendermint.types.ValidatorSet validators = 9; - tendermint.types.ValidatorSet last_validators = 10; int64 last_height_validators_changed = 11; + tendermint.types.ConsensusParams consensus_params = 12 [(gogoproto.nullable) = false]; int64 last_height_consensus_params_changed = 13; @@ -38,4 +41,6 @@ message State { uint64 last_store_height = 16 [(gogoproto.customname) = "LastStoreHeight"]; uint64 base_height = 17; + + SequencerSet sequencerSet = 18 [(gogoproto.nullable) = false]; } diff --git a/rpc/client/client.go b/rpc/client/client.go index 5fb78c44e..6fa48a6bb 100644 --- a/rpc/client/client.go +++ b/rpc/client/client.go @@ -313,7 +313,7 @@ func (c *Client) BlockchainInfo(ctx context.Context, minHeight, maxHeight int64) const limit int64 = 20 minHeight, maxHeight, err := filterMinMax( - 0, // FIXME: we might be pruned + int64(c.node.BlockManager.State.BaseHeight), int64(c.node.GetBlockManagerHeight()), minHeight, maxHeight, @@ -508,12 +508,12 @@ func (c *Client) Commit(ctx context.Context, height *int64) (*ctypes.ResultCommi // Validators returns paginated list of validators at given height. func (c *Client) Validators(ctx context.Context, heightPtr *int64, pagePtr, perPagePtr *int) (*ctypes.ResultValidators, error) { height := c.normalizeHeight(heightPtr) - validators, err := c.node.Store.LoadValidators(height) + sequencers, err := c.node.Store.LoadSequencers(height) if err != nil { return nil, fmt.Errorf("load validators for height %d: %w", height, err) } - totalCount := len(validators.Validators) + totalCount := len(sequencers.Sequencers) perPage := validatePerPage(perPagePtr) page, err := validatePage(pagePtr, perPage, totalCount) if err != nil { @@ -521,7 +521,17 @@ func (c *Client) Validators(ctx context.Context, heightPtr *int64, pagePtr, perP } skipCount := validateSkipCount(page, perPage) - v := validators.Validators[skipCount : skipCount+tmmath.MinInt(perPage, totalCount-skipCount)] + + var vals []*tmtypes.Validator + for _, s := range sequencers.Sequencers { + val, err := s.TMValidator() + if err != nil { + return nil, fmt.Errorf("convert sequencer to validator: %s :%w", s.SettlementAddress, err) + } + vals = append(vals, val) + } + + v := vals[skipCount : skipCount+tmmath.MinInt(perPage, totalCount-skipCount)] return &ctypes.ResultValidators{ BlockHeight: int64(height), Validators: v, @@ -707,12 +717,12 @@ func (c *Client) Status(ctx context.Context) (*ctypes.ResultStatus, error) { latestHeight := latest.Header.Height latestBlockTimeNano := latest.Header.Time - validators, err := c.node.Store.LoadValidators(latest.Header.Height) + sequencers, err := c.node.Store.LoadSequencers(latest.Header.Height) if err != nil { return nil, fmt.Errorf("fetch the validator info at latest block: %w", err) } - _, validator := validators.GetByAddress(latest.Header.ProposerAddress) - if validator == nil { + proposer := sequencers.Proposer + if proposer == nil { return nil, fmt.Errorf("find proposer %s in the valSet", string(latest.Header.ProposerAddress)) } state, err := c.node.Store.LoadState() @@ -758,9 +768,9 @@ func (c *Client) Status(ctx context.Context) (*ctypes.ResultStatus, error) { }, // TODO(ItzhakBokris): update ValidatorInfo fields ValidatorInfo: ctypes.ValidatorInfo{ - Address: validator.Address, - PubKey: validator.PubKey, - VotingPower: validator.VotingPower, + Address: tmbytes.HexBytes(proposer.ConsAddress()), + PubKey: proposer.PubKey(), + VotingPower: 1, }, } return result, nil diff --git a/rpc/client/client_test.go b/rpc/client/client_test.go index 741521bb3..267d6509f 100644 --- a/rpc/client/client_test.go +++ b/rpc/client/client_test.go @@ -663,6 +663,7 @@ func TestBlockchainInfo(t *testing.T) { } } +// TestValidatorSetHandling tests that EndBlock updates are ignored and the validator set is fetched from the state func TestValidatorSetHandling(t *testing.T) { assert := assert.New(t) require := require.New(t) @@ -670,7 +671,6 @@ func TestValidatorSetHandling(t *testing.T) { app.On("InitChain", mock.Anything).Return(abci.ResponseInitChain{}) app.On("CheckTx", mock.Anything).Return(abci.ResponseCheckTx{}) app.On("BeginBlock", mock.Anything).Return(abci.ResponseBeginBlock{}) - app.On("Commit", mock.Anything).Return(abci.ResponseCommit{}) app.On("Info", mock.Anything).Return(abci.ResponseInfo{LastBlockHeight: 0, LastBlockAppHash: []byte{0}}) key, _, _ := crypto.GenerateEd25519Key(crand.Reader) @@ -687,16 +687,15 @@ func TestValidatorSetHandling(t *testing.T) { genesisValidators[i] = tmtypes.GenesisValidator{Address: vKeys[i].PubKey().Address(), PubKey: vKeys[i].PubKey(), Power: int64(i + 100), Name: "one"} } + // dummy pubkey, we don't care about the actual key pbValKey, err := encoding.PubKeyToProto(vKeys[0].PubKey()) require.NoError(err) + app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{{PubKey: pbValKey, Power: 100}}}) waitCh := make(chan interface{}) - app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}).Times(2) - app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{{PubKey: pbValKey, Power: 0}}}).Once() - app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}).Once() - app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{ValidatorUpdates: []abci.ValidatorUpdate{{PubKey: pbValKey, Power: 100}}}).Once() - app.On("EndBlock", mock.Anything).Return(abci.ResponseEndBlock{}).Run(func(args mock.Arguments) { + app.On("Commit", mock.Anything).Return(abci.ResponseCommit{}).Times(5) + app.On("Commit", mock.Anything).Return(abci.ResponseCommit{}).Run(func(args mock.Arguments) { waitCh <- nil }) rollappID := "rollapp_1234-1" @@ -742,7 +741,10 @@ func TestValidatorSetHandling(t *testing.T) { err = node.Start() require.NoError(err) - <-waitCh + defer node.Stop() + + <-waitCh // triggered on the 6th commit + time.Sleep(300 * time.Millisecond) // give time for the sequencers commit to db // validator set isn't updated through ABCI anymore for h := int64(1); h <= 5; h++ { diff --git a/rpc/json/ws_test.go b/rpc/json/ws_test.go index ad9223223..78a028cb8 100644 --- a/rpc/json/ws_test.go +++ b/rpc/json/ws_test.go @@ -37,14 +37,15 @@ func TestWebSockets(t *testing.T) { conn, resp, err := websocket.DefaultDialer.Dial(strings.Replace(srv.URL, "http://", "ws://", 1)+"/websocket", nil) require.NoError(err) - require.NotNil(resp) - require.NotNil(conn) defer func() { _ = conn.Close() }() - assert.Equal(http.StatusSwitchingProtocols, resp.StatusCode) - + require.NotNil(resp) + require.NotNil(conn) + require.Equal(http.StatusSwitchingProtocols, resp.StatusCode) + err = conn.SetReadDeadline(time.Now().Add(300 * time.Second)) + require.NoError(err) err = conn.WriteMessage(websocket.TextMessage, []byte(` { "jsonrpc": "2.0", @@ -55,26 +56,23 @@ func TestWebSockets(t *testing.T) { } } `)) - assert.NoError(err) + require.NoError(err) - err = conn.SetReadDeadline(time.Now().Add(3 * time.Second)) - assert.NoError(err) typ, msg, err := conn.ReadMessage() - assert.NoError(err) - assert.Equal(websocket.TextMessage, typ) - assert.NotEmpty(msg) + require.NoError(err) + require.Equal(websocket.TextMessage, typ) + require.NotEmpty(msg) // wait for new block event - err = conn.SetReadDeadline(time.Now().Add(3 * time.Second)) - assert.NoError(err) + time.Sleep(5 * time.Second) typ, msg, err = conn.ReadMessage() - assert.NoError(err) - assert.Equal(websocket.TextMessage, typ) - assert.NotEmpty(msg) + require.NoError(err) + require.Equal(websocket.TextMessage, typ) + require.NotEmpty(msg) var responsePayload rpctypes.RPCResponse err = json.Unmarshal(msg, &responsePayload) - assert.NoError(err) - assert.Equal(rpctypes.JSONRPCIntID(7), responsePayload.ID) + require.NoError(err) + require.Equal(rpctypes.JSONRPCIntID(7), responsePayload.ID) var m map[string]interface{} err = json.Unmarshal([]byte(responsePayload.Result), &m) require.NoError(err) @@ -113,6 +111,7 @@ func TestWebsocketCloseUnsubscribe(t *testing.T) { _, local := getRPC(t) handler, err := GetHTTPHandler(local, log.TestingLogger()) require.NoError(err) + defer local.Stop() srv := httptest.NewServer(handler) diff --git a/settlement/dymension/cosmosclient.go b/settlement/dymension/cosmosclient.go index ee23068d4..346938466 100644 --- a/settlement/dymension/cosmosclient.go +++ b/settlement/dymension/cosmosclient.go @@ -9,8 +9,8 @@ import ( sdkclient "github.com/cosmos/cosmos-sdk/client" sdktypes "github.com/cosmos/cosmos-sdk/types" "github.com/dymensionxyz/cosmosclient/cosmosclient" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" - sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" + sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/ignite/cli/ignite/pkg/cosmosaccount" ctypes "github.com/tendermint/tendermint/rpc/core/types" @@ -26,6 +26,7 @@ type CosmosClient interface { StopEventListener() error EventListenerQuit() <-chan struct{} SubscribeToEvents(ctx context.Context, subscriber string, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error) + UnsubscribeAll(ctx context.Context, subscriber string) error BroadcastTx(accountName string, msgs ...sdktypes.Msg) (cosmosclient.Response, error) GetRollappClient() rollapptypes.QueryClient GetSequencerClient() sequencertypes.QueryClient @@ -44,19 +45,23 @@ func NewCosmosClient(client cosmosclient.Client) CosmosClient { } func (c *cosmosClient) StartEventListener() error { - return c.Client.RPC.WSEvents.Start() + return c.Client.RPC.Start() } func (c *cosmosClient) StopEventListener() error { - return c.Client.RPC.WSEvents.Stop() + return c.Client.RPC.Stop() } func (c *cosmosClient) EventListenerQuit() <-chan struct{} { - return c.Client.RPC.GetWSClient().Quit() + return c.Client.RPC.Quit() } func (c *cosmosClient) SubscribeToEvents(ctx context.Context, subscriber string, query string, outCapacity ...int) (out <-chan ctypes.ResultEvent, err error) { - return c.Client.RPC.WSEvents.Subscribe(ctx, subscriber, query, outCapacity...) + return c.Client.WSEvents.Subscribe(ctx, subscriber, query, outCapacity...) +} + +func (c *cosmosClient) UnsubscribeAll(ctx context.Context, subscriber string) error { + return c.Client.WSEvents.UnsubscribeAll(ctx, subscriber) } func (c *cosmosClient) GetRollappClient() rollapptypes.QueryClient { diff --git a/settlement/dymension/dymension.go b/settlement/dymension/dymension.go index da83717f2..46e303a69 100644 --- a/settlement/dymension/dymension.go +++ b/settlement/dymension/dymension.go @@ -4,41 +4,33 @@ import ( "context" "errors" "fmt" + "slices" + "strconv" "strings" "time" "github.com/avast/retry-go/v4" - "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" cdctypes "github.com/cosmos/cosmos-sdk/codec/types" cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/dymensionxyz/cosmosclient/cosmosclient" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" - sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" + sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/google/uuid" "github.com/ignite/cli/ignite/pkg/cosmosaccount" "github.com/tendermint/tendermint/libs/pubsub" - ctypes "github.com/tendermint/tendermint/rpc/core/types" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/types" - uevent "github.com/dymensionxyz/dymint/utils/event" ) const ( - addressPrefix = "dym" - dymRollappVersion = 0 - defaultGasLimit = 300000 -) - -const ( - eventStateUpdate = "state_update.rollapp_id='%s' AND state_update.status='PENDING'" - eventSequencersListUpdate = "sequencers_list_update.rollapp_id='%s'" + addressPrefix = "dym" ) const ( @@ -52,12 +44,10 @@ type Client struct { pubsub *pubsub.Server cosmosClient CosmosClient ctx context.Context - cancel context.CancelFunc rollappQueryClient rollapptypes.QueryClient sequencerQueryClient sequencertypes.QueryClient protoCodec *codec.ProtoCodec - eventMap map[string]string - sequencerList []*types.Sequencer + proposer types.Sequencer retryAttempts uint retryMinDelay time.Duration retryMaxDelay time.Duration @@ -69,12 +59,6 @@ var _ settlement.ClientI = &Client{} // Init is called once. it initializes the struct members. func (c *Client) Init(config settlement.Config, pubsub *pubsub.Server, logger types.Logger, options ...settlement.Option) error { - ctx, cancel := context.WithCancel(context.Background()) - eventMap := map[string]string{ - fmt.Sprintf(eventStateUpdate, config.RollappID): settlement.EventNewBatchAccepted, - fmt.Sprintf(eventSequencersListUpdate, config.RollappID): settlement.EventSequencersListUpdated, - } - interfaceRegistry := cdctypes.NewInterfaceRegistry() cryptocodec.RegisterInterfaces(interfaceRegistry) protoCodec := codec.NewProtoCodec(interfaceRegistry) @@ -82,9 +66,7 @@ func (c *Client) Init(config settlement.Config, pubsub *pubsub.Server, logger ty c.config = &config c.logger = logger c.pubsub = pubsub - c.ctx = ctx - c.cancel = cancel - c.eventMap = eventMap + c.ctx = context.Background() c.protoCodec = protoCodec c.retryAttempts = config.RetryAttempts c.batchAcceptanceTimeout = config.BatchAcceptanceTimeout @@ -99,7 +81,6 @@ func (c *Client) Init(config settlement.Config, pubsub *pubsub.Server, logger ty if c.cosmosClient == nil { client, err := cosmosclient.New( - ctx, getCosmosClientOptions(&config)..., ) if err != nil { @@ -125,13 +106,7 @@ func (c *Client) Start() error { // Stop stops the HubClient. func (c *Client) Stop() error { - c.cancel() - err := c.cosmosClient.StopEventListener() - if err != nil { - return err - } - - return nil + return c.cosmosClient.StopEventListener() } // SubmitBatch posts a batch to the Dymension Hub. it tries to post the batch until it is accepted by the settlement layer. @@ -150,7 +125,7 @@ func (c *Client) SubmitBatch(batch *types.Batch, daClient da.Client, daResult *d } //nolint:errcheck - defer c.pubsub.Unsubscribe(c.ctx, postBatchSubscriberClient, settlement.EventQueryNewSettlementBatchAccepted) + defer c.pubsub.UnsubscribeAll(c.ctx, postBatchSubscriberClient) for { // broadcast loop: broadcast the transaction to the blockchain (with infinite retries). @@ -166,7 +141,7 @@ func (c *Client) SubmitBatch(batch *types.Batch, daClient da.Client, daResult *d "startHeight", batch.StartHeight(), "endHeight", - batch.EndHeight, + batch.EndHeight(), "error", err, ) @@ -256,12 +231,12 @@ func (c *Client) getStateInfo(index, height *uint64) (res *rollapptypes.QueryGet res, err = c.rollappQueryClient.StateInfo(c.ctx, req) if status.Code(err) == codes.NotFound { - return retry.Unrecoverable(gerrc.ErrNotFound) + return retry.Unrecoverable(errors.Join(gerrc.ErrNotFound, err)) } return err }) if err != nil { - return nil, fmt.Errorf("query state info: %w: %w", gerrc.ErrUnknown, err) + return nil, fmt.Errorf("query state info: %w", err) } if res == nil { // not supposed to happen return nil, fmt.Errorf("empty response with nil err: %w", gerrc.ErrUnknown) @@ -302,33 +277,114 @@ func (c *Client) GetHeightState(h uint64) (*settlement.ResultGetHeightState, err // GetProposer implements settlement.ClientI. func (c *Client) GetProposer() *types.Sequencer { - seqs, err := c.GetSequencers() + // return cached proposer + if !c.proposer.IsEmpty() { + return &c.proposer + } + + seqs, err := c.GetBondedSequencers() if err != nil { - c.logger.Error("Get sequencers", "error", err) + c.logger.Error("GetBondedSequencers", "error", err) return nil } - for _, sequencer := range seqs { - if sequencer.Status == types.Proposer { - return sequencer + + var proposerAddr string + err = c.RunWithRetry(func() error { + reqProposer := &sequencertypes.QueryGetProposerByRollappRequest{ + RollappId: c.config.RollappID, } + res, err := c.sequencerQueryClient.GetProposerByRollapp(c.ctx, reqProposer) + if err == nil { + proposerAddr = res.ProposerAddr + return nil + } + if status.Code(err) == codes.NotFound { + return nil + } + return err + }) + if err != nil { + c.logger.Error("GetProposer", "error", err) + return nil } - return nil + + // find the sequencer with the proposer address + index := slices.IndexFunc(seqs, func(seq types.Sequencer) bool { + return seq.SettlementAddress == proposerAddr + }) + // will return nil if the proposer is not set + if index == -1 { + return nil + } + c.proposer = seqs[index] + return &seqs[index] } -// GetSequencers returns the bonded sequencers of the given rollapp. -func (c *Client) GetSequencers() ([]*types.Sequencer, error) { - if c.sequencerList != nil { - return c.sequencerList, nil +// GetAllSequencers returns all sequencers of the given rollapp. +func (c *Client) GetAllSequencers() ([]types.Sequencer, error) { + var res *sequencertypes.QueryGetSequencersByRollappResponse + req := &sequencertypes.QueryGetSequencersByRollappRequest{ + RollappId: c.config.RollappID, + } + + err := c.RunWithRetry(func() error { + var err error + res, err = c.sequencerQueryClient.SequencersByRollapp(c.ctx, req) + if err == nil { + return nil + } + + if status.Code(err) == codes.NotFound { + return retry.Unrecoverable(errors.Join(gerrc.ErrNotFound, err)) + } + return err + }) + if err != nil { + return nil, err + } + + // not supposed to happen, but just in case + if res == nil { + return nil, fmt.Errorf("empty response: %w", gerrc.ErrUnknown) + } + + var sequencerList []types.Sequencer + for _, sequencer := range res.Sequencers { + var pubKey cryptotypes.PubKey + err := c.protoCodec.UnpackAny(sequencer.DymintPubKey, &pubKey) + if err != nil { + return nil, err + } + + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(pubKey) + if err != nil { + return nil, err + } + + sequencerList = append(sequencerList, *types.NewSequencer(tmPubKey, sequencer.Address)) } + return sequencerList, nil +} + +// GetBondedSequencers returns the bonded sequencers of the given rollapp. +func (c *Client) GetBondedSequencers() ([]types.Sequencer, error) { var res *sequencertypes.QueryGetSequencersByRollappByStatusResponse req := &sequencertypes.QueryGetSequencersByRollappByStatusRequest{ RollappId: c.config.RollappID, Status: sequencertypes.Bonded, } + err := c.RunWithRetry(func() error { var err error res, err = c.sequencerQueryClient.SequencersByRollappByStatus(c.ctx, req) + if err == nil { + return nil + } + + if status.Code(err) == codes.NotFound { + return retry.Unrecoverable(errors.Join(gerrc.ErrNotFound, err)) + } return err }) if err != nil { @@ -340,7 +396,7 @@ func (c *Client) GetSequencers() ([]*types.Sequencer, error) { return nil, fmt.Errorf("empty response: %w", gerrc.ErrUnknown) } - sequencersList := make([]*types.Sequencer, 0, len(res.Sequencers)) + var sequencerList []types.Sequencer for _, sequencer := range res.Sequencers { var pubKey cryptotypes.PubKey err := c.protoCodec.UnpackAny(sequencer.DymintPubKey, &pubKey) @@ -348,18 +404,59 @@ func (c *Client) GetSequencers() ([]*types.Sequencer, error) { return nil, err } - status := types.Inactive - if sequencer.Proposer { - status = types.Proposer + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(pubKey) + if err != nil { + return nil, err } + sequencerList = append(sequencerList, *types.NewSequencer(tmPubKey, sequencer.Address)) + } - sequencersList = append(sequencersList, &types.Sequencer{ - PublicKey: pubKey, - Status: status, - }) + return sequencerList, nil +} + +// CheckRotationInProgress implements settlement.ClientI. +func (c *Client) CheckRotationInProgress() (*types.Sequencer, error) { + var ( + nextAddr string + found bool + ) + err := c.RunWithRetry(func() error { + req := &sequencertypes.QueryGetNextProposerByRollappRequest{ + RollappId: c.config.RollappID, + } + res, err := c.sequencerQueryClient.GetNextProposerByRollapp(c.ctx, req) + if err == nil && res.RotationInProgress { + nextAddr = res.NextProposerAddr + found = true + return nil + } + if status.Code(err) == codes.NotFound { + return nil + } + return err + }) + if err != nil { + return nil, err + } + if !found { + return nil, nil + } + if nextAddr == "" { + return &types.Sequencer{}, nil + } + + seqs, err := c.GetBondedSequencers() + if err != nil { + return nil, fmt.Errorf("get sequencers: %w", err) } - c.sequencerList = sequencersList - return sequencersList, nil + + for _, sequencer := range seqs { + if sequencer.SettlementAddress == nextAddr { + return &sequencer, nil + } + } + + return nil, fmt.Errorf("next proposer not found in bonded set: %w", gerrc.ErrInternal) } func (c *Client) broadcastBatch(msgUpdateState *rollapptypes.MsgUpdateState) error { @@ -373,39 +470,10 @@ func (c *Client) broadcastBatch(msgUpdateState *rollapptypes.MsgUpdateState) err if txResp.Code != 0 { return fmt.Errorf("broadcast tx status code is not 0: %w", gerrc.ErrUnknown) } - return nil -} -func (c *Client) eventHandler() { - // TODO(omritoptix): eventsChannel should be a generic channel which is later filtered by the event type. - subscriber := fmt.Sprintf("dymension-client-%s", uuid.New().String()) - eventsChannel, err := c.cosmosClient.SubscribeToEvents(c.ctx, subscriber, fmt.Sprintf(eventStateUpdate, c.config.RollappID), 1000) - if err != nil { - panic("Error subscribing to events") - } - // TODO: add defer unsubscribeAll + c.logger.Info("Broadcasted batch", "txHash", txResp.TxHash) - for { - select { - case <-c.ctx.Done(): - return - case <-c.cosmosClient.EventListenerQuit(): - // TODO(omritoptix): Fallback to polling - panic("Settlement WS disconnected") - case event := <-eventsChannel: - // Assert value is in map and publish it to the event bus - data, ok := c.eventMap[event.Query] - if !ok { - c.logger.Debug("Ignoring event. Type not supported", "event", event) - continue - } - eventData, err := c.getEventData(data, event) - if err != nil { - panic(err) - } - uevent.MustPublish(c.ctx, c.pubsub, eventData, map[string][]string{settlement.EventTypeKey: {data}}) - } - } + return nil } func (c *Client) convertBatchToMsgUpdateState(batch *types.Batch, daResult *da.ResultSubmitBatch) (*rollapptypes.MsgUpdateState, error) { @@ -434,22 +502,29 @@ func (c *Client) convertBatchToMsgUpdateState(batch *types.Batch, daResult *da.R StartHeight: batch.StartHeight(), NumBlocks: batch.NumBlocks(), DAPath: daResult.SubmitMetaData.ToPath(), - Version: dymRollappVersion, BDs: rollapptypes.BlockDescriptors{BD: blockDescriptors}, + Last: batch.LastBatch, } return settlementBatch, nil } func getCosmosClientOptions(config *settlement.Config) []cosmosclient.Option { + var ( + gas string + gasAdjustment float64 = 1.0 + ) if config.GasLimit == 0 { - config.GasLimit = defaultGasLimit + gas = "auto" + gasAdjustment = 1.1 + } else { + gas = strconv.FormatUint(config.GasLimit, 10) } options := []cosmosclient.Option{ cosmosclient.WithAddressPrefix(addressPrefix), - cosmosclient.WithBroadcastMode(flags.BroadcastSync), cosmosclient.WithNodeAddress(config.NodeAddress), cosmosclient.WithFees(config.GasFees), - cosmosclient.WithGasLimit(config.GasLimit), + cosmosclient.WithGas(gas), + cosmosclient.WithGasAdjustment(gasAdjustment), cosmosclient.WithGasPrices(config.GasPrices), } if config.KeyringHomeDir != "" { @@ -461,14 +536,6 @@ func getCosmosClientOptions(config *settlement.Config) []cosmosclient.Option { return options } -func (c *Client) getEventData(eventType string, rawEventData ctypes.ResultEvent) (interface{}, error) { - switch eventType { - case settlement.EventNewBatchAccepted: - return convertToNewBatchEvent(rawEventData) - } - return nil, fmt.Errorf("event type %s not recognized", eventType) -} - // pollForBatchInclusion polls the hub for the inclusion of a batch with the given end height. func (c *Client) pollForBatchInclusion(batchEndHeight uint64) (bool, error) { latestBatch, err := c.GetLatestBatch() diff --git a/settlement/dymension/dymension_test.go b/settlement/dymension/dymension_test.go index bd7d783f4..dc97bdb09 100644 --- a/settlement/dymension/dymension_test.go +++ b/settlement/dymension/dymension_test.go @@ -13,7 +13,6 @@ import ( "github.com/tendermint/tendermint/libs/log" "github.com/cosmos/cosmos-sdk/crypto/keyring" - "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" "github.com/cosmos/cosmos-sdk/types" "github.com/ignite/cli/ignite/pkg/cosmosaccount" @@ -25,8 +24,6 @@ import ( coretypes "github.com/tendermint/tendermint/rpc/core/types" "github.com/dymensionxyz/cosmosclient/cosmosclient" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" - sequencertypes "github.com/dymensionxyz/dymension/v3/x/sequencer/types" "github.com/dymensionxyz/dymint/da" rollapptypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymension/v3/x/rollapp/types" sequencertypesmock "github.com/dymensionxyz/dymint/mocks/github.com/dymensionxyz/dymension/v3/x/sequencer/types" @@ -34,6 +31,8 @@ import ( "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/settlement/dymension" "github.com/dymensionxyz/dymint/testutil" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" + sequencertypes "github.com/dymensionxyz/dymint/third_party/dymension/sequencer/types" sdkcodectypes "github.com/cosmos/cosmos-sdk/codec/types" ) @@ -45,7 +44,7 @@ func TestGetSequencers(t *testing.T) { sequencerQueryClientMock := sequencertypesmock.NewMockQueryClient(t) count := 5 - sequencersRollappResponse, _ := generateSequencerByRollappResponse(t, count) + sequencersRollappResponse := generateSequencerByRollappResponse(t, count) sequencerQueryClientMock.On("SequencersByRollappByStatus", mock.Anything, mock.Anything).Return(sequencersRollappResponse, nil) cosmosClientMock.On("GetRollappClient").Return(rollapptypesmock.NewMockQueryClient(t)) @@ -63,7 +62,7 @@ func TestGetSequencers(t *testing.T) { err = hubClient.Init(settlement.Config{}, pubsubServer, log.TestingLogger(), options...) require.NoError(err) - sequencers, err := hubClient.GetSequencers() + sequencers, err := hubClient.GetBondedSequencers() require.NoError(err) require.Len(sequencers, count) } @@ -290,29 +289,20 @@ func TestPostBatch(t *testing.T) { /* Utils */ /* -------------------------------------------------------------------------- */ -func generateSequencerByRollappResponse(t *testing.T, count int) (*sequencertypes.QueryGetSequencersByRollappByStatusResponse, sequencertypes.Sequencer) { - // Generate the proposer sequencer - proposerPubKeyAny, err := sdkcodectypes.NewAnyWithValue(ed25519.GenPrivKey().PubKey()) - require.NoError(t, err) - proposer := sequencertypes.Sequencer{ - DymintPubKey: proposerPubKeyAny, - Status: sequencertypes.Bonded, - Proposer: true, - } - squencerInfoList := []sequencertypes.Sequencer{proposer} - // Generate the inactive sequencers - for i := 0; i < count-1; i++ { - nonProposerPubKeyAny, err := sdkcodectypes.NewAnyWithValue(secp256k1.GenPrivKey().PubKey()) +func generateSequencerByRollappResponse(t *testing.T, count int) *sequencertypes.QueryGetSequencersByRollappByStatusResponse { + sequencerInfoList := []sequencertypes.Sequencer{} + for i := 0; i < count; i++ { + pk, err := sdkcodectypes.NewAnyWithValue(secp256k1.GenPrivKey().PubKey()) require.NoError(t, err) - nonProposer := sequencertypes.Sequencer{ - DymintPubKey: nonProposerPubKeyAny, + seq := sequencertypes.Sequencer{ + DymintPubKey: pk, Status: sequencertypes.Bonded, } - squencerInfoList = append(squencerInfoList, nonProposer) + sequencerInfoList = append(sequencerInfoList, seq) } response := &sequencertypes.QueryGetSequencersByRollappByStatusResponse{ - Sequencers: squencerInfoList, + Sequencers: sequencerInfoList, } - return response, proposer + return response } diff --git a/settlement/dymension/events.go b/settlement/dymension/events.go new file mode 100644 index 000000000..ed43e9dfc --- /dev/null +++ b/settlement/dymension/events.go @@ -0,0 +1,162 @@ +package dymension + +import ( + "errors" + "fmt" + "strconv" + + "github.com/dymensionxyz/dymint/settlement" + uevent "github.com/dymensionxyz/dymint/utils/event" + + "github.com/google/uuid" + ctypes "github.com/tendermint/tendermint/rpc/core/types" +) + +// TODO: use types and attributes from dymension proto +const ( + eventStateUpdateFmt = "state_update.rollapp_id='%s' AND state_update.status='PENDING'" + eventSequencersListUpdateFmt = "create_sequencer.rollapp_id='%s'" + eventRotationStartedFmt = "proposer_rotation_started.rollapp_id='%s'" +) + +func (c *Client) getEventData(eventType string, rawEventData ctypes.ResultEvent) (interface{}, error) { + switch eventType { + case settlement.EventNewBatchAccepted: + return convertToNewBatchEvent(rawEventData) + case settlement.EventNewBondedSequencer: + return convertToNewSequencerEvent(rawEventData) + case settlement.EventRotationStarted: + return convertToRotationStartedEvent(rawEventData) + } + return nil, fmt.Errorf("unrecognized event type: %s", eventType) +} + +func (c *Client) eventHandler() { + subscriber := fmt.Sprintf("dymension-client-%s", uuid.New().String()) + + eventStateUpdateQ := fmt.Sprintf(eventStateUpdateFmt, c.config.RollappID) + eventSequencersListQ := fmt.Sprintf(eventSequencersListUpdateFmt, c.config.RollappID) + eventRotationStartedQ := fmt.Sprintf(eventRotationStartedFmt, c.config.RollappID) + + // TODO: add validation callback for the event data + eventMap := map[string]string{ + eventStateUpdateQ: settlement.EventNewBatchAccepted, + eventSequencersListQ: settlement.EventNewBondedSequencer, + eventRotationStartedQ: settlement.EventRotationStarted, + } + + stateUpdatesC, err := c.cosmosClient.SubscribeToEvents(c.ctx, subscriber, eventStateUpdateQ, 1000) + if err != nil { + panic(fmt.Errorf("subscribe to events (%s): %w", eventStateUpdateQ, err)) + } + sequencersListC, err := c.cosmosClient.SubscribeToEvents(c.ctx, subscriber, eventSequencersListQ, 1000) + if err != nil { + panic(fmt.Errorf("subscribe to events (%s): %w", eventSequencersListQ, err)) + } + rotationStartedC, err := c.cosmosClient.SubscribeToEvents(c.ctx, subscriber, eventRotationStartedQ, 1000) + if err != nil { + panic(fmt.Errorf("subscribe to events (%s): %w", eventRotationStartedQ, err)) + } + + defer c.cosmosClient.UnsubscribeAll(c.ctx, subscriber) //nolint:errcheck + + for { + var e ctypes.ResultEvent + select { + case <-c.ctx.Done(): + return + case <-c.cosmosClient.EventListenerQuit(): + // TODO(omritoptix): Fallback to polling + return + case e = <-stateUpdatesC: + case e = <-sequencersListC: + case e = <-rotationStartedC: + } + c.handleReceivedEvent(e, eventMap) + } +} + +func (c *Client) handleReceivedEvent(event ctypes.ResultEvent, eventMap map[string]string) { + // Assert value is in map and publish it to the event bus + internalType, ok := eventMap[event.Query] + if !ok { + c.logger.Error("Ignoring event. Type not supported.", "event", event) + return + } + eventData, err := c.getEventData(internalType, event) + if err != nil { + c.logger.Error("Converting event data.", "event", event, "error", err) + return + } + + c.logger.Debug("Publishing internal event.", "event", internalType, "data", eventData) + + uevent.MustPublish(c.ctx, c.pubsub, eventData, map[string][]string{settlement.EventTypeKey: {internalType}}) +} + +func convertToNewBatchEvent(rawEventData ctypes.ResultEvent) (*settlement.EventDataNewBatchAccepted, error) { + var errs []error + // check all expected attributes exists + events := rawEventData.Events + if events["state_update.num_blocks"] == nil || events["state_update.start_height"] == nil || events["state_update.state_info_index"] == nil { + return nil, fmt.Errorf("missing expected attributes in event") + } + + numBlocks, err := strconv.ParseInt(rawEventData.Events["state_update.num_blocks"][0], 10, 64) + if err != nil { + errs = append(errs, err) + } + startHeight, err := strconv.ParseInt(rawEventData.Events["state_update.start_height"][0], 10, 64) + if err != nil { + errs = append(errs, err) + } + stateIndex, err := strconv.ParseInt(rawEventData.Events["state_update.state_info_index"][0], 10, 64) + if err != nil { + errs = append(errs, err) + } + if len(errs) > 0 { + return nil, errors.Join(errs...) + } + endHeight := uint64(startHeight + numBlocks - 1) + NewBatchEvent := &settlement.EventDataNewBatchAccepted{ + EndHeight: endHeight, + StateIndex: uint64(stateIndex), + } + return NewBatchEvent, nil +} + +func convertToNewSequencerEvent(rawEventData ctypes.ResultEvent) (*settlement.EventDataNewBondedSequencer, error) { + // check all expected attributes exists + events := rawEventData.Events + if events["create_sequencer.rollapp_id"] == nil { + return nil, fmt.Errorf("missing expected attributes in event") + } + // TODO: validate rollappID + + if events["create_sequencer.sequencer"] == nil { + return nil, fmt.Errorf("missing expected attributes in event") + } + + return &settlement.EventDataNewBondedSequencer{ + SeqAddr: events["create_sequencer.sequencer"][0], + }, nil +} + +func convertToRotationStartedEvent(rawEventData ctypes.ResultEvent) (*settlement.EventDataRotationStarted, error) { + // check all expected attributes exists + events := rawEventData.Events + if events["proposer_rotation_started.rollapp_id"] == nil { + return nil, fmt.Errorf("missing expected attributes in event") + } + + // TODO: validate rollappID + + if events["proposer_rotation_started.next_proposer"] == nil { + return nil, fmt.Errorf("missing expected attributes in event") + } + nextProposer := events["proposer_rotation_started.next_proposer"][0] + rotationStartedEvent := &settlement.EventDataRotationStarted{ + NextSeqAddr: nextProposer, + } + return rotationStartedEvent, nil +} diff --git a/settlement/dymension/utils.go b/settlement/dymension/utils.go index 950ee01b6..89bf9c6da 100644 --- a/settlement/dymension/utils.go +++ b/settlement/dymension/utils.go @@ -1,15 +1,10 @@ package dymension import ( - "fmt" - "strconv" - "github.com/avast/retry-go/v4" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" - "github.com/hashicorp/go-multierror" - ctypes "github.com/tendermint/tendermint/rpc/core/types" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" ) // RunWithRetry runs the given operation with retry, doing a number of attempts, and taking the last @@ -43,6 +38,7 @@ func convertStateInfoToResultRetrieveBatch(stateInfo *rollapptypes.StateInfo) (* return nil, err } batchResult := &settlement.Batch{ + Sequencer: stateInfo.Sequencer, StartHeight: stateInfo.StartHeight, EndHeight: stateInfo.StartHeight + stateInfo.NumBlocks - 1, MetaData: &settlement.BatchMetaData{ @@ -54,29 +50,3 @@ func convertStateInfoToResultRetrieveBatch(stateInfo *rollapptypes.StateInfo) (* Batch: batchResult, }, nil } - -func convertToNewBatchEvent(rawEventData ctypes.ResultEvent) (*settlement.EventDataNewBatchAccepted, error) { - // check all expected attributes exists - events := rawEventData.Events - if events["state_update.num_blocks"] == nil || events["state_update.start_height"] == nil || events["state_update.state_info_index"] == nil { - return nil, fmt.Errorf("missing expected attributes in event") - } - - var multiErr *multierror.Error - numBlocks, err := strconv.ParseInt(rawEventData.Events["state_update.num_blocks"][0], 10, 64) - multiErr = multierror.Append(multiErr, err) - startHeight, err := strconv.ParseInt(rawEventData.Events["state_update.start_height"][0], 10, 64) - multiErr = multierror.Append(multiErr, err) - stateIndex, err := strconv.ParseInt(rawEventData.Events["state_update.state_info_index"][0], 10, 64) - multiErr = multierror.Append(multiErr, err) - err = multiErr.ErrorOrNil() - if err != nil { - return nil, multiErr - } - endHeight := uint64(startHeight + numBlocks - 1) - NewBatchEvent := &settlement.EventDataNewBatchAccepted{ - EndHeight: endHeight, - StateIndex: uint64(stateIndex), - } - return NewBatchEvent, nil -} diff --git a/settlement/events.go b/settlement/events.go index 41447184e..f5e31f8ef 100644 --- a/settlement/events.go +++ b/settlement/events.go @@ -3,28 +3,32 @@ package settlement import ( "fmt" - "github.com/dymensionxyz/dymint/types" uevent "github.com/dymensionxyz/dymint/utils/event" ) -// Type keys - const ( // EventTypeKey is a reserved composite key for event name. EventTypeKey = "settlement.event" -) - -// Types -const ( - // EventNewBatchAccepted should be emitted internally in order to communicate between the settlement layer and the hub client - EventNewBatchAccepted = "EventNewBatchAccepted" - EventSequencersListUpdated = "SequencersListUpdated" + // Event types + EventNewBatchAccepted = "NewBatchAccepted" + EventNewBondedSequencer = "NewBondedSequencer" + EventRotationStarted = "RotationStarted" ) // Convenience objects +var ( + EventNewBatchAcceptedList = map[string][]string{EventTypeKey: {EventNewBatchAccepted}} + EventNewBondedSequencerList = map[string][]string{EventTypeKey: {EventNewBondedSequencer}} + EventRotationStartedList = map[string][]string{EventTypeKey: {EventRotationStarted}} +) -var EventNewBatchAcceptedList = map[string][]string{EventTypeKey: {EventNewBatchAccepted}} +// Queries +var ( + EventQueryNewSettlementBatchAccepted = uevent.QueryFor(EventTypeKey, EventNewBatchAccepted) + EventQueryNewBondedSequencer = uevent.QueryFor(EventTypeKey, EventNewBondedSequencer) + EventQueryRotationStarted = uevent.QueryFor(EventTypeKey, EventRotationStarted) +) // Data @@ -39,12 +43,18 @@ func (e EventDataNewBatchAccepted) String() string { return fmt.Sprintf("EndHeight: %d, StateIndex: %d", e.EndHeight, e.StateIndex) } -type EventDataSequencersListUpdated struct { - // Sequencers is the list of new sequencers - Sequencers []types.Sequencer +type EventDataNewBondedSequencer struct { + SeqAddr string } -// Queries -var ( - EventQueryNewSettlementBatchAccepted = uevent.QueryFor(EventTypeKey, EventNewBatchAccepted) -) +func (e EventDataNewBondedSequencer) String() string { + return fmt.Sprintf("SeqAddr: %s", e.SeqAddr) +} + +type EventDataRotationStarted struct { + NextSeqAddr string +} + +func (e EventDataRotationStarted) String() string { + return fmt.Sprintf("NextSeqAddr: %s", e.NextSeqAddr) +} diff --git a/settlement/grpc/grpc.go b/settlement/grpc/grpc.go index 3b1005ed8..4671c4fdf 100644 --- a/settlement/grpc/grpc.go +++ b/settlement/grpc/grpc.go @@ -11,6 +11,7 @@ import ( "sync/atomic" "time" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/libp2p/go-libp2p/core/crypto" tmp2p "github.com/tendermint/tendermint/p2p" @@ -19,9 +20,9 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" "github.com/dymensionxyz/dymint/types" "github.com/tendermint/tendermint/libs/pubsub" @@ -221,15 +222,27 @@ func (c *Client) GetProposer() *types.Sequencer { return nil } var pubKey cryptotypes.PubKey = &ed25519.PubKey{Key: pubKeyBytes} - return &types.Sequencer{ - PublicKey: pubKey, - Status: types.Proposer, + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(pubKey) + if err != nil { + c.logger.Error("Error converting to tendermint pubkey", "err", err) + return nil } + return types.NewSequencer(tmPubKey, pubKey.Address().String()) +} + +// GetAllSequencers implements settlement.ClientI. +func (c *Client) GetAllSequencers() ([]types.Sequencer, error) { + return c.GetBondedSequencers() +} + +// GetBondedSequencers implements settlement.ClientI. +func (c *Client) GetBondedSequencers() ([]types.Sequencer, error) { + return []types.Sequencer{*c.GetProposer()}, nil } -// GetSequencers implements settlement.ClientI. -func (c *Client) GetSequencers() ([]*types.Sequencer, error) { - return []*types.Sequencer{c.GetProposer()}, nil +// CheckRotationInProgress implements settlement.ClientI. +func (c *Client) CheckRotationInProgress() (*types.Sequencer, error) { + return nil, nil } func (c *Client) saveBatch(batch *settlement.Batch) error { @@ -263,6 +276,7 @@ func (c *Client) saveBatch(batch *settlement.Batch) error { func (c *Client) convertBatchtoSettlementBatch(batch *types.Batch, daResult *da.ResultSubmitBatch) *settlement.Batch { settlementBatch := &settlement.Batch{ + Sequencer: c.GetProposer().SettlementAddress, StartHeight: batch.StartHeight(), EndHeight: batch.EndHeight(), MetaData: &settlement.BatchMetaData{ diff --git a/settlement/local/local.go b/settlement/local/local.go index cff6c21ba..ffee2b25f 100644 --- a/settlement/local/local.go +++ b/settlement/local/local.go @@ -12,16 +12,18 @@ import ( "sync" "time" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/dymensionxyz/gerr-cosmos/gerrc" "github.com/libp2p/go-libp2p/core/crypto" tmp2p "github.com/tendermint/tendermint/p2p" "github.com/cosmos/cosmos-sdk/crypto/keys/ed25519" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" - rollapptypes "github.com/dymensionxyz/dymension/v3/x/rollapp/types" "github.com/dymensionxyz/dymint/da" "github.com/dymensionxyz/dymint/settlement" "github.com/dymensionxyz/dymint/store" + rollapptypes "github.com/dymensionxyz/dymint/third_party/dymension/rollapp/types" "github.com/dymensionxyz/dymint/types" uevent "github.com/dymensionxyz/dymint/utils/event" @@ -134,7 +136,7 @@ func (c *Client) Stop() error { // PostBatch saves the batch to the kv store func (c *Client) SubmitBatch(batch *types.Batch, daClient da.Client, daResult *da.ResultSubmitBatch) error { - settlementBatch := convertBatchToSettlementBatch(batch, daResult) + settlementBatch := c.convertBatchToSettlementBatch(batch, daResult) err := c.saveBatch(settlementBatch) if err != nil { return err @@ -198,15 +200,27 @@ func (c *Client) GetProposer() *types.Sequencer { return nil } var pubKey cryptotypes.PubKey = &ed25519.PubKey{Key: pubKeyBytes} - return &types.Sequencer{ - PublicKey: pubKey, - Status: types.Proposer, + tmPubKey, err := cryptocodec.ToTmPubKeyInterface(pubKey) + if err != nil { + c.logger.Error("Error converting to tendermint pubkey", "err", err) + return nil } + return types.NewSequencer(tmPubKey, pubKey.Address().String()) +} + +// GetAllSequencers implements settlement.ClientI. +func (c *Client) GetAllSequencers() ([]types.Sequencer, error) { + return c.GetBondedSequencers() +} + +// GetBondedSequencers implements settlement.ClientI. +func (c *Client) GetBondedSequencers() ([]types.Sequencer, error) { + return []types.Sequencer{*c.GetProposer()}, nil } -// GetSequencers implements settlement.ClientI. -func (c *Client) GetSequencers() ([]*types.Sequencer, error) { - return []*types.Sequencer{c.GetProposer()}, nil +// CheckRotationInProgress implements settlement.ClientI. +func (c *Client) CheckRotationInProgress() (*types.Sequencer, error) { + return nil, nil } func (c *Client) saveBatch(batch *settlement.Batch) error { @@ -254,8 +268,9 @@ func (c *Client) retrieveBatchAtStateIndex(slStateIndex uint64) (*settlement.Res return &batchResult, nil } -func convertBatchToSettlementBatch(batch *types.Batch, daResult *da.ResultSubmitBatch) *settlement.Batch { +func (c *Client) convertBatchToSettlementBatch(batch *types.Batch, daResult *da.ResultSubmitBatch) *settlement.Batch { settlementBatch := &settlement.Batch{ + Sequencer: c.GetProposer().SettlementAddress, StartHeight: batch.StartHeight(), EndHeight: batch.EndHeight(), MetaData: &settlement.BatchMetaData{ diff --git a/settlement/local/local_test.go b/settlement/local/local_test.go index 956416975..f7777bd04 100644 --- a/settlement/local/local_test.go +++ b/settlement/local/local_test.go @@ -31,14 +31,14 @@ func TestGetSequencers(t *testing.T) { err = sllayer.Init(cfg, nil, log.TestingLogger()) require.NoError(err) - sequencers, err := sllayer.GetSequencers() + sequencers, err := sllayer.GetBondedSequencers() require.NoError(err) assert.Equal(1, len(sequencers)) - assert.Equal(pubKeybytes, sequencers[0].PublicKey.Bytes()) + assert.Equal(pubKeybytes, sequencers[0].PubKey().Bytes()) proposer := sllayer.GetProposer() require.NotNil(proposer) - assert.Equal(pubKeybytes, proposer.PublicKey.Bytes()) + assert.Equal(pubKeybytes, proposer.PubKey().Bytes()) } func TestSubmitBatch(t *testing.T) { diff --git a/settlement/settlement.go b/settlement/settlement.go index 99e629be0..5cc6b3112 100644 --- a/settlement/settlement.go +++ b/settlement/settlement.go @@ -32,6 +32,8 @@ type BatchMetaData struct { } type Batch struct { + // sequencer is the bech32-encoded address of the sequencer sent the update + Sequencer string StartHeight uint64 EndHeight uint64 AppHashes [][32]byte @@ -72,10 +74,16 @@ type ClientI interface { // GetBatchAtIndex returns the batch at the given index. GetBatchAtIndex(index uint64) (*ResultRetrieveBatch, error) - // GetSequencers returns the list of the sequencers for this chain. - GetSequencers() ([]*types.Sequencer, error) + // GetAllSequencers returns all sequencers for this rollapp (bonded and not bonded). + GetAllSequencers() ([]types.Sequencer, error) + // GetBondedSequencers returns the list of the bonded sequencers for this rollapp. + GetBondedSequencers() ([]types.Sequencer, error) // GetProposer returns the current proposer for this chain. GetProposer() *types.Sequencer + // CheckRotationInProgress returns the next proposer for this chain in case of a rotation. + // If no rotation is in progress, it should return nil. + CheckRotationInProgress() (*types.Sequencer, error) + GetHeightState(uint64) (*ResultGetHeightState, error) } diff --git a/store/pruning.go b/store/pruning.go index 6b3950c43..45ab0e208 100644 --- a/store/pruning.go +++ b/store/pruning.go @@ -45,7 +45,7 @@ func (s *DefaultStore) PruneBlocks(from, to uint64) (uint64, error) { if err := batch.Delete(getResponsesKey(h)); err != nil { return 0, err } - if err := batch.Delete(getValidatorsKey(h)); err != nil { + if err := batch.Delete(getSequencersKey(h)); err != nil { return 0, err } if err := batch.Delete(getCidKey(h)); err != nil { diff --git a/store/pruning_test.go b/store/pruning_test.go index 3a75cb508..f814989af 100644 --- a/store/pruning_test.go +++ b/store/pruning_test.go @@ -83,7 +83,7 @@ func TestStorePruning(t *testing.T) { } // And then feed it some data - //expectedCid, err := pref.Sum(block) + // expectedCid, err := pref.Sum(block) // Validate all blocks are saved for k := range savedHeights { _, err := bstore.LoadBlock(k) diff --git a/store/store.go b/store/store.go index 3e09671e5..1ab464dab 100644 --- a/store/store.go +++ b/store/store.go @@ -21,7 +21,7 @@ var ( commitPrefix = [1]byte{3} statePrefix = [1]byte{4} responsesPrefix = [1]byte{5} - validatorsPrefix = [1]byte{6} + sequencersPrefix = [1]byte{6} cidPrefix = [1]byte{7} ) @@ -116,7 +116,7 @@ func (s *DefaultStore) LoadBlockByHash(hash [32]byte) (*types.Block, error) { return block, nil } -// SaveBlockResponses saves block responses (events, tx responses, validator set updates, etc) in Store. +// SaveBlockResponses saves block responses (events, tx responses, etc) in Store. func (s *DefaultStore) SaveBlockResponses(height uint64, responses *tmstate.ABCIResponses, batch KVBatch) (KVBatch, error) { data, err := responses.Marshal() if err != nil { @@ -206,37 +206,61 @@ func (s *DefaultStore) LoadState() (*types.State, error) { return &state, nil } -// SaveValidators stores validator set for given block height in store. -func (s *DefaultStore) SaveValidators(height uint64, validatorSet *tmtypes.ValidatorSet, batch KVBatch) (KVBatch, error) { - pbValSet, err := validatorSet.ToProto() +// SaveSequencers stores sequencerSet for given block height in store. +func (s *DefaultStore) SaveSequencers(height uint64, sequencerSet *types.SequencerSet, batch KVBatch) (KVBatch, error) { + pbValSet, err := sequencerSet.ToProto() if err != nil { - return batch, fmt.Errorf("marshal ValidatorSet to protobuf: %w", err) + return batch, fmt.Errorf("marshal sequencerSet to protobuf: %w", err) } blob, err := pbValSet.Marshal() if err != nil { - return batch, fmt.Errorf("marshal ValidatorSet: %w", err) + return batch, fmt.Errorf("marshal sequencerSet: %w", err) } if batch == nil { - return nil, s.db.Set(getValidatorsKey(height), blob) + return nil, s.db.Set(getSequencersKey(height), blob) } - err = batch.Set(getValidatorsKey(height), blob) + err = batch.Set(getSequencersKey(height), blob) return batch, err } -// LoadValidators loads validator set at given block height from store. -func (s *DefaultStore) LoadValidators(height uint64) (*tmtypes.ValidatorSet, error) { - blob, err := s.db.Get(getValidatorsKey(height)) +// LoadSequencers loads sequencer set at given block height from store. +func (s *DefaultStore) LoadSequencers(height uint64) (*types.SequencerSet, error) { + blob, err := s.db.Get(getSequencersKey(height)) if err != nil { - return nil, fmt.Errorf("load Validators for height %v: %w", height, err) + return nil, fmt.Errorf("load sequencers for height %v: %w", height, err) } - var pbValSet tmproto.ValidatorSet + var pbValSet pb.SequencerSet err = pbValSet.Unmarshal(blob) if err != nil { - return nil, fmt.Errorf("unmarshal to protobuf: %w", err) + // migration support: try to unmarshal as old ValidatorSet + return parseAsValidatorSet(blob) } - return tmtypes.ValidatorSetFromProto(&pbValSet) + var ss types.SequencerSet + err = ss.FromProto(pbValSet) + if err != nil { + return nil, fmt.Errorf("unmarshal from proto: %w", err) + } + + return &ss, nil +} + +func parseAsValidatorSet(blob []byte) (*types.SequencerSet, error) { + var ( + ss types.SequencerSet + pbValSetOld tmproto.ValidatorSet + ) + err := pbValSetOld.Unmarshal(blob) + if err != nil { + return nil, fmt.Errorf("unmarshal protobuf: %w", err) + } + pbValSet, err := tmtypes.ValidatorSetFromProto(&pbValSetOld) + if err != nil { + return nil, fmt.Errorf("unmarshal to ValidatorSet: %w", err) + } + ss.LoadFromValSet(pbValSet) + return &ss, nil } func (s *DefaultStore) loadHashFromIndex(height uint64) ([32]byte, error) { @@ -297,10 +321,10 @@ func getResponsesKey(height uint64) []byte { return append(responsesPrefix[:], buf[:]...) } -func getValidatorsKey(height uint64) []byte { +func getSequencersKey(height uint64) []byte { buf := make([]byte, 8) binary.BigEndian.PutUint64(buf, height) - return append(validatorsPrefix[:], buf[:]...) + return append(sequencersPrefix[:], buf[:]...) } func getCidKey(height uint64) []byte { diff --git a/store/storeIface.go b/store/storeIface.go index 503151d1a..9013a5242 100644 --- a/store/storeIface.go +++ b/store/storeIface.go @@ -4,7 +4,6 @@ import ( "github.com/dymensionxyz/dymint/types" "github.com/ipfs/go-cid" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" - tmtypes "github.com/tendermint/tendermint/types" ) // KV encapsulates key-value store abstraction, in minimalistic interface. @@ -68,9 +67,9 @@ type Store interface { // LoadState returns last state saved with UpdateState. LoadState() (*types.State, error) - SaveValidators(height uint64, validatorSet *tmtypes.ValidatorSet, batch KVBatch) (KVBatch, error) + SaveSequencers(height uint64, seqSet *types.SequencerSet, batch KVBatch) (KVBatch, error) - LoadValidators(height uint64) (*tmtypes.ValidatorSet, error) + LoadSequencers(height uint64) (*types.SequencerSet, error) PruneBlocks(from, to uint64) (uint64, error) diff --git a/store/store_test.go b/store/store_test.go index 26db3190a..f7afb7746 100644 --- a/store/store_test.go +++ b/store/store_test.go @@ -92,15 +92,14 @@ func TestLoadState(t *testing.T) { assert := assert.New(t) - validatorSet := testutil.GetRandomValidatorSet() + validatorSet := testutil.GenerateRandomValidatorSet() kv := store.NewDefaultInMemoryKVStore() s1 := store.New(kv) expectedHeight := uint64(10) - s := &types.State{ - NextValidators: validatorSet, - Validators: validatorSet, - } + s := &types.State{} + s.Sequencers.LoadFromValSet(validatorSet) + s.SetHeight(expectedHeight) _, err := s1.SaveState(s, nil) assert.NoError(err) @@ -245,7 +244,7 @@ func TestBlockId(t *testing.T) { // commit batch.Commit() - //retrieve cid for height 2 + // retrieve cid for height 2 resultCid, err = s.LoadBlockCid(2) require.NoError(err) require.Equal(expectedCid, resultCid) diff --git a/testutil/block.go b/testutil/block.go index aa2941aa2..b74e82edf 100644 --- a/testutil/block.go +++ b/testutil/block.go @@ -12,6 +12,7 @@ import ( "github.com/ipfs/go-datastore" "github.com/libp2p/go-libp2p/core/crypto" + "github.com/tendermint/tendermint/crypto/ed25519" "github.com/tendermint/tendermint/libs/log" "github.com/tendermint/tendermint/libs/pubsub" "github.com/tendermint/tendermint/proxy" @@ -38,7 +39,10 @@ func GetManagerWithProposerKey(conf config.BlockManagerConfig, proposerKey crypt genesis := GenerateGenesis(genesisHeight) // Change the LastBlockHeight to avoid calling InitChainSync within the manager // And updating the state according to the genesis. - state := GenerateState(storeInitialHeight, storeLastBlockHeight) + raw, _ := proposerKey.GetPublic().Raw() + pubkey := ed25519.PubKey(raw) + + state := GenerateStateWithSequencer(storeInitialHeight, storeLastBlockHeight, pubkey) var managerStore store.Store if mockStore == nil { managerStore = store.New(store.NewDefaultInMemoryKVStore()) @@ -100,19 +104,22 @@ func GetManagerWithProposerKey(conf config.BlockManagerConfig, proposerKey crypt if err != nil { return nil, err } - p2pValidator := p2p.NewValidator(logger, settlementlc) - p2pClient.SetTxValidator(p2pValidator.TxValidator(mp, mpIDs)) - p2pClient.SetBlockValidator(p2pValidator.BlockValidator()) - - if err = p2pClient.Start(context.Background()); err != nil { - return nil, err - } manager, err := block.NewManager(proposerKey, conf, genesis, managerStore, mp, proxyApp, dalc, settlementlc, nil, pubsubServer, p2pClient, logger) if err != nil { return nil, err } + + p2pValidator := p2p.NewValidator(logger, manager) + p2pClient.SetTxValidator(p2pValidator.TxValidator(mp, mpIDs)) + p2pClient.SetBlockValidator(p2pValidator.BlockValidator()) + + manager.P2PClient = p2pClient + + if err = p2pClient.Start(context.Background()); err != nil { + return nil, err + } return manager, nil } diff --git a/testutil/types.go b/testutil/types.go index 09cee1bb6..40e1bf4fd 100644 --- a/testutil/types.go +++ b/testutil/types.go @@ -8,6 +8,7 @@ import ( "github.com/dymensionxyz/dymint/types" "github.com/libp2p/go-libp2p/core/crypto" abci "github.com/tendermint/tendermint/abci/types" + tmcrypto "github.com/tendermint/tendermint/crypto" "github.com/tendermint/tendermint/crypto/ed25519" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" @@ -48,7 +49,7 @@ func GetRandomBytes(n uint64) []byte { } // generateBlock generates random blocks. -func generateBlock(height uint64) *types.Block { +func generateBlock(height uint64, proposerHash []byte) *types.Block { h := createRandomHashes() block := &types.Block{ Header: types.Header{ @@ -56,17 +57,17 @@ func generateBlock(height uint64) *types.Block { Block: BlockVersion, App: AppVersion, }, - Height: height, - Time: 4567, - LastHeaderHash: h[0], - LastCommitHash: h[1], - DataHash: h[2], - ConsensusHash: h[3], - // AppHash: h[4], - AppHash: [32]byte{}, - LastResultsHash: GetEmptyLastResultsHash(), - ProposerAddress: []byte{4, 3, 2, 1}, - SequencersHash: h[6], + Height: height, + Time: 4567, + LastHeaderHash: h[0], + LastCommitHash: h[1], + DataHash: h[2], + ConsensusHash: h[3], + AppHash: [32]byte{}, + LastResultsHash: GetEmptyLastResultsHash(), + ProposerAddress: []byte{4, 3, 2, 1}, + SequencerHash: [32]byte(proposerHash), + NextSequencersHash: [32]byte(proposerHash), }, Data: types.Data{ Txs: nil, @@ -84,10 +85,14 @@ func generateBlock(height uint64) *types.Block { } func GenerateBlocksWithTxs(startHeight uint64, num uint64, proposerKey crypto.PrivKey, nTxs int) ([]*types.Block, error) { + r, _ := proposerKey.Raw() + seq := types.NewSequencerFromValidator(*tmtypes.NewValidator(ed25519.PrivKey(r).PubKey(), 1)) + proposerHash := seq.Hash() + blocks := make([]*types.Block, num) for i := uint64(0); i < num; i++ { - block := generateBlock(i + startHeight) + block := generateBlock(i+startHeight, proposerHash) block.Data = types.Data{ Txs: make(types.Txs, nTxs), @@ -113,9 +118,17 @@ func GenerateBlocksWithTxs(startHeight uint64, num uint64, proposerKey crypto.Pr // GenerateBlocks generates random blocks. func GenerateBlocks(startHeight uint64, num uint64, proposerKey crypto.PrivKey) ([]*types.Block, error) { + r, _ := proposerKey.Raw() + seq := types.NewSequencerFromValidator(*tmtypes.NewValidator(ed25519.PrivKey(r).PubKey(), 1)) + proposerHash := seq.Hash() + blocks := make([]*types.Block, num) for i := uint64(0); i < num; i++ { - block := generateBlock(i + startHeight) + block := generateBlock(i+startHeight, proposerHash) + copy(block.Header.DataHash[:], types.GetDataHash(block)) + if i > 0 { + copy(block.Header.LastCommitHash[:], types.GetLastCommitHash(&blocks[i-1].LastCommit, &block.Header)) + } signature, err := generateSignature(proposerKey, &block.Header) if err != nil { @@ -202,17 +215,13 @@ func MustGenerateBatchAndKey(startHeight uint64, endHeight uint64) *types.Batch // GenerateRandomValidatorSet generates random validator sets func GenerateRandomValidatorSet() *tmtypes.ValidatorSet { - pubKey := ed25519.GenPrivKey().PubKey() - return &tmtypes.ValidatorSet{ - Proposer: &tmtypes.Validator{PubKey: pubKey, Address: pubKey.Address()}, - Validators: []*tmtypes.Validator{ - {PubKey: pubKey, Address: pubKey.Address()}, - }, - } + return tmtypes.NewValidatorSet([]*tmtypes.Validator{ + tmtypes.NewValidator(ed25519.GenPrivKey().PubKey(), 1), + }) } -// GenerateState generates an initial state for testing. -func GenerateState(initialHeight int64, lastBlockHeight int64) *types.State { +// GenerateStateWithSequencer generates an initial state for testing. +func GenerateStateWithSequencer(initialHeight int64, lastBlockHeight int64, pubkey tmcrypto.PubKey) *types.State { s := &types.State{ ChainID: "test-chain", InitialHeight: uint64(initialHeight), @@ -225,9 +234,8 @@ func GenerateState(initialHeight int64, lastBlockHeight int64) *types.State { App: AppVersion, }, }, - Validators: GenerateRandomValidatorSet(), - NextValidators: GenerateRandomValidatorSet(), } + s.Sequencers.SetProposer(types.NewSequencer(pubkey, "")) s.SetHeight(uint64(lastBlockHeight)) return s } @@ -282,13 +290,3 @@ func GetRandomBlock(height uint64, nTxs int) *types.Block { return block } - -func GetRandomValidatorSet() *tmtypes.ValidatorSet { - pubKey := ed25519.GenPrivKey().PubKey() - return &tmtypes.ValidatorSet{ - Proposer: &tmtypes.Validator{PubKey: pubKey, Address: pubKey.Address()}, - Validators: []*tmtypes.Validator{ - {PubKey: pubKey, Address: pubKey.Address()}, - }, - } -} diff --git a/third_party/dymension/rollapp/types/block_descriptor.pb.go b/third_party/dymension/rollapp/types/block_descriptor.pb.go new file mode 100644 index 000000000..085d88421 --- /dev/null +++ b/third_party/dymension/rollapp/types/block_descriptor.pb.go @@ -0,0 +1,545 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/block_descriptor.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// BlockDescriptor defines a single rollapp chain block description. +type BlockDescriptor struct { + // height is the height of the block + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` + // stateRoot is a 32 byte array of the hash of the block (state root of the block) + StateRoot []byte `protobuf:"bytes,2,opt,name=stateRoot,proto3" json:"stateRoot,omitempty"` +} + +func (m *BlockDescriptor) Reset() { *m = BlockDescriptor{} } +func (m *BlockDescriptor) String() string { return proto.CompactTextString(m) } +func (*BlockDescriptor) ProtoMessage() {} +func (*BlockDescriptor) Descriptor() ([]byte, []int) { + return fileDescriptor_9e537259fa860c20, []int{0} +} +func (m *BlockDescriptor) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockDescriptor) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockDescriptor.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 *BlockDescriptor) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockDescriptor.Merge(m, src) +} +func (m *BlockDescriptor) XXX_Size() int { + return m.Size() +} +func (m *BlockDescriptor) XXX_DiscardUnknown() { + xxx_messageInfo_BlockDescriptor.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockDescriptor proto.InternalMessageInfo + +func (m *BlockDescriptor) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *BlockDescriptor) GetStateRoot() []byte { + if m != nil { + return m.StateRoot + } + return nil +} + +// BlockDescriptors defines list of BlockDescriptor. +type BlockDescriptors struct { + BD []BlockDescriptor `protobuf:"bytes,1,rep,name=BD,proto3" json:"BD"` +} + +func (m *BlockDescriptors) Reset() { *m = BlockDescriptors{} } +func (m *BlockDescriptors) String() string { return proto.CompactTextString(m) } +func (*BlockDescriptors) ProtoMessage() {} +func (*BlockDescriptors) Descriptor() ([]byte, []int) { + return fileDescriptor_9e537259fa860c20, []int{1} +} +func (m *BlockDescriptors) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockDescriptors) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockDescriptors.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 *BlockDescriptors) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockDescriptors.Merge(m, src) +} +func (m *BlockDescriptors) XXX_Size() int { + return m.Size() +} +func (m *BlockDescriptors) XXX_DiscardUnknown() { + xxx_messageInfo_BlockDescriptors.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockDescriptors proto.InternalMessageInfo + +func (m *BlockDescriptors) GetBD() []BlockDescriptor { + if m != nil { + return m.BD + } + return nil +} + +func init() { + proto.RegisterType((*BlockDescriptor)(nil), "dymensionxyz.dymension.rollapp.BlockDescriptor") + proto.RegisterType((*BlockDescriptors)(nil), "dymensionxyz.dymension.rollapp.BlockDescriptors") +} + +func init() { + proto.RegisterFile("dymension/rollapp/block_descriptor.proto", fileDescriptor_9e537259fa860c20) +} + +var fileDescriptor_9e537259fa860c20 = []byte{ + // 243 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xa9, 0xcc, 0x4d, + 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0xca, 0xcf, 0xc9, 0x49, 0x2c, 0x28, 0xd0, 0x4f, 0xca, + 0xc9, 0x4f, 0xce, 0x8e, 0x4f, 0x49, 0x2d, 0x4e, 0x2e, 0xca, 0x2c, 0x28, 0xc9, 0x2f, 0xd2, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x83, 0xab, 0xac, 0xa8, 0xac, 0xd2, 0x83, 0x73, 0xf4, 0xa0, + 0xda, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4a, 0xf5, 0x41, 0x2c, 0x88, 0x2e, 0x25, 0x77, + 0x2e, 0x7e, 0x27, 0x90, 0x79, 0x2e, 0x70, 0xe3, 0x84, 0xc4, 0xb8, 0xd8, 0x32, 0x52, 0x33, 0xd3, + 0x33, 0x4a, 0x24, 0x18, 0x15, 0x18, 0x35, 0x58, 0x82, 0xa0, 0x3c, 0x21, 0x19, 0x2e, 0xce, 0xe2, + 0x92, 0xc4, 0x92, 0xd4, 0xa0, 0xfc, 0xfc, 0x12, 0x09, 0x26, 0x05, 0x46, 0x0d, 0x9e, 0x20, 0x84, + 0x80, 0x52, 0x24, 0x97, 0x00, 0x9a, 0x41, 0xc5, 0x42, 0xae, 0x5c, 0x4c, 0x4e, 0x2e, 0x12, 0x8c, + 0x0a, 0xcc, 0x1a, 0xdc, 0x46, 0xfa, 0x7a, 0xf8, 0xdd, 0xa7, 0x87, 0xa6, 0xdb, 0x89, 0xe5, 0xc4, + 0x3d, 0x79, 0x86, 0x20, 0x26, 0x27, 0x17, 0x27, 0xbf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, + 0x63, 0x7c, 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, + 0x96, 0x63, 0x88, 0x32, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, + 0x36, 0x1e, 0xc1, 0xd1, 0x2f, 0x33, 0xd6, 0xaf, 0x80, 0x07, 0x5d, 0x49, 0x65, 0x41, 0x6a, 0x71, + 0x12, 0x1b, 0xd8, 0xeb, 0xc6, 0x80, 0x00, 0x00, 0x00, 0xff, 0xff, 0x29, 0x7b, 0x0f, 0xc6, 0x5c, + 0x01, 0x00, 0x00, +} + +func (m *BlockDescriptor) 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 *BlockDescriptor) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockDescriptor) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.StateRoot) > 0 { + i -= len(m.StateRoot) + copy(dAtA[i:], m.StateRoot) + i = encodeVarintBlockDescriptor(dAtA, i, uint64(len(m.StateRoot))) + i-- + dAtA[i] = 0x12 + } + if m.Height != 0 { + i = encodeVarintBlockDescriptor(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *BlockDescriptors) 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 *BlockDescriptors) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockDescriptors) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BD) > 0 { + for iNdEx := len(m.BD) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BD[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintBlockDescriptor(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func encodeVarintBlockDescriptor(dAtA []byte, offset int, v uint64) int { + offset -= sovBlockDescriptor(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *BlockDescriptor) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovBlockDescriptor(uint64(m.Height)) + } + l = len(m.StateRoot) + if l > 0 { + n += 1 + l + sovBlockDescriptor(uint64(l)) + } + return n +} + +func (m *BlockDescriptors) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.BD) > 0 { + for _, e := range m.BD { + l = e.Size() + n += 1 + l + sovBlockDescriptor(uint64(l)) + } + } + return n +} + +func sovBlockDescriptor(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozBlockDescriptor(x uint64) (n int) { + return sovBlockDescriptor(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *BlockDescriptor) 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 ErrIntOverflowBlockDescriptor + } + 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: BlockDescriptor: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockDescriptor: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowBlockDescriptor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateRoot", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockDescriptor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthBlockDescriptor + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthBlockDescriptor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateRoot = append(m.StateRoot[:0], dAtA[iNdEx:postIndex]...) + if m.StateRoot == nil { + m.StateRoot = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlockDescriptor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBlockDescriptor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockDescriptors) 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 ErrIntOverflowBlockDescriptor + } + 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: BlockDescriptors: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockDescriptors: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BD", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowBlockDescriptor + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthBlockDescriptor + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthBlockDescriptor + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BD = append(m.BD, BlockDescriptor{}) + if err := m.BD[len(m.BD)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipBlockDescriptor(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthBlockDescriptor + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipBlockDescriptor(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, ErrIntOverflowBlockDescriptor + } + 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, ErrIntOverflowBlockDescriptor + } + 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, ErrIntOverflowBlockDescriptor + } + 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, ErrInvalidLengthBlockDescriptor + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupBlockDescriptor + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthBlockDescriptor + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthBlockDescriptor = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowBlockDescriptor = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupBlockDescriptor = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/errors.go b/third_party/dymension/rollapp/types/errors.go new file mode 100644 index 000000000..6a7963ff3 --- /dev/null +++ b/third_party/dymension/rollapp/types/errors.go @@ -0,0 +1,52 @@ +package types + +// DONTCOVER + +import ( + errorsmod "cosmossdk.io/errors" + "github.com/dymensionxyz/gerr-cosmos/gerrc" +) + +// x/rollapp module sentinel errors +var ( + ErrRollappExists = errorsmod.Register(ModuleName, 1000, "rollapp already exists") + ErrInvalidInitialSequencer = errorsmod.Register(ModuleName, 1001, "empty initial sequencer") + ErrInvalidCreatorAddress = errorsmod.Register(ModuleName, 1002, "invalid creator address") + ErrInvalidBech32Prefix = errorsmod.Register(ModuleName, 1003, "invalid Bech32 prefix") + ErrRollappFrozen = errorsmod.Register(ModuleName, 1004, "rollapp is frozen") + ErrInvalidNumBlocks = errorsmod.Register(ModuleName, 1005, "invalid number of blocks") + ErrInvalidBlockSequence = errorsmod.Register(ModuleName, 1006, "invalid block sequence") + ErrUnknownRollappID = errorsmod.Register(ModuleName, 1007, "rollapp does not exist") + ErrWrongBlockHeight = errorsmod.Register(ModuleName, 1009, "start-height does not match rollapps state") + ErrInvalidGenesisChecksum = errorsmod.Register(ModuleName, 1010, "invalid genesis checksum") + ErrInvalidStateRoot = errorsmod.Register(ModuleName, 1011, "invalid blocks state root") + ErrFeePayment = errorsmod.Register(ModuleName, 1013, "rollapp creation fee payment error") + ErrStateNotExists = errorsmod.Register(ModuleName, 1017, "state of this height doesn't exist") + ErrInvalidHeight = errorsmod.Register(ModuleName, 1018, "invalid rollapp height") + ErrInvalidRollappID = errorsmod.Register(ModuleName, 1020, "invalid rollapp-id") + ErrNoFinalizedStateYetForRollapp = errorsmod.Register(ModuleName, 1024, "no finalized state yet for rollapp") + ErrInvalidClientState = errorsmod.Register(ModuleName, 1025, "invalid client state") + ErrRollappNotRegistered = errorsmod.Register(ModuleName, 1035, "rollapp not registered") + ErrUnknownRequest = errorsmod.Register(ModuleName, 1036, "unknown request") + ErrNotFound = errorsmod.Register(ModuleName, 1037, "not found") + ErrLogic = errorsmod.Register(ModuleName, 1038, "internal logic error") + ErrInvalidAddress = errorsmod.Register(ModuleName, 1040, "invalid address") + ErrInvalidAlias = errorsmod.Wrap(gerrc.ErrInvalidArgument, "alias") + ErrInvalidURL = errorsmod.Wrap(gerrc.ErrInvalidArgument, "invalid url") + ErrInvalidDescription = errorsmod.Wrap(gerrc.ErrInvalidArgument, "description") + ErrInvalidLogoURI = errorsmod.Wrap(gerrc.ErrInvalidArgument, "logo uri") + ErrInvalidTokenLogoURI = errorsmod.Wrap(gerrc.ErrInvalidArgument, "token logo uri") + ErrInvalidMetadata = errorsmod.Wrap(gerrc.ErrInvalidArgument, "metadata") + ErrImmutableFieldUpdateAfterSealed = errorsmod.Wrap(gerrc.ErrInvalidArgument, "update immutable field after rollapp sealed") + ErrSealWithImmutableFieldsNotSet = errorsmod.Wrap(gerrc.ErrInvalidArgument, "seal with immutable fields not set") + ErrUnauthorizedSigner = errorsmod.Wrap(gerrc.ErrPermissionDenied, "unauthorized signer") + ErrSameOwner = errorsmod.Wrap(gerrc.ErrInvalidArgument, "same owner") + ErrInvalidRequest = errorsmod.Wrap(gerrc.ErrInvalidArgument, "invalid request") + ErrInvalidVMType = errorsmod.Wrap(gerrc.ErrInvalidArgument, "invalid vm type") + + /* ------------------------------ fraud related ----------------------------- */ + ErrDisputeAlreadyFinalized = errorsmod.Register(ModuleName, 2000, "disputed height already finalized") + ErrDisputeAlreadyReverted = errorsmod.Register(ModuleName, 2001, "disputed height already reverted") + ErrWrongClientId = errorsmod.Register(ModuleName, 2002, "client id does not match the rollapp") + ErrWrongProposerAddr = errorsmod.Register(ModuleName, 2003, "wrong proposer address") +) diff --git a/third_party/dymension/rollapp/types/events.go b/third_party/dymension/rollapp/types/events.go new file mode 100644 index 000000000..fad8b67b0 --- /dev/null +++ b/third_party/dymension/rollapp/types/events.go @@ -0,0 +1,22 @@ +package types + +const ( + EventTypeStateUpdate = "state_update" + EventTypeStatusChange = "status_change" + + AttributeKeyRollappId = "rollapp_id" + AttributeKeyStateInfoIndex = "state_info_index" + AttributeKeyStartHeight = "start_height" + AttributeKeyNumBlocks = "num_blocks" + AttributeKeyDAPath = "da_path" + AttributeKeyStatus = "status" + + // EventTypeFraud is emitted when a fraud evidence is submitted + EventTypeFraud = "fraud_proposal" + AttributeKeyFraudHeight = "fraud_height" + AttributeKeyFraudSequencer = "fraud_sequencer" + AttributeKeyClientID = "client_id" + + // EventTypeTransferGenesisTransfersEnabled is when the bridge is enabled + EventTypeTransferGenesisTransfersEnabled = "transfer_genesis_transfers_enabled" +) diff --git a/third_party/dymension/rollapp/types/genesis.pb.go b/third_party/dymension/rollapp/types/genesis.pb.go new file mode 100644 index 000000000..6c52485f5 --- /dev/null +++ b/third_party/dymension/rollapp/types/genesis.pb.go @@ -0,0 +1,708 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/genesis.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// GenesisState defines the rollapp module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + RollappList []Rollapp `protobuf:"bytes,2,rep,name=rollappList,proto3" json:"rollappList"` + StateInfoList []StateInfo `protobuf:"bytes,3,rep,name=stateInfoList,proto3" json:"stateInfoList"` + LatestStateInfoIndexList []StateInfoIndex `protobuf:"bytes,4,rep,name=latestStateInfoIndexList,proto3" json:"latestStateInfoIndexList"` + LatestFinalizedStateIndexList []StateInfoIndex `protobuf:"bytes,5,rep,name=latestFinalizedStateIndexList,proto3" json:"latestFinalizedStateIndexList"` + BlockHeightToFinalizationQueueList []BlockHeightToFinalizationQueue `protobuf:"bytes,6,rep,name=blockHeightToFinalizationQueueList,proto3" json:"blockHeightToFinalizationQueueList"` + // LivenessEvents are scheduled upcoming liveness events + LivenessEvents []LivenessEvent `protobuf:"bytes,7,rep,name=livenessEvents,proto3" json:"livenessEvents"` +} + +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_f4bf6d3c28914609, []int{0} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetRollappList() []Rollapp { + if m != nil { + return m.RollappList + } + return nil +} + +func (m *GenesisState) GetStateInfoList() []StateInfo { + if m != nil { + return m.StateInfoList + } + return nil +} + +func (m *GenesisState) GetLatestStateInfoIndexList() []StateInfoIndex { + if m != nil { + return m.LatestStateInfoIndexList + } + return nil +} + +func (m *GenesisState) GetLatestFinalizedStateIndexList() []StateInfoIndex { + if m != nil { + return m.LatestFinalizedStateIndexList + } + return nil +} + +func (m *GenesisState) GetBlockHeightToFinalizationQueueList() []BlockHeightToFinalizationQueue { + if m != nil { + return m.BlockHeightToFinalizationQueueList + } + return nil +} + +func (m *GenesisState) GetLivenessEvents() []LivenessEvent { + if m != nil { + return m.LivenessEvents + } + return nil +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "dymensionxyz.dymension.rollapp.GenesisState") +} + +func init() { proto.RegisterFile("dymension/rollapp/genesis.proto", fileDescriptor_f4bf6d3c28914609) } + +var fileDescriptor_f4bf6d3c28914609 = []byte{ + // 421 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x93, 0x4d, 0x6f, 0xda, 0x30, + 0x1c, 0xc6, 0x93, 0xf1, 0x32, 0xc9, 0x6c, 0x3b, 0x58, 0x3b, 0x44, 0x48, 0x33, 0x88, 0xc3, 0xc6, + 0x0e, 0x4b, 0x24, 0xd8, 0x79, 0x07, 0xb4, 0x37, 0x24, 0xd4, 0x17, 0x68, 0x2f, 0xed, 0x01, 0x19, + 0x30, 0xc1, 0x6a, 0xb0, 0xa3, 0xd8, 0x20, 0xe0, 0x53, 0xf4, 0xd0, 0x0f, 0xc5, 0x91, 0x63, 0x4f, + 0xa8, 0x82, 0x2f, 0x52, 0xe1, 0x38, 0x29, 0x2d, 0x85, 0x20, 0xf5, 0xe4, 0x58, 0x7e, 0xfe, 0xbf, + 0xdf, 0x23, 0x2b, 0x06, 0x85, 0xde, 0x74, 0x48, 0x98, 0xa0, 0x9c, 0x39, 0x01, 0xf7, 0x3c, 0xec, + 0xfb, 0x8e, 0x4b, 0x18, 0x11, 0x54, 0xd8, 0x7e, 0xc0, 0x25, 0x87, 0x28, 0x0e, 0x4c, 0xa6, 0x33, + 0x3b, 0xde, 0xd8, 0x3a, 0x9d, 0xff, 0xec, 0x72, 0x97, 0xab, 0xa8, 0xb3, 0xf9, 0x0a, 0xa7, 0xf2, + 0x68, 0x17, 0xeb, 0xe3, 0x00, 0x0f, 0x35, 0x35, 0xff, 0x8a, 0x56, 0xaf, 0x3a, 0x50, 0xda, 0x0d, + 0x08, 0x89, 0x25, 0x69, 0x53, 0xd6, 0x8f, 0x24, 0xe5, 0xbd, 0xdd, 0xdb, 0x32, 0xc0, 0x4c, 0xf4, + 0x49, 0xa0, 0x93, 0xc5, 0xdd, 0xa4, 0x47, 0xc7, 0x9b, 0xac, 0x2e, 0x54, 0x5a, 0x66, 0xc0, 0x87, + 0x7f, 0xe1, 0x70, 0x6b, 0xe3, 0x81, 0xbf, 0x41, 0x36, 0x6c, 0x6c, 0x99, 0x45, 0xb3, 0x9c, 0xab, + 0x7c, 0xb5, 0x0f, 0x5f, 0x84, 0x7d, 0xa6, 0xd2, 0xb5, 0xf4, 0x7c, 0x59, 0x30, 0x9a, 0x7a, 0x16, + 0x9e, 0x82, 0x9c, 0x3e, 0x6f, 0x50, 0x21, 0xad, 0x77, 0xc5, 0x54, 0x39, 0x57, 0xf9, 0x96, 0x84, + 0x6a, 0x86, 0xab, 0x66, 0x6d, 0x13, 0xe0, 0x25, 0xf8, 0xa8, 0xee, 0xa1, 0xce, 0xfa, 0x5c, 0x21, + 0x53, 0x0a, 0xf9, 0x3d, 0x09, 0xd9, 0x8a, 0x86, 0x34, 0xf4, 0x39, 0x05, 0xfa, 0xc0, 0xf2, 0xb0, + 0x24, 0x42, 0xc6, 0xb9, 0x3a, 0xeb, 0x91, 0x89, 0x32, 0xa4, 0x95, 0xc1, 0x3e, 0xda, 0xa0, 0x26, + 0xb5, 0x66, 0x2f, 0x15, 0xce, 0xc0, 0x97, 0xf0, 0xec, 0x2f, 0x65, 0xd8, 0xa3, 0x33, 0xd2, 0xd3, + 0xa1, 0x48, 0x9b, 0x79, 0x83, 0xf6, 0x30, 0x1a, 0xde, 0x99, 0xa0, 0xd4, 0xf1, 0x78, 0xf7, 0xe6, + 0x3f, 0xa1, 0xee, 0x40, 0x5e, 0x70, 0x1d, 0xc4, 0x92, 0x72, 0x76, 0x3e, 0x22, 0x23, 0xa2, 0x1a, + 0x64, 0x55, 0x83, 0x5f, 0x49, 0x0d, 0x6a, 0x07, 0x49, 0xba, 0xd1, 0x11, 0x3e, 0x78, 0x0d, 0x3e, + 0x45, 0x7f, 0xe5, 0x9f, 0x31, 0x61, 0x52, 0x58, 0xef, 0x55, 0x83, 0x1f, 0x49, 0x0d, 0x1a, 0xdb, + 0x53, 0x5a, 0xf8, 0x02, 0x55, 0x3b, 0x99, 0xaf, 0x90, 0xb9, 0x58, 0x21, 0xf3, 0x61, 0x85, 0xcc, + 0xdb, 0x35, 0x32, 0x16, 0x6b, 0x64, 0xdc, 0xaf, 0x91, 0x71, 0xf5, 0xd3, 0xa5, 0x72, 0x30, 0xea, + 0xd8, 0x5d, 0x3e, 0x74, 0xb6, 0x45, 0x4f, 0x1b, 0x67, 0x5c, 0x75, 0x26, 0xf1, 0xcb, 0x91, 0x53, + 0x9f, 0x88, 0x4e, 0x56, 0xbd, 0x9b, 0xea, 0x63, 0x00, 0x00, 0x00, 0xff, 0xff, 0xc8, 0x1a, 0xa4, + 0x2f, 0x41, 0x04, 0x00, 0x00, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.LivenessEvents) > 0 { + for iNdEx := len(m.LivenessEvents) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LivenessEvents[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + } + } + if len(m.BlockHeightToFinalizationQueueList) > 0 { + for iNdEx := len(m.BlockHeightToFinalizationQueueList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BlockHeightToFinalizationQueueList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + } + if len(m.LatestFinalizedStateIndexList) > 0 { + for iNdEx := len(m.LatestFinalizedStateIndexList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LatestFinalizedStateIndexList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + } + if len(m.LatestStateInfoIndexList) > 0 { + for iNdEx := len(m.LatestStateInfoIndexList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.LatestStateInfoIndexList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.StateInfoList) > 0 { + for iNdEx := len(m.StateInfoList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.StateInfoList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.RollappList) > 0 { + for iNdEx := len(m.RollappList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.RollappList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.RollappList) > 0 { + for _, e := range m.RollappList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.StateInfoList) > 0 { + for _, e := range m.StateInfoList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.LatestStateInfoIndexList) > 0 { + for _, e := range m.LatestStateInfoIndexList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.LatestFinalizedStateIndexList) > 0 { + for _, e := range m.LatestFinalizedStateIndexList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.BlockHeightToFinalizationQueueList) > 0 { + for _, e := range m.BlockHeightToFinalizationQueueList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.LivenessEvents) > 0 { + for _, e := range m.LivenessEvents { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RollappList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappList = append(m.RollappList, Rollapp{}) + if err := m.RollappList[len(m.RollappList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateInfoList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.StateInfoList = append(m.StateInfoList, StateInfo{}) + if err := m.StateInfoList[len(m.StateInfoList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestStateInfoIndexList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestStateInfoIndexList = append(m.LatestStateInfoIndexList, StateInfoIndex{}) + if err := m.LatestStateInfoIndexList[len(m.LatestStateInfoIndexList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestFinalizedStateIndexList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LatestFinalizedStateIndexList = append(m.LatestFinalizedStateIndexList, StateInfoIndex{}) + if err := m.LatestFinalizedStateIndexList[len(m.LatestFinalizedStateIndexList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BlockHeightToFinalizationQueueList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BlockHeightToFinalizationQueueList = append(m.BlockHeightToFinalizationQueueList, BlockHeightToFinalizationQueue{}) + if err := m.BlockHeightToFinalizationQueueList[len(m.BlockHeightToFinalizationQueueList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LivenessEvents", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.LivenessEvents = append(m.LivenessEvents, LivenessEvent{}) + if err := m.LivenessEvents[len(m.LivenessEvents)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/genesis_transfer.pb.go b/third_party/dymension/rollapp/types/genesis_transfer.pb.go new file mode 100644 index 000000000..687d3c360 --- /dev/null +++ b/third_party/dymension/rollapp/types/genesis_transfer.pb.go @@ -0,0 +1,398 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/genesis_transfer.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// Bookkeeping for the genesis transfer bridge protocol. +// Each rollapp will have one of these items corresponding to it. +type GenesisTransfers struct { + RollappID string `protobuf:"bytes,1,opt,name=rollappID,proto3" json:"rollappID,omitempty"` + // The total number of incoming ibc transfers to be fast tracked in the genesis transfer period + NumTotal uint64 `protobuf:"varint,2,opt,name=numTotal,proto3" json:"numTotal,omitempty"` + // The number of transfers already processed, when this number reaches numTotal the genesis transfer window closes. + NumReceived uint64 `protobuf:"varint,3,opt,name=numReceived,proto3" json:"numReceived,omitempty"` +} + +func (m *GenesisTransfers) Reset() { *m = GenesisTransfers{} } +func (m *GenesisTransfers) String() string { return proto.CompactTextString(m) } +func (*GenesisTransfers) ProtoMessage() {} +func (*GenesisTransfers) Descriptor() ([]byte, []int) { + return fileDescriptor_abbd5969075b03fa, []int{0} +} +func (m *GenesisTransfers) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisTransfers) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisTransfers.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 *GenesisTransfers) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisTransfers.Merge(m, src) +} +func (m *GenesisTransfers) XXX_Size() int { + return m.Size() +} +func (m *GenesisTransfers) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisTransfers.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisTransfers proto.InternalMessageInfo + +func (m *GenesisTransfers) GetRollappID() string { + if m != nil { + return m.RollappID + } + return "" +} + +func (m *GenesisTransfers) GetNumTotal() uint64 { + if m != nil { + return m.NumTotal + } + return 0 +} + +func (m *GenesisTransfers) GetNumReceived() uint64 { + if m != nil { + return m.NumReceived + } + return 0 +} + +func init() { + proto.RegisterType((*GenesisTransfers)(nil), "dymensionxyz.dymension.rollapp.GenesisTransfers") +} + +func init() { + proto.RegisterFile("dymension/rollapp/genesis_transfer.proto", fileDescriptor_abbd5969075b03fa) +} + +var fileDescriptor_abbd5969075b03fa = []byte{ + // 257 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x48, 0xa9, 0xcc, 0x4d, + 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0xca, 0xcf, 0xc9, 0x49, 0x2c, 0x28, 0xd0, 0x4f, 0x4f, + 0xcd, 0x4b, 0x2d, 0xce, 0x2c, 0x8e, 0x2f, 0x29, 0x4a, 0xcc, 0x2b, 0x4e, 0x4b, 0x2d, 0xd2, 0x2b, + 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x92, 0x83, 0xab, 0xac, 0xa8, 0xac, 0xd2, 0x83, 0x73, 0xf4, 0xa0, + 0xda, 0xa4, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x4a, 0xf5, 0x41, 0x2c, 0x88, 0x2e, 0x29, 0x39, + 0x4c, 0xf3, 0x0b, 0x12, 0x8b, 0x12, 0x73, 0x8b, 0xa1, 0xf2, 0xf2, 0x98, 0xf2, 0x50, 0x1a, 0xaa, + 0x40, 0x09, 0x53, 0x41, 0x71, 0x49, 0x62, 0x49, 0x6a, 0x7c, 0x66, 0x5e, 0x1a, 0xd4, 0x12, 0xa5, + 0x3c, 0x2e, 0x01, 0x77, 0x88, 0xa3, 0x43, 0xa0, 0x6e, 0x2e, 0x16, 0x92, 0xe1, 0xe2, 0x84, 0xaa, + 0xf7, 0x74, 0x91, 0x60, 0x54, 0x60, 0xd4, 0xe0, 0x0c, 0x42, 0x08, 0x08, 0x49, 0x71, 0x71, 0xe4, + 0x95, 0xe6, 0x86, 0xe4, 0x97, 0x24, 0xe6, 0x48, 0x30, 0x29, 0x30, 0x6a, 0xb0, 0x04, 0xc1, 0xf9, + 0x42, 0x0a, 0x5c, 0xdc, 0x79, 0xa5, 0xb9, 0x41, 0xa9, 0xc9, 0xa9, 0x99, 0x65, 0xa9, 0x29, 0x12, + 0xcc, 0x60, 0x69, 0x64, 0x21, 0x27, 0xbf, 0x13, 0x8f, 0xe4, 0x18, 0x2f, 0x3c, 0x92, 0x63, 0x7c, + 0xf0, 0x48, 0x8e, 0x71, 0xc2, 0x63, 0x39, 0x86, 0x0b, 0x8f, 0xe5, 0x18, 0x6e, 0x3c, 0x96, 0x63, + 0x88, 0x32, 0x49, 0xcf, 0x2c, 0xc9, 0x28, 0x4d, 0xd2, 0x4b, 0xce, 0xcf, 0xd5, 0x47, 0x0e, 0x2f, + 0x04, 0x47, 0xbf, 0xcc, 0x58, 0xbf, 0x02, 0xee, 0x95, 0x92, 0xca, 0x82, 0xd4, 0xe2, 0x24, 0x36, + 0xb0, 0x37, 0x8c, 0x01, 0x01, 0x00, 0x00, 0xff, 0xff, 0x28, 0x1c, 0x26, 0x98, 0x8d, 0x01, 0x00, + 0x00, +} + +func (m *GenesisTransfers) 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 *GenesisTransfers) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisTransfers) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.NumReceived != 0 { + i = encodeVarintGenesisTransfer(dAtA, i, uint64(m.NumReceived)) + i-- + dAtA[i] = 0x18 + } + if m.NumTotal != 0 { + i = encodeVarintGenesisTransfer(dAtA, i, uint64(m.NumTotal)) + i-- + dAtA[i] = 0x10 + } + if len(m.RollappID) > 0 { + i -= len(m.RollappID) + copy(dAtA[i:], m.RollappID) + i = encodeVarintGenesisTransfer(dAtA, i, uint64(len(m.RollappID))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesisTransfer(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesisTransfer(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisTransfers) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappID) + if l > 0 { + n += 1 + l + sovGenesisTransfer(uint64(l)) + } + if m.NumTotal != 0 { + n += 1 + sovGenesisTransfer(uint64(m.NumTotal)) + } + if m.NumReceived != 0 { + n += 1 + sovGenesisTransfer(uint64(m.NumReceived)) + } + return n +} + +func sovGenesisTransfer(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesisTransfer(x uint64) (n int) { + return sovGenesisTransfer(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisTransfers) 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 ErrIntOverflowGenesisTransfer + } + 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: GenesisTransfers: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisTransfers: 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 ErrIntOverflowGenesisTransfer + } + 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 ErrInvalidLengthGenesisTransfer + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesisTransfer + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappID = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumTotal", wireType) + } + m.NumTotal = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesisTransfer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumTotal |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumReceived", wireType) + } + m.NumReceived = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesisTransfer + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumReceived |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipGenesisTransfer(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesisTransfer + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesisTransfer(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, ErrIntOverflowGenesisTransfer + } + 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, ErrIntOverflowGenesisTransfer + } + 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, ErrIntOverflowGenesisTransfer + } + 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, ErrInvalidLengthGenesisTransfer + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesisTransfer + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesisTransfer + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesisTransfer = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesisTransfer = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesisTransfer = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/keys.go b/third_party/dymension/rollapp/types/keys.go new file mode 100644 index 000000000..aadec02e2 --- /dev/null +++ b/third_party/dymension/rollapp/types/keys.go @@ -0,0 +1,22 @@ +package types + +const ( + // ModuleName defines the module name + ModuleName = "rollapp" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_rollapp" +) + +func KeyPrefix(p string) []byte { + return []byte(p) +} diff --git a/third_party/dymension/rollapp/types/liveness.pb.go b/third_party/dymension/rollapp/types/liveness.pb.go new file mode 100644 index 000000000..a43a3cda3 --- /dev/null +++ b/third_party/dymension/rollapp/types/liveness.pb.go @@ -0,0 +1,403 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/liveness.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// LivenessEvent stores upcoming slash/jail actions on sequencers of rollapps +type LivenessEvent struct { + // RollappId of relevant rollapp + RollappId string `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // HubHeight when event will occur + HubHeight int64 `protobuf:"varint,2,opt,name=hub_height,json=hubHeight,proto3" json:"hub_height,omitempty"` + // IsJail is true iff the event is to jail rather than slash + IsJail bool `protobuf:"varint,3,opt,name=is_jail,json=isJail,proto3" json:"is_jail,omitempty"` +} + +func (m *LivenessEvent) Reset() { *m = LivenessEvent{} } +func (m *LivenessEvent) String() string { return proto.CompactTextString(m) } +func (*LivenessEvent) ProtoMessage() {} +func (*LivenessEvent) Descriptor() ([]byte, []int) { + return fileDescriptor_2246d0b8d3a7ee7a, []int{0} +} +func (m *LivenessEvent) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *LivenessEvent) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_LivenessEvent.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 *LivenessEvent) XXX_Merge(src proto.Message) { + xxx_messageInfo_LivenessEvent.Merge(m, src) +} +func (m *LivenessEvent) XXX_Size() int { + return m.Size() +} +func (m *LivenessEvent) XXX_DiscardUnknown() { + xxx_messageInfo_LivenessEvent.DiscardUnknown(m) +} + +var xxx_messageInfo_LivenessEvent proto.InternalMessageInfo + +func (m *LivenessEvent) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *LivenessEvent) GetHubHeight() int64 { + if m != nil { + return m.HubHeight + } + return 0 +} + +func (m *LivenessEvent) GetIsJail() bool { + if m != nil { + return m.IsJail + } + return false +} + +func init() { + proto.RegisterType((*LivenessEvent)(nil), "dymensionxyz.dymension.rollapp.LivenessEvent") +} + +func init() { proto.RegisterFile("dymension/rollapp/liveness.proto", fileDescriptor_2246d0b8d3a7ee7a) } + +var fileDescriptor_2246d0b8d3a7ee7a = []byte{ + // 269 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x90, 0x41, 0x4b, 0xc3, 0x30, + 0x1c, 0xc5, 0x1b, 0x07, 0xd3, 0x16, 0xbc, 0x14, 0xc1, 0x32, 0x30, 0x94, 0x9d, 0x7a, 0x6a, 0x18, + 0xf3, 0x13, 0x08, 0x82, 0x8a, 0x78, 0xe8, 0xd1, 0x4b, 0x49, 0xda, 0xac, 0xfd, 0x4b, 0x9b, 0x94, + 0xfd, 0xd3, 0xb2, 0xfa, 0x29, 0xfc, 0x58, 0x1e, 0x77, 0xf4, 0x28, 0xed, 0x17, 0x91, 0x75, 0xb5, + 0x0a, 0xbb, 0xe5, 0xbd, 0xf7, 0xcb, 0xe3, 0x25, 0x8e, 0x9f, 0xb6, 0xa5, 0x54, 0x08, 0x5a, 0xb1, + 0xad, 0x2e, 0x0a, 0x5e, 0x55, 0xac, 0x80, 0x46, 0x2a, 0x89, 0x18, 0x56, 0x5b, 0x6d, 0xb4, 0x4b, + 0x27, 0x62, 0xd7, 0xbe, 0x87, 0x93, 0x08, 0x47, 0x7c, 0x71, 0x95, 0xe9, 0x4c, 0x0f, 0x28, 0x3b, + 0x9c, 0x8e, 0xb7, 0x16, 0xcb, 0xd3, 0x5e, 0x34, 0xdc, 0xc8, 0x18, 0xd4, 0xe6, 0x97, 0xa1, 0x89, + 0xc6, 0x52, 0x23, 0x13, 0x1c, 0x25, 0x6b, 0x56, 0x42, 0x1a, 0xbe, 0x62, 0x89, 0x06, 0x75, 0xcc, + 0x97, 0x1b, 0xe7, 0xf2, 0x79, 0xdc, 0x72, 0xdf, 0x48, 0x65, 0xdc, 0x1b, 0xc7, 0x19, 0xcb, 0x62, + 0x48, 0x3d, 0xe2, 0x93, 0xc0, 0x8e, 0xec, 0xd1, 0x79, 0x4c, 0x0f, 0x71, 0x5e, 0x8b, 0x38, 0x97, + 0x90, 0xe5, 0xc6, 0x3b, 0xf3, 0x49, 0x30, 0x8b, 0xec, 0xbc, 0x16, 0x0f, 0x83, 0xe1, 0x5e, 0x3b, + 0xe7, 0x80, 0xf1, 0x1b, 0x87, 0xc2, 0x9b, 0xf9, 0x24, 0xb8, 0x88, 0xe6, 0x80, 0x4f, 0x1c, 0x8a, + 0xbb, 0x97, 0xcf, 0x8e, 0x92, 0x7d, 0x47, 0xc9, 0x77, 0x47, 0xc9, 0x47, 0x4f, 0xad, 0x7d, 0x4f, + 0xad, 0xaf, 0x9e, 0x5a, 0xaf, 0xb7, 0x19, 0x98, 0xbc, 0x16, 0x61, 0xa2, 0x4b, 0xf6, 0xff, 0x1b, + 0xfe, 0x04, 0x6b, 0xd6, 0x6c, 0x37, 0x3d, 0xd1, 0xb4, 0x95, 0x44, 0x31, 0x1f, 0xe6, 0xaf, 0x7f, + 0x02, 0x00, 0x00, 0xff, 0xff, 0xa4, 0xff, 0xb9, 0x45, 0x5c, 0x01, 0x00, 0x00, +} + +func (m *LivenessEvent) 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 *LivenessEvent) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *LivenessEvent) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.IsJail { + i-- + if m.IsJail { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x18 + } + if m.HubHeight != 0 { + i = encodeVarintLiveness(dAtA, i, uint64(m.HubHeight)) + i-- + dAtA[i] = 0x10 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintLiveness(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintLiveness(dAtA []byte, offset int, v uint64) int { + offset -= sovLiveness(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *LivenessEvent) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovLiveness(uint64(l)) + } + if m.HubHeight != 0 { + n += 1 + sovLiveness(uint64(m.HubHeight)) + } + if m.IsJail { + n += 2 + } + return n +} + +func sovLiveness(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozLiveness(x uint64) (n int) { + return sovLiveness(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *LivenessEvent) 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 ErrIntOverflowLiveness + } + 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: LivenessEvent: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: LivenessEvent: 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 ErrIntOverflowLiveness + } + 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 ErrInvalidLengthLiveness + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthLiveness + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field HubHeight", wireType) + } + m.HubHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiveness + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.HubHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field IsJail", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowLiveness + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.IsJail = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipLiveness(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthLiveness + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipLiveness(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, ErrIntOverflowLiveness + } + 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, ErrIntOverflowLiveness + } + 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, ErrIntOverflowLiveness + } + 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, ErrInvalidLengthLiveness + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupLiveness + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthLiveness + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthLiveness = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowLiveness = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupLiveness = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/message_update_state.go b/third_party/dymension/rollapp/types/message_update_state.go new file mode 100644 index 000000000..5ac362c2a --- /dev/null +++ b/third_party/dymension/rollapp/types/message_update_state.go @@ -0,0 +1,60 @@ +package types + +import ( + "math" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +const TypeMsgUpdateState = "update_state" + +var _ sdk.Msg = &MsgUpdateState{} + +func (msg *MsgUpdateState) GetSigners() []sdk.AccAddress { + creator, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + panic(err) + } + return []sdk.AccAddress{creator} +} + +func (msg *MsgUpdateState) ValidateBasic() error { + _, err := sdk.AccAddressFromBech32(msg.Creator) + if err != nil { + return errorsmod.Wrapf(ErrInvalidAddress, "invalid creator address (%s)", err) + } + + // an update can't be with no BDs + if msg.NumBlocks == uint64(0) { + return errorsmod.Wrap(ErrInvalidNumBlocks, "number of blocks can not be zero") + } + + if msg.NumBlocks > math.MaxUint64-msg.StartHeight { + return errorsmod.Wrapf(ErrInvalidNumBlocks, "numBlocks(%d) + startHeight(%d) exceeds max uint64", msg.NumBlocks, msg.StartHeight) + } + + // check to see that update contains all BDs + if len(msg.BDs.BD) != int(msg.NumBlocks) { + return errorsmod.Wrapf(ErrInvalidNumBlocks, "number of blocks (%d) != number of block descriptors(%d)", msg.NumBlocks, len(msg.BDs.BD)) + } + + // check to see that startHeight is not zaro + if msg.StartHeight == 0 { + return errorsmod.Wrapf(ErrWrongBlockHeight, "StartHeight must be greater than zero") + } + + // check that the blocks are sequential by height + for bdIndex := uint64(0); bdIndex < msg.NumBlocks; bdIndex += 1 { + if msg.BDs.BD[bdIndex].Height != msg.StartHeight+bdIndex { + return ErrInvalidBlockSequence + } + // check to see stateRoot is a 32 byte array + if len(msg.BDs.BD[bdIndex].StateRoot) != 32 { + return errorsmod.Wrapf(ErrInvalidStateRoot, "StateRoot of block high (%d) must be 32 byte array. But received (%d) bytes", + msg.BDs.BD[bdIndex].Height, len(msg.BDs.BD[bdIndex].StateRoot)) + } + } + + return nil +} diff --git a/third_party/dymension/rollapp/types/metadata.pb.go b/third_party/dymension/rollapp/types/metadata.pb.go new file mode 100644 index 000000000..76dd0a070 --- /dev/null +++ b/third_party/dymension/rollapp/types/metadata.pb.go @@ -0,0 +1,582 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/metadata.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 + +type RollappMetadata struct { + // website is the rollapp website + Website string `protobuf:"bytes,1,opt,name=website,proto3" json:"website,omitempty"` + // description is the rollapp description. should be limited to 512 chars + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` + // logo_data_uri is a base64 rep with a URI prefix to the rollapp logo. Should be limited to 25kb. + LogoDataUri string `protobuf:"bytes,3,opt,name=logo_data_uri,json=logoDataUri,proto3" json:"logo_data_uri,omitempty"` + // token_logo_data_uri is a URI to the native token logo. Should be limited to 25kb. + TokenLogoDataUri string `protobuf:"bytes,4,opt,name=token_logo_data_uri,json=tokenLogoDataUri,proto3" json:"token_logo_data_uri,omitempty"` + // telegram is the rollapp telegram link + Telegram string `protobuf:"bytes,5,opt,name=telegram,proto3" json:"telegram,omitempty"` + // x is the rollapp twitter link + X string `protobuf:"bytes,6,opt,name=x,proto3" json:"x,omitempty"` +} + +func (m *RollappMetadata) Reset() { *m = RollappMetadata{} } +func (m *RollappMetadata) String() string { return proto.CompactTextString(m) } +func (*RollappMetadata) ProtoMessage() {} +func (*RollappMetadata) Descriptor() ([]byte, []int) { + return fileDescriptor_1b2ee545949ab800, []int{0} +} +func (m *RollappMetadata) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RollappMetadata) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RollappMetadata.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 *RollappMetadata) XXX_Merge(src proto.Message) { + xxx_messageInfo_RollappMetadata.Merge(m, src) +} +func (m *RollappMetadata) XXX_Size() int { + return m.Size() +} +func (m *RollappMetadata) XXX_DiscardUnknown() { + xxx_messageInfo_RollappMetadata.DiscardUnknown(m) +} + +var xxx_messageInfo_RollappMetadata proto.InternalMessageInfo + +func (m *RollappMetadata) GetWebsite() string { + if m != nil { + return m.Website + } + return "" +} + +func (m *RollappMetadata) GetDescription() string { + if m != nil { + return m.Description + } + return "" +} + +func (m *RollappMetadata) GetLogoDataUri() string { + if m != nil { + return m.LogoDataUri + } + return "" +} + +func (m *RollappMetadata) GetTokenLogoDataUri() string { + if m != nil { + return m.TokenLogoDataUri + } + return "" +} + +func (m *RollappMetadata) GetTelegram() string { + if m != nil { + return m.Telegram + } + return "" +} + +func (m *RollappMetadata) GetX() string { + if m != nil { + return m.X + } + return "" +} + +func init() { + proto.RegisterType((*RollappMetadata)(nil), "dymensionxyz.dymension.rollapp.RollappMetadata") +} + +func init() { proto.RegisterFile("dymension/rollapp/metadata.proto", fileDescriptor_1b2ee545949ab800) } + +var fileDescriptor_1b2ee545949ab800 = []byte{ + // 260 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x54, 0x90, 0xbd, 0x4e, 0xc3, 0x30, + 0x14, 0x85, 0x63, 0x7e, 0x0a, 0x18, 0x10, 0xc8, 0x2c, 0x16, 0x83, 0x15, 0x75, 0x62, 0x21, 0x1e, + 0xca, 0x13, 0x20, 0x46, 0x60, 0xa8, 0xc4, 0xc2, 0x12, 0x39, 0x8d, 0x15, 0x2c, 0x92, 0x5c, 0xcb, + 0xb9, 0x85, 0x84, 0xa7, 0xe0, 0xb1, 0x10, 0x53, 0x47, 0x46, 0x94, 0xbc, 0x08, 0xaa, 0x1b, 0x42, + 0xd8, 0xfc, 0x9d, 0xf3, 0xf9, 0x0e, 0x87, 0x86, 0x69, 0x53, 0xe8, 0xb2, 0x32, 0x50, 0x4a, 0x07, + 0x79, 0xae, 0xac, 0x95, 0x85, 0x46, 0x95, 0x2a, 0x54, 0x91, 0x75, 0x80, 0xc0, 0xc4, 0x60, 0xd4, + 0xcd, 0x5b, 0x34, 0x40, 0xd4, 0xeb, 0xd3, 0x4f, 0x42, 0x4f, 0xe6, 0x9b, 0xf7, 0x5d, 0xff, 0x93, + 0x71, 0xba, 0xf7, 0xaa, 0x93, 0xca, 0xa0, 0xe6, 0x24, 0x24, 0x17, 0x07, 0xf3, 0x5f, 0x64, 0x21, + 0x3d, 0x4c, 0x75, 0xb5, 0x70, 0xc6, 0xa2, 0x81, 0x92, 0x6f, 0xf9, 0x76, 0x1c, 0xb1, 0x29, 0x3d, + 0xce, 0x21, 0x83, 0x78, 0x7d, 0x28, 0x5e, 0x3a, 0xc3, 0xb7, 0x37, 0xce, 0x3a, 0xbc, 0x51, 0xa8, + 0x1e, 0x9c, 0x61, 0x97, 0xf4, 0x0c, 0xe1, 0x59, 0x97, 0xf1, 0x7f, 0x73, 0xc7, 0x9b, 0xa7, 0xbe, + 0xba, 0x1d, 0xe9, 0xe7, 0x74, 0x1f, 0x75, 0xae, 0x33, 0xa7, 0x0a, 0xbe, 0xeb, 0x9d, 0x81, 0xd9, + 0x11, 0x25, 0x35, 0x9f, 0xf8, 0x90, 0xd4, 0xd7, 0xf7, 0x1f, 0xad, 0x20, 0xab, 0x56, 0x90, 0xef, + 0x56, 0x90, 0xf7, 0x4e, 0x04, 0xab, 0x4e, 0x04, 0x5f, 0x9d, 0x08, 0x1e, 0xaf, 0x32, 0x83, 0x4f, + 0xcb, 0x24, 0x5a, 0x40, 0x21, 0xc7, 0x8b, 0xfc, 0x81, 0x7c, 0x99, 0xc9, 0x7a, 0x58, 0x11, 0x1b, + 0xab, 0xab, 0x64, 0xe2, 0x37, 0x9c, 0xfd, 0x04, 0x00, 0x00, 0xff, 0xff, 0xd8, 0xa5, 0x40, 0xd1, + 0x67, 0x01, 0x00, 0x00, +} + +func (m *RollappMetadata) 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 *RollappMetadata) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RollappMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0x32 + } + 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] = 0x2a + } + if len(m.TokenLogoDataUri) > 0 { + i -= len(m.TokenLogoDataUri) + copy(dAtA[i:], m.TokenLogoDataUri) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.TokenLogoDataUri))) + i-- + dAtA[i] = 0x22 + } + if len(m.LogoDataUri) > 0 { + i -= len(m.LogoDataUri) + copy(dAtA[i:], m.LogoDataUri) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.LogoDataUri))) + i-- + dAtA[i] = 0x1a + } + if len(m.Description) > 0 { + i -= len(m.Description) + copy(dAtA[i:], m.Description) + i = encodeVarintMetadata(dAtA, i, uint64(len(m.Description))) + i-- + dAtA[i] = 0x12 + } + 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] = 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 *RollappMetadata) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Website) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.Description) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.LogoDataUri) + if l > 0 { + n += 1 + l + sovMetadata(uint64(l)) + } + l = len(m.TokenLogoDataUri) + if l > 0 { + n += 1 + l + sovMetadata(uint64(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)) + } + 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 *RollappMetadata) 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: RollappMetadata: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RollappMetadata: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Description", 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.Description = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LogoDataUri", 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.LogoDataUri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TokenLogoDataUri", 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.TokenLogoDataUri = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 6: + 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 + 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/third_party/dymension/rollapp/types/params.go b/third_party/dymension/rollapp/types/params.go new file mode 100644 index 000000000..45f4172cb --- /dev/null +++ b/third_party/dymension/rollapp/types/params.go @@ -0,0 +1,9 @@ +package types + +import "gopkg.in/yaml.v2" + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/third_party/dymension/rollapp/types/params.pb.go b/third_party/dymension/rollapp/types/params.pb.go new file mode 100644 index 000000000..2146385c9 --- /dev/null +++ b/third_party/dymension/rollapp/types/params.pb.go @@ -0,0 +1,424 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/params.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// Params defines the parameters for the module. +type Params struct { + // dispute_period_in_blocks the number of blocks it takes + // to change a status of a state from received to finalized. + // during that period, any user could submit fraud proof + DisputePeriodInBlocks uint64 `protobuf:"varint,1,opt,name=dispute_period_in_blocks,json=disputePeriodInBlocks,proto3" json:"dispute_period_in_blocks,omitempty" yaml:"dispute_period_in_blocks"` + // The time (num hub blocks) a sequencer has to post a block, before he will be slashed + LivenessSlashBlocks uint64 `protobuf:"varint,4,opt,name=liveness_slash_blocks,json=livenessSlashBlocks,proto3" json:"liveness_slash_blocks,omitempty" yaml:"liveness_slash_blocks"` + // The min gap (num hub blocks) between a sequence of slashes if the sequencer continues to be down + LivenessSlashInterval uint64 `protobuf:"varint,5,opt,name=liveness_slash_interval,json=livenessSlashInterval,proto3" json:"liveness_slash_interval,omitempty" yaml:"liveness_slash_interval"` + // The time (num hub blocks) a sequencer can be down after which he will be jailed rather than slashed + LivenessJailBlocks uint64 `protobuf:"varint,6,opt,name=liveness_jail_blocks,json=livenessJailBlocks,proto3" json:"liveness_jail_blocks,omitempty" yaml:"liveness_jail_blocks"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_8a5e294b0dff70d2, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetDisputePeriodInBlocks() uint64 { + if m != nil { + return m.DisputePeriodInBlocks + } + return 0 +} + +func (m *Params) GetLivenessSlashBlocks() uint64 { + if m != nil { + return m.LivenessSlashBlocks + } + return 0 +} + +func (m *Params) GetLivenessSlashInterval() uint64 { + if m != nil { + return m.LivenessSlashInterval + } + return 0 +} + +func (m *Params) GetLivenessJailBlocks() uint64 { + if m != nil { + return m.LivenessJailBlocks + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "dymensionxyz.dymension.rollapp.Params") +} + +func init() { proto.RegisterFile("dymension/rollapp/params.proto", fileDescriptor_8a5e294b0dff70d2) } + +var fileDescriptor_8a5e294b0dff70d2 = []byte{ + // 364 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x92, 0x31, 0x6f, 0xb2, 0x40, + 0x18, 0xc7, 0x41, 0x79, 0x8d, 0x61, 0x32, 0xbc, 0x9a, 0xd7, 0xf8, 0x36, 0x87, 0xa1, 0x4b, 0x27, + 0x2e, 0xc6, 0x4e, 0x8e, 0x6e, 0x3a, 0x34, 0x96, 0x76, 0x32, 0x4d, 0xc8, 0x81, 0x17, 0xbd, 0xf6, + 0xe0, 0x08, 0x87, 0x44, 0xfa, 0x29, 0x3a, 0x76, 0xec, 0xc7, 0xe9, 0xe8, 0xd8, 0x89, 0x34, 0xfa, + 0x0d, 0xd8, 0x9b, 0x34, 0x1e, 0xa0, 0xd6, 0xd8, 0x8d, 0xfb, 0xff, 0x7f, 0xf7, 0xe3, 0x49, 0x9e, + 0x53, 0xc1, 0x2c, 0xf1, 0xb0, 0xcf, 0x09, 0xf3, 0x61, 0xc8, 0x28, 0x45, 0x41, 0x00, 0x03, 0x14, + 0x22, 0x8f, 0x9b, 0x41, 0xc8, 0x22, 0xa6, 0x1d, 0xfa, 0x55, 0xf2, 0x6c, 0xee, 0x0f, 0x66, 0x01, + 0x77, 0x9a, 0x73, 0x36, 0x67, 0x02, 0x85, 0xbb, 0xaf, 0xfc, 0x56, 0x07, 0xb8, 0x8c, 0x7b, 0x8c, + 0x43, 0x07, 0x71, 0x0c, 0xe3, 0x9e, 0x83, 0x23, 0xd4, 0x83, 0x2e, 0x23, 0x7e, 0xde, 0x1b, 0x5f, + 0x15, 0xb5, 0x36, 0x11, 0xbf, 0xd1, 0x1e, 0xd4, 0xf6, 0x8c, 0xf0, 0x60, 0x19, 0x61, 0x3b, 0xc0, + 0x21, 0x61, 0x33, 0x9b, 0xf8, 0xb6, 0x43, 0x99, 0xfb, 0xc4, 0xdb, 0x72, 0x57, 0xbe, 0x52, 0x86, + 0x97, 0x59, 0xaa, 0xeb, 0x09, 0xf2, 0xe8, 0xc0, 0xf8, 0x8d, 0x34, 0xac, 0x56, 0x51, 0x4d, 0x44, + 0x33, 0xf2, 0x87, 0x22, 0xd7, 0xee, 0xd5, 0x16, 0x25, 0x31, 0xf6, 0x31, 0xe7, 0x36, 0xa7, 0x88, + 0x2f, 0x4a, 0xb5, 0x22, 0xd4, 0xdd, 0x2c, 0xd5, 0x2f, 0x72, 0xf5, 0x59, 0xcc, 0xb0, 0xfe, 0x96, + 0xf9, 0xdd, 0x2e, 0x2e, 0xac, 0x53, 0xf5, 0xdf, 0x09, 0x4e, 0xfc, 0x08, 0x87, 0x31, 0xa2, 0xed, + 0x3f, 0xc2, 0x6b, 0x64, 0xa9, 0x0e, 0xce, 0x7a, 0x4b, 0xd0, 0xb0, 0x5a, 0x3f, 0xcc, 0xa3, 0x22, + 0xd7, 0x6e, 0xd5, 0xe6, 0xfe, 0xca, 0x23, 0x22, 0xb4, 0x1c, 0xb8, 0x26, 0xc4, 0x7a, 0x96, 0xea, + 0xff, 0x4f, 0xc4, 0x47, 0x94, 0x61, 0x69, 0x65, 0x3c, 0x46, 0x84, 0xe6, 0xe3, 0x0e, 0x94, 0xd7, + 0x37, 0x5d, 0x1a, 0x2b, 0xf5, 0x4a, 0xa3, 0x3a, 0x56, 0xea, 0xd5, 0x86, 0x32, 0xbc, 0x79, 0xdf, + 0x00, 0x79, 0xbd, 0x01, 0xf2, 0xe7, 0x06, 0xc8, 0x2f, 0x5b, 0x20, 0xad, 0xb7, 0x40, 0xfa, 0xd8, + 0x02, 0x69, 0x7a, 0x3d, 0x27, 0xd1, 0x62, 0xe9, 0x98, 0x2e, 0xf3, 0xe0, 0xf1, 0xea, 0x0f, 0x07, + 0x18, 0xf7, 0xe1, 0x6a, 0xff, 0x58, 0xa2, 0x24, 0xc0, 0xdc, 0xa9, 0x89, 0xb5, 0xf6, 0xbf, 0x03, + 0x00, 0x00, 0xff, 0xff, 0x54, 0x12, 0x48, 0xc3, 0x4e, 0x02, 0x00, 0x00, +} + +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LivenessJailBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.LivenessJailBlocks)) + i-- + dAtA[i] = 0x30 + } + if m.LivenessSlashInterval != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.LivenessSlashInterval)) + i-- + dAtA[i] = 0x28 + } + if m.LivenessSlashBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.LivenessSlashBlocks)) + i-- + dAtA[i] = 0x20 + } + if m.DisputePeriodInBlocks != 0 { + i = encodeVarintParams(dAtA, i, uint64(m.DisputePeriodInBlocks)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.DisputePeriodInBlocks != 0 { + n += 1 + sovParams(uint64(m.DisputePeriodInBlocks)) + } + if m.LivenessSlashBlocks != 0 { + n += 1 + sovParams(uint64(m.LivenessSlashBlocks)) + } + if m.LivenessSlashInterval != 0 { + n += 1 + sovParams(uint64(m.LivenessSlashInterval)) + } + if m.LivenessJailBlocks != 0 { + n += 1 + sovParams(uint64(m.LivenessJailBlocks)) + } + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DisputePeriodInBlocks", wireType) + } + m.DisputePeriodInBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DisputePeriodInBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LivenessSlashBlocks", wireType) + } + m.LivenessSlashBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LivenessSlashBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LivenessSlashInterval", wireType) + } + m.LivenessSlashInterval = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LivenessSlashInterval |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 6: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LivenessJailBlocks", wireType) + } + m.LivenessJailBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LivenessJailBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/query.pb.go b/third_party/dymension/rollapp/types/query.pb.go new file mode 100644 index 000000000..7bd7cadd8 --- /dev/null +++ b/third_party/dymension/rollapp/types/query.pb.go @@ -0,0 +1,3112 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "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" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +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_6816c5236b322a4f, []int{0} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +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_6816c5236b322a4f, []int{1} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetRollappRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` +} + +func (m *QueryGetRollappRequest) Reset() { *m = QueryGetRollappRequest{} } +func (m *QueryGetRollappRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetRollappRequest) ProtoMessage() {} +func (*QueryGetRollappRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{2} +} +func (m *QueryGetRollappRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRollappRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRollappRequest.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 *QueryGetRollappRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRollappRequest.Merge(m, src) +} +func (m *QueryGetRollappRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRollappRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRollappRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRollappRequest proto.InternalMessageInfo + +func (m *QueryGetRollappRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +type QueryGetRollappByEIP155Request struct { + Eip155 uint64 `protobuf:"varint,1,opt,name=eip155,proto3" json:"eip155,omitempty"` +} + +func (m *QueryGetRollappByEIP155Request) Reset() { *m = QueryGetRollappByEIP155Request{} } +func (m *QueryGetRollappByEIP155Request) String() string { return proto.CompactTextString(m) } +func (*QueryGetRollappByEIP155Request) ProtoMessage() {} +func (*QueryGetRollappByEIP155Request) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{3} +} +func (m *QueryGetRollappByEIP155Request) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRollappByEIP155Request) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRollappByEIP155Request.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 *QueryGetRollappByEIP155Request) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRollappByEIP155Request.Merge(m, src) +} +func (m *QueryGetRollappByEIP155Request) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRollappByEIP155Request) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRollappByEIP155Request.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRollappByEIP155Request proto.InternalMessageInfo + +func (m *QueryGetRollappByEIP155Request) GetEip155() uint64 { + if m != nil { + return m.Eip155 + } + return 0 +} + +type QueryGetLatestHeightRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + Finalized bool `protobuf:"varint,2,opt,name=finalized,proto3" json:"finalized,omitempty"` +} + +func (m *QueryGetLatestHeightRequest) Reset() { *m = QueryGetLatestHeightRequest{} } +func (m *QueryGetLatestHeightRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetLatestHeightRequest) ProtoMessage() {} +func (*QueryGetLatestHeightRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{4} +} +func (m *QueryGetLatestHeightRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetLatestHeightRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetLatestHeightRequest.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 *QueryGetLatestHeightRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetLatestHeightRequest.Merge(m, src) +} +func (m *QueryGetLatestHeightRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetLatestHeightRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetLatestHeightRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetLatestHeightRequest proto.InternalMessageInfo + +func (m *QueryGetLatestHeightRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *QueryGetLatestHeightRequest) GetFinalized() bool { + if m != nil { + return m.Finalized + } + return false +} + +type QueryGetLatestHeightResponse struct { + Height uint64 `protobuf:"varint,1,opt,name=height,proto3" json:"height,omitempty"` +} + +func (m *QueryGetLatestHeightResponse) Reset() { *m = QueryGetLatestHeightResponse{} } +func (m *QueryGetLatestHeightResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetLatestHeightResponse) ProtoMessage() {} +func (*QueryGetLatestHeightResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{5} +} +func (m *QueryGetLatestHeightResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetLatestHeightResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetLatestHeightResponse.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 *QueryGetLatestHeightResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetLatestHeightResponse.Merge(m, src) +} +func (m *QueryGetLatestHeightResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetLatestHeightResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetLatestHeightResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetLatestHeightResponse proto.InternalMessageInfo + +func (m *QueryGetLatestHeightResponse) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +type QueryGetLatestStateIndexRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + Finalized bool `protobuf:"varint,2,opt,name=finalized,proto3" json:"finalized,omitempty"` +} + +func (m *QueryGetLatestStateIndexRequest) Reset() { *m = QueryGetLatestStateIndexRequest{} } +func (m *QueryGetLatestStateIndexRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetLatestStateIndexRequest) ProtoMessage() {} +func (*QueryGetLatestStateIndexRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{6} +} +func (m *QueryGetLatestStateIndexRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetLatestStateIndexRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetLatestStateIndexRequest.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 *QueryGetLatestStateIndexRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetLatestStateIndexRequest.Merge(m, src) +} +func (m *QueryGetLatestStateIndexRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetLatestStateIndexRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetLatestStateIndexRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetLatestStateIndexRequest proto.InternalMessageInfo + +func (m *QueryGetLatestStateIndexRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *QueryGetLatestStateIndexRequest) GetFinalized() bool { + if m != nil { + return m.Finalized + } + return false +} + +type QueryGetLatestStateIndexResponse struct { + StateIndex StateInfoIndex `protobuf:"bytes,1,opt,name=stateIndex,proto3" json:"stateIndex"` +} + +func (m *QueryGetLatestStateIndexResponse) Reset() { *m = QueryGetLatestStateIndexResponse{} } +func (m *QueryGetLatestStateIndexResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetLatestStateIndexResponse) ProtoMessage() {} +func (*QueryGetLatestStateIndexResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{7} +} +func (m *QueryGetLatestStateIndexResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetLatestStateIndexResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetLatestStateIndexResponse.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 *QueryGetLatestStateIndexResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetLatestStateIndexResponse.Merge(m, src) +} +func (m *QueryGetLatestStateIndexResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetLatestStateIndexResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetLatestStateIndexResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetLatestStateIndexResponse proto.InternalMessageInfo + +func (m *QueryGetLatestStateIndexResponse) GetStateIndex() StateInfoIndex { + if m != nil { + return m.StateIndex + } + return StateInfoIndex{} +} + +type QueryGetRollappResponse struct { + Rollapp Rollapp `protobuf:"bytes,1,opt,name=rollapp,proto3" json:"rollapp"` + // Defines the index of the last rollapp UpdateState. + LatestStateIndex *StateInfoIndex `protobuf:"bytes,2,opt,name=latestStateIndex,proto3" json:"latestStateIndex,omitempty"` + // Defines the index of the last rollapp UpdateState that was finalized. + LatestFinalizedStateIndex *StateInfoIndex `protobuf:"bytes,3,opt,name=latestFinalizedStateIndex,proto3" json:"latestFinalizedStateIndex,omitempty"` + LatestHeight uint64 `protobuf:"varint,4,opt,name=latestHeight,proto3" json:"latestHeight,omitempty"` + LatestFinalizedHeight uint64 `protobuf:"varint,5,opt,name=latestFinalizedHeight,proto3" json:"latestFinalizedHeight,omitempty"` +} + +func (m *QueryGetRollappResponse) Reset() { *m = QueryGetRollappResponse{} } +func (m *QueryGetRollappResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetRollappResponse) ProtoMessage() {} +func (*QueryGetRollappResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{8} +} +func (m *QueryGetRollappResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetRollappResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetRollappResponse.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 *QueryGetRollappResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetRollappResponse.Merge(m, src) +} +func (m *QueryGetRollappResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetRollappResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetRollappResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetRollappResponse proto.InternalMessageInfo + +func (m *QueryGetRollappResponse) GetRollapp() Rollapp { + if m != nil { + return m.Rollapp + } + return Rollapp{} +} + +func (m *QueryGetRollappResponse) GetLatestStateIndex() *StateInfoIndex { + if m != nil { + return m.LatestStateIndex + } + return nil +} + +func (m *QueryGetRollappResponse) GetLatestFinalizedStateIndex() *StateInfoIndex { + if m != nil { + return m.LatestFinalizedStateIndex + } + return nil +} + +func (m *QueryGetRollappResponse) GetLatestHeight() uint64 { + if m != nil { + return m.LatestHeight + } + return 0 +} + +func (m *QueryGetRollappResponse) GetLatestFinalizedHeight() uint64 { + if m != nil { + return m.LatestFinalizedHeight + } + return 0 +} + +type QueryAllRollappRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRollappRequest) Reset() { *m = QueryAllRollappRequest{} } +func (m *QueryAllRollappRequest) String() string { return proto.CompactTextString(m) } +func (*QueryAllRollappRequest) ProtoMessage() {} +func (*QueryAllRollappRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{9} +} +func (m *QueryAllRollappRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRollappRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRollappRequest.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 *QueryAllRollappRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRollappRequest.Merge(m, src) +} +func (m *QueryAllRollappRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRollappRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRollappRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRollappRequest proto.InternalMessageInfo + +func (m *QueryAllRollappRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryAllRollappResponse struct { + Rollapp []RollappSummary `protobuf:"bytes,1,rep,name=rollapp,proto3" json:"rollapp"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +func (m *QueryAllRollappResponse) Reset() { *m = QueryAllRollappResponse{} } +func (m *QueryAllRollappResponse) String() string { return proto.CompactTextString(m) } +func (*QueryAllRollappResponse) ProtoMessage() {} +func (*QueryAllRollappResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{10} +} +func (m *QueryAllRollappResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryAllRollappResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryAllRollappResponse.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 *QueryAllRollappResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryAllRollappResponse.Merge(m, src) +} +func (m *QueryAllRollappResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryAllRollappResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryAllRollappResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryAllRollappResponse proto.InternalMessageInfo + +func (m *QueryAllRollappResponse) GetRollapp() []RollappSummary { + if m != nil { + return m.Rollapp + } + return nil +} + +func (m *QueryAllRollappResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetStateInfoRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` + Height uint64 `protobuf:"varint,3,opt,name=height,proto3" json:"height,omitempty"` + Finalized bool `protobuf:"varint,4,opt,name=finalized,proto3" json:"finalized,omitempty"` +} + +func (m *QueryGetStateInfoRequest) Reset() { *m = QueryGetStateInfoRequest{} } +func (m *QueryGetStateInfoRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetStateInfoRequest) ProtoMessage() {} +func (*QueryGetStateInfoRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{11} +} +func (m *QueryGetStateInfoRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetStateInfoRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetStateInfoRequest.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 *QueryGetStateInfoRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetStateInfoRequest.Merge(m, src) +} +func (m *QueryGetStateInfoRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetStateInfoRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetStateInfoRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetStateInfoRequest proto.InternalMessageInfo + +func (m *QueryGetStateInfoRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *QueryGetStateInfoRequest) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +func (m *QueryGetStateInfoRequest) GetHeight() uint64 { + if m != nil { + return m.Height + } + return 0 +} + +func (m *QueryGetStateInfoRequest) GetFinalized() bool { + if m != nil { + return m.Finalized + } + return false +} + +type QueryGetStateInfoResponse struct { + StateInfo StateInfo `protobuf:"bytes,1,opt,name=stateInfo,proto3" json:"stateInfo"` +} + +func (m *QueryGetStateInfoResponse) Reset() { *m = QueryGetStateInfoResponse{} } +func (m *QueryGetStateInfoResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetStateInfoResponse) ProtoMessage() {} +func (*QueryGetStateInfoResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_6816c5236b322a4f, []int{12} +} +func (m *QueryGetStateInfoResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetStateInfoResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetStateInfoResponse.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 *QueryGetStateInfoResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetStateInfoResponse.Merge(m, src) +} +func (m *QueryGetStateInfoResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetStateInfoResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetStateInfoResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetStateInfoResponse proto.InternalMessageInfo + +func (m *QueryGetStateInfoResponse) GetStateInfo() StateInfo { + if m != nil { + return m.StateInfo + } + return StateInfo{} +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "dymensionxyz.dymension.rollapp.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "dymensionxyz.dymension.rollapp.QueryParamsResponse") + proto.RegisterType((*QueryGetRollappRequest)(nil), "dymensionxyz.dymension.rollapp.QueryGetRollappRequest") + proto.RegisterType((*QueryGetRollappByEIP155Request)(nil), "dymensionxyz.dymension.rollapp.QueryGetRollappByEIP155Request") + proto.RegisterType((*QueryGetLatestHeightRequest)(nil), "dymensionxyz.dymension.rollapp.QueryGetLatestHeightRequest") + proto.RegisterType((*QueryGetLatestHeightResponse)(nil), "dymensionxyz.dymension.rollapp.QueryGetLatestHeightResponse") + proto.RegisterType((*QueryGetLatestStateIndexRequest)(nil), "dymensionxyz.dymension.rollapp.QueryGetLatestStateIndexRequest") + proto.RegisterType((*QueryGetLatestStateIndexResponse)(nil), "dymensionxyz.dymension.rollapp.QueryGetLatestStateIndexResponse") + proto.RegisterType((*QueryGetRollappResponse)(nil), "dymensionxyz.dymension.rollapp.QueryGetRollappResponse") + proto.RegisterType((*QueryAllRollappRequest)(nil), "dymensionxyz.dymension.rollapp.QueryAllRollappRequest") + proto.RegisterType((*QueryAllRollappResponse)(nil), "dymensionxyz.dymension.rollapp.QueryAllRollappResponse") + proto.RegisterType((*QueryGetStateInfoRequest)(nil), "dymensionxyz.dymension.rollapp.QueryGetStateInfoRequest") + proto.RegisterType((*QueryGetStateInfoResponse)(nil), "dymensionxyz.dymension.rollapp.QueryGetStateInfoResponse") +} + +func init() { proto.RegisterFile("dymension/rollapp/query.proto", fileDescriptor_6816c5236b322a4f) } + +var fileDescriptor_6816c5236b322a4f = []byte{ + // 900 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x56, 0x4d, 0x4f, 0x33, 0x55, + 0x14, 0xee, 0xd0, 0xd2, 0xd7, 0x1e, 0xdf, 0x44, 0x72, 0x45, 0x2c, 0x15, 0x07, 0x32, 0x0b, 0x3e, + 0x5c, 0xcc, 0xa4, 0x94, 0xf2, 0x11, 0x0c, 0x02, 0x51, 0x90, 0x44, 0x09, 0x0e, 0x6e, 0xc4, 0x18, + 0x9c, 0xd2, 0xcb, 0x30, 0x66, 0x3a, 0x33, 0x74, 0xa6, 0xa4, 0x85, 0xb0, 0x31, 0xc6, 0xb5, 0x89, + 0xbf, 0xc0, 0x3f, 0xe0, 0xc2, 0x8d, 0x3f, 0xc0, 0x0d, 0x0b, 0x17, 0x24, 0x26, 0xc6, 0x8d, 0xc6, + 0x80, 0x3f, 0xc4, 0xf4, 0xde, 0x33, 0xd3, 0xf9, 0x68, 0xed, 0xb4, 0x71, 0xd5, 0xce, 0xbd, 0xe7, + 0x79, 0xce, 0x73, 0xee, 0x39, 0xf7, 0x9c, 0x0b, 0x6f, 0xd7, 0x3b, 0x0d, 0x6a, 0xb9, 0x86, 0x6d, + 0x29, 0x4d, 0xdb, 0x34, 0x35, 0xc7, 0x51, 0xae, 0x5b, 0xb4, 0xd9, 0x91, 0x9d, 0xa6, 0xed, 0xd9, + 0x44, 0x0c, 0xb6, 0xdb, 0x9d, 0x5b, 0x39, 0xf8, 0x90, 0xd1, 0xb6, 0x34, 0xad, 0xdb, 0xba, 0xcd, + 0x4c, 0x95, 0xee, 0x3f, 0x8e, 0x2a, 0xcd, 0xe9, 0xb6, 0xad, 0x9b, 0x54, 0xd1, 0x1c, 0x43, 0xd1, + 0x2c, 0xcb, 0xf6, 0x34, 0xcf, 0xb0, 0x2d, 0x17, 0x77, 0xdf, 0xb9, 0xb0, 0xdd, 0x86, 0xed, 0x2a, + 0x35, 0xcd, 0xa5, 0xdc, 0x99, 0x72, 0x53, 0xae, 0x51, 0x4f, 0x2b, 0x2b, 0x8e, 0xa6, 0x1b, 0x16, + 0x33, 0x46, 0x5b, 0x31, 0x29, 0xcf, 0xd1, 0x9a, 0x5a, 0xc3, 0xe7, 0x9a, 0x4f, 0xee, 0xe3, 0x2f, + 0x1a, 0x48, 0x49, 0x03, 0xd7, 0xd3, 0x3c, 0x7a, 0x6e, 0x58, 0x97, 0x28, 0x57, 0x9a, 0x06, 0xf2, + 0x49, 0x57, 0xc6, 0x09, 0x63, 0x56, 0xe9, 0x75, 0x8b, 0xba, 0x9e, 0xf4, 0x39, 0xbc, 0x1e, 0x59, + 0x75, 0x1d, 0xdb, 0x72, 0x29, 0x79, 0x1f, 0xf2, 0x5c, 0x41, 0x51, 0x58, 0x10, 0x96, 0x5f, 0x5d, + 0x5d, 0x94, 0xff, 0xfb, 0x88, 0x64, 0x8e, 0xdf, 0xcf, 0x3d, 0xfc, 0x35, 0x9f, 0x51, 0x11, 0x2b, + 0xad, 0xc3, 0x0c, 0x23, 0x3f, 0xa4, 0x9e, 0xca, 0xed, 0xd0, 0x2d, 0x99, 0x83, 0x02, 0x22, 0x8f, + 0xea, 0xcc, 0x45, 0x41, 0xed, 0x2d, 0x48, 0x9b, 0x20, 0xc6, 0x70, 0xfb, 0x9d, 0x0f, 0x8e, 0x4e, + 0xca, 0xd5, 0xaa, 0x8f, 0x9f, 0x81, 0x3c, 0x35, 0x9c, 0x72, 0xb5, 0xca, 0xc0, 0x39, 0x15, 0xbf, + 0xa4, 0xcf, 0xe0, 0x2d, 0x1f, 0xf9, 0x91, 0xe6, 0x51, 0xd7, 0xfb, 0x90, 0x1a, 0xfa, 0x95, 0x97, + 0xca, 0x6d, 0x77, 0xf7, 0xd2, 0xb0, 0x34, 0xd3, 0xb8, 0xa5, 0xf5, 0xe2, 0xc4, 0x82, 0xb0, 0xfc, + 0x8a, 0xda, 0x5b, 0x90, 0xd6, 0x61, 0xae, 0x3f, 0x35, 0x1e, 0xd9, 0x0c, 0xe4, 0xaf, 0xd8, 0x8a, + 0x2f, 0x89, 0x7f, 0x49, 0x5f, 0xc0, 0x7c, 0x14, 0x77, 0xda, 0xcd, 0xcc, 0x91, 0x55, 0xa7, 0xed, + 0xff, 0x43, 0x56, 0x1b, 0x16, 0x06, 0xd3, 0xa3, 0xb4, 0x4f, 0x01, 0xdc, 0x60, 0x15, 0x33, 0x2a, + 0x0f, 0xcb, 0x28, 0xf2, 0x5c, 0xda, 0x0c, 0x85, 0x99, 0x0d, 0xf1, 0x48, 0xdf, 0x66, 0xe1, 0xcd, + 0x44, 0x7a, 0xd1, 0xe3, 0x21, 0xbc, 0x40, 0x1e, 0x74, 0xb7, 0x34, 0xcc, 0x9d, 0x9f, 0x68, 0xee, + 0xc7, 0x47, 0x93, 0x33, 0x98, 0x32, 0x63, 0x61, 0xb1, 0x33, 0x18, 0x39, 0x00, 0x35, 0xc1, 0x43, + 0x4c, 0x98, 0xe5, 0x6b, 0x07, 0xfe, 0x69, 0x86, 0x9c, 0x64, 0xc7, 0x72, 0x32, 0x98, 0x90, 0x48, + 0xf0, 0xd2, 0x0c, 0xd5, 0x4d, 0x31, 0xc7, 0xaa, 0x24, 0xb2, 0x46, 0xd6, 0xe0, 0x8d, 0x18, 0x01, + 0x1a, 0x4f, 0x32, 0xe3, 0xfe, 0x9b, 0xd2, 0x97, 0x78, 0xcd, 0xf6, 0x4c, 0x33, 0x76, 0xcd, 0x0e, + 0x00, 0x7a, 0xcd, 0x26, 0xb8, 0xca, 0xbc, 0x33, 0xc9, 0xdd, 0xce, 0x24, 0xf3, 0x36, 0x88, 0x9d, + 0x49, 0x3e, 0xd1, 0x74, 0x8a, 0x58, 0x35, 0x84, 0x94, 0x7e, 0x12, 0x30, 0xd5, 0x61, 0x17, 0x98, + 0xea, 0xe3, 0x70, 0xaa, 0xb3, 0x69, 0xce, 0x0c, 0x19, 0x4e, 0x5b, 0x8d, 0x86, 0xd6, 0xec, 0xc4, + 0x33, 0x7e, 0x18, 0xd1, 0x3c, 0x81, 0xd5, 0x33, 0x4c, 0x33, 0x17, 0x13, 0x11, 0xfd, 0x8d, 0x00, + 0x45, 0xbf, 0x3e, 0x83, 0x34, 0xa5, 0xbb, 0x72, 0xd3, 0x30, 0x69, 0x04, 0xa5, 0x96, 0x53, 0xf9, + 0x47, 0xe8, 0x86, 0x67, 0xc3, 0x37, 0x3c, 0x7a, 0x41, 0x73, 0xf1, 0x0b, 0xfa, 0x15, 0xcc, 0xf6, + 0x51, 0x81, 0x87, 0xf7, 0x31, 0x14, 0x5c, 0x7f, 0x11, 0xf3, 0xb3, 0x92, 0xba, 0xe4, 0xf0, 0xe4, + 0x7a, 0x0c, 0xab, 0xbf, 0x03, 0x4c, 0x32, 0x67, 0xe4, 0x07, 0x01, 0xf2, 0xbc, 0x27, 0x93, 0xd5, + 0x61, 0x84, 0xc9, 0xb1, 0x50, 0xaa, 0x8c, 0x84, 0xe1, 0xc1, 0x48, 0xf2, 0xd7, 0xbf, 0xfd, 0xf3, + 0xfd, 0xc4, 0x32, 0x59, 0x54, 0xc2, 0x60, 0x65, 0xd0, 0x70, 0x23, 0x3f, 0x0b, 0xf0, 0x02, 0x6b, + 0x81, 0xac, 0xa7, 0x72, 0x98, 0x18, 0x24, 0xa5, 0x8d, 0x91, 0x71, 0x28, 0x76, 0x9b, 0x89, 0xad, + 0x92, 0xca, 0x30, 0xb1, 0xfe, 0xef, 0x5d, 0x50, 0x1e, 0xf7, 0xe4, 0x17, 0x01, 0x5e, 0x8b, 0x4d, + 0x26, 0xb2, 0x33, 0xa2, 0x92, 0xd8, 0x48, 0x1b, 0x3f, 0x92, 0x0d, 0x16, 0x49, 0x99, 0x28, 0xc3, + 0x22, 0xe1, 0x33, 0x52, 0xb9, 0xe3, 0xbf, 0xf7, 0xe4, 0x47, 0x01, 0x00, 0xc9, 0xf6, 0x4c, 0x33, + 0x65, 0x0a, 0x12, 0x4d, 0x26, 0xa5, 0xf0, 0x64, 0xe7, 0x90, 0x14, 0x26, 0x7c, 0x85, 0x2c, 0xa5, + 0x4c, 0x01, 0xf9, 0x55, 0x80, 0x97, 0xe1, 0xd9, 0x4b, 0xb6, 0xd3, 0x9e, 0x59, 0x9f, 0xc7, 0x40, + 0xe9, 0xdd, 0xf1, 0xc0, 0x28, 0x7e, 0x8f, 0x89, 0xdf, 0x26, 0x5b, 0xc3, 0xc4, 0xf3, 0x9e, 0x7d, + 0xce, 0x7b, 0x45, 0xa4, 0x8a, 0xfe, 0x14, 0x60, 0x2a, 0x3e, 0xb3, 0xc9, 0x7b, 0xa3, 0xa9, 0x4a, + 0x3c, 0x26, 0x4a, 0xbb, 0xe3, 0x13, 0x60, 0x68, 0x07, 0x2c, 0xb4, 0x5d, 0xb2, 0x93, 0x32, 0x34, + 0xff, 0xa9, 0x59, 0xa7, 0xed, 0x48, 0x7c, 0x0f, 0x02, 0x14, 0x82, 0x66, 0x45, 0x36, 0xd3, 0xea, + 0x8a, 0xf7, 0xea, 0xd2, 0xd6, 0x18, 0xc8, 0x51, 0x43, 0xe9, 0x3d, 0x97, 0xc3, 0x21, 0x28, 0x77, + 0x2c, 0xaa, 0xfb, 0xfd, 0xe3, 0x87, 0x27, 0x51, 0x78, 0x7c, 0x12, 0x85, 0xbf, 0x9f, 0x44, 0xe1, + 0xbb, 0x67, 0x31, 0xf3, 0xf8, 0x2c, 0x66, 0xfe, 0x78, 0x16, 0x33, 0x67, 0x6b, 0xba, 0xe1, 0x5d, + 0xb5, 0x6a, 0xf2, 0x85, 0xdd, 0x18, 0xe4, 0xe3, 0xa6, 0xa2, 0xb4, 0x03, 0x47, 0x5e, 0xc7, 0xa1, + 0x6e, 0x2d, 0xcf, 0xde, 0xe4, 0x95, 0x7f, 0x03, 0x00, 0x00, 0xff, 0xff, 0x05, 0x4c, 0xda, 0x84, + 0x99, 0x0c, 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 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a Rollapp by index. + Rollapp(ctx context.Context, in *QueryGetRollappRequest, opts ...grpc.CallOption) (*QueryGetRollappResponse, error) + // Queries a Rollapp by index. + RollappByEIP155(ctx context.Context, in *QueryGetRollappByEIP155Request, opts ...grpc.CallOption) (*QueryGetRollappResponse, error) + // Queries a list of Rollapp items. + RollappAll(ctx context.Context, in *QueryAllRollappRequest, opts ...grpc.CallOption) (*QueryAllRollappResponse, error) + // Queries a LatestHeight by rollapp-id. + LatestHeight(ctx context.Context, in *QueryGetLatestHeightRequest, opts ...grpc.CallOption) (*QueryGetLatestHeightResponse, error) + // Queries a LatestStateIndex by rollapp-id. + LatestStateIndex(ctx context.Context, in *QueryGetLatestStateIndexRequest, opts ...grpc.CallOption) (*QueryGetLatestStateIndexResponse, error) + // Queries a StateInfo by index. + StateInfo(ctx context.Context, in *QueryGetStateInfoRequest, opts ...grpc.CallOption) (*QueryGetStateInfoResponse, error) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Rollapp(ctx context.Context, in *QueryGetRollappRequest, opts ...grpc.CallOption) (*QueryGetRollappResponse, error) { + out := new(QueryGetRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/Rollapp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RollappByEIP155(ctx context.Context, in *QueryGetRollappByEIP155Request, opts ...grpc.CallOption) (*QueryGetRollappResponse, error) { + out := new(QueryGetRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/RollappByEIP155", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) RollappAll(ctx context.Context, in *QueryAllRollappRequest, opts ...grpc.CallOption) (*QueryAllRollappResponse, error) { + out := new(QueryAllRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/RollappAll", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) LatestHeight(ctx context.Context, in *QueryGetLatestHeightRequest, opts ...grpc.CallOption) (*QueryGetLatestHeightResponse, error) { + out := new(QueryGetLatestHeightResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/LatestHeight", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) LatestStateIndex(ctx context.Context, in *QueryGetLatestStateIndexRequest, opts ...grpc.CallOption) (*QueryGetLatestStateIndexResponse, error) { + out := new(QueryGetLatestStateIndexResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/LatestStateIndex", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) StateInfo(ctx context.Context, in *QueryGetStateInfoRequest, opts ...grpc.CallOption) (*QueryGetStateInfoResponse, error) { + out := new(QueryGetStateInfoResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Query/StateInfo", 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. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a Rollapp by index. + Rollapp(context.Context, *QueryGetRollappRequest) (*QueryGetRollappResponse, error) + // Queries a Rollapp by index. + RollappByEIP155(context.Context, *QueryGetRollappByEIP155Request) (*QueryGetRollappResponse, error) + // Queries a list of Rollapp items. + RollappAll(context.Context, *QueryAllRollappRequest) (*QueryAllRollappResponse, error) + // Queries a LatestHeight by rollapp-id. + LatestHeight(context.Context, *QueryGetLatestHeightRequest) (*QueryGetLatestHeightResponse, error) + // Queries a LatestStateIndex by rollapp-id. + LatestStateIndex(context.Context, *QueryGetLatestStateIndexRequest) (*QueryGetLatestStateIndexResponse, error) + // Queries a StateInfo by index. + StateInfo(context.Context, *QueryGetStateInfoRequest) (*QueryGetStateInfoResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Rollapp(ctx context.Context, req *QueryGetRollappRequest) (*QueryGetRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Rollapp not implemented") +} +func (*UnimplementedQueryServer) RollappByEIP155(ctx context.Context, req *QueryGetRollappByEIP155Request) (*QueryGetRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RollappByEIP155 not implemented") +} +func (*UnimplementedQueryServer) RollappAll(ctx context.Context, req *QueryAllRollappRequest) (*QueryAllRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method RollappAll not implemented") +} +func (*UnimplementedQueryServer) LatestHeight(ctx context.Context, req *QueryGetLatestHeightRequest) (*QueryGetLatestHeightResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LatestHeight not implemented") +} +func (*UnimplementedQueryServer) LatestStateIndex(ctx context.Context, req *QueryGetLatestStateIndexRequest) (*QueryGetLatestStateIndexResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method LatestStateIndex not implemented") +} +func (*UnimplementedQueryServer) StateInfo(ctx context.Context, req *QueryGetStateInfoRequest) (*QueryGetStateInfoResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method StateInfo not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Rollapp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRollappRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Rollapp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/Rollapp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Rollapp(ctx, req.(*QueryGetRollappRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RollappByEIP155_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetRollappByEIP155Request) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RollappByEIP155(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/RollappByEIP155", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RollappByEIP155(ctx, req.(*QueryGetRollappByEIP155Request)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_RollappAll_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryAllRollappRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).RollappAll(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/RollappAll", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).RollappAll(ctx, req.(*QueryAllRollappRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_LatestHeight_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetLatestHeightRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LatestHeight(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/LatestHeight", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LatestHeight(ctx, req.(*QueryGetLatestHeightRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_LatestStateIndex_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetLatestStateIndexRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).LatestStateIndex(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/LatestStateIndex", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).LatestStateIndex(ctx, req.(*QueryGetLatestStateIndexRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_StateInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetStateInfoRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).StateInfo(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Query/StateInfo", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).StateInfo(ctx, req.(*QueryGetStateInfoRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "dymensionxyz.dymension.rollapp.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Rollapp", + Handler: _Query_Rollapp_Handler, + }, + { + MethodName: "RollappByEIP155", + Handler: _Query_RollappByEIP155_Handler, + }, + { + MethodName: "RollappAll", + Handler: _Query_RollappAll_Handler, + }, + { + MethodName: "LatestHeight", + Handler: _Query_LatestHeight_Handler, + }, + { + MethodName: "LatestStateIndex", + Handler: _Query_LatestStateIndex_Handler, + }, + { + MethodName: "StateInfo", + Handler: _Query_StateInfo_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "dymension/rollapp/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetRollappRequest) 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 *QueryGetRollappRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRollappRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetRollappByEIP155Request) 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 *QueryGetRollappByEIP155Request) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRollappByEIP155Request) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Eip155 != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Eip155)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetLatestHeightRequest) 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 *QueryGetLatestHeightRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetLatestHeightRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Finalized { + i-- + if m.Finalized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetLatestHeightResponse) 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 *QueryGetLatestHeightResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetLatestHeightResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryGetLatestStateIndexRequest) 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 *QueryGetLatestStateIndexRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetLatestStateIndexRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Finalized { + i-- + if m.Finalized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetLatestStateIndexResponse) 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 *QueryGetLatestStateIndexResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetLatestStateIndexResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.StateIndex.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 *QueryGetRollappResponse) 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 *QueryGetRollappResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetRollappResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LatestFinalizedHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.LatestFinalizedHeight)) + i-- + dAtA[i] = 0x28 + } + if m.LatestHeight != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.LatestHeight)) + i-- + dAtA[i] = 0x20 + } + if m.LatestFinalizedStateIndex != nil { + { + size, err := m.LatestFinalizedStateIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.LatestStateIndex != nil { + { + size, err := m.LatestStateIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + { + size, err := m.Rollapp.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 *QueryAllRollappRequest) 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 *QueryAllRollappRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRollappRequest) 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 *QueryAllRollappResponse) 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 *QueryAllRollappResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryAllRollappResponse) 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.Rollapp) > 0 { + for iNdEx := len(m.Rollapp) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Rollapp[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 (m *QueryGetStateInfoRequest) 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 *QueryGetStateInfoRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetStateInfoRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Finalized { + i-- + if m.Finalized { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } + if m.Height != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Height)) + i-- + dAtA[i] = 0x18 + } + if m.Index != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x10 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetStateInfoResponse) 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 *QueryGetStateInfoResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetStateInfoResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.StateInfo.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 + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetRollappRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetRollappByEIP155Request) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Eip155 != 0 { + n += 1 + sovQuery(uint64(m.Eip155)) + } + return n +} + +func (m *QueryGetLatestHeightRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Finalized { + n += 2 + } + return n +} + +func (m *QueryGetLatestHeightResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + return n +} + +func (m *QueryGetLatestStateIndexRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Finalized { + n += 2 + } + return n +} + +func (m *QueryGetLatestStateIndexResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StateIndex.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetRollappResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Rollapp.Size() + n += 1 + l + sovQuery(uint64(l)) + if m.LatestStateIndex != nil { + l = m.LatestStateIndex.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.LatestFinalizedStateIndex != nil { + l = m.LatestFinalizedStateIndex.Size() + n += 1 + l + sovQuery(uint64(l)) + } + if m.LatestHeight != 0 { + n += 1 + sovQuery(uint64(m.LatestHeight)) + } + if m.LatestFinalizedHeight != 0 { + n += 1 + sovQuery(uint64(m.LatestFinalizedHeight)) + } + return n +} + +func (m *QueryAllRollappRequest) 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 *QueryAllRollappResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Rollapp) > 0 { + for _, e := range m.Rollapp { + 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 (m *QueryGetStateInfoRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Index != 0 { + n += 1 + sovQuery(uint64(m.Index)) + } + if m.Height != 0 { + n += 1 + sovQuery(uint64(m.Height)) + } + if m.Finalized { + n += 2 + } + return n +} + +func (m *QueryGetStateInfoResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StateInfo.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 err := m.Params.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 *QueryGetRollappRequest) 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: QueryGetRollappRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRollappRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetRollappByEIP155Request) 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: QueryGetRollappByEIP155Request: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRollappByEIP155Request: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Eip155", wireType) + } + m.Eip155 = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Eip155 |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryGetLatestHeightRequest) 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: QueryGetLatestHeightRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLatestHeightRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Finalized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Finalized = bool(v != 0) + 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 *QueryGetLatestHeightResponse) 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: QueryGetLatestHeightResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLatestHeightResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryGetLatestStateIndexRequest) 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: QueryGetLatestStateIndexRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLatestStateIndexRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Finalized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Finalized = bool(v != 0) + 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 *QueryGetLatestStateIndexResponse) 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: QueryGetLatestStateIndexResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetLatestStateIndexResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateIndex", 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 err := m.StateIndex.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 *QueryGetRollappResponse) 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: QueryGetRollappResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetRollappResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rollapp", 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 err := m.Rollapp.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestStateIndex", 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.LatestStateIndex == nil { + m.LatestStateIndex = &StateInfoIndex{} + } + if err := m.LatestStateIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestFinalizedStateIndex", 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.LatestFinalizedStateIndex == nil { + m.LatestFinalizedStateIndex = &StateInfoIndex{} + } + if err := m.LatestFinalizedStateIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestHeight", wireType) + } + m.LatestHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LatestHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestFinalizedHeight", wireType) + } + m.LatestFinalizedHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LatestFinalizedHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryAllRollappRequest) 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: QueryAllRollappRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRollappRequest: 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 *QueryAllRollappResponse) 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: QueryAllRollappResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryAllRollappResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Rollapp", 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.Rollapp = append(m.Rollapp, RollappSummary{}) + if err := m.Rollapp[len(m.Rollapp)-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 (m *QueryGetStateInfoRequest) 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: QueryGetStateInfoRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetStateInfoRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Height |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Finalized", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Finalized = bool(v != 0) + 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 *QueryGetStateInfoResponse) 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: QueryGetStateInfoResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetStateInfoResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateInfo", 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 err := m.StateInfo.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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/query.pb.gw.go b/third_party/dymension/rollapp/types/query.pb.gw.go new file mode 100644 index 000000000..190a21b4b --- /dev/null +++ b/third_party/dymension/rollapp/types/query.pb.gw.go @@ -0,0 +1,817 @@ +// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT. +// source: dymension/rollapp/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_Rollapp_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRollappRequest + 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.Rollapp(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_Rollapp_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRollappRequest + 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.Rollapp(ctx, &protoReq) + return msg, metadata, err + +} + +func request_Query_RollappByEIP155_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRollappByEIP155Request + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["eip155"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "eip155") + } + + protoReq.Eip155, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "eip155", err) + } + + msg, err := client.RollappByEIP155(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RollappByEIP155_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetRollappByEIP155Request + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["eip155"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "eip155") + } + + protoReq.Eip155, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "eip155", err) + } + + msg, err := server.RollappByEIP155(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_RollappAll_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)} +) + +func request_Query_RollappAll_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRollappRequest + 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_RollappAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.RollappAll(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_RollappAll_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryAllRollappRequest + 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_RollappAll_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.RollappAll(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_LatestHeight_0 = &utilities.DoubleArray{Encoding: map[string]int{"rollappId": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_LatestHeight_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetLatestHeightRequest + 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) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LatestHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LatestHeight(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LatestHeight_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetLatestHeightRequest + 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) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LatestHeight_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LatestHeight(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_LatestStateIndex_0 = &utilities.DoubleArray{Encoding: map[string]int{"rollappId": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}} +) + +func request_Query_LatestStateIndex_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetLatestStateIndexRequest + 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) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LatestStateIndex_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.LatestStateIndex(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_LatestStateIndex_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetLatestStateIndexRequest + 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) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_LatestStateIndex_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.LatestStateIndex(ctx, &protoReq) + return msg, metadata, err + +} + +var ( + filter_Query_StateInfo_0 = &utilities.DoubleArray{Encoding: map[string]int{"rollappId": 0, "index": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}} +) + +func request_Query_StateInfo_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetStateInfoRequest + 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) + } + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_StateInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := client.StateInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_StateInfo_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryGetStateInfoRequest + 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) + } + + val, ok = pathParams["index"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "index") + } + + protoReq.Index, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "index", err) + } + + if err := req.ParseForm(); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_Query_StateInfo_0); err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err) + } + + msg, err := server.StateInfo(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_Rollapp_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_Rollapp_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_Rollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RollappByEIP155_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_RollappByEIP155_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_RollappByEIP155_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RollappAll_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_RollappAll_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_RollappAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LatestHeight_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_LatestHeight_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_LatestHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LatestStateIndex_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_LatestStateIndex_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_LatestStateIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_StateInfo_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_StateInfo_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_StateInfo_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_Rollapp_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_Rollapp_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_Rollapp_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RollappByEIP155_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_RollappByEIP155_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_RollappByEIP155_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_RollappAll_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_RollappAll_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_RollappAll_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LatestHeight_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_LatestHeight_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_LatestHeight_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_LatestStateIndex_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_LatestStateIndex_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_LatestStateIndex_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + + mux.Handle("GET", pattern_Query_StateInfo_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_StateInfo_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_StateInfo_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", "rollapp", "params"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_Rollapp_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"dymensionxyz", "dymension", "rollapp", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RollappByEIP155_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 3}, []string{"dymensionxyz", "dymension", "rollapp", "eip155"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_RollappAll_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 2}, []string{"dymensionxyz", "dymension", "rollapp"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_LatestHeight_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "rollapp", "latest_height", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_LatestStateIndex_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4}, []string{"dymensionxyz", "dymension", "rollapp", "latest_state_index", "rollappId"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_StateInfo_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", "rollapp", "state_info", "rollappId", "index"}, "", runtime.AssumeColonVerbOpt(false))) +) + +var ( + forward_Query_Params_0 = runtime.ForwardResponseMessage + + forward_Query_Rollapp_0 = runtime.ForwardResponseMessage + + forward_Query_RollappByEIP155_0 = runtime.ForwardResponseMessage + + forward_Query_RollappAll_0 = runtime.ForwardResponseMessage + + forward_Query_LatestHeight_0 = runtime.ForwardResponseMessage + + forward_Query_LatestStateIndex_0 = runtime.ForwardResponseMessage + + forward_Query_StateInfo_0 = runtime.ForwardResponseMessage +) diff --git a/third_party/dymension/rollapp/types/rollapp.pb.go b/third_party/dymension/rollapp/types/rollapp.pb.go new file mode 100644 index 000000000..431f8719a --- /dev/null +++ b/third_party/dymension/rollapp/types/rollapp.pb.go @@ -0,0 +1,1479 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/rollapp.proto + +package types + +import ( + fmt "fmt" + _ "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 + +type Rollapp_VMType int32 + +const ( + Rollapp_Unspecified Rollapp_VMType = 0 + Rollapp_EVM Rollapp_VMType = 1 + Rollapp_WASM Rollapp_VMType = 2 +) + +var Rollapp_VMType_name = map[int32]string{ + 0: "Unspecified", + 1: "EVM", + 2: "WASM", +} + +var Rollapp_VMType_value = map[string]int32{ + "Unspecified": 0, + "EVM": 1, + "WASM": 2, +} + +func (x Rollapp_VMType) String() string { + return proto.EnumName(Rollapp_VMType_name, int32(x)) +} + +func (Rollapp_VMType) EnumDescriptor() ([]byte, []int) { + return fileDescriptor_2c072320fdc0abd9, []int{1, 0} +} + +// RollappGenesisState is a partial repr of the state the hub can expect the rollapp to be in upon genesis +type RollappGenesisState struct { + // If true, then full usage of the canonical ibc transfer channel is enabled. + // Note: in v3.1.0 and prior this field marked the completion of the 'genesis event' + // Keeping and renaming the field enables a seamless upgrade https://www.notion.so/dymension/ADR-x-Genesis-Bridge-Phase-2-89769aa551b5440b9ed403a101775ce1?pvs=4#89698384d815435b87393dbe45bc5a74 + // to the new genesis transfer protocol + // Note: if this field is false, ibc transfers may still be allowed in one or either direction. + TransfersEnabled bool `protobuf:"varint,2,opt,name=transfers_enabled,json=transfersEnabled,proto3" json:"transfers_enabled,omitempty"` +} + +func (m *RollappGenesisState) Reset() { *m = RollappGenesisState{} } +func (m *RollappGenesisState) String() string { return proto.CompactTextString(m) } +func (*RollappGenesisState) ProtoMessage() {} +func (*RollappGenesisState) Descriptor() ([]byte, []int) { + return fileDescriptor_2c072320fdc0abd9, []int{0} +} +func (m *RollappGenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RollappGenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RollappGenesisState.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 *RollappGenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_RollappGenesisState.Merge(m, src) +} +func (m *RollappGenesisState) XXX_Size() int { + return m.Size() +} +func (m *RollappGenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_RollappGenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_RollappGenesisState proto.InternalMessageInfo + +func (m *RollappGenesisState) GetTransfersEnabled() bool { + if m != nil { + return m.TransfersEnabled + } + return false +} + +// Rollapp defines a rollapp object. First, the RollApp is created and then +// sequencers can be created and attached. The RollApp is identified by rollappId +type Rollapp struct { + // The unique identifier of the rollapp chain. + // The rollapp_id follows the same standard as cosmos chain_id. + RollappId string `protobuf:"bytes,1,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // owner is the bech32-encoded address of the rollapp owner. + Owner string `protobuf:"bytes,2,opt,name=owner,proto3" json:"owner,omitempty"` + // genesis_state is a partial repr of the state the hub can expect the rollapp to be in upon genesis + GenesisState RollappGenesisState `protobuf:"bytes,7,opt,name=genesis_state,json=genesisState,proto3" json:"genesis_state"` + // channel_id will be set to the canonical IBC channel of the rollapp. + ChannelId string `protobuf:"bytes,8,opt,name=channel_id,json=channelId,proto3" json:"channel_id,omitempty"` + // frozen is a boolean that indicates if the rollapp is frozen. + Frozen bool `protobuf:"varint,9,opt,name=frozen,proto3" json:"frozen,omitempty"` + // registeredDenoms is a list of registered denom bases on this rollapp + RegisteredDenoms []string `protobuf:"bytes,10,rep,name=registeredDenoms,proto3" json:"registeredDenoms,omitempty"` + // unique bech32 prefix + Bech32Prefix string `protobuf:"bytes,11,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` + // checksum used to verify integrity of the genesis file + GenesisChecksum string `protobuf:"bytes,12,opt,name=genesis_checksum,json=genesisChecksum,proto3" json:"genesis_checksum,omitempty"` + // metadata is the rollapp metadata + Metadata *RollappMetadata `protobuf:"bytes,14,opt,name=metadata,proto3" json:"metadata,omitempty"` + // initial_sequencer is an option to preset one or more coma-separated bech32-encoded addresses of the + // sequencer(s) that are allowed to initially register and serve for this rollapp. + // if left empty, no sequencer is allowed to register. + // if set to "*" any sequencer can register. + InitialSequencer string `protobuf:"bytes,15,opt,name=initial_sequencer,json=initialSequencer,proto3" json:"initial_sequencer,omitempty"` + // vm_type is the type of rollapp machine: EVM or WASM + VmType Rollapp_VMType `protobuf:"varint,16,opt,name=vm_type,json=vmType,proto3,enum=dymensionxyz.dymension.rollapp.Rollapp_VMType" json:"vm_type,omitempty"` + // sealed is a boolean that indicates if the immutable fields are no longer updatable. + Sealed bool `protobuf:"varint,17,opt,name=sealed,proto3" json:"sealed,omitempty"` + // LivenessEventHeight is the height of an upcoming liveness event (slash or jail) + // 0 means not set + LivenessEventHeight int64 `protobuf:"varint,18,opt,name=liveness_event_height,json=livenessEventHeight,proto3" json:"liveness_event_height,omitempty"` + // The LastStateUpdateHeight HUB height when the last state update was received + LastStateUpdateHeight int64 `protobuf:"varint,19,opt,name=last_state_update_height,json=lastStateUpdateHeight,proto3" json:"last_state_update_height,omitempty"` +} + +func (m *Rollapp) Reset() { *m = Rollapp{} } +func (m *Rollapp) String() string { return proto.CompactTextString(m) } +func (*Rollapp) ProtoMessage() {} +func (*Rollapp) Descriptor() ([]byte, []int) { + return fileDescriptor_2c072320fdc0abd9, []int{1} +} +func (m *Rollapp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Rollapp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Rollapp.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 *Rollapp) XXX_Merge(src proto.Message) { + xxx_messageInfo_Rollapp.Merge(m, src) +} +func (m *Rollapp) XXX_Size() int { + return m.Size() +} +func (m *Rollapp) XXX_DiscardUnknown() { + xxx_messageInfo_Rollapp.DiscardUnknown(m) +} + +var xxx_messageInfo_Rollapp proto.InternalMessageInfo + +func (m *Rollapp) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *Rollapp) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *Rollapp) GetGenesisState() RollappGenesisState { + if m != nil { + return m.GenesisState + } + return RollappGenesisState{} +} + +func (m *Rollapp) GetChannelId() string { + if m != nil { + return m.ChannelId + } + return "" +} + +func (m *Rollapp) GetFrozen() bool { + if m != nil { + return m.Frozen + } + return false +} + +func (m *Rollapp) GetRegisteredDenoms() []string { + if m != nil { + return m.RegisteredDenoms + } + return nil +} + +func (m *Rollapp) GetBech32Prefix() string { + if m != nil { + return m.Bech32Prefix + } + return "" +} + +func (m *Rollapp) GetGenesisChecksum() string { + if m != nil { + return m.GenesisChecksum + } + return "" +} + +func (m *Rollapp) GetMetadata() *RollappMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *Rollapp) GetInitialSequencer() string { + if m != nil { + return m.InitialSequencer + } + return "" +} + +func (m *Rollapp) GetVmType() Rollapp_VMType { + if m != nil { + return m.VmType + } + return Rollapp_Unspecified +} + +func (m *Rollapp) GetSealed() bool { + if m != nil { + return m.Sealed + } + return false +} + +func (m *Rollapp) GetLivenessEventHeight() int64 { + if m != nil { + return m.LivenessEventHeight + } + return 0 +} + +func (m *Rollapp) GetLastStateUpdateHeight() int64 { + if m != nil { + return m.LastStateUpdateHeight + } + return 0 +} + +// Rollapp summary is a compact representation of Rollapp +type RollappSummary struct { + // The unique identifier of the rollapp chain. + // The rollappId follows the same standard as cosmos chain_id. + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // Defines the index of the last rollapp UpdateState. + LatestStateIndex *StateInfoIndex `protobuf:"bytes,2,opt,name=latestStateIndex,proto3" json:"latestStateIndex,omitempty"` + // Defines the index of the last rollapp UpdateState that was finalized. + LatestFinalizedStateIndex *StateInfoIndex `protobuf:"bytes,3,opt,name=latestFinalizedStateIndex,proto3" json:"latestFinalizedStateIndex,omitempty"` +} + +func (m *RollappSummary) Reset() { *m = RollappSummary{} } +func (m *RollappSummary) String() string { return proto.CompactTextString(m) } +func (*RollappSummary) ProtoMessage() {} +func (*RollappSummary) Descriptor() ([]byte, []int) { + return fileDescriptor_2c072320fdc0abd9, []int{2} +} +func (m *RollappSummary) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *RollappSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_RollappSummary.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 *RollappSummary) XXX_Merge(src proto.Message) { + xxx_messageInfo_RollappSummary.Merge(m, src) +} +func (m *RollappSummary) XXX_Size() int { + return m.Size() +} +func (m *RollappSummary) XXX_DiscardUnknown() { + xxx_messageInfo_RollappSummary.DiscardUnknown(m) +} + +var xxx_messageInfo_RollappSummary proto.InternalMessageInfo + +func (m *RollappSummary) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *RollappSummary) GetLatestStateIndex() *StateInfoIndex { + if m != nil { + return m.LatestStateIndex + } + return nil +} + +func (m *RollappSummary) GetLatestFinalizedStateIndex() *StateInfoIndex { + if m != nil { + return m.LatestFinalizedStateIndex + } + return nil +} + +func init() { + proto.RegisterEnum("dymensionxyz.dymension.rollapp.Rollapp_VMType", Rollapp_VMType_name, Rollapp_VMType_value) + proto.RegisterType((*RollappGenesisState)(nil), "dymensionxyz.dymension.rollapp.RollappGenesisState") + proto.RegisterType((*Rollapp)(nil), "dymensionxyz.dymension.rollapp.Rollapp") + proto.RegisterType((*RollappSummary)(nil), "dymensionxyz.dymension.rollapp.RollappSummary") +} + +func init() { proto.RegisterFile("dymension/rollapp/rollapp.proto", fileDescriptor_2c072320fdc0abd9) } + +var fileDescriptor_2c072320fdc0abd9 = []byte{ + // 688 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x54, 0xc9, 0x6e, 0xdb, 0x48, + 0x10, 0x15, 0x2d, 0x59, 0x4b, 0xcb, 0x0b, 0xdd, 0xb6, 0x67, 0x38, 0xc6, 0x98, 0x16, 0x34, 0x17, + 0xcd, 0x02, 0x12, 0x96, 0x06, 0x98, 0xf3, 0x38, 0x71, 0xbc, 0x04, 0x0a, 0x02, 0x2a, 0x76, 0x00, + 0x1f, 0x42, 0xb4, 0xc8, 0x12, 0xd5, 0x08, 0xd9, 0x64, 0xd8, 0x2d, 0x45, 0xf2, 0x57, 0xe4, 0xb3, + 0x7c, 0x09, 0xe0, 0x63, 0x4e, 0x41, 0x60, 0xff, 0x44, 0x8e, 0x01, 0x9b, 0x2d, 0xd9, 0x80, 0xb2, + 0x18, 0x39, 0x15, 0xeb, 0xbd, 0xaa, 0x7a, 0x55, 0xd5, 0x05, 0xa2, 0x3d, 0x7f, 0x1a, 0x01, 0xe3, + 0x34, 0x66, 0x76, 0x1a, 0x87, 0x21, 0x49, 0x92, 0x99, 0xb5, 0x92, 0x34, 0x16, 0x31, 0x36, 0xe7, + 0x01, 0x93, 0xe9, 0xa5, 0x35, 0x77, 0x2c, 0x15, 0xb5, 0xb3, 0x15, 0xc4, 0x41, 0x2c, 0x43, 0xed, + 0xec, 0x2b, 0xcf, 0xda, 0x31, 0xbd, 0x98, 0x47, 0x31, 0xb7, 0xfb, 0x84, 0x83, 0x3d, 0xde, 0xef, + 0x83, 0x20, 0xfb, 0xb6, 0x17, 0x53, 0xa6, 0xf8, 0x5f, 0x15, 0x1f, 0xf1, 0xc0, 0x1e, 0xef, 0x67, + 0x46, 0x11, 0xcd, 0xc5, 0x7e, 0xb8, 0x20, 0x02, 0x5c, 0xca, 0x06, 0xb3, 0xe2, 0x8d, 0xc5, 0x98, + 0x08, 0x04, 0xf1, 0x89, 0x20, 0x79, 0x44, 0xf3, 0x18, 0x6d, 0x3a, 0x39, 0x73, 0x04, 0x0c, 0x38, + 0xe5, 0xbd, 0xac, 0x06, 0xfe, 0x1b, 0x6d, 0x88, 0x94, 0x30, 0x3e, 0x80, 0x94, 0xbb, 0xc0, 0x48, + 0x3f, 0x04, 0xdf, 0x58, 0x6a, 0x68, 0xad, 0xaa, 0xa3, 0xcf, 0x89, 0xc3, 0x1c, 0x3f, 0x2d, 0x55, + 0x35, 0x7d, 0xa9, 0xf9, 0x7e, 0x19, 0x55, 0x54, 0x29, 0xbc, 0x8b, 0x90, 0xd2, 0x73, 0xa9, 0x6f, + 0x68, 0x0d, 0xad, 0x55, 0x73, 0x6a, 0x0a, 0x39, 0xf1, 0xf1, 0x16, 0x5a, 0x8e, 0xdf, 0x32, 0x48, + 0x65, 0xc5, 0x9a, 0x93, 0x3b, 0xf8, 0x15, 0x5a, 0x0d, 0xf2, 0x1e, 0x5c, 0x39, 0x88, 0x51, 0x69, + 0x68, 0xad, 0x7a, 0xbb, 0x63, 0x7d, 0x7f, 0xaf, 0xd6, 0x57, 0xfa, 0x3f, 0x28, 0x5d, 0x7d, 0xdc, + 0x2b, 0x38, 0x2b, 0xc1, 0xfd, 0x99, 0x76, 0x11, 0xf2, 0x86, 0x84, 0x31, 0x08, 0xb3, 0xa6, 0xaa, + 0x79, 0x53, 0x0a, 0x39, 0xf1, 0xf1, 0x2f, 0xa8, 0x3c, 0x48, 0xe3, 0x4b, 0x60, 0x46, 0x4d, 0xce, + 0xa9, 0x3c, 0xfc, 0x17, 0xd2, 0x53, 0x08, 0x28, 0x17, 0x90, 0x82, 0xff, 0x18, 0x58, 0x1c, 0x71, + 0x03, 0x35, 0x8a, 0xad, 0x9a, 0xb3, 0x80, 0xe3, 0x3f, 0xd0, 0x6a, 0x1f, 0xbc, 0x61, 0xa7, 0xed, + 0x26, 0x29, 0x0c, 0xe8, 0xc4, 0xa8, 0x4b, 0x95, 0x95, 0x1c, 0x7c, 0x2e, 0x31, 0xfc, 0x27, 0xd2, + 0x67, 0x73, 0x7a, 0x43, 0xf0, 0x5e, 0xf3, 0x51, 0x64, 0xac, 0xc8, 0xb8, 0x75, 0x85, 0x3f, 0x52, + 0x30, 0x7e, 0x8a, 0xaa, 0xb3, 0xf7, 0x32, 0xd6, 0xe4, 0x36, 0xec, 0x07, 0x6e, 0xa3, 0xab, 0xd2, + 0x9c, 0x79, 0x81, 0xec, 0x4d, 0x29, 0xa3, 0x82, 0x92, 0xd0, 0xe5, 0xf0, 0x66, 0x04, 0xcc, 0x83, + 0xd4, 0x58, 0x97, 0xc2, 0xba, 0x22, 0x7a, 0x33, 0x1c, 0x1f, 0xa1, 0xca, 0x38, 0x72, 0xc5, 0x34, + 0x01, 0x43, 0x6f, 0x68, 0xad, 0xb5, 0xb6, 0xf5, 0x40, 0x61, 0xeb, 0xbc, 0xfb, 0x62, 0x9a, 0x80, + 0x53, 0x1e, 0x47, 0x99, 0xcd, 0xd6, 0xca, 0x81, 0x64, 0xe7, 0xb3, 0x91, 0xaf, 0x35, 0xf7, 0x70, + 0x1b, 0x6d, 0x87, 0x74, 0x9c, 0xcd, 0xcb, 0x5d, 0x18, 0x03, 0x13, 0xee, 0x10, 0x68, 0x30, 0x14, + 0x06, 0x6e, 0x68, 0xad, 0xa2, 0xb3, 0x39, 0x23, 0x0f, 0x33, 0xee, 0x58, 0x52, 0xf8, 0x3f, 0x64, + 0x84, 0x84, 0x8b, 0xfc, 0x3c, 0xdc, 0x51, 0xe2, 0x67, 0x46, 0xa5, 0x6d, 0xca, 0xb4, 0xed, 0x8c, + 0x97, 0xcf, 0x7d, 0x26, 0xd9, 0x3c, 0xb1, 0xf9, 0x0f, 0x2a, 0xe7, 0x6d, 0xe1, 0x75, 0x54, 0x3f, + 0x63, 0x3c, 0x01, 0x8f, 0x0e, 0x28, 0xf8, 0x7a, 0x01, 0x57, 0x50, 0xf1, 0xf0, 0xbc, 0xab, 0x6b, + 0xb8, 0x8a, 0x4a, 0x2f, 0xff, 0xef, 0x75, 0xf5, 0xa5, 0xd3, 0x52, 0xb5, 0xa8, 0x57, 0x9a, 0x9f, + 0x35, 0xb4, 0xa6, 0x66, 0xea, 0x8d, 0xa2, 0x88, 0xa4, 0x53, 0xfc, 0x3b, 0xba, 0x3b, 0xe2, 0xc5, + 0xab, 0xbe, 0x40, 0x7a, 0x48, 0x04, 0x28, 0xfd, 0x13, 0xe6, 0xc3, 0x44, 0x1e, 0x78, 0xfd, 0xc7, + 0xbb, 0x53, 0x19, 0x83, 0x58, 0x66, 0x39, 0x0b, 0x75, 0x70, 0x88, 0x7e, 0xcb, 0xb1, 0x27, 0x94, + 0x91, 0x90, 0x5e, 0x82, 0x7f, 0x4f, 0xa4, 0xf8, 0x53, 0x22, 0xdf, 0x2e, 0x78, 0xf0, 0xec, 0xea, + 0xc6, 0xd4, 0xae, 0x6f, 0x4c, 0xed, 0xd3, 0x8d, 0xa9, 0xbd, 0xbb, 0x35, 0x0b, 0xd7, 0xb7, 0x66, + 0xe1, 0xc3, 0xad, 0x59, 0xb8, 0xf8, 0x37, 0xa0, 0x62, 0x38, 0xea, 0x5b, 0x5e, 0x1c, 0xd9, 0xf7, + 0xe5, 0xee, 0x1c, 0x7b, 0xdc, 0xb1, 0x27, 0xf3, 0xbf, 0x4d, 0x76, 0x40, 0xbc, 0x5f, 0x96, 0xff, + 0x9a, 0xce, 0x97, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb4, 0x5c, 0xa0, 0xd1, 0x43, 0x05, 0x00, 0x00, +} + +func (m *RollappGenesisState) 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 *RollappGenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RollappGenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.TransfersEnabled { + i-- + if m.TransfersEnabled { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + return len(dAtA) - i, nil +} + +func (m *Rollapp) 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 *Rollapp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Rollapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LastStateUpdateHeight != 0 { + i = encodeVarintRollapp(dAtA, i, uint64(m.LastStateUpdateHeight)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x98 + } + if m.LivenessEventHeight != 0 { + i = encodeVarintRollapp(dAtA, i, uint64(m.LivenessEventHeight)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x90 + } + if m.Sealed { + i-- + if m.Sealed { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x88 + } + if m.VmType != 0 { + i = encodeVarintRollapp(dAtA, i, uint64(m.VmType)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if len(m.InitialSequencer) > 0 { + i -= len(m.InitialSequencer) + copy(dAtA[i:], m.InitialSequencer) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.InitialSequencer))) + i-- + dAtA[i] = 0x7a + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollapp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x72 + } + if len(m.GenesisChecksum) > 0 { + i -= len(m.GenesisChecksum) + copy(dAtA[i:], m.GenesisChecksum) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.GenesisChecksum))) + i-- + dAtA[i] = 0x62 + } + if len(m.Bech32Prefix) > 0 { + i -= len(m.Bech32Prefix) + copy(dAtA[i:], m.Bech32Prefix) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.Bech32Prefix))) + i-- + dAtA[i] = 0x5a + } + if len(m.RegisteredDenoms) > 0 { + for iNdEx := len(m.RegisteredDenoms) - 1; iNdEx >= 0; iNdEx-- { + i -= len(m.RegisteredDenoms[iNdEx]) + copy(dAtA[i:], m.RegisteredDenoms[iNdEx]) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.RegisteredDenoms[iNdEx]))) + i-- + dAtA[i] = 0x52 + } + } + if m.Frozen { + i-- + if m.Frozen { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x48 + } + if len(m.ChannelId) > 0 { + i -= len(m.ChannelId) + copy(dAtA[i:], m.ChannelId) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.ChannelId))) + i-- + dAtA[i] = 0x42 + } + { + size, err := m.GenesisState.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollapp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0x12 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *RollappSummary) 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 *RollappSummary) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *RollappSummary) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.LatestFinalizedStateIndex != nil { + { + size, err := m.LatestFinalizedStateIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollapp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + if m.LatestStateIndex != nil { + { + size, err := m.LatestStateIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintRollapp(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintRollapp(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintRollapp(dAtA []byte, offset int, v uint64) int { + offset -= sovRollapp(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *RollappGenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.TransfersEnabled { + n += 2 + } + return n +} + +func (m *Rollapp) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + l = m.GenesisState.Size() + n += 1 + l + sovRollapp(uint64(l)) + l = len(m.ChannelId) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + if m.Frozen { + n += 2 + } + if len(m.RegisteredDenoms) > 0 { + for _, s := range m.RegisteredDenoms { + l = len(s) + n += 1 + l + sovRollapp(uint64(l)) + } + } + l = len(m.Bech32Prefix) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + l = len(m.GenesisChecksum) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovRollapp(uint64(l)) + } + l = len(m.InitialSequencer) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + if m.VmType != 0 { + n += 2 + sovRollapp(uint64(m.VmType)) + } + if m.Sealed { + n += 3 + } + if m.LivenessEventHeight != 0 { + n += 2 + sovRollapp(uint64(m.LivenessEventHeight)) + } + if m.LastStateUpdateHeight != 0 { + n += 2 + sovRollapp(uint64(m.LastStateUpdateHeight)) + } + return n +} + +func (m *RollappSummary) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovRollapp(uint64(l)) + } + if m.LatestStateIndex != nil { + l = m.LatestStateIndex.Size() + n += 1 + l + sovRollapp(uint64(l)) + } + if m.LatestFinalizedStateIndex != nil { + l = m.LatestFinalizedStateIndex.Size() + n += 1 + l + sovRollapp(uint64(l)) + } + return n +} + +func sovRollapp(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozRollapp(x uint64) (n int) { + return sovRollapp(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *RollappGenesisState) 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 ErrIntOverflowRollapp + } + 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: RollappGenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RollappGenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field TransfersEnabled", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.TransfersEnabled = bool(v != 0) + default: + iNdEx = preIndex + skippy, err := skipRollapp(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollapp + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *Rollapp) 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 ErrIntOverflowRollapp + } + 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: Rollapp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Rollapp: 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 ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + 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 Owner", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Owner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisState", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollapp + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.GenesisState.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ChannelId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ChannelId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 9: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Frozen", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Frozen = bool(v != 0) + case 10: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field RegisteredDenoms", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RegisteredDenoms = append(m.RegisteredDenoms, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + case 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bech32Prefix", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Bech32Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisChecksum", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisChecksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + 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 ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollapp + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.Metadata == nil { + m.Metadata = &RollappMetadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 15: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialSequencer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitialSequencer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VmType", wireType) + } + m.VmType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VmType |= Rollapp_VMType(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 17: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Sealed", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Sealed = bool(v != 0) + case 18: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LivenessEventHeight", wireType) + } + m.LivenessEventHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LivenessEventHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 19: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field LastStateUpdateHeight", wireType) + } + m.LastStateUpdateHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.LastStateUpdateHeight |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipRollapp(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollapp + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *RollappSummary) 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 ErrIntOverflowRollapp + } + 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: RollappSummary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: RollappSummary: 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 ErrIntOverflowRollapp + } + 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 ErrInvalidLengthRollapp + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + 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 LatestStateIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollapp + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LatestStateIndex == nil { + m.LatestStateIndex = &StateInfoIndex{} + } + if err := m.LatestStateIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LatestFinalizedStateIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowRollapp + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthRollapp + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthRollapp + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.LatestFinalizedStateIndex == nil { + m.LatestFinalizedStateIndex = &StateInfoIndex{} + } + if err := m.LatestFinalizedStateIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipRollapp(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthRollapp + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipRollapp(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, ErrIntOverflowRollapp + } + 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, ErrIntOverflowRollapp + } + 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, ErrIntOverflowRollapp + } + 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, ErrInvalidLengthRollapp + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupRollapp + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthRollapp + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthRollapp = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowRollapp = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupRollapp = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/state_info.pb.go b/third_party/dymension/rollapp/types/state_info.pb.go new file mode 100644 index 000000000..ae2e20ee5 --- /dev/null +++ b/third_party/dymension/rollapp/types/state_info.pb.go @@ -0,0 +1,1328 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/state_info.proto + +package types + +import ( + fmt "fmt" + types "github.com/dymensionxyz/dymension/v3/x/common/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 + +// StateInfoIndex is the data used for indexing and retrieving a StateInfo +// it updated and saved with every UpdateState in StateInfo. +// We use the this structure also for: +// 1. LatestStateInfoIndex which defines the rollapps' current (latest) index of the last UpdateState +// 2. LatestFinalizedStateIndex which defines the rollapps' current (latest) index of the latest StateInfo that was finalized +type StateInfoIndex struct { + // rollappId is the rollapp that the sequencer belongs to and asking to update + // it used to identify the what rollapp a StateInfo belongs + // The rollappId follows the same standard as cosmos chain_id + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // index is a sequential increasing number, updating on each + // state update used for indexing to a specific state info, the first index is 1 + Index uint64 `protobuf:"varint,2,opt,name=index,proto3" json:"index,omitempty"` +} + +func (m *StateInfoIndex) Reset() { *m = StateInfoIndex{} } +func (m *StateInfoIndex) String() string { return proto.CompactTextString(m) } +func (*StateInfoIndex) ProtoMessage() {} +func (*StateInfoIndex) Descriptor() ([]byte, []int) { + return fileDescriptor_17fce0215a9cbbfb, []int{0} +} +func (m *StateInfoIndex) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StateInfoIndex) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StateInfoIndex.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 *StateInfoIndex) XXX_Merge(src proto.Message) { + xxx_messageInfo_StateInfoIndex.Merge(m, src) +} +func (m *StateInfoIndex) XXX_Size() int { + return m.Size() +} +func (m *StateInfoIndex) XXX_DiscardUnknown() { + xxx_messageInfo_StateInfoIndex.DiscardUnknown(m) +} + +var xxx_messageInfo_StateInfoIndex proto.InternalMessageInfo + +func (m *StateInfoIndex) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *StateInfoIndex) GetIndex() uint64 { + if m != nil { + return m.Index + } + return 0 +} + +// StateInfo defines a rollapps' state. +type StateInfo struct { + // stateInfoIndex defines what rollapp the state belongs to + // and in which index it can be referenced + StateInfoIndex StateInfoIndex `protobuf:"bytes,1,opt,name=stateInfoIndex,proto3" json:"stateInfoIndex"` + // sequencer is the bech32-encoded address of the sequencer sent the update + Sequencer string `protobuf:"bytes,2,opt,name=sequencer,proto3" json:"sequencer,omitempty"` + // startHeight is the block height of the first block in the batch + StartHeight uint64 `protobuf:"varint,3,opt,name=startHeight,proto3" json:"startHeight,omitempty"` + // numBlocks is the number of blocks included in this batch update + NumBlocks uint64 `protobuf:"varint,4,opt,name=numBlocks,proto3" json:"numBlocks,omitempty"` + // DAPath is the description of the location on the DA layer + DAPath string `protobuf:"bytes,5,opt,name=DAPath,proto3" json:"DAPath,omitempty"` + // creationHeight is the height at which the UpdateState took place + CreationHeight uint64 `protobuf:"varint,7,opt,name=creationHeight,proto3" json:"creationHeight,omitempty"` + // status is the status of the state update + Status types.Status `protobuf:"varint,8,opt,name=status,proto3,enum=dymensionxyz.dymension.common.Status" json:"status,omitempty"` + // BDs is a list of block description objects (one per block) + // the list must be ordered by height, starting from startHeight to startHeight+numBlocks-1 + BDs BlockDescriptors `protobuf:"bytes,9,opt,name=BDs,proto3" json:"BDs"` +} + +func (m *StateInfo) Reset() { *m = StateInfo{} } +func (m *StateInfo) String() string { return proto.CompactTextString(m) } +func (*StateInfo) ProtoMessage() {} +func (*StateInfo) Descriptor() ([]byte, []int) { + return fileDescriptor_17fce0215a9cbbfb, []int{1} +} +func (m *StateInfo) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StateInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StateInfo.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 *StateInfo) XXX_Merge(src proto.Message) { + xxx_messageInfo_StateInfo.Merge(m, src) +} +func (m *StateInfo) XXX_Size() int { + return m.Size() +} +func (m *StateInfo) XXX_DiscardUnknown() { + xxx_messageInfo_StateInfo.DiscardUnknown(m) +} + +var xxx_messageInfo_StateInfo proto.InternalMessageInfo + +func (m *StateInfo) GetStateInfoIndex() StateInfoIndex { + if m != nil { + return m.StateInfoIndex + } + return StateInfoIndex{} +} + +func (m *StateInfo) GetSequencer() string { + if m != nil { + return m.Sequencer + } + return "" +} + +func (m *StateInfo) GetStartHeight() uint64 { + if m != nil { + return m.StartHeight + } + return 0 +} + +func (m *StateInfo) GetNumBlocks() uint64 { + if m != nil { + return m.NumBlocks + } + return 0 +} + +func (m *StateInfo) GetDAPath() string { + if m != nil { + return m.DAPath + } + return "" +} + +func (m *StateInfo) GetCreationHeight() uint64 { + if m != nil { + return m.CreationHeight + } + return 0 +} + +func (m *StateInfo) GetStatus() types.Status { + if m != nil { + return m.Status + } + return types.Status_PENDING +} + +func (m *StateInfo) GetBDs() BlockDescriptors { + if m != nil { + return m.BDs + } + return BlockDescriptors{} +} + +// StateInfoSummary is a compact representation of StateInfo +type StateInfoSummary struct { + // stateInfoIndex defines what rollapp the state belongs to + // and in which index it can be referenced + StateInfoIndex StateInfoIndex `protobuf:"bytes,1,opt,name=stateInfoIndex,proto3" json:"stateInfoIndex"` + // status is the status of the state update + Status types.Status `protobuf:"varint,2,opt,name=status,proto3,enum=dymensionxyz.dymension.common.Status" json:"status,omitempty"` + // creationHeight is the height at which the UpdateState took place + CreationHeight uint64 `protobuf:"varint,3,opt,name=creationHeight,proto3" json:"creationHeight,omitempty"` +} + +func (m *StateInfoSummary) Reset() { *m = StateInfoSummary{} } +func (m *StateInfoSummary) String() string { return proto.CompactTextString(m) } +func (*StateInfoSummary) ProtoMessage() {} +func (*StateInfoSummary) Descriptor() ([]byte, []int) { + return fileDescriptor_17fce0215a9cbbfb, []int{2} +} +func (m *StateInfoSummary) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *StateInfoSummary) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_StateInfoSummary.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 *StateInfoSummary) XXX_Merge(src proto.Message) { + xxx_messageInfo_StateInfoSummary.Merge(m, src) +} +func (m *StateInfoSummary) XXX_Size() int { + return m.Size() +} +func (m *StateInfoSummary) XXX_DiscardUnknown() { + xxx_messageInfo_StateInfoSummary.DiscardUnknown(m) +} + +var xxx_messageInfo_StateInfoSummary proto.InternalMessageInfo + +func (m *StateInfoSummary) GetStateInfoIndex() StateInfoIndex { + if m != nil { + return m.StateInfoIndex + } + return StateInfoIndex{} +} + +func (m *StateInfoSummary) GetStatus() types.Status { + if m != nil { + return m.Status + } + return types.Status_PENDING +} + +func (m *StateInfoSummary) GetCreationHeight() uint64 { + if m != nil { + return m.CreationHeight + } + return 0 +} + +// BlockHeightToFinalizationQueue defines a map from block height to list of states to finalized +type BlockHeightToFinalizationQueue struct { + // creationHeight is the block height that the state should be finalized + CreationHeight uint64 `protobuf:"varint,1,opt,name=creationHeight,proto3" json:"creationHeight,omitempty"` + // finalizationQueue is a list of states that are waiting to be finalized + // when the block height becomes creationHeight + FinalizationQueue []StateInfoIndex `protobuf:"bytes,2,rep,name=finalizationQueue,proto3" json:"finalizationQueue"` +} + +func (m *BlockHeightToFinalizationQueue) Reset() { *m = BlockHeightToFinalizationQueue{} } +func (m *BlockHeightToFinalizationQueue) String() string { return proto.CompactTextString(m) } +func (*BlockHeightToFinalizationQueue) ProtoMessage() {} +func (*BlockHeightToFinalizationQueue) Descriptor() ([]byte, []int) { + return fileDescriptor_17fce0215a9cbbfb, []int{3} +} +func (m *BlockHeightToFinalizationQueue) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *BlockHeightToFinalizationQueue) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_BlockHeightToFinalizationQueue.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 *BlockHeightToFinalizationQueue) XXX_Merge(src proto.Message) { + xxx_messageInfo_BlockHeightToFinalizationQueue.Merge(m, src) +} +func (m *BlockHeightToFinalizationQueue) XXX_Size() int { + return m.Size() +} +func (m *BlockHeightToFinalizationQueue) XXX_DiscardUnknown() { + xxx_messageInfo_BlockHeightToFinalizationQueue.DiscardUnknown(m) +} + +var xxx_messageInfo_BlockHeightToFinalizationQueue proto.InternalMessageInfo + +func (m *BlockHeightToFinalizationQueue) GetCreationHeight() uint64 { + if m != nil { + return m.CreationHeight + } + return 0 +} + +func (m *BlockHeightToFinalizationQueue) GetFinalizationQueue() []StateInfoIndex { + if m != nil { + return m.FinalizationQueue + } + return nil +} + +func init() { + proto.RegisterType((*StateInfoIndex)(nil), "dymensionxyz.dymension.rollapp.StateInfoIndex") + proto.RegisterType((*StateInfo)(nil), "dymensionxyz.dymension.rollapp.StateInfo") + proto.RegisterType((*StateInfoSummary)(nil), "dymensionxyz.dymension.rollapp.StateInfoSummary") + proto.RegisterType((*BlockHeightToFinalizationQueue)(nil), "dymensionxyz.dymension.rollapp.BlockHeightToFinalizationQueue") +} + +func init() { + proto.RegisterFile("dymension/rollapp/state_info.proto", fileDescriptor_17fce0215a9cbbfb) +} + +var fileDescriptor_17fce0215a9cbbfb = []byte{ + // 479 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xb4, 0x93, 0x4f, 0x6b, 0x13, 0x41, + 0x18, 0xc6, 0x33, 0xd9, 0x34, 0xed, 0x4e, 0x21, 0xd4, 0xa1, 0xc8, 0x52, 0x74, 0x5c, 0x16, 0x94, + 0x9c, 0x76, 0xa5, 0xf5, 0xea, 0xc1, 0x10, 0xa4, 0xf1, 0x20, 0xba, 0xf5, 0x24, 0x42, 0xd9, 0x6c, + 0x26, 0xc9, 0x60, 0x76, 0x66, 0x9d, 0x3f, 0x92, 0xf4, 0x53, 0x78, 0xf2, 0x53, 0xf8, 0x41, 0x7a, + 0xec, 0x4d, 0x4f, 0x22, 0xc9, 0x17, 0x91, 0x99, 0x5d, 0x76, 0xdb, 0x24, 0x2a, 0x04, 0xbc, 0xe5, + 0x7d, 0xf7, 0x7d, 0x9e, 0x3c, 0xef, 0xef, 0x65, 0x60, 0x30, 0x5a, 0x64, 0x84, 0x49, 0xca, 0x59, + 0x24, 0xf8, 0x6c, 0x96, 0xe4, 0x79, 0x24, 0x55, 0xa2, 0xc8, 0x25, 0x65, 0x63, 0x1e, 0xe6, 0x82, + 0x2b, 0x8e, 0x70, 0x35, 0x33, 0x5f, 0x5c, 0x85, 0x55, 0x11, 0x96, 0x82, 0x93, 0xe3, 0x09, 0x9f, + 0x70, 0x3b, 0x1a, 0x99, 0x5f, 0x85, 0xea, 0xa4, 0xbb, 0xe9, 0x3c, 0x9c, 0xf1, 0xf4, 0xe3, 0xe5, + 0x88, 0xc8, 0x54, 0xd0, 0x5c, 0x71, 0x51, 0x4e, 0x3e, 0xac, 0x27, 0x53, 0x9e, 0x65, 0x9c, 0xd9, + 0x08, 0x5a, 0x16, 0x9f, 0x83, 0x3e, 0xec, 0x5c, 0x98, 0x48, 0x03, 0x36, 0xe6, 0x03, 0x36, 0x22, + 0x73, 0xf4, 0x00, 0xba, 0xa5, 0xe5, 0x60, 0xe4, 0x01, 0x1f, 0x74, 0xdd, 0xb8, 0x6e, 0xa0, 0x63, + 0xb8, 0x47, 0xcd, 0x98, 0xd7, 0xf4, 0x41, 0xb7, 0x15, 0x17, 0x45, 0xf0, 0xd5, 0x81, 0x6e, 0x65, + 0x83, 0x3e, 0xc0, 0x8e, 0xbc, 0xe3, 0x69, 0x6d, 0x0e, 0x4f, 0xc3, 0xf0, 0xef, 0xbb, 0x86, 0x77, + 0x93, 0xf4, 0x5a, 0xd7, 0x3f, 0x1f, 0x35, 0xe2, 0x35, 0x2f, 0x93, 0x4f, 0x92, 0x4f, 0x9a, 0xb0, + 0x94, 0x08, 0x9b, 0xc2, 0x8d, 0xeb, 0x06, 0xf2, 0xe1, 0xa1, 0x54, 0x89, 0x50, 0xe7, 0x84, 0x4e, + 0xa6, 0xca, 0x73, 0x6c, 0xca, 0xdb, 0x2d, 0xa3, 0x67, 0x3a, 0xeb, 0x19, 0x5a, 0xd2, 0x6b, 0xd9, + 0xef, 0x75, 0x03, 0xdd, 0x87, 0xed, 0xfe, 0x8b, 0x37, 0x89, 0x9a, 0x7a, 0x7b, 0xd6, 0xba, 0xac, + 0xd0, 0x13, 0xd8, 0x49, 0x05, 0x49, 0x14, 0xe5, 0xac, 0xb4, 0xde, 0xb7, 0xd2, 0xb5, 0x2e, 0x7a, + 0x0e, 0xdb, 0x05, 0x5f, 0xef, 0xc0, 0x07, 0xdd, 0xce, 0xe9, 0xe3, 0x3f, 0xed, 0x5c, 0x1c, 0xc3, + 0xae, 0xac, 0x65, 0x5c, 0x8a, 0xd0, 0x39, 0x74, 0x7a, 0x7d, 0xe9, 0xb9, 0x96, 0xd7, 0xd3, 0x7f, + 0xf1, 0xb2, 0x99, 0xfb, 0xd5, 0xc5, 0x65, 0x49, 0xcc, 0x58, 0xbc, 0x6a, 0x1d, 0xb4, 0x8f, 0xf6, + 0x83, 0xef, 0x00, 0x1e, 0x55, 0x54, 0x2f, 0x74, 0x96, 0x25, 0x62, 0xf1, 0x9f, 0xef, 0x53, 0x13, + 0x68, 0xee, 0x42, 0x60, 0x13, 0xb4, 0xb3, 0x0d, 0x74, 0xf0, 0x0d, 0x40, 0x6c, 0xf7, 0x2f, 0xea, + 0x77, 0xfc, 0x25, 0x65, 0xc9, 0x8c, 0x5e, 0xd9, 0x99, 0xb7, 0x9a, 0x68, 0xb2, 0xc5, 0x0a, 0x6c, + 0xbd, 0xd9, 0x10, 0xde, 0x1b, 0xaf, 0x8b, 0xbd, 0xa6, 0xef, 0xec, 0x8c, 0x64, 0xd3, 0xae, 0xf7, + 0xfa, 0x7a, 0x89, 0xc1, 0xcd, 0x12, 0x83, 0x5f, 0x4b, 0x0c, 0xbe, 0xac, 0x70, 0xe3, 0x66, 0x85, + 0x1b, 0x3f, 0x56, 0xb8, 0xf1, 0xfe, 0xd9, 0x84, 0xaa, 0xa9, 0x1e, 0x1a, 0x1c, 0xd1, 0xed, 0x3f, + 0xab, 0x8b, 0xe8, 0xf3, 0x59, 0x34, 0xaf, 0xde, 0xb9, 0x5a, 0xe4, 0x44, 0x0e, 0xdb, 0xf6, 0xf9, + 0x9e, 0xfd, 0x0e, 0x00, 0x00, 0xff, 0xff, 0x18, 0x32, 0x02, 0x7e, 0x63, 0x04, 0x00, 0x00, +} + +func (m *StateInfoIndex) 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 *StateInfoIndex) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateInfoIndex) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Index != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.Index)) + i-- + dAtA[i] = 0x10 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintStateInfo(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *StateInfo) 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 *StateInfo) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateInfo) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.BDs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStateInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + if m.Status != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x40 + } + if m.CreationHeight != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.CreationHeight)) + i-- + dAtA[i] = 0x38 + } + if len(m.DAPath) > 0 { + i -= len(m.DAPath) + copy(dAtA[i:], m.DAPath) + i = encodeVarintStateInfo(dAtA, i, uint64(len(m.DAPath))) + i-- + dAtA[i] = 0x2a + } + if m.NumBlocks != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.NumBlocks)) + i-- + dAtA[i] = 0x20 + } + if m.StartHeight != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.StartHeight)) + i-- + dAtA[i] = 0x18 + } + if len(m.Sequencer) > 0 { + i -= len(m.Sequencer) + copy(dAtA[i:], m.Sequencer) + i = encodeVarintStateInfo(dAtA, i, uint64(len(m.Sequencer))) + i-- + dAtA[i] = 0x12 + } + { + size, err := m.StateInfoIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStateInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *StateInfoSummary) 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 *StateInfoSummary) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *StateInfoSummary) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CreationHeight != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.CreationHeight)) + i-- + dAtA[i] = 0x18 + } + if m.Status != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + { + size, err := m.StateInfoIndex.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStateInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *BlockHeightToFinalizationQueue) 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 *BlockHeightToFinalizationQueue) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *BlockHeightToFinalizationQueue) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.FinalizationQueue) > 0 { + for iNdEx := len(m.FinalizationQueue) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.FinalizationQueue[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintStateInfo(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + if m.CreationHeight != 0 { + i = encodeVarintStateInfo(dAtA, i, uint64(m.CreationHeight)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func encodeVarintStateInfo(dAtA []byte, offset int, v uint64) int { + offset -= sovStateInfo(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *StateInfoIndex) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovStateInfo(uint64(l)) + } + if m.Index != 0 { + n += 1 + sovStateInfo(uint64(m.Index)) + } + return n +} + +func (m *StateInfo) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StateInfoIndex.Size() + n += 1 + l + sovStateInfo(uint64(l)) + l = len(m.Sequencer) + if l > 0 { + n += 1 + l + sovStateInfo(uint64(l)) + } + if m.StartHeight != 0 { + n += 1 + sovStateInfo(uint64(m.StartHeight)) + } + if m.NumBlocks != 0 { + n += 1 + sovStateInfo(uint64(m.NumBlocks)) + } + l = len(m.DAPath) + if l > 0 { + n += 1 + l + sovStateInfo(uint64(l)) + } + if m.CreationHeight != 0 { + n += 1 + sovStateInfo(uint64(m.CreationHeight)) + } + if m.Status != 0 { + n += 1 + sovStateInfo(uint64(m.Status)) + } + l = m.BDs.Size() + n += 1 + l + sovStateInfo(uint64(l)) + return n +} + +func (m *StateInfoSummary) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.StateInfoIndex.Size() + n += 1 + l + sovStateInfo(uint64(l)) + if m.Status != 0 { + n += 1 + sovStateInfo(uint64(m.Status)) + } + if m.CreationHeight != 0 { + n += 1 + sovStateInfo(uint64(m.CreationHeight)) + } + return n +} + +func (m *BlockHeightToFinalizationQueue) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CreationHeight != 0 { + n += 1 + sovStateInfo(uint64(m.CreationHeight)) + } + if len(m.FinalizationQueue) > 0 { + for _, e := range m.FinalizationQueue { + l = e.Size() + n += 1 + l + sovStateInfo(uint64(l)) + } + } + return n +} + +func sovStateInfo(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozStateInfo(x uint64) (n int) { + return sovStateInfo(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *StateInfoIndex) 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 ErrIntOverflowStateInfo + } + 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: StateInfoIndex: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StateInfoIndex: 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 ErrIntOverflowStateInfo + } + 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 ErrInvalidLengthStateInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Index", wireType) + } + m.Index = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Index |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStateInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStateInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StateInfo) 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 ErrIntOverflowStateInfo + } + 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: StateInfo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StateInfo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateInfoIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStateInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StateInfoIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowStateInfo + } + 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 ErrInvalidLengthStateInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Sequencer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartHeight", wireType) + } + m.StartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) + } + m.NumBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DAPath", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + 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 ErrInvalidLengthStateInfo + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.DAPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) + } + m.CreationHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 8: + 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 ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= types.Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BDs", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStateInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.BDs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStateInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStateInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *StateInfoSummary) 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 ErrIntOverflowStateInfo + } + 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: StateInfoSummary: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: StateInfoSummary: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field StateInfoIndex", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStateInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.StateInfoIndex.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + 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 ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= types.Status(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 3: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) + } + m.CreationHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipStateInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStateInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *BlockHeightToFinalizationQueue) 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 ErrIntOverflowStateInfo + } + 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: BlockHeightToFinalizationQueue: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: BlockHeightToFinalizationQueue: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field CreationHeight", wireType) + } + m.CreationHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.CreationHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field FinalizationQueue", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowStateInfo + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthStateInfo + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthStateInfo + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.FinalizationQueue = append(m.FinalizationQueue, StateInfoIndex{}) + if err := m.FinalizationQueue[len(m.FinalizationQueue)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipStateInfo(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthStateInfo + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipStateInfo(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, ErrIntOverflowStateInfo + } + 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, ErrIntOverflowStateInfo + } + 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, ErrIntOverflowStateInfo + } + 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, ErrInvalidLengthStateInfo + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupStateInfo + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthStateInfo + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthStateInfo = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowStateInfo = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupStateInfo = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/rollapp/types/tx.pb.go b/third_party/dymension/rollapp/types/tx.pb.go new file mode 100644 index 000000000..ca1cd5064 --- /dev/null +++ b/third_party/dymension/rollapp/types/tx.pb.go @@ -0,0 +1,2595 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/rollapp/tx.proto + +package types + +import ( + context "context" + fmt "fmt" + _ "github.com/cosmos/cosmos-sdk/types/msgservice" + _ "github.com/gogo/protobuf/gogoproto" + grpc1 "github.com/gogo/protobuf/grpc" + proto "github.com/gogo/protobuf/proto" + grpc "google.golang.org/grpc" + codes "google.golang.org/grpc/codes" + status "google.golang.org/grpc/status" + 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 + +// MsgCreateRollapp creates a new rollapp chain on the hub. +type MsgCreateRollapp struct { + // creator is the bech32-encoded address of the rollapp creator + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // rollappId is the unique identifier of the rollapp chain. + // The rollapp_id follows the same standard as cosmos chain_id + RollappId string `protobuf:"bytes,2,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // initial_sequencer takes one or more coma-separated bech32-encoded addresses of the + // sequencer(s) that are allowed to initially serve this rollappId. + InitialSequencer string `protobuf:"bytes,11,opt,name=initial_sequencer,json=initialSequencer,proto3" json:"initial_sequencer,omitempty"` + // the unique rollapp address bech32 prefix. + Bech32Prefix string `protobuf:"bytes,12,opt,name=bech32_prefix,json=bech32Prefix,proto3" json:"bech32_prefix,omitempty"` + // alias is the chain alias used for display and namespace system + Alias string `protobuf:"bytes,13,opt,name=alias,proto3" json:"alias,omitempty"` + // checksum used to verify integrity of the genesis file + GenesisChecksum string `protobuf:"bytes,14,opt,name=genesis_checksum,json=genesisChecksum,proto3" json:"genesis_checksum,omitempty"` + // metadata is the rollapp metadata + Metadata *RollappMetadata `protobuf:"bytes,15,opt,name=metadata,proto3" json:"metadata,omitempty"` + // vm_type is the type of rollapp machine: EVM or WASM + VmType Rollapp_VMType `protobuf:"varint,16,opt,name=vm_type,json=vmType,proto3,enum=dymensionxyz.dymension.rollapp.Rollapp_VMType" json:"vm_type,omitempty"` +} + +func (m *MsgCreateRollapp) Reset() { *m = MsgCreateRollapp{} } +func (m *MsgCreateRollapp) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRollapp) ProtoMessage() {} +func (*MsgCreateRollapp) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{0} +} +func (m *MsgCreateRollapp) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRollapp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRollapp.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 *MsgCreateRollapp) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRollapp.Merge(m, src) +} +func (m *MsgCreateRollapp) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRollapp) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRollapp.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRollapp proto.InternalMessageInfo + +func (m *MsgCreateRollapp) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateRollapp) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *MsgCreateRollapp) GetInitialSequencer() string { + if m != nil { + return m.InitialSequencer + } + return "" +} + +func (m *MsgCreateRollapp) GetBech32Prefix() string { + if m != nil { + return m.Bech32Prefix + } + return "" +} + +func (m *MsgCreateRollapp) GetAlias() string { + if m != nil { + return m.Alias + } + return "" +} + +func (m *MsgCreateRollapp) GetGenesisChecksum() string { + if m != nil { + return m.GenesisChecksum + } + return "" +} + +func (m *MsgCreateRollapp) GetMetadata() *RollappMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +func (m *MsgCreateRollapp) GetVmType() Rollapp_VMType { + if m != nil { + return m.VmType + } + return Rollapp_Unspecified +} + +type MsgCreateRollappResponse struct { +} + +func (m *MsgCreateRollappResponse) Reset() { *m = MsgCreateRollappResponse{} } +func (m *MsgCreateRollappResponse) String() string { return proto.CompactTextString(m) } +func (*MsgCreateRollappResponse) ProtoMessage() {} +func (*MsgCreateRollappResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{1} +} +func (m *MsgCreateRollappResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgCreateRollappResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgCreateRollappResponse.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 *MsgCreateRollappResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgCreateRollappResponse.Merge(m, src) +} +func (m *MsgCreateRollappResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgCreateRollappResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgCreateRollappResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgCreateRollappResponse proto.InternalMessageInfo + +// MsgUpdateRollappInformation updates the rollapp information. +type MsgUpdateRollappInformation struct { + // owner is the bech32-encoded address of the rollapp owner + Owner string `protobuf:"bytes,1,opt,name=owner,proto3" json:"owner,omitempty"` + // rollapp_id is the unique identifier of the rollapp chain. + RollappId string `protobuf:"bytes,2,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // initial_sequencer is one or more bech32-encoded address of the + // sequencer that are allowed to initially serve this rollappId. + // wildcard '*' means any sequencer is allowed to be the first proposer. + InitialSequencer string `protobuf:"bytes,3,opt,name=initial_sequencer,json=initialSequencer,proto3" json:"initial_sequencer,omitempty"` + // checksum used to verify integrity + GenesisChecksum string `protobuf:"bytes,4,opt,name=genesis_checksum,json=genesisChecksum,proto3" json:"genesis_checksum,omitempty"` + // metadata is the rollapp metadata + Metadata *RollappMetadata `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"` +} + +func (m *MsgUpdateRollappInformation) Reset() { *m = MsgUpdateRollappInformation{} } +func (m *MsgUpdateRollappInformation) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRollappInformation) ProtoMessage() {} +func (*MsgUpdateRollappInformation) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{2} +} +func (m *MsgUpdateRollappInformation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRollappInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRollappInformation.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 *MsgUpdateRollappInformation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRollappInformation.Merge(m, src) +} +func (m *MsgUpdateRollappInformation) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRollappInformation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRollappInformation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRollappInformation proto.InternalMessageInfo + +func (m *MsgUpdateRollappInformation) GetOwner() string { + if m != nil { + return m.Owner + } + return "" +} + +func (m *MsgUpdateRollappInformation) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *MsgUpdateRollappInformation) GetInitialSequencer() string { + if m != nil { + return m.InitialSequencer + } + return "" +} + +func (m *MsgUpdateRollappInformation) GetGenesisChecksum() string { + if m != nil { + return m.GenesisChecksum + } + return "" +} + +func (m *MsgUpdateRollappInformation) GetMetadata() *RollappMetadata { + if m != nil { + return m.Metadata + } + return nil +} + +type MsgUpdateRollappInformationResponse struct { +} + +func (m *MsgUpdateRollappInformationResponse) Reset() { *m = MsgUpdateRollappInformationResponse{} } +func (m *MsgUpdateRollappInformationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateRollappInformationResponse) ProtoMessage() {} +func (*MsgUpdateRollappInformationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{3} +} +func (m *MsgUpdateRollappInformationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateRollappInformationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateRollappInformationResponse.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 *MsgUpdateRollappInformationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateRollappInformationResponse.Merge(m, src) +} +func (m *MsgUpdateRollappInformationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateRollappInformationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateRollappInformationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateRollappInformationResponse proto.InternalMessageInfo + +// MsgUpdateState updates a rollapp state with a block batch. +// a block batch is a list of ordered blocks (by height) +type MsgUpdateState struct { + // creator is the bech32-encoded address of the sequencer sending the update + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` + // rollappId is the rollapp that the sequencer belongs to and asking to update + // The rollappId follows the same standard as cosmos chain_id + RollappId string `protobuf:"bytes,2,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + // startHeight is the block height of the first block in the batch + StartHeight uint64 `protobuf:"varint,3,opt,name=startHeight,proto3" json:"startHeight,omitempty"` + // numBlocks is the number of blocks included in this batch update + NumBlocks uint64 `protobuf:"varint,4,opt,name=numBlocks,proto3" json:"numBlocks,omitempty"` + // DAPath is the description of the location on the DA layer + DAPath string `protobuf:"bytes,5,opt,name=DAPath,proto3" json:"DAPath,omitempty"` + // BDs is a list of block description objects (one per block) + // the list must be ordered by height, starting from startHeight to startHeight+numBlocks-1 + BDs BlockDescriptors `protobuf:"bytes,7,opt,name=BDs,proto3" json:"BDs"` + // last is true if this is the last batch of the sequencer + Last bool `protobuf:"varint,8,opt,name=last,proto3" json:"last,omitempty"` +} + +func (m *MsgUpdateState) Reset() { *m = MsgUpdateState{} } +func (m *MsgUpdateState) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateState) ProtoMessage() {} +func (*MsgUpdateState) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{4} +} +func (m *MsgUpdateState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateState.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 *MsgUpdateState) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateState.Merge(m, src) +} +func (m *MsgUpdateState) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateState) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateState.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateState proto.InternalMessageInfo + +func (m *MsgUpdateState) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateState) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *MsgUpdateState) GetStartHeight() uint64 { + if m != nil { + return m.StartHeight + } + return 0 +} + +func (m *MsgUpdateState) GetNumBlocks() uint64 { + if m != nil { + return m.NumBlocks + } + return 0 +} + +func (m *MsgUpdateState) GetDAPath() string { + if m != nil { + return m.DAPath + } + return "" +} + +func (m *MsgUpdateState) GetBDs() BlockDescriptors { + if m != nil { + return m.BDs + } + return BlockDescriptors{} +} + +func (m *MsgUpdateState) GetLast() bool { + if m != nil { + return m.Last + } + return false +} + +type MsgUpdateStateResponse 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"` +} + +func (m *MsgUpdateStateResponse) Reset() { *m = MsgUpdateStateResponse{} } +func (m *MsgUpdateStateResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateStateResponse) ProtoMessage() {} +func (*MsgUpdateStateResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{5} +} +func (m *MsgUpdateStateResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateStateResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateStateResponse.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 *MsgUpdateStateResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateStateResponse.Merge(m, src) +} +func (m *MsgUpdateStateResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateStateResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateStateResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateStateResponse proto.InternalMessageInfo + +func (m *MsgUpdateStateResponse) GetNextProposerAddr() string { + if m != nil { + return m.NextProposerAddr + } + return "" +} + +func (m *MsgUpdateStateResponse) GetRotationInProgress() bool { + if m != nil { + return m.RotationInProgress + } + return false +} + +// MsgTransferOwnership transfers the ownership of a rollapp chain to a new owner. +type MsgTransferOwnership struct { + // current_owner is the bech32-encoded address of the current owner + CurrentOwner string `protobuf:"bytes,1,opt,name=current_owner,json=currentOwner,proto3" json:"current_owner,omitempty"` + // new_owner is the bech32-encoded address of the new owner + NewOwner string `protobuf:"bytes,2,opt,name=new_owner,json=newOwner,proto3" json:"new_owner,omitempty"` + // rollapp_id is the unique identifier of the rollapp chain. + RollappId string `protobuf:"bytes,3,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` +} + +func (m *MsgTransferOwnership) Reset() { *m = MsgTransferOwnership{} } +func (m *MsgTransferOwnership) String() string { return proto.CompactTextString(m) } +func (*MsgTransferOwnership) ProtoMessage() {} +func (*MsgTransferOwnership) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{6} +} +func (m *MsgTransferOwnership) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferOwnership) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferOwnership.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 *MsgTransferOwnership) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferOwnership.Merge(m, src) +} +func (m *MsgTransferOwnership) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferOwnership) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferOwnership.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferOwnership proto.InternalMessageInfo + +func (m *MsgTransferOwnership) GetCurrentOwner() string { + if m != nil { + return m.CurrentOwner + } + return "" +} + +func (m *MsgTransferOwnership) GetNewOwner() string { + if m != nil { + return m.NewOwner + } + return "" +} + +func (m *MsgTransferOwnership) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +type MsgTransferOwnershipResponse struct { +} + +func (m *MsgTransferOwnershipResponse) Reset() { *m = MsgTransferOwnershipResponse{} } +func (m *MsgTransferOwnershipResponse) String() string { return proto.CompactTextString(m) } +func (*MsgTransferOwnershipResponse) ProtoMessage() {} +func (*MsgTransferOwnershipResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_935cc363af28220c, []int{7} +} +func (m *MsgTransferOwnershipResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgTransferOwnershipResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgTransferOwnershipResponse.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 *MsgTransferOwnershipResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgTransferOwnershipResponse.Merge(m, src) +} +func (m *MsgTransferOwnershipResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgTransferOwnershipResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgTransferOwnershipResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgTransferOwnershipResponse proto.InternalMessageInfo + +func init() { + proto.RegisterType((*MsgCreateRollapp)(nil), "dymensionxyz.dymension.rollapp.MsgCreateRollapp") + proto.RegisterType((*MsgCreateRollappResponse)(nil), "dymensionxyz.dymension.rollapp.MsgCreateRollappResponse") + proto.RegisterType((*MsgUpdateRollappInformation)(nil), "dymensionxyz.dymension.rollapp.MsgUpdateRollappInformation") + proto.RegisterType((*MsgUpdateRollappInformationResponse)(nil), "dymensionxyz.dymension.rollapp.MsgUpdateRollappInformationResponse") + proto.RegisterType((*MsgUpdateState)(nil), "dymensionxyz.dymension.rollapp.MsgUpdateState") + proto.RegisterType((*MsgUpdateStateResponse)(nil), "dymensionxyz.dymension.rollapp.MsgUpdateStateResponse") + proto.RegisterType((*MsgTransferOwnership)(nil), "dymensionxyz.dymension.rollapp.MsgTransferOwnership") + proto.RegisterType((*MsgTransferOwnershipResponse)(nil), "dymensionxyz.dymension.rollapp.MsgTransferOwnershipResponse") +} + +func init() { proto.RegisterFile("dymension/rollapp/tx.proto", fileDescriptor_935cc363af28220c) } + +var fileDescriptor_935cc363af28220c = []byte{ + // 815 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xa4, 0x96, 0xcf, 0x6f, 0xe3, 0x44, + 0x14, 0xc7, 0xe3, 0x26, 0x9b, 0x1f, 0x2f, 0x69, 0x37, 0x3b, 0xaa, 0x16, 0xcb, 0xbb, 0x78, 0xa3, + 0xac, 0x90, 0xc2, 0x22, 0xd9, 0x90, 0xae, 0x10, 0x2a, 0x5c, 0x36, 0xad, 0xc4, 0x16, 0x14, 0x36, + 0x78, 0x17, 0x0e, 0x5c, 0x22, 0xc7, 0x9e, 0x3a, 0xd6, 0xc6, 0x33, 0x66, 0x66, 0x92, 0x26, 0x70, + 0xe3, 0x02, 0x88, 0x0b, 0xe2, 0xcc, 0x89, 0xbf, 0x80, 0x3f, 0x63, 0x8f, 0x7b, 0xe4, 0x84, 0x50, + 0x7b, 0xe0, 0xdf, 0x40, 0x1e, 0xff, 0x48, 0x5a, 0xa7, 0xdd, 0xb4, 0x9c, 0xec, 0xf7, 0x7d, 0xdf, + 0xf7, 0x3c, 0xfd, 0xbc, 0x99, 0x69, 0x40, 0x73, 0x17, 0x01, 0x26, 0xdc, 0xa7, 0xc4, 0x64, 0x74, + 0x32, 0xb1, 0xc3, 0xd0, 0x14, 0x73, 0x23, 0x64, 0x54, 0x50, 0xa4, 0x67, 0xb9, 0xf9, 0xe2, 0x3b, + 0x23, 0x0b, 0x8c, 0xc4, 0xa8, 0xbd, 0xe5, 0x50, 0x1e, 0x50, 0x6e, 0x06, 0xdc, 0x33, 0x67, 0x1f, + 0x44, 0x8f, 0xb8, 0x50, 0xeb, 0xe4, 0x9b, 0x8e, 0x26, 0xd4, 0x79, 0x39, 0x74, 0x31, 0x77, 0x98, + 0x1f, 0x0a, 0xca, 0x12, 0xe7, 0x83, 0xbc, 0x33, 0x79, 0x26, 0x86, 0x56, 0xde, 0x10, 0x60, 0x61, + 0xbb, 0xb6, 0xb0, 0x13, 0xc7, 0xae, 0x47, 0x3d, 0x2a, 0x5f, 0xcd, 0xe8, 0x2d, 0x56, 0xdb, 0x3f, + 0x15, 0xa1, 0xd9, 0xe7, 0xde, 0x01, 0xc3, 0xb6, 0xc0, 0x56, 0x5c, 0x89, 0x54, 0xa8, 0x38, 0x91, + 0x40, 0x99, 0xaa, 0xb4, 0x94, 0x4e, 0xcd, 0x4a, 0x43, 0xf4, 0x36, 0x40, 0xd2, 0x7e, 0xe8, 0xbb, + 0xea, 0x96, 0x4c, 0xd6, 0x12, 0xe5, 0xc8, 0x45, 0xef, 0xc1, 0x1d, 0x9f, 0xf8, 0xc2, 0xb7, 0x27, + 0x43, 0x8e, 0xbf, 0x9d, 0x62, 0xe2, 0x60, 0xa6, 0xd6, 0xa5, 0xab, 0x99, 0x24, 0x9e, 0xa7, 0x3a, + 0x7a, 0x08, 0xdb, 0x23, 0xec, 0x8c, 0xf7, 0xba, 0xc3, 0x90, 0xe1, 0x63, 0x7f, 0xae, 0x36, 0xa4, + 0xb1, 0x11, 0x8b, 0x03, 0xa9, 0xa1, 0x5d, 0xb8, 0x65, 0x4f, 0x7c, 0x9b, 0xab, 0xdb, 0x32, 0x19, + 0x07, 0xe8, 0x5d, 0x68, 0x7a, 0x98, 0x60, 0xee, 0xf3, 0xa1, 0x33, 0xc6, 0xce, 0x4b, 0x3e, 0x0d, + 0xd4, 0x1d, 0x69, 0xb8, 0x9d, 0xe8, 0x07, 0x89, 0x8c, 0x3e, 0x87, 0x6a, 0x0a, 0x42, 0xbd, 0xdd, + 0x52, 0x3a, 0xf5, 0xae, 0x69, 0x5c, 0x3d, 0x2f, 0x23, 0xc1, 0xd0, 0x4f, 0xca, 0xac, 0xac, 0x01, + 0xfa, 0x14, 0x2a, 0xb3, 0x60, 0x28, 0x16, 0x21, 0x56, 0x9b, 0x2d, 0xa5, 0xb3, 0xd3, 0x35, 0x36, + 0xec, 0x65, 0x7c, 0xdd, 0x7f, 0xb1, 0x08, 0xb1, 0x55, 0x9e, 0x05, 0xd1, 0x73, 0xbf, 0xf1, 0xc3, + 0xbf, 0x7f, 0x3e, 0x4a, 0xa9, 0x7e, 0x56, 0xaa, 0x16, 0x9b, 0xf5, 0xb6, 0x06, 0xea, 0xc5, 0x49, + 0x58, 0x98, 0x87, 0x94, 0x70, 0xdc, 0xfe, 0x79, 0x0b, 0xee, 0xf5, 0xb9, 0xf7, 0x55, 0xe8, 0x2e, + 0x93, 0x47, 0xe4, 0x98, 0xb2, 0xc0, 0x16, 0x3e, 0x25, 0x11, 0x26, 0x7a, 0x42, 0x70, 0x3a, 0xaf, + 0x38, 0xb8, 0xd1, 0xb4, 0x8a, 0x97, 0x4c, 0x6b, 0x1d, 0xf2, 0xd2, 0x7a, 0xe4, 0x5f, 0xae, 0x20, + 0xbf, 0x75, 0x23, 0xe4, 0xbd, 0xd2, 0xab, 0xbf, 0x1f, 0x28, 0x4b, 0xf0, 0xfb, 0x10, 0xf1, 0x8a, + 0xff, 0xaa, 0xf6, 0x3b, 0xf0, 0xf0, 0x0a, 0x14, 0x19, 0xb2, 0xdf, 0xb6, 0x60, 0x27, 0xf3, 0x3d, + 0x17, 0xb6, 0xc0, 0x57, 0xec, 0xeb, 0xfb, 0xb0, 0xe4, 0x92, 0x07, 0xd5, 0x82, 0x3a, 0x17, 0x36, + 0x13, 0x4f, 0xb1, 0xef, 0x8d, 0x85, 0x44, 0x54, 0xb2, 0x56, 0xa5, 0xa8, 0x9e, 0x4c, 0x83, 0x5e, + 0x74, 0x78, 0xb9, 0xc4, 0x52, 0xb2, 0x96, 0x02, 0xba, 0x0b, 0xe5, 0xc3, 0x27, 0x03, 0x5b, 0x8c, + 0x25, 0x8e, 0x9a, 0x95, 0x44, 0xe8, 0x29, 0x14, 0x7b, 0x87, 0x5c, 0xad, 0x48, 0x46, 0xef, 0xbf, + 0x89, 0x91, 0x6c, 0x76, 0x98, 0xdd, 0x0c, 0x5c, 0x42, 0x2a, 0x58, 0x51, 0x0b, 0x84, 0xa0, 0x34, + 0xb1, 0xb9, 0x50, 0xab, 0x2d, 0xa5, 0x53, 0xb5, 0xe4, 0x7b, 0x6e, 0x8f, 0x95, 0x9b, 0x95, 0xb6, + 0x80, 0xbb, 0xe7, 0x99, 0xa4, 0xb8, 0xd0, 0x23, 0x68, 0x12, 0x3c, 0x17, 0x03, 0x46, 0x43, 0xca, + 0x31, 0x7b, 0xe2, 0xba, 0x29, 0xa4, 0x9c, 0x8e, 0x0c, 0x40, 0x8c, 0x0a, 0x89, 0xfb, 0x88, 0x0c, + 0x18, 0xf5, 0x18, 0xe6, 0x5c, 0x62, 0xab, 0x5a, 0x6b, 0x32, 0xed, 0x5f, 0x14, 0xd8, 0xed, 0x73, + 0xef, 0x05, 0xb3, 0x09, 0x3f, 0xc6, 0xec, 0x59, 0x34, 0x46, 0x3e, 0xf6, 0xc3, 0xe8, 0x0a, 0x70, + 0xa6, 0x8c, 0x61, 0x22, 0x86, 0xab, 0xdb, 0xb7, 0x91, 0x88, 0xd2, 0x88, 0xee, 0x41, 0x8d, 0xe0, + 0x93, 0xc4, 0x10, 0xcf, 0xa6, 0x4a, 0xf0, 0xc9, 0xb3, 0x35, 0x5b, 0xbc, 0x78, 0x61, 0x72, 0xfb, + 0x28, 0x62, 0x70, 0xfe, 0x1b, 0x6d, 0x1d, 0xee, 0xaf, 0x5b, 0x4c, 0x4a, 0xa2, 0xfb, 0x47, 0x09, + 0x8a, 0x7d, 0xee, 0xa1, 0xef, 0x61, 0xfb, 0xfc, 0xb5, 0xf8, 0xc6, 0x09, 0x5d, 0x3c, 0xbe, 0xda, + 0x47, 0xd7, 0xad, 0xc8, 0xc6, 0xf1, 0xbb, 0x02, 0xea, 0xa5, 0xa7, 0xfd, 0xe3, 0x0d, 0xda, 0x5e, + 0x56, 0xac, 0x1d, 0xfc, 0x8f, 0xe2, 0x6c, 0x79, 0x53, 0xa8, 0xaf, 0x1e, 0x2c, 0x63, 0xe3, 0x9e, + 0xd2, 0xaf, 0x7d, 0x78, 0x3d, 0x7f, 0xf6, 0xd9, 0x1f, 0x15, 0xb8, 0x93, 0xdf, 0x45, 0x8f, 0x37, + 0xe8, 0x96, 0xab, 0xd2, 0x3e, 0xb9, 0x49, 0x55, 0xba, 0x92, 0xde, 0x17, 0xaf, 0x4e, 0x75, 0xe5, + 0xf5, 0xa9, 0xae, 0xfc, 0x73, 0xaa, 0x2b, 0xbf, 0x9e, 0xe9, 0x85, 0xd7, 0x67, 0x7a, 0xe1, 0xaf, + 0x33, 0xbd, 0xf0, 0xcd, 0x63, 0xcf, 0x17, 0xe3, 0xe9, 0xc8, 0x70, 0x68, 0x60, 0xae, 0x7e, 0x61, + 0x19, 0x98, 0xb3, 0x3d, 0x73, 0xbe, 0xfc, 0x19, 0xb1, 0x08, 0x31, 0x1f, 0x95, 0xe5, 0xbf, 0xe3, + 0xbd, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x94, 0x38, 0xf3, 0x65, 0x68, 0x08, 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 { + CreateRollapp(ctx context.Context, in *MsgCreateRollapp, opts ...grpc.CallOption) (*MsgCreateRollappResponse, error) + UpdateRollappInformation(ctx context.Context, in *MsgUpdateRollappInformation, opts ...grpc.CallOption) (*MsgUpdateRollappInformationResponse, error) + UpdateState(ctx context.Context, in *MsgUpdateState, opts ...grpc.CallOption) (*MsgUpdateStateResponse, error) + TransferOwnership(ctx context.Context, in *MsgTransferOwnership, opts ...grpc.CallOption) (*MsgTransferOwnershipResponse, error) +} + +type msgClient struct { + cc grpc1.ClientConn +} + +func NewMsgClient(cc grpc1.ClientConn) MsgClient { + return &msgClient{cc} +} + +func (c *msgClient) CreateRollapp(ctx context.Context, in *MsgCreateRollapp, opts ...grpc.CallOption) (*MsgCreateRollappResponse, error) { + out := new(MsgCreateRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Msg/CreateRollapp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateRollappInformation(ctx context.Context, in *MsgUpdateRollappInformation, opts ...grpc.CallOption) (*MsgUpdateRollappInformationResponse, error) { + out := new(MsgUpdateRollappInformationResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Msg/UpdateRollappInformation", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) UpdateState(ctx context.Context, in *MsgUpdateState, opts ...grpc.CallOption) (*MsgUpdateStateResponse, error) { + out := new(MsgUpdateStateResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Msg/UpdateState", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *msgClient) TransferOwnership(ctx context.Context, in *MsgTransferOwnership, opts ...grpc.CallOption) (*MsgTransferOwnershipResponse, error) { + out := new(MsgTransferOwnershipResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.rollapp.Msg/TransferOwnership", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// MsgServer is the server API for Msg service. +type MsgServer interface { + CreateRollapp(context.Context, *MsgCreateRollapp) (*MsgCreateRollappResponse, error) + UpdateRollappInformation(context.Context, *MsgUpdateRollappInformation) (*MsgUpdateRollappInformationResponse, error) + UpdateState(context.Context, *MsgUpdateState) (*MsgUpdateStateResponse, error) + TransferOwnership(context.Context, *MsgTransferOwnership) (*MsgTransferOwnershipResponse, error) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +func (*UnimplementedMsgServer) CreateRollapp(ctx context.Context, req *MsgCreateRollapp) (*MsgCreateRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method CreateRollapp not implemented") +} +func (*UnimplementedMsgServer) UpdateRollappInformation(ctx context.Context, req *MsgUpdateRollappInformation) (*MsgUpdateRollappInformationResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateRollappInformation not implemented") +} +func (*UnimplementedMsgServer) UpdateState(ctx context.Context, req *MsgUpdateState) (*MsgUpdateStateResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method UpdateState not implemented") +} +func (*UnimplementedMsgServer) TransferOwnership(ctx context.Context, req *MsgTransferOwnership) (*MsgTransferOwnershipResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method TransferOwnership not implemented") +} + +func RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +func _Msg_CreateRollapp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgCreateRollapp) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).CreateRollapp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Msg/CreateRollapp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).CreateRollapp(ctx, req.(*MsgCreateRollapp)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateRollappInformation_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateRollappInformation) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateRollappInformation(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Msg/UpdateRollappInformation", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateRollappInformation(ctx, req.(*MsgUpdateRollappInformation)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_UpdateState_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgUpdateState) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).UpdateState(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Msg/UpdateState", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).UpdateState(ctx, req.(*MsgUpdateState)) + } + return interceptor(ctx, in, info, handler) +} + +func _Msg_TransferOwnership_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgTransferOwnership) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).TransferOwnership(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.rollapp.Msg/TransferOwnership", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).TransferOwnership(ctx, req.(*MsgTransferOwnership)) + } + return interceptor(ctx, in, info, handler) +} + +var _Msg_serviceDesc = grpc.ServiceDesc{ + ServiceName: "dymensionxyz.dymension.rollapp.Msg", + HandlerType: (*MsgServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "CreateRollapp", + Handler: _Msg_CreateRollapp_Handler, + }, + { + MethodName: "UpdateRollappInformation", + Handler: _Msg_UpdateRollappInformation_Handler, + }, + { + MethodName: "UpdateState", + Handler: _Msg_UpdateState_Handler, + }, + { + MethodName: "TransferOwnership", + Handler: _Msg_TransferOwnership_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "dymension/rollapp/tx.proto", +} + +func (m *MsgCreateRollapp) 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 *MsgCreateRollapp) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRollapp) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VmType != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.VmType)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x80 + } + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x7a + } + if len(m.GenesisChecksum) > 0 { + i -= len(m.GenesisChecksum) + copy(dAtA[i:], m.GenesisChecksum) + i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisChecksum))) + i-- + dAtA[i] = 0x72 + } + if len(m.Alias) > 0 { + i -= len(m.Alias) + copy(dAtA[i:], m.Alias) + i = encodeVarintTx(dAtA, i, uint64(len(m.Alias))) + i-- + dAtA[i] = 0x6a + } + if len(m.Bech32Prefix) > 0 { + i -= len(m.Bech32Prefix) + copy(dAtA[i:], m.Bech32Prefix) + i = encodeVarintTx(dAtA, i, uint64(len(m.Bech32Prefix))) + i-- + dAtA[i] = 0x62 + } + if len(m.InitialSequencer) > 0 { + i -= len(m.InitialSequencer) + copy(dAtA[i:], m.InitialSequencer) + i = encodeVarintTx(dAtA, i, uint64(len(m.InitialSequencer))) + i-- + dAtA[i] = 0x5a + } + 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 + } + 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 *MsgCreateRollappResponse) 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 *MsgCreateRollappResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgCreateRollappResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRollappInformation) 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 *MsgUpdateRollappInformation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRollappInformation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Metadata != nil { + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + } + if len(m.GenesisChecksum) > 0 { + i -= len(m.GenesisChecksum) + copy(dAtA[i:], m.GenesisChecksum) + i = encodeVarintTx(dAtA, i, uint64(len(m.GenesisChecksum))) + i-- + dAtA[i] = 0x22 + } + if len(m.InitialSequencer) > 0 { + i -= len(m.InitialSequencer) + copy(dAtA[i:], m.InitialSequencer) + i = encodeVarintTx(dAtA, i, uint64(len(m.InitialSequencer))) + 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 + } + if len(m.Owner) > 0 { + i -= len(m.Owner) + copy(dAtA[i:], m.Owner) + i = encodeVarintTx(dAtA, i, uint64(len(m.Owner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgUpdateRollappInformationResponse) 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 *MsgUpdateRollappInformationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateRollappInformationResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgUpdateState) 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 *MsgUpdateState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Last { + i-- + if m.Last { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x40 + } + { + size, err := m.BDs.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x3a + if len(m.DAPath) > 0 { + i -= len(m.DAPath) + copy(dAtA[i:], m.DAPath) + i = encodeVarintTx(dAtA, i, uint64(len(m.DAPath))) + i-- + dAtA[i] = 0x2a + } + if m.NumBlocks != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.NumBlocks)) + i-- + dAtA[i] = 0x20 + } + if m.StartHeight != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.StartHeight)) + i-- + dAtA[i] = 0x18 + } + 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 + } + 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 *MsgUpdateStateResponse) 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 *MsgUpdateStateResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateStateResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RotationInProgress { + i-- + if m.RotationInProgress { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.NextProposerAddr) > 0 { + i -= len(m.NextProposerAddr) + copy(dAtA[i:], m.NextProposerAddr) + i = encodeVarintTx(dAtA, i, uint64(len(m.NextProposerAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferOwnership) 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 *MsgTransferOwnership) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferOwnership) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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] = 0x1a + } + if len(m.NewOwner) > 0 { + i -= len(m.NewOwner) + copy(dAtA[i:], m.NewOwner) + i = encodeVarintTx(dAtA, i, uint64(len(m.NewOwner))) + i-- + dAtA[i] = 0x12 + } + if len(m.CurrentOwner) > 0 { + i -= len(m.CurrentOwner) + copy(dAtA[i:], m.CurrentOwner) + i = encodeVarintTx(dAtA, i, uint64(len(m.CurrentOwner))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *MsgTransferOwnershipResponse) 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 *MsgTransferOwnershipResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgTransferOwnershipResponse) 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 *MsgCreateRollapp) 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.RollappId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.InitialSequencer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Bech32Prefix) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Alias) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GenesisChecksum) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + } + if m.VmType != 0 { + n += 2 + sovTx(uint64(m.VmType)) + } + return n +} + +func (m *MsgCreateRollappResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateRollappInformation) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Owner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.InitialSequencer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.GenesisChecksum) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.Metadata != nil { + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUpdateRollappInformationResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgUpdateState) 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.RollappId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.StartHeight != 0 { + n += 1 + sovTx(uint64(m.StartHeight)) + } + if m.NumBlocks != 0 { + n += 1 + sovTx(uint64(m.NumBlocks)) + } + l = len(m.DAPath) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.BDs.Size() + n += 1 + l + sovTx(uint64(l)) + if m.Last { + n += 2 + } + return n +} + +func (m *MsgUpdateStateResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NextProposerAddr) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.RotationInProgress { + n += 2 + } + return n +} + +func (m *MsgTransferOwnership) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.CurrentOwner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.NewOwner) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgTransferOwnershipResponse) 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 *MsgCreateRollapp) 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: MsgCreateRollapp: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRollapp: 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 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 11: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialSequencer", 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.InitialSequencer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 12: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Bech32Prefix", 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.Bech32Prefix = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 13: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Alias", 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.Alias = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisChecksum", 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.GenesisChecksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 15: + 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 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.Metadata == nil { + m.Metadata = &RollappMetadata{} + } + if err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 16: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field VmType", wireType) + } + m.VmType = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.VmType |= Rollapp_VMType(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *MsgCreateRollappResponse) 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: MsgCreateRollappResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgCreateRollappResponse: 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 *MsgUpdateRollappInformation) 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: MsgUpdateRollappInformation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRollappInformation: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Owner", 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.Owner = 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 InitialSequencer", 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.InitialSequencer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisChecksum", 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.GenesisChecksum = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + 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 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.Metadata == nil { + m.Metadata = &RollappMetadata{} + } + if err := m.Metadata.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 *MsgUpdateRollappInformationResponse) 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: MsgUpdateRollappInformationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateRollappInformationResponse: 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 *MsgUpdateState) 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: MsgUpdateState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateState: 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 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 != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field StartHeight", wireType) + } + m.StartHeight = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.StartHeight |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field NumBlocks", wireType) + } + m.NumBlocks = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.NumBlocks |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field DAPath", 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.DAPath = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 7: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BDs", 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 err := m.BDs.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 8: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Last", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Last = bool(v != 0) + 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 *MsgUpdateStateResponse) 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: MsgUpdateStateResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateStateResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 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.NextProposerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RotationInProgress", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RotationInProgress = bool(v != 0) + 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 *MsgTransferOwnership) 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: MsgTransferOwnership: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferOwnership: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CurrentOwner", 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.CurrentOwner = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NewOwner", 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.NewOwner = string(dAtA[iNdEx:postIndex]) + 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 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 + 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 *MsgTransferOwnershipResponse) 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: MsgTransferOwnershipResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgTransferOwnershipResponse: 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/third_party/dymension/rollapp/types/types.go b/third_party/dymension/rollapp/types/types.go new file mode 100644 index 000000000..308c44e6a --- /dev/null +++ b/third_party/dymension/rollapp/types/types.go @@ -0,0 +1,7 @@ +package types + +import ( + common "github.com/dymensionxyz/dymension/v3/x/common/types" +) + +type StateStatus common.Status diff --git a/third_party/dymension/sequencer/types/description.pb.go b/third_party/dymension/sequencer/types/description.pb.go new file mode 100644 index 000000000..1d45971a9 --- /dev/null +++ b/third_party/dymension/sequencer/types/description.pb.go @@ -0,0 +1,531 @@ +// 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.go b/third_party/dymension/sequencer/types/events.go new file mode 100644 index 000000000..3977bbee5 --- /dev/null +++ b/third_party/dymension/sequencer/types/events.go @@ -0,0 +1,27 @@ +package types + +// Incentive module event types. +const ( + // EventTypeCreateSequencer is emitted when a sequencer is created + EventTypeCreateSequencer = "create_sequencer" + AttributeKeyRollappId = "rollapp_id" + AttributeKeySequencer = "sequencer" + AttributeKeyBond = "bond" + AttributeKeyProposer = "proposer" + + // EventTypeUnbonding is emitted when a sequencer is unbonding + EventTypeUnbonding = "unbonding" + AttributeKeyCompletionTime = "completion_time" + + // EventTypeNoBondedSequencer is emitted when no bonded sequencer is found for a rollapp + EventTypeNoBondedSequencer = "no_bonded_sequencer" + + // EventTypeProposerRotated is emitted when a proposer is rotated + EventTypeProposerRotated = "proposer_rotated" + + // EventTypeUnbonded is emitted when a sequencer is unbonded + EventTypeUnbonded = "unbonded" + + // EventTypeSlashed is emitted when a sequencer is slashed + EventTypeSlashed = "slashed" +) diff --git a/third_party/dymension/sequencer/types/events.pb.go b/third_party/dymension/sequencer/types/events.pb.go new file mode 100644 index 000000000..0cfb2da09 --- /dev/null +++ b/third_party/dymension/sequencer/types/events.pb.go @@ -0,0 +1,450 @@ +// 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, + 0xcb, 0x52, 0x2a, 0x8d, 0x6c, 0x51, 0x80, 0x06, 0xef, 0xa8, 0x58, 0xad, 0x9f, 0xd8, 0xa1, 0x60, + 0x07, 0x79, 0xaf, 0x9b, 0x00, 0xe6, 0x80, 0x73, 0xa3, 0xe7, 0x75, 0x51, 0xc3, 0xbd, 0x4e, 0x0a, + 0x29, 0xd4, 0xfd, 0xea, 0x67, 0xbb, 0xb4, 0xd6, 0xf0, 0x38, 0x42, 0xc9, 0xcb, 0x51, 0x2c, 0x75, + 0x34, 0xe2, 0x09, 0x64, 0xca, 0xce, 0xff, 0xdb, 0x79, 0x8e, 0x29, 0x2f, 0x47, 0xd5, 0x53, 0x0f, + 0xce, 0xbe, 0x89, 0xeb, 0x5d, 0x55, 0xe1, 0xae, 0x55, 0x52, 0xc8, 0x08, 0xa5, 0x08, 0x41, 0x09, + 0x6f, 0xe2, 0xb6, 0x0e, 0x69, 0x7c, 0x12, 0x90, 0x41, 0x2b, 0xf4, 0xdf, 0x5e, 0x87, 0x1d, 0x1b, + 0x65, 0x2a, 0x44, 0x21, 0x11, 0x6f, 0x75, 0x91, 0xa9, 0x74, 0x76, 0x94, 0x7a, 0xa1, 0xfb, 0x2f, + 0x12, 0x42, 0x8a, 0x79, 0x94, 0xc3, 0x52, 0x69, 0xff, 0x4f, 0x40, 0x06, 0xed, 0x8b, 0x2e, 0xb3, + 0x5c, 0x15, 0x8f, 0xd9, 0x78, 0xec, 0x12, 0x32, 0x15, 0x36, 0x37, 0x1f, 0x7d, 0x67, 0xd6, 0x36, + 0xd0, 0xd4, 0x30, 0xde, 0xdc, 0x6d, 0xc6, 0xa0, 0x84, 0xdf, 0x08, 0x1a, 0xbf, 0xb3, 0xe7, 0x15, + 0xfb, 0xf2, 0xd9, 0x1f, 0xa4, 0x99, 0xbe, 0x5f, 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/genesis.pb.go b/third_party/dymension/sequencer/types/genesis.pb.go new file mode 100644 index 000000000..28e75b87a --- /dev/null +++ b/third_party/dymension/sequencer/types/genesis.pb.go @@ -0,0 +1,740 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/genesis.proto + +package types + +import ( + fmt "fmt" + _ "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 + +// GenesisState defines the sequencer module's genesis state. +type GenesisState struct { + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` + // sequencerList is a list of all defined sequencers + SequencerList []Sequencer `protobuf:"bytes,2,rep,name=sequencerList,proto3" json:"sequencerList"` + // genesisProposers is a list of the defined genesis proposers + GenesisProposers []GenesisProposer `protobuf:"bytes,3,rep,name=genesisProposers,proto3" json:"genesisProposers"` + // bondReductions is a list of all bond reductions + BondReductions []BondReduction `protobuf:"bytes,4,rep,name=bondReductions,proto3" json:"bondReductions"` +} + +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} +} +func (m *GenesisState) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisState) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisState.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 *GenesisState) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisState.Merge(m, src) +} +func (m *GenesisState) XXX_Size() int { + return m.Size() +} +func (m *GenesisState) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisState.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisState proto.InternalMessageInfo + +func (m *GenesisState) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +func (m *GenesisState) GetSequencerList() []Sequencer { + if m != nil { + return m.SequencerList + } + return nil +} + +func (m *GenesisState) GetGenesisProposers() []GenesisProposer { + if m != nil { + return m.GenesisProposers + } + return nil +} + +func (m *GenesisState) GetBondReductions() []BondReduction { + if m != nil { + return m.BondReductions + } + return nil +} + +type GenesisProposer struct { + Address string `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"` + RollappId string `protobuf:"bytes,2,opt,name=rollappId,proto3" json:"rollappId,omitempty"` +} + +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} +} +func (m *GenesisProposer) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *GenesisProposer) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_GenesisProposer.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 *GenesisProposer) XXX_Merge(src proto.Message) { + xxx_messageInfo_GenesisProposer.Merge(m, src) +} +func (m *GenesisProposer) XXX_Size() int { + return m.Size() +} +func (m *GenesisProposer) XXX_DiscardUnknown() { + xxx_messageInfo_GenesisProposer.DiscardUnknown(m) +} + +var xxx_messageInfo_GenesisProposer proto.InternalMessageInfo + +func (m *GenesisProposer) GetAddress() string { + if m != nil { + return m.Address + } + return "" +} + +func (m *GenesisProposer) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func init() { + proto.RegisterType((*GenesisState)(nil), "dymensionxyz.dymension.sequencer.GenesisState") + proto.RegisterType((*GenesisProposer)(nil), "dymensionxyz.dymension.sequencer.GenesisProposer") +} + +func init() { proto.RegisterFile("dymension/sequencer/genesis.proto", fileDescriptor_52f5d9dc91070770) } + +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, +} + +func (m *GenesisState) 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 *GenesisState) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisState) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BondReductions) > 0 { + for iNdEx := len(m.BondReductions) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.BondReductions[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + } + } + if len(m.GenesisProposers) > 0 { + for iNdEx := len(m.GenesisProposers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.GenesisProposers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1a + } + } + if len(m.SequencerList) > 0 { + for iNdEx := len(m.SequencerList) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.SequencerList[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + } + { + size, err := m.Params.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintGenesis(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *GenesisProposer) 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 *GenesisProposer) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *GenesisProposer) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0x12 + } + if len(m.Address) > 0 { + i -= len(m.Address) + copy(dAtA[i:], m.Address) + i = encodeVarintGenesis(dAtA, i, uint64(len(m.Address))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintGenesis(dAtA []byte, offset int, v uint64) int { + offset -= sovGenesis(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *GenesisState) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovGenesis(uint64(l)) + if len(m.SequencerList) > 0 { + for _, e := range m.SequencerList { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.GenesisProposers) > 0 { + for _, e := range m.GenesisProposers { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + if len(m.BondReductions) > 0 { + for _, e := range m.BondReductions { + l = e.Size() + n += 1 + l + sovGenesis(uint64(l)) + } + } + return n +} + +func (m *GenesisProposer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.Address) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovGenesis(uint64(l)) + } + return n +} + +func sovGenesis(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozGenesis(x uint64) (n int) { + return sovGenesis(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *GenesisState) 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 ErrIntOverflowGenesis + } + 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: GenesisState: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisState: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.Params.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerList", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerList = append(m.SequencerList, Sequencer{}) + if err := m.SequencerList[len(m.SequencerList)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field GenesisProposers", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.GenesisProposers = append(m.GenesisProposers, GenesisProposer{}) + if err := m.GenesisProposers[len(m.GenesisProposers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BondReductions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthGenesis + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BondReductions = append(m.BondReductions, BondReduction{}) + if err := m.BondReductions[len(m.BondReductions)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *GenesisProposer) 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 ErrIntOverflowGenesis + } + 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: GenesisProposer: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: GenesisProposer: 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 ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + 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 RollappId", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGenesis + } + 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 ErrInvalidLengthGenesis + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGenesis + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGenesis(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGenesis + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipGenesis(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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrIntOverflowGenesis + } + 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, ErrInvalidLengthGenesis + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupGenesis + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthGenesis + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthGenesis = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowGenesis = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupGenesis = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/sequencer/types/keys.go b/third_party/dymension/sequencer/types/keys.go new file mode 100644 index 000000000..80310719d --- /dev/null +++ b/third_party/dymension/sequencer/types/keys.go @@ -0,0 +1,104 @@ +package types + +import ( + "encoding/binary" + fmt "fmt" + "time" + + sdk "github.com/cosmos/cosmos-sdk/types" +) + +var _ binary.ByteOrder + +const ( + // ModuleName defines the module name + ModuleName = "sequencer" + + // StoreKey defines the primary module store key + StoreKey = ModuleName + + // RouterKey is the message route for slashing + RouterKey = ModuleName + + // QuerierRoute defines the module's query routing key + QuerierRoute = ModuleName + + // MemStoreKey defines the in-memory store key + MemStoreKey = "mem_sequencer" +) + +var ( + // KeySeparator defines the separator for keys + KeySeparator = "/" + + // SequencersKeyPrefix is the prefix to retrieve all Sequencers by their address + SequencersKeyPrefix = []byte{0x00} // prefix/seqAddr + + // SequencersByRollappKeyPrefix is the prefix to retrieve all SequencersByRollapp + SequencersByRollappKeyPrefix = []byte{0x01} // prefix/rollappId + BondedSequencersKeyPrefix = []byte{0xa1} + UnbondedSequencersKeyPrefix = []byte{0xa2} + UnbondingSequencersKeyPrefix = []byte{0xa3} + + UnbondingQueueKey = []byte{0x41} // prefix for the timestamps in unbonding queue +) + +/* --------------------- specific sequencer address keys -------------------- */ +func SequencerKey(sequencerAddress string) []byte { + sequencerAddrBytes := []byte(sequencerAddress) + return []byte(fmt.Sprintf("%s%s%s", SequencersKeyPrefix, KeySeparator, sequencerAddrBytes)) +} + +// SequencerByRollappByStatusKey returns the store key to retrieve a SequencersByRollapp from the index fields +func SequencerByRollappByStatusKey(rollappId, seqAddr string, status OperatingStatus) []byte { + return append(SequencersByRollappByStatusKey(rollappId, status), []byte(seqAddr)...) +} + +/* ------------------------- multiple sequencers keys ------------------------ */ +func SequencersKey() []byte { + return SequencersKeyPrefix +} + +// SequencersByRollappKey returns the store key to retrieve a SequencersByRollapp from the index fields +func SequencersByRollappKey(rollappId string) []byte { + rollappIdBytes := []byte(rollappId) + return []byte(fmt.Sprintf("%s%s%s", SequencersByRollappKeyPrefix, KeySeparator, rollappIdBytes)) +} + +// SequencersByRollappByStatusKey returns the store key to retrieve a SequencersByRollappByStatus from the index fields +func SequencersByRollappByStatusKey(rollappId string, status OperatingStatus) []byte { + // Get the relevant key prefix based on the packet status + var prefix []byte + switch status { + case Bonded: + prefix = BondedSequencersKeyPrefix + case Unbonded: + prefix = UnbondedSequencersKeyPrefix + case Unbonding: + prefix = UnbondingSequencersKeyPrefix + } + + return []byte(fmt.Sprintf("%s%s%s", SequencersByRollappKey(rollappId), KeySeparator, prefix)) +} + +/* -------------------------- unbonding queue keys -------------------------- */ +func UnbondingQueueByTimeKey(endTime time.Time) []byte { + timeBz := sdk.FormatTimeBytes(endTime) + prefixL := len(UnbondingQueueKey) + + bz := make([]byte, prefixL+len(timeBz)) + + // copy the prefix + copy(bz[:prefixL], UnbondingQueueKey) + // copy the encoded time bytes + copy(bz[prefixL:prefixL+len(timeBz)], timeBz) + + return bz +} + +func UnbondingSequencerKey(sequencerAddress string, endTime time.Time) []byte { + key := UnbondingQueueByTimeKey(endTime) + key = append(key, KeySeparator...) + key = append(key, []byte(sequencerAddress)...) + return key +} diff --git a/third_party/dymension/sequencer/types/metadata.pb.go b/third_party/dymension/sequencer/types/metadata.pb.go new file mode 100644 index 000000000..47fd6b928 --- /dev/null +++ b/third_party/dymension/sequencer/types/metadata.pb.go @@ -0,0 +1,1494 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/metadata.proto + +package types + +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_b236c92093bea103, []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_b236c92093bea103, []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_b236c92093bea103, []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("dymension/sequencer/metadata.proto", fileDescriptor_b236c92093bea103) +} + +var fileDescriptor_b236c92093bea103 = []byte{ + // 535 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x84, 0x53, 0xc1, 0x6f, 0xd3, 0x3e, + 0x18, 0x6d, 0xd6, 0xae, 0x4d, 0x9c, 0xae, 0xfb, 0xfd, 0x22, 0x84, 0xcc, 0x10, 0x21, 0xf4, 0x80, + 0x2a, 0x24, 0x12, 0xd4, 0x49, 0xdc, 0x19, 0x93, 0xd0, 0x10, 0x48, 0x53, 0xca, 0x0e, 0x70, 0x89, + 0xdc, 0xf4, 0x23, 0x8d, 0x9a, 0xc4, 0xc6, 0x76, 0x4b, 0xca, 0x5f, 0xc1, 0x81, 0x3f, 0x8a, 0xe3, + 0x8e, 0x88, 0x03, 0x42, 0xed, 0x3f, 0x82, 0xec, 0x24, 0x5d, 0x77, 0xda, 0x29, 0x7e, 0xef, 0xfb, + 0xde, 0xb3, 0xfd, 0xbe, 0x18, 0x0d, 0x67, 0xeb, 0x1c, 0x0a, 0x91, 0xd2, 0x22, 0x10, 0xf0, 0x65, + 0x09, 0x45, 0x0c, 0x3c, 0xc8, 0x41, 0x92, 0x19, 0x91, 0xc4, 0x67, 0x9c, 0x4a, 0xea, 0x78, 0xbb, + 0x9e, 0x72, 0xfd, 0xcd, 0xdf, 0x01, 0x7f, 0x27, 0x38, 0xb9, 0x97, 0xd0, 0x84, 0xea, 0xe6, 0x40, + 0xad, 0x2a, 0xdd, 0xf0, 0x47, 0x07, 0xfd, 0x3f, 0x69, 0x7a, 0xde, 0xd7, 0x9e, 0x0e, 0x46, 0xbd, + 0x9c, 0x16, 0xe9, 0x02, 0x38, 0x36, 0x3c, 0x63, 0x64, 0x85, 0x0d, 0x54, 0x95, 0x19, 0x48, 0x92, + 0x66, 0x02, 0x1f, 0x56, 0x95, 0x1a, 0x3a, 0x0f, 0x91, 0xc5, 0xc6, 0x2c, 0x12, 0x00, 0x33, 0x81, + 0xbb, 0x5e, 0x7b, 0x64, 0x85, 0x26, 0x1b, 0xb3, 0x89, 0xc2, 0x8e, 0x83, 0x3a, 0x9c, 0xc5, 0x02, + 0xf7, 0x34, 0xaf, 0xd7, 0xce, 0x03, 0x64, 0xc2, 0x2a, 0x8f, 0x34, 0x6f, 0x6a, 0xbe, 0x07, 0xab, + 0x3c, 0x54, 0xa5, 0x21, 0x3a, 0xe2, 0x20, 0x64, 0x44, 0x58, 0x1a, 0x2d, 0x79, 0x26, 0xb0, 0xa5, + 0xeb, 0xb6, 0x22, 0x5f, 0xb1, 0xf4, 0x8a, 0x67, 0xc2, 0x79, 0x82, 0xfa, 0x50, 0xb2, 0x8c, 0x72, + 0xe0, 0xaa, 0x07, 0x23, 0x7d, 0x1c, 0xbb, 0xe1, 0xae, 0x78, 0xa6, 0x5a, 0x12, 0x28, 0x40, 0xa4, + 0xa2, 0x72, 0xb1, 0x2b, 0x97, 0x9a, 0xd3, 0x2e, 0x1f, 0xd1, 0x71, 0x4c, 0x0b, 0x49, 0x62, 0x19, + 0x35, 0xf7, 0xea, 0x7b, 0xc6, 0xc8, 0x1e, 0xbf, 0xf0, 0xef, 0x4a, 0xd4, 0x7f, 0x5d, 0x09, 0xcf, + 0x2b, 0x5d, 0x38, 0x88, 0x6f, 0x61, 0xe7, 0x11, 0x42, 0x50, 0x4a, 0x4e, 0x22, 0x15, 0x29, 0x3e, + 0xf2, 0x8c, 0x51, 0x3f, 0xb4, 0x34, 0x73, 0xae, 0x32, 0x7e, 0x87, 0x2c, 0x51, 0x10, 0x26, 0xe6, + 0x54, 0x0a, 0x3c, 0xf0, 0xda, 0x23, 0x7b, 0xec, 0xdf, 0xbd, 0xe7, 0xa4, 0x96, 0x5c, 0x14, 0x9f, + 0x69, 0x78, 0x63, 0xe0, 0xbc, 0x41, 0x56, 0x42, 0x44, 0xc4, 0x78, 0x1a, 0x03, 0x3e, 0x56, 0x51, + 0x9c, 0x3d, 0xfb, 0xfd, 0xe7, 0xf1, 0xd3, 0x24, 0x95, 0xf3, 0xe5, 0xd4, 0x8f, 0x69, 0x1e, 0xc4, + 0x54, 0xe4, 0x54, 0xd4, 0x9f, 0xe7, 0x62, 0xb6, 0x08, 0xe4, 0x9a, 0x81, 0xf0, 0x2f, 0x0a, 0x19, + 0x9a, 0x09, 0x11, 0x97, 0x4a, 0xfb, 0xb6, 0x63, 0x1e, 0xfc, 0x77, 0x38, 0xfc, 0x80, 0x06, 0xb7, + 0x6f, 0xa7, 0x06, 0xff, 0x15, 0xa6, 0x22, 0x95, 0x80, 0xed, 0x6a, 0xf0, 0x35, 0x74, 0x4e, 0x90, + 0x29, 0x21, 0x83, 0x84, 0x93, 0xbc, 0xfe, 0x5b, 0x76, 0xd8, 0xe9, 0x23, 0xa3, 0xc4, 0x07, 0x9a, + 0x34, 0xca, 0x21, 0xa0, 0xfe, 0xfe, 0xf9, 0xd5, 0x7c, 0x9a, 0x1b, 0xe8, 0x11, 0x56, 0x6a, 0xbb, + 0xe1, 0xd4, 0x08, 0xef, 0xa3, 0xee, 0x1c, 0xd2, 0x64, 0x2e, 0xb5, 0x4b, 0x27, 0xac, 0x91, 0xda, + 0x34, 0x9e, 0x43, 0xbc, 0x10, 0xcb, 0x1c, 0xb7, 0xab, 0x4d, 0x1b, 0x7c, 0x76, 0xf9, 0x73, 0xe3, + 0x1a, 0xd7, 0x1b, 0xd7, 0xf8, 0xbb, 0x71, 0x8d, 0xef, 0x5b, 0xb7, 0x75, 0xbd, 0x75, 0x5b, 0xbf, + 0xb6, 0x6e, 0xeb, 0xd3, 0xcb, 0xbd, 0x38, 0xf6, 0xa3, 0xbe, 0x01, 0xc1, 0xea, 0x34, 0x28, 0xf7, + 0x9e, 0x99, 0x8e, 0x68, 0xda, 0xd5, 0x8f, 0xe5, 0xf4, 0x5f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x56, + 0x6a, 0x04, 0x3d, 0x8a, 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/third_party/dymension/sequencer/types/operating_status.pb.go b/third_party/dymension/sequencer/types/operating_status.pb.go new file mode 100644 index 000000000..a3dae80b5 --- /dev/null +++ b/third_party/dymension/sequencer/types/operating_status.pb.go @@ -0,0 +1,85 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/operating_status.proto + +package types + +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_406c52b8df3dd90f, []int{0} +} + +func init() { + proto.RegisterEnum("dymensionxyz.dymension.sequencer.OperatingStatus", OperatingStatus_name, OperatingStatus_value) +} + +func init() { + proto.RegisterFile("dymension/sequencer/operating_status.proto", fileDescriptor_406c52b8df3dd90f) +} + +var fileDescriptor_406c52b8df3dd90f = []byte{ + // 259 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xd2, 0x4a, 0xa9, 0xcc, 0x4d, + 0xcd, 0x2b, 0xce, 0xcc, 0xcf, 0xd3, 0x2f, 0x4e, 0x2d, 0x2c, 0x4d, 0xcd, 0x4b, 0x4e, 0x2d, 0xd2, + 0xcf, 0x2f, 0x48, 0x2d, 0x4a, 0x2c, 0xc9, 0xcc, 0x4b, 0x8f, 0x2f, 0x2e, 0x49, 0x2c, 0x29, 0x2d, + 0xd6, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x52, 0x80, 0xab, 0xad, 0xa8, 0xac, 0xd2, 0x83, 0x73, + 0xf4, 0xe0, 0x1a, 0xa5, 0x44, 0xd2, 0xf3, 0xd3, 0xf3, 0xc1, 0x8a, 0xf5, 0x41, 0x2c, 0x88, 0x3e, + 0xad, 0x39, 0x8c, 0x5c, 0xfc, 0xfe, 0x30, 0x23, 0x83, 0xc1, 0x26, 0x0a, 0x69, 0x73, 0x49, 0xfa, + 0x07, 0xb8, 0x06, 0x39, 0x86, 0x78, 0xfa, 0xb9, 0xc7, 0x07, 0x87, 0x38, 0x86, 0x84, 0x06, 0xc7, + 0x87, 0xfa, 0x39, 0xf9, 0xfb, 0xb9, 0xb8, 0xba, 0x08, 0x30, 0x48, 0xf1, 0x74, 0xcd, 0x55, 0xe0, + 0x08, 0xcd, 0x4b, 0xca, 0xcf, 0x4b, 0x49, 0x4d, 0x11, 0xd2, 0xe5, 0x92, 0xc2, 0xa1, 0xd8, 0xd3, + 0xcf, 0x5d, 0x80, 0x51, 0x8a, 0xb7, 0x6b, 0xae, 0x02, 0x27, 0x44, 0x75, 0x66, 0x5e, 0xba, 0x90, + 0x3a, 0x97, 0x38, 0x86, 0x72, 0xa8, 0xc9, 0x4c, 0x52, 0x5c, 0x5d, 0x73, 0x15, 0xd8, 0x9c, 0xc0, + 0xe6, 0x4a, 0xb1, 0x74, 0x2c, 0x96, 0x63, 0x70, 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, 0xbf, 0x23, 0x38, 0xfa, 0x65, 0xc6, 0xfa, 0x15, 0x48, 0x21, 0x57, 0x52, 0x59, 0x90, 0x5a, + 0x9c, 0xc4, 0x06, 0xf6, 0xb7, 0x31, 0x20, 0x00, 0x00, 0xff, 0xff, 0xe6, 0x7a, 0x7d, 0xf3, 0x5d, + 0x01, 0x00, 0x00, +} diff --git a/third_party/dymension/sequencer/types/params.go b/third_party/dymension/sequencer/types/params.go new file mode 100644 index 000000000..2c89595f9 --- /dev/null +++ b/third_party/dymension/sequencer/types/params.go @@ -0,0 +1,11 @@ +package types + +import ( + "gopkg.in/yaml.v2" +) + +// String implements the Stringer interface. +func (p Params) String() string { + out, _ := yaml.Marshal(p) + return string(out) +} diff --git a/third_party/dymension/sequencer/types/params.pb.go b/third_party/dymension/sequencer/types/params.pb.go new file mode 100644 index 000000000..26ea35e1d --- /dev/null +++ b/third_party/dymension/sequencer/types/params.pb.go @@ -0,0 +1,527 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/params.proto + +package types + +import ( + fmt "fmt" + 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" + _ "github.com/gogo/protobuf/types" + github_com_gogo_protobuf_types "github.com/gogo/protobuf/types" + 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 + +// Params defines the parameters for the module. +type Params struct { + MinBond types.Coin `protobuf:"bytes,1,opt,name=min_bond,json=minBond,proto3" json:"min_bond,omitempty"` + // unbonding_time is the time duration of unbonding. + UnbondingTime time.Duration `protobuf:"bytes,2,opt,name=unbonding_time,json=unbondingTime,proto3,stdduration" json:"unbonding_time"` + // 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. + NoticePeriod time.Duration `protobuf:"bytes,3,opt,name=notice_period,json=noticePeriod,proto3,stdduration" json:"notice_period"` + // LivenessSlashMultiplier multiplies with the tokens of the slashed sequencer to compute the burn amount. + LivenessSlashMultiplier github_com_cosmos_cosmos_sdk_types.Dec `protobuf:"bytes,4,opt,name=liveness_slash_multiplier,json=livenessSlashMultiplier,proto3,customtype=github.com/cosmos/cosmos-sdk/types.Dec" json:"liveness_slash_multiplier" yaml:"liveness_slash_multiplier"` +} + +func (m *Params) Reset() { *m = Params{} } +func (*Params) ProtoMessage() {} +func (*Params) Descriptor() ([]byte, []int) { + return fileDescriptor_d06545e8924ecfea, []int{0} +} +func (m *Params) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *Params) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_Params.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 *Params) XXX_Merge(src proto.Message) { + xxx_messageInfo_Params.Merge(m, src) +} +func (m *Params) XXX_Size() int { + return m.Size() +} +func (m *Params) XXX_DiscardUnknown() { + xxx_messageInfo_Params.DiscardUnknown(m) +} + +var xxx_messageInfo_Params proto.InternalMessageInfo + +func (m *Params) GetMinBond() types.Coin { + if m != nil { + return m.MinBond + } + return types.Coin{} +} + +func (m *Params) GetUnbondingTime() time.Duration { + if m != nil { + return m.UnbondingTime + } + return 0 +} + +func (m *Params) GetNoticePeriod() time.Duration { + if m != nil { + return m.NoticePeriod + } + return 0 +} + +func init() { + proto.RegisterType((*Params)(nil), "dymensionxyz.dymension.sequencer.Params") +} + +func init() { proto.RegisterFile("dymension/sequencer/params.proto", fileDescriptor_d06545e8924ecfea) } + +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, 0xee, 0x3d, 0x3b, 0xa4, 0x3d, 0x9d, 0xb6, + 0x74, 0x3a, 0xd0, 0xe9, 0x0b, 0xe4, 0xd2, 0x5b, 0x5c, 0x37, 0x8e, 0xf1, 0xbb, 0x71, 0xac, 0x31, + 0xf2, 0x04, 0x05, 0xd7, 0x20, 0x0a, 0x5d, 0x07, 0x77, 0x04, 0x97, 0x1e, 0xca, 0xd4, 0x7a, 0x65, + 0x3e, 0xa8, 0x64, 0x2b, 0x72, 0x99, 0x85, 0x9a, 0x0b, 0x98, 0xdf, 0x1a, 0xb8, 0x7d, 0x2b, 0x3a, + 0xb6, 0xa2, 0x67, 0x43, 0x2b, 0x6f, 0xd6, 0x72, 0x2f, 0x7f, 0x38, 0x24, 0x38, 0x98, 0xa2, 0x6f, + 0xb9, 0x00, 0xeb, 0xa5, 0x79, 0x20, 0x51, 0xf3, 0x04, 0xc2, 0x02, 0x4a, 0x8e, 0xe9, 0x7c, 0xef, + 0xff, 0x51, 0xf7, 0xfb, 0xa4, 0xdf, 0x05, 0xad, 0x2f, 0xc4, 0x3c, 0xcc, 0xf9, 0x0a, 0x24, 0x28, + 0x15, 0xaa, 0x3c, 0x52, 0xe7, 0xa1, 0xa8, 0x72, 0xcd, 0x8b, 0x9c, 0x43, 0x39, 0xbf, 0xed, 0x92, + 0xa3, 0xbb, 0x5e, 0xd0, 0x66, 0xbf, 0x37, 0xce, 0xe3, 0x8c, 0xeb, 0xf3, 0x2a, 0xa6, 0x09, 0x0a, + 0x36, 0x6c, 0xba, 0xff, 0x3c, 0x55, 0xe9, 0x07, 0xa6, 0xeb, 0x02, 0x14, 0x3d, 0x83, 0xe4, 0x4f, + 0xe3, 0xb8, 0x75, 0x24, 0xf2, 0xd3, 0xe5, 0x3f, 0xc1, 0xcb, 0xe0, 0xd1, 0xa8, 0xbd, 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, +} + +func (this *Params) Equal(that interface{}) bool { + if that == nil { + return this == nil + } + + that1, ok := that.(*Params) + if !ok { + that2, ok := that.(Params) + if ok { + that1 = &that2 + } else { + return false + } + } + if that1 == nil { + return this == nil + } else if this == nil { + return false + } + if !this.MinBond.Equal(&that1.MinBond) { + return false + } + if this.UnbondingTime != that1.UnbondingTime { + return false + } + if this.NoticePeriod != that1.NoticePeriod { + return false + } + if !this.LivenessSlashMultiplier.Equal(that1.LivenessSlashMultiplier) { + return false + } + return true +} +func (m *Params) 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 *Params) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size := m.LivenessSlashMultiplier.Size() + i -= size + if _, err := m.LivenessSlashMultiplier.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + n1, err1 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.NoticePeriod, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.NoticePeriod):]) + if err1 != nil { + return 0, err1 + } + i -= n1 + i = encodeVarintParams(dAtA, i, uint64(n1)) + i-- + dAtA[i] = 0x1a + n2, err2 := github_com_gogo_protobuf_types.StdDurationMarshalTo(m.UnbondingTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdDuration(m.UnbondingTime):]) + if err2 != nil { + return 0, err2 + } + i -= n2 + i = encodeVarintParams(dAtA, i, uint64(n2)) + i-- + dAtA[i] = 0x12 + { + size, err := m.MinBond.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintParams(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func encodeVarintParams(dAtA []byte, offset int, v uint64) int { + offset -= sovParams(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *Params) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.MinBond.Size() + n += 1 + l + sovParams(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.UnbondingTime) + n += 1 + l + sovParams(uint64(l)) + l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.NoticePeriod) + n += 1 + l + sovParams(uint64(l)) + l = m.LivenessSlashMultiplier.Size() + n += 1 + l + sovParams(uint64(l)) + return n +} + +func sovParams(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozParams(x uint64) (n int) { + return sovParams(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *Params) 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 ErrIntOverflowParams + } + 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: Params: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: Params: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field MinBond", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.MinBond.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingTime", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.UnbondingTime, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoticePeriod", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthParams + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := github_com_gogo_protobuf_types.StdDurationUnmarshal(&m.NoticePeriod, dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field LivenessSlashMultiplier", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowParams + } + 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 ErrInvalidLengthParams + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthParams + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.LivenessSlashMultiplier.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipParams(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthParams + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func skipParams(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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrIntOverflowParams + } + 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, ErrInvalidLengthParams + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupParams + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthParams + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthParams = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowParams = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupParams = fmt.Errorf("proto: unexpected end of group") +) diff --git a/third_party/dymension/sequencer/types/query.pb.go b/third_party/dymension/sequencer/types/query.pb.go new file mode 100644 index 000000000..d104fe6a2 --- /dev/null +++ b/third_party/dymension/sequencer/types/query.pb.go @@ -0,0 +1,3031 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/query.proto + +package types + +import ( + context "context" + fmt "fmt" + query "github.com/cosmos/cosmos-sdk/types/query" + _ "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" + 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 + +// QueryParamsRequest is request type for the Query/Params RPC method. +type QueryParamsRequest struct { +} + +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} +} +func (m *QueryParamsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsRequest.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 *QueryParamsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsRequest.Merge(m, src) +} +func (m *QueryParamsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsRequest proto.InternalMessageInfo + +// QueryParamsResponse is response type for the Query/Params RPC method. +type QueryParamsResponse struct { + // params holds all the parameters of this module. + Params Params `protobuf:"bytes,1,opt,name=params,proto3" json:"params"` +} + +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} +} +func (m *QueryParamsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryParamsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryParamsResponse.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 *QueryParamsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryParamsResponse.Merge(m, src) +} +func (m *QueryParamsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryParamsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryParamsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryParamsResponse proto.InternalMessageInfo + +func (m *QueryParamsResponse) GetParams() Params { + if m != nil { + return m.Params + } + return Params{} +} + +type QueryGetSequencerRequest struct { + SequencerAddress string `protobuf:"bytes,1,opt,name=sequencerAddress,proto3" json:"sequencerAddress,omitempty"` +} + +func (m *QueryGetSequencerRequest) Reset() { *m = QueryGetSequencerRequest{} } +func (m *QueryGetSequencerRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetSequencerRequest) ProtoMessage() {} +func (*QueryGetSequencerRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{2} +} +func (m *QueryGetSequencerRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSequencerRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSequencerRequest.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 *QueryGetSequencerRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSequencerRequest.Merge(m, src) +} +func (m *QueryGetSequencerRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSequencerRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSequencerRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSequencerRequest proto.InternalMessageInfo + +func (m *QueryGetSequencerRequest) GetSequencerAddress() string { + if m != nil { + return m.SequencerAddress + } + return "" +} + +type QueryGetSequencerResponse struct { + Sequencer Sequencer `protobuf:"bytes,1,opt,name=sequencer,proto3" json:"sequencer"` +} + +func (m *QueryGetSequencerResponse) Reset() { *m = QueryGetSequencerResponse{} } +func (m *QueryGetSequencerResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetSequencerResponse) ProtoMessage() {} +func (*QueryGetSequencerResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{3} +} +func (m *QueryGetSequencerResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSequencerResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSequencerResponse.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 *QueryGetSequencerResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSequencerResponse.Merge(m, src) +} +func (m *QueryGetSequencerResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSequencerResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSequencerResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSequencerResponse proto.InternalMessageInfo + +func (m *QueryGetSequencerResponse) GetSequencer() Sequencer { + if m != nil { + return m.Sequencer + } + return Sequencer{} +} + +type QuerySequencersRequest struct { + Pagination *query.PageRequest `protobuf:"bytes,1,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +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} +} +func (m *QuerySequencersRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySequencersRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySequencersRequest.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 *QuerySequencersRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySequencersRequest.Merge(m, src) +} +func (m *QuerySequencersRequest) XXX_Size() int { + return m.Size() +} +func (m *QuerySequencersRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySequencersRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySequencersRequest proto.InternalMessageInfo + +func (m *QuerySequencersRequest) GetPagination() *query.PageRequest { + if m != nil { + return m.Pagination + } + return nil +} + +type QuerySequencersResponse struct { + Sequencers []Sequencer `protobuf:"bytes,1,rep,name=sequencers,proto3" json:"sequencers"` + Pagination *query.PageResponse `protobuf:"bytes,2,opt,name=pagination,proto3" json:"pagination,omitempty"` +} + +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} +} +func (m *QuerySequencersResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QuerySequencersResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QuerySequencersResponse.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 *QuerySequencersResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QuerySequencersResponse.Merge(m, src) +} +func (m *QuerySequencersResponse) XXX_Size() int { + return m.Size() +} +func (m *QuerySequencersResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QuerySequencersResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QuerySequencersResponse proto.InternalMessageInfo + +func (m *QuerySequencersResponse) GetSequencers() []Sequencer { + if m != nil { + return m.Sequencers + } + return nil +} + +func (m *QuerySequencersResponse) GetPagination() *query.PageResponse { + if m != nil { + return m.Pagination + } + return nil +} + +type QueryGetSequencersByRollappRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` +} + +func (m *QueryGetSequencersByRollappRequest) Reset() { *m = QueryGetSequencersByRollappRequest{} } +func (m *QueryGetSequencersByRollappRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetSequencersByRollappRequest) ProtoMessage() {} +func (*QueryGetSequencersByRollappRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{6} +} +func (m *QueryGetSequencersByRollappRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSequencersByRollappRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSequencersByRollappRequest.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 *QueryGetSequencersByRollappRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSequencersByRollappRequest.Merge(m, src) +} +func (m *QueryGetSequencersByRollappRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSequencersByRollappRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSequencersByRollappRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSequencersByRollappRequest proto.InternalMessageInfo + +func (m *QueryGetSequencersByRollappRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +type QueryGetSequencersByRollappResponse struct { + Sequencers []Sequencer `protobuf:"bytes,1,rep,name=sequencers,proto3" json:"sequencers"` +} + +func (m *QueryGetSequencersByRollappResponse) Reset() { *m = QueryGetSequencersByRollappResponse{} } +func (m *QueryGetSequencersByRollappResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetSequencersByRollappResponse) ProtoMessage() {} +func (*QueryGetSequencersByRollappResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{7} +} +func (m *QueryGetSequencersByRollappResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSequencersByRollappResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSequencersByRollappResponse.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 *QueryGetSequencersByRollappResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSequencersByRollappResponse.Merge(m, src) +} +func (m *QueryGetSequencersByRollappResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSequencersByRollappResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSequencersByRollappResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSequencersByRollappResponse proto.InternalMessageInfo + +func (m *QueryGetSequencersByRollappResponse) GetSequencers() []Sequencer { + if m != nil { + return m.Sequencers + } + return nil +} + +type QueryGetSequencersByRollappByStatusRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` + Status OperatingStatus `protobuf:"varint,2,opt,name=status,proto3,enum=dymensionxyz.dymension.sequencer.OperatingStatus" json:"status,omitempty"` +} + +func (m *QueryGetSequencersByRollappByStatusRequest) Reset() { + *m = QueryGetSequencersByRollappByStatusRequest{} +} +func (m *QueryGetSequencersByRollappByStatusRequest) String() string { + return proto.CompactTextString(m) +} +func (*QueryGetSequencersByRollappByStatusRequest) ProtoMessage() {} +func (*QueryGetSequencersByRollappByStatusRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{8} +} +func (m *QueryGetSequencersByRollappByStatusRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSequencersByRollappByStatusRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSequencersByRollappByStatusRequest.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 *QueryGetSequencersByRollappByStatusRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSequencersByRollappByStatusRequest.Merge(m, src) +} +func (m *QueryGetSequencersByRollappByStatusRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSequencersByRollappByStatusRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSequencersByRollappByStatusRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSequencersByRollappByStatusRequest proto.InternalMessageInfo + +func (m *QueryGetSequencersByRollappByStatusRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *QueryGetSequencersByRollappByStatusRequest) GetStatus() OperatingStatus { + if m != nil { + return m.Status + } + return Unbonded +} + +type QueryGetSequencersByRollappByStatusResponse struct { + Sequencers []Sequencer `protobuf:"bytes,1,rep,name=sequencers,proto3" json:"sequencers"` +} + +func (m *QueryGetSequencersByRollappByStatusResponse) Reset() { + *m = QueryGetSequencersByRollappByStatusResponse{} +} +func (m *QueryGetSequencersByRollappByStatusResponse) String() string { + return proto.CompactTextString(m) +} +func (*QueryGetSequencersByRollappByStatusResponse) ProtoMessage() {} +func (*QueryGetSequencersByRollappByStatusResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{9} +} +func (m *QueryGetSequencersByRollappByStatusResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetSequencersByRollappByStatusResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetSequencersByRollappByStatusResponse.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 *QueryGetSequencersByRollappByStatusResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetSequencersByRollappByStatusResponse.Merge(m, src) +} +func (m *QueryGetSequencersByRollappByStatusResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetSequencersByRollappByStatusResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetSequencersByRollappByStatusResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetSequencersByRollappByStatusResponse proto.InternalMessageInfo + +func (m *QueryGetSequencersByRollappByStatusResponse) GetSequencers() []Sequencer { + if m != nil { + return m.Sequencers + } + return nil +} + +// Request type for the GetProposerByRollapp RPC method. +type QueryGetProposerByRollappRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` +} + +func (m *QueryGetProposerByRollappRequest) Reset() { *m = QueryGetProposerByRollappRequest{} } +func (m *QueryGetProposerByRollappRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetProposerByRollappRequest) ProtoMessage() {} +func (*QueryGetProposerByRollappRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{10} +} +func (m *QueryGetProposerByRollappRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetProposerByRollappRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetProposerByRollappRequest.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 *QueryGetProposerByRollappRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetProposerByRollappRequest.Merge(m, src) +} +func (m *QueryGetProposerByRollappRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetProposerByRollappRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetProposerByRollappRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetProposerByRollappRequest proto.InternalMessageInfo + +func (m *QueryGetProposerByRollappRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +// Response type for the GetProposerByRollapp RPC method. +type QueryGetProposerByRollappResponse struct { + ProposerAddr string `protobuf:"bytes,1,opt,name=proposerAddr,proto3" json:"proposerAddr,omitempty"` +} + +func (m *QueryGetProposerByRollappResponse) Reset() { *m = QueryGetProposerByRollappResponse{} } +func (m *QueryGetProposerByRollappResponse) String() string { return proto.CompactTextString(m) } +func (*QueryGetProposerByRollappResponse) ProtoMessage() {} +func (*QueryGetProposerByRollappResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{11} +} +func (m *QueryGetProposerByRollappResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetProposerByRollappResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetProposerByRollappResponse.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 *QueryGetProposerByRollappResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetProposerByRollappResponse.Merge(m, src) +} +func (m *QueryGetProposerByRollappResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetProposerByRollappResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetProposerByRollappResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetProposerByRollappResponse proto.InternalMessageInfo + +func (m *QueryGetProposerByRollappResponse) GetProposerAddr() string { + if m != nil { + return m.ProposerAddr + } + return "" +} + +// Request type for the GetNextProposerByRollapp RPC method. +type QueryGetNextProposerByRollappRequest struct { + RollappId string `protobuf:"bytes,1,opt,name=rollappId,proto3" json:"rollappId,omitempty"` +} + +func (m *QueryGetNextProposerByRollappRequest) Reset() { *m = QueryGetNextProposerByRollappRequest{} } +func (m *QueryGetNextProposerByRollappRequest) String() string { return proto.CompactTextString(m) } +func (*QueryGetNextProposerByRollappRequest) ProtoMessage() {} +func (*QueryGetNextProposerByRollappRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_d09222b66a78a447, []int{12} +} +func (m *QueryGetNextProposerByRollappRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetNextProposerByRollappRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetNextProposerByRollappRequest.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 *QueryGetNextProposerByRollappRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetNextProposerByRollappRequest.Merge(m, src) +} +func (m *QueryGetNextProposerByRollappRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryGetNextProposerByRollappRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetNextProposerByRollappRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetNextProposerByRollappRequest proto.InternalMessageInfo + +func (m *QueryGetNextProposerByRollappRequest) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +// 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"` +} + +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} +} +func (m *QueryGetNextProposerByRollappResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryGetNextProposerByRollappResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryGetNextProposerByRollappResponse.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 *QueryGetNextProposerByRollappResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryGetNextProposerByRollappResponse.Merge(m, src) +} +func (m *QueryGetNextProposerByRollappResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryGetNextProposerByRollappResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryGetNextProposerByRollappResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryGetNextProposerByRollappResponse proto.InternalMessageInfo + +func (m *QueryGetNextProposerByRollappResponse) GetNextProposerAddr() string { + if m != nil { + return m.NextProposerAddr + } + return "" +} + +func (m *QueryGetNextProposerByRollappResponse) GetRotationInProgress() bool { + if m != nil { + return m.RotationInProgress + } + return false +} + +func init() { + proto.RegisterType((*QueryParamsRequest)(nil), "dymensionxyz.dymension.sequencer.QueryParamsRequest") + proto.RegisterType((*QueryParamsResponse)(nil), "dymensionxyz.dymension.sequencer.QueryParamsResponse") + proto.RegisterType((*QueryGetSequencerRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetSequencerRequest") + proto.RegisterType((*QueryGetSequencerResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetSequencerResponse") + proto.RegisterType((*QuerySequencersRequest)(nil), "dymensionxyz.dymension.sequencer.QuerySequencersRequest") + proto.RegisterType((*QuerySequencersResponse)(nil), "dymensionxyz.dymension.sequencer.QuerySequencersResponse") + proto.RegisterType((*QueryGetSequencersByRollappRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetSequencersByRollappRequest") + proto.RegisterType((*QueryGetSequencersByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetSequencersByRollappResponse") + proto.RegisterType((*QueryGetSequencersByRollappByStatusRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetSequencersByRollappByStatusRequest") + proto.RegisterType((*QueryGetSequencersByRollappByStatusResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetSequencersByRollappByStatusResponse") + proto.RegisterType((*QueryGetProposerByRollappRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetProposerByRollappRequest") + proto.RegisterType((*QueryGetProposerByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetProposerByRollappResponse") + proto.RegisterType((*QueryGetNextProposerByRollappRequest)(nil), "dymensionxyz.dymension.sequencer.QueryGetNextProposerByRollappRequest") + proto.RegisterType((*QueryGetNextProposerByRollappResponse)(nil), "dymensionxyz.dymension.sequencer.QueryGetNextProposerByRollappResponse") +} + +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, 0x56, 0x0c, 0x55, 0x2b, 0xe8, + 0x2c, 0x98, 0xc7, 0xc6, 0xfc, 0x28, 0x1a, 0xaa, 0xa9, 0x96, 0x5c, 0xb4, 0x09, 0xbf, 0x08, 0xef, + 0xc9, 0x2d, 0xe9, 0x17, 0x44, 0x0c, 0x6c, 0xaa, 0x56, 0x41, 0xd7, 0xb2, 0xd4, 0x52, 0xad, 0x32, + 0x07, 0x94, 0x46, 0x00, 0x6d, 0xd9, 0xa4, 0xd2, 0xac, 0x4a, 0xc6, 0x0e, 0xa7, 0x96, 0xf4, 0x1c, + 0x86, 0x1b, 0x4e, 0xa9, 0x41, 0x74, 0x8a, 0x51, 0x12, 0xc2, 0x0e, 0x9b, 0x51, 0x21, 0x26, 0x4c, + 0xfe, 0x33, 0x33, 0x29, 0x07, 0xb5, 0x4c, 0x76, 0x10, 0x12, 0x7f, 0x1e, 0x7f, 0x1d, 0x0f, 0x65, + 0x78, 0xb6, 0x94, 0x84, 0x51, 0x06, 0x9f, 0xc2, 0xd6, 0xb6, 0x1b, 0xc9, 0x4b, 0xa3, 0x38, 0x0c, + 0x79, 0xd9, 0x8f, 0xf2, 0x79, 0x13, 0x53, 0xa7, 0x5a, 0x24, 0xd3, 0x74, 0x2e, 0x15, 0xe1, 0x8a, + 0x0f, 0x0e, 0x27, 0xbb, 0x09, 0x11, 0x2f, 0x81, 0xf3, 0x9d, 0x0a, 0xe6, 0xeb, 0xe1, 0x70, 0xca, + 0x35, 0x0c, 0xe9, 0x05, 0xfc, 0xc7, 0xaa, 0x79, 0x21, 0x6e, 0xbb, 0x50, 0x12, 0xa0, 0x36, 0x4b, + 0x5e, 0xeb, 0xa6, 0xec, 0x0c, 0x5e, 0xb6, 0x07, 0x2f, 0x3b, 0xdf, 0x19, 0x1f, 0xbc, 0x9c, 0x56, + 0x35, 0xcc, 0x73, 0x33, 0x75, 0x99, 0xd2, 0x07, 0x01, 0xfe, 0x6f, 0x2a, 0xc1, 0xe5, 0x6c, 0x01, + 0x78, 0x54, 0xec, 0x8e, 0xfc, 0xd1, 0x9b, 0x9e, 0x3a, 0x10, 0x94, 0x6a, 0xa0, 0x3d, 0xc0, 0x68, + 0xdf, 0x0a, 0xa4, 0xed, 0xf0, 0x69, 0xe0, 0x9d, 0x00, 0xa9, 0x69, 0x0e, 0x34, 0x51, 0xcd, 0x90, + 0x62, 0x51, 0x35, 0x0c, 0xb7, 0x4b, 0x63, 0x10, 0x31, 0x9d, 0x93, 0xb5, 0x3c, 0x1f, 0x69, 0xed, + 0x40, 0xaa, 0xc0, 0x44, 0x5b, 0x8c, 0x4b, 0x6b, 0x83, 0xf4, 0x4e, 0x80, 0x78, 0x9b, 0xd2, 0x89, + 0xea, 0x36, 0x5b, 0x98, 0x8e, 0x64, 0xa0, 0x35, 0x08, 0x3b, 0xfb, 0xc5, 0xfa, 0xf9, 0xef, 0xcc, + 0x74, 0x30, 0xb7, 0x4d, 0x77, 0x33, 0x79, 0x1d, 0x0e, 0x20, 0xbd, 0x16, 0x60, 0xaa, 0x23, 0x5e, + 0x97, 0xd7, 0x9a, 0x25, 0x88, 0xb9, 0x0c, 0xd2, 0x26, 0x31, 0x08, 0xc5, 0x66, 0x97, 0x63, 0x4d, + 0xc1, 0xb5, 0x36, 0x08, 0x9c, 0xb9, 0x04, 0x83, 0x06, 0x7f, 0x69, 0xaf, 0x36, 0x47, 0x69, 0x38, + 0x93, 0x56, 0xe0, 0xba, 0x0b, 0xb4, 0x81, 0x2b, 0xbd, 0xd2, 0x79, 0x2b, 0xc0, 0x8d, 0x00, 0x18, + 0xce, 0x29, 0x0e, 0x43, 0x7a, 0x5d, 0x40, 0x1d, 0xaf, 0xa6, 0x73, 0x24, 0x03, 0x32, 0xb9, 0xed, + 0xaf, 0xe9, 0x69, 0x93, 0x68, 0xcc, 0xb5, 0xec, 0x0f, 0xe0, 0xef, 0x8c, 0xcf, 0x9b, 0x99, 0xa3, + 0x41, 0xf8, 0x8b, 0xb1, 0x40, 0xef, 0x05, 0x08, 0x3b, 0x16, 0x89, 0xee, 0x06, 0x8f, 0xaa, 0xd9, + 0xa9, 0xc5, 0x7b, 0x5d, 0x66, 0x39, 0xea, 0xa4, 0x3b, 0x6f, 0x3e, 0xff, 0x38, 0x1a, 0x88, 0xa3, + 0x49, 0xa5, 0x3e, 0x5d, 0x69, 0x7d, 0xff, 0xa0, 0x4f, 0x02, 0x44, 0xbc, 0x4f, 0x05, 0x3d, 0xe8, + 0xb0, 0xac, 0x8f, 0xc3, 0x8b, 0x0b, 0x3d, 0xe5, 0x72, 0xe2, 0x49, 0x46, 0x7c, 0x09, 0x2d, 0x06, + 0x13, 0xaf, 0x3d, 0xed, 0x9f, 0xbf, 0x39, 0x0e, 0xd0, 0x47, 0x01, 0xa0, 0xb6, 0x54, 0x68, 0xbe, + 0x43, 0x4e, 0x4d, 0xde, 0x2f, 0xde, 0xef, 0x21, 0x93, 0x6b, 0x99, 0x65, 0x5a, 0x6e, 0xa3, 0xa9, + 0x2e, 0xb4, 0xa0, 0x9f, 0x02, 0x0c, 0xfb, 0xb8, 0x01, 0x5a, 0xe9, 0xa1, 0xab, 0x4d, 0x1e, 0x2d, + 0xae, 0xf6, 0x89, 0xc2, 0x95, 0x3d, 0x66, 0xca, 0x56, 0xd1, 0x72, 0x17, 0xca, 0x68, 0x36, 0x57, + 0xcd, 0xf2, 0x4d, 0x55, 0xf6, 0xbd, 0x95, 0x3d, 0x40, 0x87, 0x03, 0x70, 0xb5, 0x8d, 0xff, 0xa1, + 0xf5, 0xbe, 0x38, 0x9f, 0xb3, 0x77, 0xf1, 0xc9, 0x05, 0xa1, 0xf1, 0x4e, 0x3c, 0x65, 0x9d, 0xd8, + 0x40, 0xeb, 0x17, 0xd0, 0x09, 0x65, 0xdf, 0xb9, 0x19, 0x0e, 0xd0, 0x37, 0x01, 0x46, 0xfc, 0x1c, + 0x15, 0x25, 0x3a, 0x67, 0xdf, 0xca, 0x41, 0xc5, 0xe5, 0xbe, 0x30, 0xb8, 0xee, 0x45, 0xa6, 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, +} + +// 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 + +// QueryClient is the client API for Query service. +// +// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream. +type QueryClient interface { + // Parameters queries the parameters of the module. + Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) + // Queries a Sequencer by address. + Sequencer(ctx context.Context, in *QueryGetSequencerRequest, opts ...grpc.CallOption) (*QueryGetSequencerResponse, error) + // Queries a list of Sequencer items. + Sequencers(ctx context.Context, in *QuerySequencersRequest, opts ...grpc.CallOption) (*QuerySequencersResponse, error) + // Queries a SequencersByRollapp by rollappId. + SequencersByRollapp(ctx context.Context, in *QueryGetSequencersByRollappRequest, opts ...grpc.CallOption) (*QueryGetSequencersByRollappResponse, error) + // Queries a SequencersByRollappByStatus + SequencersByRollappByStatus(ctx context.Context, in *QueryGetSequencersByRollappByStatusRequest, opts ...grpc.CallOption) (*QueryGetSequencersByRollappByStatusResponse, error) + // Queries the current proposer by rollappId. + 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) +} + +type queryClient struct { + cc grpc1.ClientConn +} + +func NewQueryClient(cc grpc1.ClientConn) QueryClient { + return &queryClient{cc} +} + +func (c *queryClient) Params(ctx context.Context, in *QueryParamsRequest, opts ...grpc.CallOption) (*QueryParamsResponse, error) { + out := new(QueryParamsResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/Params", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Sequencer(ctx context.Context, in *QueryGetSequencerRequest, opts ...grpc.CallOption) (*QueryGetSequencerResponse, error) { + out := new(QueryGetSequencerResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/Sequencer", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) Sequencers(ctx context.Context, in *QuerySequencersRequest, opts ...grpc.CallOption) (*QuerySequencersResponse, error) { + out := new(QuerySequencersResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/Sequencers", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SequencersByRollapp(ctx context.Context, in *QueryGetSequencersByRollappRequest, opts ...grpc.CallOption) (*QueryGetSequencersByRollappResponse, error) { + out := new(QueryGetSequencersByRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/SequencersByRollapp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) SequencersByRollappByStatus(ctx context.Context, in *QueryGetSequencersByRollappByStatusRequest, opts ...grpc.CallOption) (*QueryGetSequencersByRollappByStatusResponse, error) { + out := new(QueryGetSequencersByRollappByStatusResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/SequencersByRollappByStatus", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetProposerByRollapp(ctx context.Context, in *QueryGetProposerByRollappRequest, opts ...grpc.CallOption) (*QueryGetProposerByRollappResponse, error) { + out := new(QueryGetProposerByRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/GetProposerByRollapp", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +func (c *queryClient) GetNextProposerByRollapp(ctx context.Context, in *QueryGetNextProposerByRollappRequest, opts ...grpc.CallOption) (*QueryGetNextProposerByRollappResponse, error) { + out := new(QueryGetNextProposerByRollappResponse) + err := c.cc.Invoke(ctx, "/dymensionxyz.dymension.sequencer.Query/GetNextProposerByRollapp", 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. + Params(context.Context, *QueryParamsRequest) (*QueryParamsResponse, error) + // Queries a Sequencer by address. + Sequencer(context.Context, *QueryGetSequencerRequest) (*QueryGetSequencerResponse, error) + // Queries a list of Sequencer items. + Sequencers(context.Context, *QuerySequencersRequest) (*QuerySequencersResponse, error) + // Queries a SequencersByRollapp by rollappId. + SequencersByRollapp(context.Context, *QueryGetSequencersByRollappRequest) (*QueryGetSequencersByRollappResponse, error) + // Queries a SequencersByRollappByStatus + SequencersByRollappByStatus(context.Context, *QueryGetSequencersByRollappByStatusRequest) (*QueryGetSequencersByRollappByStatusResponse, error) + // Queries the current proposer by rollappId. + GetProposerByRollapp(context.Context, *QueryGetProposerByRollappRequest) (*QueryGetProposerByRollappResponse, error) + // Queries the next proposer by rollappId. + GetNextProposerByRollapp(context.Context, *QueryGetNextProposerByRollappRequest) (*QueryGetNextProposerByRollappResponse, error) +} + +// UnimplementedQueryServer can be embedded to have forward compatible implementations. +type UnimplementedQueryServer struct { +} + +func (*UnimplementedQueryServer) Params(ctx context.Context, req *QueryParamsRequest) (*QueryParamsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Params not implemented") +} +func (*UnimplementedQueryServer) Sequencer(ctx context.Context, req *QueryGetSequencerRequest) (*QueryGetSequencerResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sequencer not implemented") +} +func (*UnimplementedQueryServer) Sequencers(ctx context.Context, req *QuerySequencersRequest) (*QuerySequencersResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Sequencers not implemented") +} +func (*UnimplementedQueryServer) SequencersByRollapp(ctx context.Context, req *QueryGetSequencersByRollappRequest) (*QueryGetSequencersByRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SequencersByRollapp not implemented") +} +func (*UnimplementedQueryServer) SequencersByRollappByStatus(ctx context.Context, req *QueryGetSequencersByRollappByStatusRequest) (*QueryGetSequencersByRollappByStatusResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SequencersByRollappByStatus not implemented") +} +func (*UnimplementedQueryServer) GetProposerByRollapp(ctx context.Context, req *QueryGetProposerByRollappRequest) (*QueryGetProposerByRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetProposerByRollapp not implemented") +} +func (*UnimplementedQueryServer) GetNextProposerByRollapp(ctx context.Context, req *QueryGetNextProposerByRollappRequest) (*QueryGetNextProposerByRollappResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method GetNextProposerByRollapp not implemented") +} + +func RegisterQueryServer(s grpc1.Server, srv QueryServer) { + s.RegisterService(&_Query_serviceDesc, srv) +} + +func _Query_Params_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryParamsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Params(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/Params", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Params(ctx, req.(*QueryParamsRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Sequencer_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSequencerRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sequencer(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/Sequencer", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sequencer(ctx, req.(*QueryGetSequencerRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_Sequencers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QuerySequencersRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).Sequencers(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/Sequencers", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).Sequencers(ctx, req.(*QuerySequencersRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SequencersByRollapp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSequencersByRollappRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SequencersByRollapp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/SequencersByRollapp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SequencersByRollapp(ctx, req.(*QueryGetSequencersByRollappRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_SequencersByRollappByStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetSequencersByRollappByStatusRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).SequencersByRollappByStatus(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/SequencersByRollappByStatus", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).SequencersByRollappByStatus(ctx, req.(*QueryGetSequencersByRollappByStatusRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetProposerByRollapp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetProposerByRollappRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetProposerByRollapp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/GetProposerByRollapp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetProposerByRollapp(ctx, req.(*QueryGetProposerByRollappRequest)) + } + return interceptor(ctx, in, info, handler) +} + +func _Query_GetNextProposerByRollapp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryGetNextProposerByRollappRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).GetNextProposerByRollapp(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Query/GetNextProposerByRollapp", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).GetNextProposerByRollapp(ctx, req.(*QueryGetNextProposerByRollappRequest)) + } + return interceptor(ctx, in, info, handler) +} + +var _Query_serviceDesc = grpc.ServiceDesc{ + ServiceName: "dymensionxyz.dymension.sequencer.Query", + HandlerType: (*QueryServer)(nil), + Methods: []grpc.MethodDesc{ + { + MethodName: "Params", + Handler: _Query_Params_Handler, + }, + { + MethodName: "Sequencer", + Handler: _Query_Sequencer_Handler, + }, + { + MethodName: "Sequencers", + Handler: _Query_Sequencers_Handler, + }, + { + MethodName: "SequencersByRollapp", + Handler: _Query_SequencersByRollapp_Handler, + }, + { + MethodName: "SequencersByRollappByStatus", + Handler: _Query_SequencersByRollappByStatus_Handler, + }, + { + MethodName: "GetProposerByRollapp", + Handler: _Query_GetProposerByRollapp_Handler, + }, + { + MethodName: "GetNextProposerByRollapp", + Handler: _Query_GetNextProposerByRollapp_Handler, + }, + }, + Streams: []grpc.StreamDesc{}, + Metadata: "dymension/sequencer/query.proto", +} + +func (m *QueryParamsRequest) 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 *QueryParamsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *QueryParamsResponse) 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 *QueryParamsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryParamsResponse) 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 = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + return len(dAtA) - i, nil +} + +func (m *QueryGetSequencerRequest) 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 *QueryGetSequencerRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSequencerRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.SequencerAddress) > 0 { + i -= len(m.SequencerAddress) + copy(dAtA[i:], m.SequencerAddress) + i = encodeVarintQuery(dAtA, i, uint64(len(m.SequencerAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetSequencerResponse) 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 *QueryGetSequencerResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSequencerResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Sequencer.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 *QuerySequencersRequest) 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 *QuerySequencersRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySequencersRequest) 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 *QuerySequencersResponse) 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 *QuerySequencersResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QuerySequencersResponse) 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.Sequencers) > 0 { + for iNdEx := len(m.Sequencers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sequencers[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 (m *QueryGetSequencersByRollappRequest) 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 *QueryGetSequencersByRollappRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSequencersByRollappRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetSequencersByRollappResponse) 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 *QueryGetSequencersByRollappResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSequencersByRollappResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sequencers) > 0 { + for iNdEx := len(m.Sequencers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sequencers[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 (m *QueryGetSequencersByRollappByStatusRequest) 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 *QueryGetSequencersByRollappByStatusRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSequencersByRollappByStatusRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Status != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.Status)) + i-- + dAtA[i] = 0x10 + } + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetSequencersByRollappByStatusResponse) 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 *QueryGetSequencersByRollappByStatusResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetSequencersByRollappByStatusResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Sequencers) > 0 { + for iNdEx := len(m.Sequencers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sequencers[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 (m *QueryGetProposerByRollappRequest) 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 *QueryGetProposerByRollappRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetProposerByRollappRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetProposerByRollappResponse) 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 *QueryGetProposerByRollappResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetProposerByRollappResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.ProposerAddr) > 0 { + i -= len(m.ProposerAddr) + copy(dAtA[i:], m.ProposerAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.ProposerAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetNextProposerByRollappRequest) 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 *QueryGetNextProposerByRollappRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetNextProposerByRollappRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.RollappId) > 0 { + i -= len(m.RollappId) + copy(dAtA[i:], m.RollappId) + i = encodeVarintQuery(dAtA, i, uint64(len(m.RollappId))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *QueryGetNextProposerByRollappResponse) 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 *QueryGetNextProposerByRollappResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryGetNextProposerByRollappResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.RotationInProgress { + i-- + if m.RotationInProgress { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x10 + } + if len(m.NextProposerAddr) > 0 { + i -= len(m.NextProposerAddr) + copy(dAtA[i:], m.NextProposerAddr) + i = encodeVarintQuery(dAtA, i, uint64(len(m.NextProposerAddr))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { + offset -= sovQuery(v) + base := offset + for v >= 1<<7 { + dAtA[offset] = uint8(v&0x7f | 0x80) + v >>= 7 + offset++ + } + dAtA[offset] = uint8(v) + return base +} +func (m *QueryParamsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *QueryParamsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Params.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QueryGetSequencerRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SequencerAddress) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetSequencerResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = m.Sequencer.Size() + n += 1 + l + sovQuery(uint64(l)) + return n +} + +func (m *QuerySequencersRequest) 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 *QuerySequencersResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Sequencers) > 0 { + for _, e := range m.Sequencers { + 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 (m *QueryGetSequencersByRollappRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetSequencersByRollappResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Sequencers) > 0 { + for _, e := range m.Sequencers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryGetSequencersByRollappByStatusRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.Status != 0 { + n += 1 + sovQuery(uint64(m.Status)) + } + return n +} + +func (m *QueryGetSequencersByRollappByStatusResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Sequencers) > 0 { + for _, e := range m.Sequencers { + l = e.Size() + n += 1 + l + sovQuery(uint64(l)) + } + } + return n +} + +func (m *QueryGetProposerByRollappRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetProposerByRollappResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.ProposerAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetNextProposerByRollappRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.RollappId) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + +func (m *QueryGetNextProposerByRollappResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.NextProposerAddr) + if l > 0 { + n += 1 + l + sovQuery(uint64(l)) + } + if m.RotationInProgress { + n += 2 + } + return n +} + +func sovQuery(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozQuery(x uint64) (n int) { + return sovQuery(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *QueryParamsRequest) 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: QueryParamsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + 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 *QueryParamsResponse) 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: QueryParamsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryParamsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Params", 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 err := m.Params.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 *QueryGetSequencerRequest) 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: QueryGetSequencerRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSequencerRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.SequencerAddress = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetSequencerResponse) 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: QueryGetSequencerResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSequencerResponse: 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 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 err := m.Sequencer.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 *QuerySequencersRequest) 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: QuerySequencersRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySequencersRequest: 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 *QuerySequencersResponse) 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: QuerySequencersResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QuerySequencersResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencers", 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.Sequencers = append(m.Sequencers, Sequencer{}) + if err := m.Sequencers[len(m.Sequencers)-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 (m *QueryGetSequencersByRollappRequest) 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: QueryGetSequencersByRollappRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSequencersByRollappRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetSequencersByRollappResponse) 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: QueryGetSequencersByRollappResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSequencersByRollappResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencers", 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.Sequencers = append(m.Sequencers, Sequencer{}) + if err := m.Sequencers[len(m.Sequencers)-1].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 *QueryGetSequencersByRollappByStatusRequest) 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: QueryGetSequencersByRollappByStatusRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSequencersByRollappByStatusRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + 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 ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.Status |= OperatingStatus(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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 *QueryGetSequencersByRollappByStatusResponse) 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: QueryGetSequencersByRollappByStatusResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetSequencersByRollappByStatusResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencers", 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.Sequencers = append(m.Sequencers, Sequencer{}) + if err := m.Sequencers[len(m.Sequencers)-1].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 *QueryGetProposerByRollappRequest) 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: QueryGetProposerByRollappRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetProposerByRollappRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetProposerByRollappResponse) 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: QueryGetProposerByRollappResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetProposerByRollappResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposerAddr", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposerAddr = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetNextProposerByRollappRequest) 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: QueryGetNextProposerByRollappRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetNextProposerByRollappRequest: 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.RollappId = string(dAtA[iNdEx:postIndex]) + 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 *QueryGetNextProposerByRollappResponse) 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: QueryGetNextProposerByRollappResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryGetNextProposerByRollappResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + 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 ErrIntOverflowQuery + } + 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 ErrInvalidLengthQuery + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextProposerAddr = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field RotationInProgress", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.RotationInProgress = bool(v != 0) + 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 + depth := 0 + for iNdEx < l { + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return 0, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrIntOverflowQuery + } + 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, ErrInvalidLengthQuery + } + iNdEx += length + case 3: + depth++ + case 4: + if depth == 0 { + return 0, ErrUnexpectedEndOfGroupQuery + } + depth-- + case 5: + iNdEx += 4 + default: + return 0, fmt.Errorf("proto: illegal wireType %d", wireType) + } + if iNdEx < 0 { + return 0, ErrInvalidLengthQuery + } + if depth == 0 { + return iNdEx, nil + } + } + return 0, io.ErrUnexpectedEOF +} + +var ( + ErrInvalidLengthQuery = fmt.Errorf("proto: negative length found during unmarshaling") + ErrIntOverflowQuery = fmt.Errorf("proto: integer overflow") + ErrUnexpectedEndOfGroupQuery = 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 new file mode 100644 index 000000000..9429bb4c2 --- /dev/null +++ b/third_party/dymension/sequencer/types/query.pb.gw.go @@ -0,0 +1,769 @@ +// 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/sequencer.pb.go b/third_party/dymension/sequencer/types/sequencer.pb.go new file mode 100644 index 000000000..f4a55aedc --- /dev/null +++ b/third_party/dymension/sequencer/types/sequencer.pb.go @@ -0,0 +1,1087 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/sequencer.proto + +package types + +import ( + fmt "fmt" + _ "github.com/cosmos/cosmos-proto" + types "github.com/cosmos/cosmos-sdk/codec/types" + 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 "github.com/gogo/protobuf/types" + 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"` + // 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, if unbonding, the min time for the sequencer to + // 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"` +} + +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_17d99b644bf09274, []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 +} + +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{} +} + +// 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_17d99b644bf09274, []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("dymension/sequencer/sequencer.proto", fileDescriptor_17d99b644bf09274) +} + +var fileDescriptor_17d99b644bf09274 = []byte{ + // 635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x53, 0xc1, 0x6e, 0xd3, 0x4a, + 0x14, 0x8d, 0x5f, 0xda, 0x34, 0x99, 0x3c, 0x50, 0x19, 0x02, 0xb8, 0x15, 0x72, 0xac, 0xb2, 0xb1, + 0x40, 0x1d, 0x93, 0x54, 0x62, 0xdf, 0x20, 0x24, 0x0a, 0x42, 0x14, 0x17, 0x36, 0x6c, 0xac, 0xb1, + 0x3d, 0xb8, 0xa6, 0xf1, 0x8c, 0xf1, 0x8c, 0xab, 0x9a, 0x5f, 0x60, 0xd3, 0xef, 0x60, 0xcd, 0x47, + 0x54, 0xac, 0xba, 0x64, 0x45, 0x51, 0xf3, 0x23, 0xc8, 0x33, 0x63, 0x37, 0x81, 0x8a, 0xaa, 0x2b, + 0xfb, 0xfa, 0x9e, 0x73, 0xe6, 0x9e, 0x3b, 0xc7, 0xe0, 0x41, 0x54, 0xa6, 0x84, 0xf2, 0x84, 0x51, + 0x97, 0x93, 0x4f, 0x05, 0xa1, 0x21, 0xc9, 0x2f, 0xde, 0x50, 0x96, 0x33, 0xc1, 0xa0, 0xdd, 0x80, + 0x8e, 0xca, 0xcf, 0xa8, 0x29, 0x50, 0x83, 0x5b, 0x5f, 0x0b, 0x19, 0x4f, 0x19, 0xf7, 0x25, 0xde, + 0x55, 0x85, 0x22, 0xaf, 0xaf, 0xc5, 0x8c, 0xc5, 0x53, 0xe2, 0xca, 0x2a, 0x28, 0x3e, 0xb8, 0x98, + 0x96, 0xba, 0x35, 0x88, 0x59, 0xcc, 0x14, 0xa5, 0x7a, 0xd3, 0x5f, 0x87, 0x7f, 0x12, 0x44, 0x92, + 0x12, 0x2e, 0x70, 0x9a, 0x69, 0x80, 0xa5, 0xf4, 0xdd, 0x00, 0x73, 0xe2, 0x1e, 0x8e, 0x02, 0x22, + 0xf0, 0xc8, 0x0d, 0x59, 0x42, 0x75, 0xff, 0x9e, 0xee, 0xa7, 0x3c, 0x76, 0x0f, 0x47, 0xd5, 0x43, + 0x37, 0x36, 0x2e, 0x33, 0x9b, 0x12, 0x81, 0x23, 0x2c, 0xb0, 0xc6, 0x3c, 0xbc, 0x0c, 0xc3, 0x32, + 0x92, 0x63, 0x91, 0xd0, 0xd8, 0xe7, 0x02, 0x8b, 0x42, 0x5b, 0xdb, 0xf8, 0xb2, 0x0c, 0x7a, 0x7b, + 0x35, 0x08, 0x9a, 0x60, 0x05, 0x47, 0x51, 0x4e, 0x38, 0x37, 0x0d, 0xdb, 0x70, 0x7a, 0x5e, 0x5d, + 0x42, 0x0f, 0xfc, 0x1f, 0x95, 0x69, 0x42, 0xc5, 0x6e, 0x11, 0xbc, 0x24, 0xa5, 0xf9, 0x9f, 0x6d, + 0x38, 0xfd, 0xf1, 0x00, 0x29, 0xa3, 0xa8, 0x36, 0x8a, 0xb6, 0x69, 0x39, 0x31, 0xbf, 0x7f, 0xdb, + 0x1c, 0xe8, 0x05, 0x86, 0x79, 0x99, 0x09, 0x86, 0x14, 0xcb, 0x5b, 0xd0, 0x80, 0xf7, 0x41, 0x2f, + 0x67, 0xd3, 0x29, 0xce, 0xb2, 0x9d, 0xc8, 0x6c, 0xcb, 0xf3, 0x2e, 0x3e, 0xc0, 0x77, 0xa0, 0x5b, + 0xfb, 0x32, 0x97, 0xe4, 0x69, 0x5b, 0xe8, 0xaa, 0x4b, 0x44, 0x8d, 0x95, 0x57, 0x9a, 0x3a, 0x59, + 0x3a, 0xf9, 0x39, 0x6c, 0x79, 0x8d, 0x14, 0xbc, 0x0b, 0x3a, 0x1f, 0x71, 0x32, 0x25, 0x91, 0xb9, + 0x6c, 0x1b, 0x4e, 0xd7, 0xd3, 0x15, 0xdc, 0x01, 0x1d, 0xb5, 0x18, 0x73, 0xc5, 0x36, 0x9c, 0x9b, + 0xe3, 0xd1, 0xd5, 0x87, 0xbd, 0xae, 0x57, 0xba, 0x27, 0x89, 0x9e, 0x16, 0x80, 0x21, 0xe8, 0x08, + 0x76, 0x40, 0x28, 0x37, 0xbb, 0x76, 0xdb, 0xe9, 0x8f, 0xd7, 0x90, 0x5e, 0x46, 0x75, 0xdb, 0x48, + 0xdf, 0x36, 0x7a, 0xca, 0x12, 0x3a, 0x79, 0x5c, 0x4d, 0xf7, 0xf5, 0x6c, 0xe8, 0xc4, 0x89, 0xd8, + 0x2f, 0x02, 0x14, 0xb2, 0x54, 0x47, 0x4f, 0x3f, 0x36, 0x79, 0x74, 0xe0, 0x8a, 0x32, 0x23, 0x5c, + 0x12, 0xb8, 0xa7, 0xa5, 0xe1, 0x18, 0xdc, 0x29, 0x68, 0xc0, 0x68, 0xe4, 0xe7, 0xd5, 0x40, 0x5c, + 0xf8, 0xfb, 0x24, 0x89, 0xf7, 0x85, 0xd9, 0xb3, 0x0d, 0xa7, 0xed, 0xdd, 0x56, 0x4d, 0x4f, 0xf5, + 0x9e, 0xcb, 0x16, 0x7c, 0x06, 0xfa, 0x9a, 0x53, 0xe5, 0xd1, 0x04, 0x72, 0xab, 0xeb, 0x7f, 0xdd, + 0xe1, 0xdb, 0x3a, 0xac, 0x93, 0x6e, 0x35, 0xde, 0xf1, 0xd9, 0xd0, 0xf0, 0x80, 0x22, 0x56, 0x2d, + 0xe8, 0x01, 0x48, 0x99, 0x48, 0x42, 0xe2, 0x67, 0x24, 0x4f, 0x98, 0x56, 0xeb, 0x5f, 0x43, 0x6d, + 0x55, 0xf1, 0x77, 0x25, 0xbd, 0x02, 0xbc, 0x58, 0xea, 0x76, 0x56, 0x57, 0x36, 0x66, 0x06, 0xb8, + 0x31, 0x91, 0x63, 0x47, 0x45, 0x28, 0x12, 0x46, 0xe1, 0x23, 0x70, 0xab, 0x59, 0xb8, 0xbf, 0x98, + 0xcd, 0xd5, 0xa6, 0xb1, 0xad, 0x43, 0xfa, 0x06, 0x0c, 0x22, 0x12, 0xe6, 0x04, 0x73, 0xe2, 0x4b, + 0x9b, 0x38, 0x65, 0x05, 0x15, 0x3a, 0xac, 0xff, 0xb8, 0x06, 0x15, 0x12, 0x58, 0x93, 0xab, 0x11, + 0xb6, 0x25, 0xb5, 0xf2, 0xba, 0x28, 0x29, 0xbd, 0xb6, 0xaf, 0xe3, 0x75, 0x5e, 0xb5, 0x02, 0x4c, + 0x76, 0x4f, 0xce, 0x2d, 0xe3, 0xf4, 0xdc, 0x32, 0x7e, 0x9d, 0x5b, 0xc6, 0xf1, 0xcc, 0x6a, 0x9d, + 0xce, 0xac, 0xd6, 0x8f, 0x99, 0xd5, 0x7a, 0xff, 0x64, 0x2e, 0x06, 0xf3, 0xf1, 0xbb, 0x28, 0xdc, + 0xc3, 0x2d, 0xf7, 0x68, 0xee, 0xb7, 0x96, 0xd1, 0x08, 0x3a, 0x72, 0x82, 0xad, 0xdf, 0x01, 0x00, + 0x00, 0xff, 0xff, 0xdd, 0x3f, 0x85, 0xd1, 0x0b, 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 + 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.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.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)) + 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 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 + 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/third_party/dymension/sequencer/types/tx.pb.go new file mode 100644 index 000000000..599478313 --- /dev/null +++ b/third_party/dymension/sequencer/types/tx.pb.go @@ -0,0 +1,2569 @@ +// Code generated by protoc-gen-gogo. DO NOT EDIT. +// source: dymension/sequencer/tx.proto + +package types + +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" + 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 + +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"` + // 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"` + // rollapp_id defines the rollapp to which the sequencer belongs. + RollappId string `protobuf:"bytes,3,opt,name=rollapp_id,json=rollappId,proto3" json:"rollapp_id,omitempty"` + // metadata defines the extra information for the sequencer. + 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"` +} + +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} +} +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) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgCreateSequencer) GetDymintPubKey() *types.Any { + if m != nil { + return m.DymintPubKey + } + return nil +} + +func (m *MsgCreateSequencer) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *MsgCreateSequencer) GetMetadata() SequencerMetadata { + if m != nil { + return m.Metadata + } + return SequencerMetadata{} +} + +func (m *MsgCreateSequencer) GetBond() types1.Coin { + if m != nil { + return m.Bond + } + return types1.Coin{} +} + +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_26d679aa996065f1, []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 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"` +} + +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} +} +func (m *MsgUpdateSequencerInformation) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencerInformation) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencerInformation.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 *MsgUpdateSequencerInformation) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencerInformation.Merge(m, src) +} +func (m *MsgUpdateSequencerInformation) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencerInformation) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencerInformation.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencerInformation proto.InternalMessageInfo + +func (m *MsgUpdateSequencerInformation) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgUpdateSequencerInformation) GetRollappId() string { + if m != nil { + return m.RollappId + } + return "" +} + +func (m *MsgUpdateSequencerInformation) GetMetadata() SequencerMetadata { + if m != nil { + return m.Metadata + } + return SequencerMetadata{} +} + +type MsgUpdateSequencerInformationResponse struct { +} + +func (m *MsgUpdateSequencerInformationResponse) Reset() { *m = MsgUpdateSequencerInformationResponse{} } +func (m *MsgUpdateSequencerInformationResponse) String() string { return proto.CompactTextString(m) } +func (*MsgUpdateSequencerInformationResponse) ProtoMessage() {} +func (*MsgUpdateSequencerInformationResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_26d679aa996065f1, []int{3} +} +func (m *MsgUpdateSequencerInformationResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUpdateSequencerInformationResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUpdateSequencerInformationResponse.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 *MsgUpdateSequencerInformationResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUpdateSequencerInformationResponse.Merge(m, src) +} +func (m *MsgUpdateSequencerInformationResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUpdateSequencerInformationResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUpdateSequencerInformationResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUpdateSequencerInformationResponse proto.InternalMessageInfo + +// MsgUnbond defines a SDK message for performing an undelegation from a +// bond and a sequencer. +type MsgUnbond struct { + Creator string `protobuf:"bytes,1,opt,name=creator,proto3" json:"creator,omitempty"` +} + +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} +} +func (m *MsgUnbond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnbond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnbond.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 *MsgUnbond) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnbond.Merge(m, src) +} +func (m *MsgUnbond) XXX_Size() int { + return m.Size() +} +func (m *MsgUnbond) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnbond.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnbond proto.InternalMessageInfo + +func (m *MsgUnbond) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +// MsgUnbondResponse defines the Msg/Unbond response type. +type MsgUnbondResponse struct { + // 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. + // + // Types that are valid to be assigned to CompletionTime: + // *MsgUnbondResponse_UnbondingCompletionTime + // *MsgUnbondResponse_NoticePeriodCompletionTime + CompletionTime isMsgUnbondResponse_CompletionTime `protobuf_oneof:"completion_time"` +} + +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} +} +func (m *MsgUnbondResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgUnbondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgUnbondResponse.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 *MsgUnbondResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgUnbondResponse.Merge(m, src) +} +func (m *MsgUnbondResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgUnbondResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgUnbondResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgUnbondResponse proto.InternalMessageInfo + +type isMsgUnbondResponse_CompletionTime interface { + isMsgUnbondResponse_CompletionTime() + MarshalTo([]byte) (int, error) + Size() int +} + +type MsgUnbondResponse_UnbondingCompletionTime struct { + UnbondingCompletionTime *time.Time `protobuf:"bytes,1,opt,name=unbonding_completion_time,json=unbondingCompletionTime,proto3,oneof,stdtime" json:"unbonding_completion_time,omitempty"` +} +type MsgUnbondResponse_NoticePeriodCompletionTime struct { + NoticePeriodCompletionTime *time.Time `protobuf:"bytes,2,opt,name=notice_period_completion_time,json=noticePeriodCompletionTime,proto3,oneof,stdtime" json:"notice_period_completion_time,omitempty"` +} + +func (*MsgUnbondResponse_UnbondingCompletionTime) isMsgUnbondResponse_CompletionTime() {} +func (*MsgUnbondResponse_NoticePeriodCompletionTime) isMsgUnbondResponse_CompletionTime() {} + +func (m *MsgUnbondResponse) GetCompletionTime() isMsgUnbondResponse_CompletionTime { + if m != nil { + return m.CompletionTime + } + return nil +} + +func (m *MsgUnbondResponse) GetUnbondingCompletionTime() *time.Time { + if x, ok := m.GetCompletionTime().(*MsgUnbondResponse_UnbondingCompletionTime); ok { + return x.UnbondingCompletionTime + } + return nil +} + +func (m *MsgUnbondResponse) GetNoticePeriodCompletionTime() *time.Time { + if x, ok := m.GetCompletionTime().(*MsgUnbondResponse_NoticePeriodCompletionTime); ok { + return x.NoticePeriodCompletionTime + } + return nil +} + +// XXX_OneofWrappers is for the internal use of the proto package. +func (*MsgUnbondResponse) XXX_OneofWrappers() []interface{} { + return []interface{}{ + (*MsgUnbondResponse_UnbondingCompletionTime)(nil), + (*MsgUnbondResponse_NoticePeriodCompletionTime)(nil), + } +} + +// MsgIncreaseBond defines a SDK message for increasing the bond amount of a sequencer. +type MsgIncreaseBond 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"` + // add_amount is the amount of coins to be added to the sequencer's bond. + AddAmount types1.Coin `protobuf:"bytes,2,opt,name=add_amount,json=addAmount,proto3" json:"add_amount"` +} + +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} +} +func (m *MsgIncreaseBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgIncreaseBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgIncreaseBond.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 *MsgIncreaseBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgIncreaseBond.Merge(m, src) +} +func (m *MsgIncreaseBond) XXX_Size() int { + return m.Size() +} +func (m *MsgIncreaseBond) XXX_DiscardUnknown() { + xxx_messageInfo_MsgIncreaseBond.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgIncreaseBond proto.InternalMessageInfo + +func (m *MsgIncreaseBond) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgIncreaseBond) GetAddAmount() types1.Coin { + if m != nil { + return m.AddAmount + } + return types1.Coin{} +} + +// MsgIncreaseBondResponse defines the Msg/IncreaseBond response type. +type MsgIncreaseBondResponse struct { +} + +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} +} +func (m *MsgIncreaseBondResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgIncreaseBondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgIncreaseBondResponse.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 *MsgIncreaseBondResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgIncreaseBondResponse.Merge(m, src) +} +func (m *MsgIncreaseBondResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgIncreaseBondResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgIncreaseBondResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgIncreaseBondResponse proto.InternalMessageInfo + +// MsgDecreaseBond defines a SDK message for decreasing the bond of a sequencer. +type MsgDecreaseBond 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"` + // decrease_amount is the amount of coins to decrease the bond by. + DecreaseAmount types1.Coin `protobuf:"bytes,2,opt,name=decrease_amount,json=decreaseAmount,proto3" json:"decrease_amount"` +} + +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} +} +func (m *MsgDecreaseBond) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDecreaseBond) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDecreaseBond.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 *MsgDecreaseBond) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDecreaseBond.Merge(m, src) +} +func (m *MsgDecreaseBond) XXX_Size() int { + return m.Size() +} +func (m *MsgDecreaseBond) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDecreaseBond.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDecreaseBond proto.InternalMessageInfo + +func (m *MsgDecreaseBond) GetCreator() string { + if m != nil { + return m.Creator + } + return "" +} + +func (m *MsgDecreaseBond) GetDecreaseAmount() types1.Coin { + if m != nil { + return m.DecreaseAmount + } + return types1.Coin{} +} + +// MsgDecreaseBondResponse defines the Msg/DecreaseBond response type. +type MsgDecreaseBondResponse struct { + CompletionTime time.Time `protobuf:"bytes,1,opt,name=completion_time,json=completionTime,proto3,stdtime" json:"completion_time"` +} + +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} +} +func (m *MsgDecreaseBondResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgDecreaseBondResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgDecreaseBondResponse.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 *MsgDecreaseBondResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgDecreaseBondResponse.Merge(m, src) +} +func (m *MsgDecreaseBondResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgDecreaseBondResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgDecreaseBondResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgDecreaseBondResponse proto.InternalMessageInfo + +func (m *MsgDecreaseBondResponse) GetCompletionTime() time.Time { + if m != nil { + return m.CompletionTime + } + return time.Time{} +} + +func init() { + 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((*MsgUnbond)(nil), "dymensionxyz.dymension.sequencer.MsgUnbond") + proto.RegisterType((*MsgUnbondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgUnbondResponse") + proto.RegisterType((*MsgIncreaseBond)(nil), "dymensionxyz.dymension.sequencer.MsgIncreaseBond") + proto.RegisterType((*MsgIncreaseBondResponse)(nil), "dymensionxyz.dymension.sequencer.MsgIncreaseBondResponse") + proto.RegisterType((*MsgDecreaseBond)(nil), "dymensionxyz.dymension.sequencer.MsgDecreaseBond") + 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, 0xba, 0x6d, 0x3d, 0x25, 0x33, 0xf3, 0xbe, + 0xcf, 0xf3, 0xbc, 0xcf, 0xbc, 0xef, 0xb0, 0x60, 0x0e, 0xfa, 0x0e, 0xc2, 0xd4, 0x26, 0x58, 0xa7, + 0xe8, 0x69, 0x07, 0x61, 0x13, 0x79, 0x3a, 0xdb, 0xd5, 0x5c, 0x8f, 0x30, 0x22, 0x2f, 0x88, 0xd3, + 0x5d, 0xff, 0x99, 0x26, 0x16, 0x9a, 0x08, 0x55, 0xf3, 0x16, 0x21, 0x56, 0x1b, 0xe9, 0x61, 0x7c, + 0xab, 0xb3, 0xa5, 0x1b, 0xd8, 0x8f, 0x92, 0xd5, 0xbc, 0x49, 0xa8, 0x43, 0x68, 0x33, 0x5c, 0xe9, + 0xd1, 0x82, 0x1f, 0xcd, 0x58, 0xc4, 0x22, 0xd1, 0x7e, 0xf0, 0x8f, 0xef, 0x16, 0xa2, 0x18, 0xbd, + 0x65, 0x50, 0xa4, 0xef, 0x94, 0x5b, 0x88, 0x19, 0x65, 0xdd, 0x24, 0x36, 0xe6, 0xe7, 0xc5, 0x7e, + 0x2e, 0x66, 0x3b, 0x88, 0x32, 0xc3, 0x71, 0x79, 0xc0, 0x2c, 0x07, 0x70, 0xa8, 0xa5, 0xef, 0x94, + 0x83, 0x1f, 0x7e, 0x50, 0x3a, 0xa9, 0x4a, 0x07, 0x31, 0x03, 0x1a, 0xcc, 0x88, 0x62, 0x4a, 0x1f, + 0xd3, 0x40, 0xae, 0x53, 0x6b, 0xc5, 0x43, 0x06, 0x43, 0x1b, 0x71, 0x94, 0xac, 0x80, 0xff, 0xcc, + 0x60, 0x8b, 0x78, 0x8a, 0xb4, 0x20, 0x2d, 0x66, 0x1b, 0xf1, 0x52, 0x6e, 0x80, 0x49, 0xe8, 0x3b, + 0x36, 0x66, 0xeb, 0x9d, 0xd6, 0x7d, 0xe4, 0x2b, 0xe9, 0x05, 0x69, 0x71, 0xa2, 0x32, 0xa3, 0x45, + 0x2a, 0xb5, 0x58, 0xa5, 0xb6, 0x8c, 0xfd, 0x9a, 0xf2, 0xf9, 0xc3, 0xb5, 0x19, 0x6e, 0x81, 0xe9, + 0xf9, 0x2e, 0x23, 0x5a, 0x94, 0xd5, 0xe8, 0xc1, 0x90, 0xe7, 0x01, 0xf0, 0x48, 0xbb, 0x6d, 0xb8, + 0x6e, 0xd3, 0x86, 0xca, 0x48, 0x48, 0x98, 0xe5, 0x3b, 0x6b, 0x50, 0xde, 0x04, 0xe3, 0xb1, 0x6a, + 0x25, 0x13, 0xd2, 0x55, 0xb5, 0xd3, 0xae, 0x48, 0x13, 0xb5, 0xd4, 0x79, 0x6a, 0x2d, 0xb3, 0xff, + 0xad, 0x98, 0x6a, 0x08, 0x28, 0xb9, 0x0a, 0x32, 0x2d, 0x82, 0xa1, 0x32, 0x1a, 0x42, 0xe6, 0x35, + 0x2e, 0x34, 0xb8, 0x07, 0x8d, 0xdf, 0x83, 0xb6, 0x42, 0x6c, 0xcc, 0x13, 0xc3, 0xe0, 0xa5, 0xc9, + 0x17, 0x3f, 0xdf, 0x5f, 0x89, 0xcd, 0x28, 0xcd, 0x01, 0x75, 0xd0, 0xbc, 0x06, 0xa2, 0x2e, 0xc1, + 0x14, 0x95, 0x3e, 0x49, 0x60, 0xbe, 0x4e, 0xad, 0x4d, 0x17, 0x76, 0x1f, 0xaf, 0xe1, 0x2d, 0xe2, + 0x39, 0x06, 0xb3, 0x09, 0x1e, 0x62, 0x73, 0xaf, 0x25, 0xe9, 0x61, 0x96, 0x8c, 0xfc, 0x33, 0x4b, + 0xfa, 0xaa, 0xbb, 0x0c, 0x2e, 0x0d, 0x95, 0x2f, 0x0a, 0x7d, 0x00, 0xb2, 0x41, 0x20, 0x0e, 0x1c, + 0x92, 0x2b, 0x7d, 0x35, 0xd5, 0x94, 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...) + if err != nil { + return nil, err + } + return out, 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 (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 + } + 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 + } + return out, 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...) + if err != nil { + return nil, err + } + return out, 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) +} + +// UnimplementedMsgServer can be embedded to have forward compatible implementations. +type UnimplementedMsgServer struct { +} + +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 RegisterMsgServer(s grpc1.Server, srv MsgServer) { + s.RegisterService(&_Msg_serviceDesc, srv) +} + +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) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/dymensionxyz.dymension.sequencer.Msg/CreateSequencer", + } + 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 { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x2a + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x22 + 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] = 0x1a + } + if m.DymintPubKey != nil { + { + size, err := m.DymintPubKey.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *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 *MsgUpdateSequencerInformation) 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 *MsgUpdateSequencerInformation) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencerInformation) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.Metadata.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + 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 + } + 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 *MsgUpdateSequencerInformationResponse) 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 *MsgUpdateSequencerInformationResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUpdateSequencerInformationResponse) 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) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgUnbond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnbond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + 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 *MsgUnbondResponse) 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 *MsgUnbondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgUnbondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.CompletionTime != nil { + { + size := m.CompletionTime.Size() + i -= size + if _, err := m.CompletionTime.MarshalTo(dAtA[i:]); err != nil { + return 0, err + } + } + } + return len(dAtA) - i, nil +} + +func (m *MsgUnbondResponse_UnbondingCompletionTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 + } + i -= n5 + i = encodeVarintTx(dAtA, i, uint64(n5)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} +func (m *MsgUnbondResponse_NoticePeriodCompletionTime) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +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 + } + i -= n6 + i = encodeVarintTx(dAtA, i, uint64(n6)) + i-- + dAtA[i] = 0x12 + } + return len(dAtA) - i, nil +} +func (m *MsgIncreaseBond) 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 *MsgIncreaseBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.AddAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *MsgIncreaseBondResponse) 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 *MsgIncreaseBondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgIncreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + return len(dAtA) - i, nil +} + +func (m *MsgDecreaseBond) 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 *MsgDecreaseBond) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDecreaseBond) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + { + size, err := m.DecreaseAmount.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + 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 *MsgDecreaseBondResponse) 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 *MsgDecreaseBondResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgDecreaseBondResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = 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 + } + i -= n9 + i = encodeVarintTx(dAtA, i, uint64(n9)) + i-- + dAtA[i] = 0xa + 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.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.DymintPubKey != nil { + l = m.DymintPubKey.Size() + 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)) + l = m.Bond.Size() + 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 *MsgUpdateSequencerInformation) 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.RollappId) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = m.Metadata.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgUpdateSequencerInformationResponse) 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 + } + var l int + _ = l + l = len(m.Creator) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgUnbondResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.CompletionTime != nil { + n += m.CompletionTime.Size() + } + return n +} + +func (m *MsgUnbondResponse_UnbondingCompletionTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.UnbondingCompletionTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.UnbondingCompletionTime) + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgUnbondResponse_NoticePeriodCompletionTime) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.NoticePeriodCompletionTime != nil { + l = github_com_gogo_protobuf_types.SizeOfStdTime(*m.NoticePeriodCompletionTime) + n += 1 + l + sovTx(uint64(l)) + } + return n +} +func (m *MsgIncreaseBond) 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 = m.AddAmount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgIncreaseBondResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + return n +} + +func (m *MsgDecreaseBond) 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 = m.DecreaseAmount.Size() + n += 1 + l + sovTx(uint64(l)) + return n +} + +func (m *MsgDecreaseBondResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = github_com_gogo_protobuf_types.SizeOfStdTime(m.CompletionTime) + n += 1 + l + sovTx(uint64(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 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 + } + 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 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 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 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 err := m.Metadata.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 5: + 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 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 err := m.Bond.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 *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 *MsgUpdateSequencerInformation) 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: MsgUpdateSequencerInformation: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencerInformation: 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 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) + } + 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 err := m.Metadata.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 *MsgUpdateSequencerInformationResponse) 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: MsgUpdateSequencerInformationResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUpdateSequencerInformationResponse: 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 + 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: MsgUnbond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnbond: 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 + 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 *MsgUnbondResponse) 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: MsgUnbondResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgUnbondResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field UnbondingCompletionTime", 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 + } + v := new(time.Time) + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(v, dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.CompletionTime = &MsgUnbondResponse_UnbondingCompletionTime{v} + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NoticePeriodCompletionTime", 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 + } + v := new(time.Time) + if err := github_com_gogo_protobuf_types.StdTimeUnmarshal(v, dAtA[iNdEx:postIndex]); err != nil { + return err + } + m.CompletionTime = &MsgUnbondResponse_NoticePeriodCompletionTime{v} + 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 *MsgIncreaseBond) 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: MsgIncreaseBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgIncreaseBond: 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 AddAmount", 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 err := m.AddAmount.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 *MsgIncreaseBondResponse) 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: MsgIncreaseBondResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgIncreaseBondResponse: 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 *MsgDecreaseBond) 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: MsgDecreaseBond: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDecreaseBond: 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 DecreaseAmount", 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 err := m.DecreaseAmount.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 *MsgDecreaseBondResponse) 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: MsgDecreaseBondResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgDecreaseBondResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field CompletionTime", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.CompletionTime, 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 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/types/batch.go b/types/batch.go index 90ac90af1..2476df5a3 100644 --- a/types/batch.go +++ b/types/batch.go @@ -9,6 +9,8 @@ const ( type Batch struct { Blocks []*Block Commits []*Commit + // LastBatch is true if this is the last batch of the sequencer (i.e completes it's rotation flow). + LastBatch bool } // StartHeight is the height of the first block in the batch. diff --git a/types/block.go b/types/block.go index 542fd27fc..4e44a1490 100644 --- a/types/block.go +++ b/types/block.go @@ -10,10 +10,6 @@ import ( type Header struct { // Block and App version Version Version - // NamespaceID identifies this chain e.g. when connected to other rollups via IBC. - // TODO(ismail): figure out if we want to use namespace.ID here instead (downside is that it isn't fixed size) - // at least extract the used constants (32, 8) as package variables though. - NamespaceID [8]byte Height uint64 Time uint64 // time in tai64 format @@ -38,8 +34,10 @@ type Header struct { // pubkey can't be recovered by the signature (e.g. ed25519). ProposerAddress []byte // original proposer of the block - // Hash of block sequencer set, at a time of block creation - SequencersHash [32]byte + // Hash of proposer validatorSet (compatible with tendermint) + SequencerHash [32]byte + // Hash of the next proposer validatorSet (compatible with tendermint) + NextSequencersHash [32]byte // The Chain ID ChainID string @@ -108,3 +106,16 @@ type Signature []byte type IntermediateStateRoots struct { RawRootsList [][]byte } + +func GetLastCommitHash(lastCommit *Commit, header *Header) []byte { + lastABCICommit := ToABCICommit(lastCommit, header) + return lastABCICommit.Hash() +} + +// GetDataHash returns the hash of the block data to be set in the block header. +func GetDataHash(block *Block) []byte { + abciData := tmtypes.Data{ + Txs: ToABCIBlockDataTxs(&block.Data), + } + return abciData.Hash() +} diff --git a/types/conv.go b/types/conv.go index 0efd04b98..bddb98547 100644 --- a/types/conv.go +++ b/types/conv.go @@ -11,31 +11,8 @@ import ( // ToABCIHeaderPB converts Dymint header to Header format defined in ABCI. // Caller should fill all the fields that are not available in Dymint header (like ChainID). func ToABCIHeaderPB(header *Header) types.Header { - return types.Header{ - Version: version.Consensus{ - Block: header.Version.Block, - App: header.Version.App, - }, - Height: int64(header.Height), - Time: time.Unix(0, int64(header.Time)), - LastBlockId: types.BlockID{ - Hash: header.LastHeaderHash[:], - PartSetHeader: types.PartSetHeader{ - Total: 1, - Hash: header.LastHeaderHash[:], - }, - }, - LastCommitHash: header.LastCommitHash[:], - DataHash: header.DataHash[:], - ValidatorsHash: header.SequencersHash[:], - NextValidatorsHash: header.SequencersHash[:], - ConsensusHash: header.ConsensusHash[:], - AppHash: header.AppHash[:], - LastResultsHash: header.LastResultsHash[:], - EvidenceHash: new(tmtypes.EvidenceData).Hash(), - ProposerAddress: header.ProposerAddress, - ChainID: header.ChainID, - } + tmheader := ToABCIHeader(header) + return *tmheader.ToProto() } // ToABCIHeader converts Dymint header to Header format defined in ABCI. @@ -57,8 +34,8 @@ func ToABCIHeader(header *Header) tmtypes.Header { }, LastCommitHash: header.LastCommitHash[:], DataHash: header.DataHash[:], - ValidatorsHash: header.SequencersHash[:], - NextValidatorsHash: header.SequencersHash[:], + ValidatorsHash: header.SequencerHash[:], + NextValidatorsHash: header.NextSequencersHash[:], ConsensusHash: header.ConsensusHash[:], AppHash: header.AppHash[:], LastResultsHash: header.LastResultsHash[:], diff --git a/types/errors.go b/types/errors.go index ae7925b71..cfabbe0b1 100644 --- a/types/errors.go +++ b/types/errors.go @@ -1,6 +1,11 @@ package types -import "errors" +import ( + "errors" + "fmt" + + "github.com/dymensionxyz/gerr-cosmos/gerrc" +) var ( ErrInvalidSignature = errors.New("invalid signature") @@ -8,4 +13,5 @@ var ( ErrEmptyBlock = errors.New("block has no transactions and is not allowed to be empty") ErrInvalidBlockHeight = errors.New("invalid block height") ErrInvalidHeaderDataHash = errors.New("header not matching block data") + ErrMissingProposerPubKey = fmt.Errorf("missing proposer public key: %w", gerrc.ErrNotFound) ) diff --git a/types/hashing.go b/types/hashing.go index 1500658e8..17162ee0e 100644 --- a/types/hashing.go +++ b/types/hashing.go @@ -1,40 +1,9 @@ package types -import ( - "time" - - tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - tmtypes "github.com/tendermint/tendermint/types" -) - // Hash returns ABCI-compatible hash of a header. func (h *Header) Hash() [32]byte { - abciHeader := tmtypes.Header{ - Version: tmversion.Consensus{ - Block: h.Version.Block, - App: h.Version.App, - }, - Height: int64(h.Height), - Time: time.Unix(0, int64(h.Time)), - LastBlockID: tmtypes.BlockID{ - Hash: h.LastHeaderHash[:], - PartSetHeader: tmtypes.PartSetHeader{ - Total: 1, - Hash: h.LastHeaderHash[:], - }, - }, - LastCommitHash: h.LastCommitHash[:], - DataHash: h.DataHash[:], - ValidatorsHash: h.SequencersHash[:], - NextValidatorsHash: h.SequencersHash[:], - ConsensusHash: h.ConsensusHash[:], - AppHash: h.AppHash[:], - LastResultsHash: h.LastResultsHash[:], - EvidenceHash: new(tmtypes.EvidenceData).Hash(), - ProposerAddress: h.ProposerAddress, - ChainID: h.ChainID, - } var hash [32]byte + abciHeader := ToABCIHeader(h) copy(hash[:], abciHeader.Hash()) return hash } diff --git a/types/pb/dymint/dymint.pb.go b/types/pb/dymint/dymint.pb.go index d9356bad5..f3894f5d5 100644 --- a/types/pb/dymint/dymint.pb.go +++ b/types/pb/dymint/dymint.pb.go @@ -109,8 +109,10 @@ type Header struct { // We keep this in case users choose another signature format where the // pubkey can't be recovered by the signature (e.g. ed25519). ProposerAddress []byte `protobuf:"bytes,11,opt,name=proposer_address,json=proposerAddress,proto3" json:"proposer_address,omitempty"` - // Hash of block sequencer set, at a time of block creation - SequencersHash []byte `protobuf:"bytes,12,opt,name=sequencers_hash,json=sequencersHash,proto3" json:"sequencers_hash,omitempty"` + // Hash of proposer validatorSet (compatible with tendermint) + SequencerHash []byte `protobuf:"bytes,12,opt,name=sequencer_hash,json=sequencerHash,proto3" json:"sequencer_hash,omitempty"` + // Hash of the next proposer validatorSet (compatible with tendermint) + NextSequencerHash []byte `protobuf:"bytes,14,opt,name=next_sequencer_hash,json=nextSequencerHash,proto3" json:"next_sequencer_hash,omitempty"` // Chain ID the block belongs to ChainId string `protobuf:"bytes,13,opt,name=chain_id,json=chainId,proto3" json:"chain_id,omitempty"` } @@ -226,9 +228,16 @@ func (m *Header) GetProposerAddress() []byte { return nil } -func (m *Header) GetSequencersHash() []byte { +func (m *Header) GetSequencerHash() []byte { if m != nil { - return m.SequencersHash + return m.SequencerHash + } + return nil +} + +func (m *Header) GetNextSequencerHash() []byte { + if m != nil { + return m.NextSequencerHash } return nil } @@ -497,6 +506,110 @@ func (m *Batch) GetCommits() []*Commit { return nil } +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"` +} + +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_fe69c538ded4b87f, []int{6} +} +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) GetSettlementAddress() string { + if m != nil { + return m.SettlementAddress + } + return "" +} + +func (m *Sequencer) GetValidator() *types.Validator { + if m != nil { + return m.Validator + } + 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"` +} + +func (m *SequencerSet) Reset() { *m = SequencerSet{} } +func (m *SequencerSet) String() string { return proto.CompactTextString(m) } +func (*SequencerSet) ProtoMessage() {} +func (*SequencerSet) Descriptor() ([]byte, []int) { + return fileDescriptor_fe69c538ded4b87f, []int{7} +} +func (m *SequencerSet) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *SequencerSet) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_SequencerSet.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 *SequencerSet) XXX_Merge(src proto.Message) { + xxx_messageInfo_SequencerSet.Merge(m, src) +} +func (m *SequencerSet) XXX_Size() int { + return m.Size() +} +func (m *SequencerSet) XXX_DiscardUnknown() { + xxx_messageInfo_SequencerSet.DiscardUnknown(m) +} + +var xxx_messageInfo_SequencerSet proto.InternalMessageInfo + +func (m *SequencerSet) GetSequencers() []*Sequencer { + if m != nil { + return m.Sequencers + } + return nil +} + +func (m *SequencerSet) GetProposer() *Sequencer { + if m != nil { + return m.Proposer + } + return nil +} + func init() { proto.RegisterType((*Version)(nil), "dymint.Version") proto.RegisterType((*Header)(nil), "dymint.Header") @@ -504,56 +617,64 @@ func init() { proto.RegisterType((*Data)(nil), "dymint.Data") proto.RegisterType((*Block)(nil), "dymint.Block") proto.RegisterType((*Batch)(nil), "dymint.Batch") + proto.RegisterType((*Sequencer)(nil), "dymint.Sequencer") + proto.RegisterType((*SequencerSet)(nil), "dymint.SequencerSet") } func init() { proto.RegisterFile("types/dymint/dymint.proto", fileDescriptor_fe69c538ded4b87f) } var fileDescriptor_fe69c538ded4b87f = []byte{ - // 691 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x64, 0x94, 0x3d, 0x6f, 0xd3, 0x40, - 0x18, 0xc7, 0xeb, 0x26, 0x75, 0x92, 0xc7, 0xe9, 0x0b, 0x27, 0x54, 0xb9, 0xad, 0x30, 0xa9, 0xa5, - 0x42, 0xca, 0xe0, 0x8a, 0x20, 0x24, 0x26, 0x24, 0x0a, 0x48, 0xe9, 0x7a, 0x95, 0x18, 0x58, 0xa2, - 0x8b, 0x7d, 0x8a, 0x4f, 0xd4, 0x2f, 0xf8, 0x2e, 0x55, 0xcb, 0xc8, 0xc6, 0xc6, 0xcc, 0xc6, 0xb7, - 0x61, 0xec, 0xc0, 0xc0, 0x88, 0xda, 0x2f, 0x82, 0xee, 0xb9, 0x73, 0x6c, 0x60, 0x49, 0x7c, 0xff, - 0xff, 0xcf, 0xe7, 0xe7, 0x9e, 0x97, 0x83, 0x3d, 0x75, 0x5d, 0x72, 0x79, 0x92, 0x5c, 0x67, 0x22, - 0x57, 0xf6, 0x2f, 0x2a, 0xab, 0x42, 0x15, 0xc4, 0x35, 0xab, 0xfd, 0x43, 0x83, 0x28, 0x9e, 0x27, - 0xbc, 0x42, 0x8c, 0xcd, 0x63, 0x71, 0x82, 0xaa, 0x41, 0xf7, 0xc3, 0xff, 0x10, 0x2b, 0x34, 0x4c, - 0xf8, 0x14, 0x7a, 0xef, 0x78, 0x25, 0x45, 0x91, 0x93, 0xfb, 0xb0, 0x31, 0xbf, 0x28, 0xe2, 0x0f, - 0xbe, 0x33, 0x72, 0xc6, 0x5d, 0x6a, 0x16, 0x64, 0x07, 0x3a, 0xac, 0x2c, 0xfd, 0x75, 0xd4, 0xf4, - 0x63, 0xf8, 0xb3, 0x03, 0xee, 0x94, 0xb3, 0x84, 0x57, 0xe4, 0x18, 0x7a, 0x97, 0xe6, 0x6d, 0x7c, - 0xc9, 0x9b, 0x6c, 0x47, 0x36, 0x58, 0xbb, 0x29, 0xad, 0x7d, 0x72, 0x04, 0xc3, 0x9c, 0x65, 0x5c, - 0x96, 0x2c, 0xe6, 0x33, 0x91, 0xe0, 0x86, 0xc3, 0xd3, 0x75, 0xdf, 0xa1, 0xde, 0x4a, 0x3f, 0x4b, - 0xc8, 0x2e, 0xb8, 0x29, 0x17, 0x8b, 0x54, 0xf9, 0x1d, 0xfc, 0xa2, 0x5d, 0x11, 0x02, 0x5d, 0x25, - 0x32, 0xee, 0x77, 0x51, 0xc5, 0x67, 0x32, 0x86, 0x9d, 0x0b, 0x26, 0xd5, 0x2c, 0xc5, 0x60, 0x66, - 0x29, 0x93, 0xa9, 0xbf, 0xa1, 0xb7, 0xa5, 0x5b, 0x5a, 0x37, 0x31, 0x4e, 0x99, 0x4c, 0x57, 0x64, - 0x5c, 0x64, 0x99, 0x50, 0x86, 0x74, 0x1b, 0xf2, 0x35, 0xca, 0x48, 0x1e, 0xc0, 0x20, 0x61, 0x8a, - 0x19, 0xa4, 0x87, 0x48, 0x5f, 0x0b, 0x68, 0x1e, 0xc1, 0x56, 0x5c, 0xe4, 0x92, 0xe7, 0x72, 0x29, - 0x0d, 0xd1, 0x47, 0x62, 0x73, 0xa5, 0x22, 0xb6, 0x07, 0x7d, 0x56, 0x96, 0x06, 0x18, 0x20, 0xd0, - 0x63, 0x65, 0x89, 0xd6, 0x13, 0xb8, 0x87, 0x81, 0x54, 0x5c, 0x2e, 0x2f, 0x94, 0xdd, 0x04, 0x90, - 0xd9, 0xd6, 0x06, 0x35, 0x3a, 0xb2, 0xc7, 0xb0, 0x53, 0x56, 0x45, 0x59, 0x48, 0x5e, 0xcd, 0x58, - 0x92, 0x54, 0x5c, 0x4a, 0xdf, 0x33, 0x68, 0xad, 0xbf, 0x32, 0x32, 0x79, 0x0c, 0xdb, 0x92, 0x7f, - 0x5c, 0xf2, 0x3c, 0xe6, 0x95, 0xdd, 0x74, 0x68, 0x8e, 0xd7, 0xc8, 0x75, 0x68, 0x71, 0xca, 0x44, - 0xae, 0x2b, 0xb0, 0x39, 0x72, 0xc6, 0x03, 0xda, 0xc3, 0xf5, 0x59, 0x12, 0x7e, 0x77, 0xc0, 0x35, - 0x89, 0x68, 0x15, 0xc1, 0xf9, 0xab, 0x08, 0x0f, 0xc1, 0x6b, 0xe7, 0x1a, 0x4b, 0x48, 0x21, 0x6d, - 0xf2, 0x1c, 0x00, 0x48, 0xb1, 0xc8, 0x99, 0x5a, 0x56, 0x5c, 0xfa, 0x9d, 0x51, 0x47, 0xfb, 0x8d, - 0x42, 0x5e, 0xc2, 0x50, 0x65, 0xb3, 0x95, 0x80, 0xd5, 0xf4, 0x26, 0x07, 0x51, 0xd3, 0xa2, 0x91, - 0x69, 0x4e, 0x13, 0xc8, 0xb9, 0x58, 0x50, 0x4f, 0x65, 0xe7, 0x35, 0x1f, 0x7e, 0x71, 0xa0, 0xfb, - 0x86, 0x29, 0xa6, 0xbb, 0x52, 0x5d, 0x49, 0xdf, 0xc1, 0x2f, 0xe8, 0x47, 0xf2, 0x02, 0x7c, 0x91, - 0x2b, 0x5e, 0x65, 0x3c, 0x11, 0x4c, 0xf1, 0x99, 0x54, 0xfa, 0xb7, 0x2a, 0x0a, 0x25, 0xfd, 0x75, - 0xc4, 0x76, 0xdb, 0xfe, 0xb9, 0xb6, 0xa9, 0x76, 0xc9, 0x73, 0xe8, 0xf3, 0x4b, 0x91, 0xe8, 0x2c, - 0x61, 0xc8, 0xde, 0x64, 0xaf, 0x1d, 0x90, 0x1e, 0xab, 0xe8, 0xad, 0x05, 0xe8, 0x0a, 0x0d, 0x3f, - 0x3b, 0xb0, 0x71, 0x8a, 0x23, 0xf2, 0x48, 0xa7, 0x4b, 0xe7, 0xc0, 0x0e, 0xc1, 0x56, 0x3d, 0x04, - 0xa6, 0x03, 0xa9, 0x75, 0xc9, 0x08, 0xba, 0xba, 0x95, 0x30, 0x6f, 0xde, 0x64, 0x58, 0x53, 0xfa, - 0x40, 0x14, 0x1d, 0x72, 0x02, 0x5e, 0xab, 0x4f, 0x71, 0x04, 0x5a, 0xdb, 0x99, 0xa4, 0x50, 0x68, - 0x5a, 0x36, 0xfc, 0xa6, 0x83, 0x60, 0x2a, 0x4e, 0xc9, 0x21, 0x0c, 0xa5, 0x62, 0x95, 0x9e, 0x86, - 0x56, 0xe5, 0x3c, 0xd4, 0xa6, 0xa6, 0x7c, 0x0f, 0x00, 0x78, 0x9e, 0xd4, 0x80, 0x99, 0xe8, 0x01, - 0xcf, 0x13, 0x6b, 0x1f, 0x81, 0x8b, 0x23, 0x2f, 0x6d, 0x16, 0x36, 0xeb, 0xef, 0xe2, 0x29, 0xa9, - 0x35, 0xc9, 0x18, 0x7a, 0x26, 0x3c, 0xe9, 0x77, 0x91, 0xfb, 0x37, 0xbe, 0xda, 0x3e, 0x9d, 0xfe, - 0xb8, 0x0d, 0x9c, 0x9b, 0xdb, 0xc0, 0xf9, 0x7d, 0x1b, 0x38, 0x5f, 0xef, 0x82, 0xb5, 0x9b, 0xbb, - 0x60, 0xed, 0xd7, 0x5d, 0xb0, 0xf6, 0x3e, 0x5a, 0x08, 0x95, 0x2e, 0xe7, 0x51, 0x5c, 0x64, 0xfa, - 0x76, 0xe3, 0xb9, 0xbe, 0x22, 0xae, 0xae, 0x3f, 0xd5, 0x37, 0x9e, 0xb9, 0xa7, 0xca, 0xb9, 0x5d, - 0xcf, 0x5d, 0xbc, 0xac, 0x9e, 0xfd, 0x09, 0x00, 0x00, 0xff, 0xff, 0x32, 0x3a, 0x63, 0x85, 0x18, - 0x05, 0x00, 0x00, + // 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, 0xd3, 0x54, 0x0a, 0x67, 0x13, + 0xb1, 0xbd, 0xaa, 0x3f, 0x55, 0x36, 0x55, 0x2e, 0xf9, 0x0b, 0x5a, 0xfc, 0x3a, 0x0a, 0x54, 0x92, + 0x30, 0x64, 0x7b, 0xdc, 0xaf, 0x06, 0xa4, 0x86, 0xd5, 0x7b, 0x6d, 0x00, 0x5a, 0xa2, 0xee, 0x9d, + 0x05, 0x5b, 0x17, 0x38, 0x50, 0xc7, 0x2a, 0x5d, 0x2a, 0x07, 0x66, 0x64, 0xba, 0xc5, 0xc8, 0xe8, + 0x7e, 0xa5, 0xc6, 0x25, 0x43, 0xa8, 0xab, 0xc6, 0xc3, 0xbc, 0xd9, 0xe3, 0x4e, 0x41, 0xa9, 0x0f, + 0xa2, 0xe8, 0x90, 0x33, 0xb0, 0x2b, 0x5d, 0x8d, 0x03, 0x53, 0xd9, 0x4e, 0x27, 0x85, 0xc2, 0xba, + 0xc1, 0xdd, 0x4f, 0x2a, 0x08, 0x26, 0xfd, 0x90, 0x1c, 0x42, 0x47, 0x48, 0x96, 0xab, 0xd9, 0xa9, + 0x54, 0xce, 0x46, 0x6d, 0xa2, 0xcb, 0xf7, 0x1b, 0x00, 0x4f, 0x82, 0x02, 0xd0, 0xf3, 0xdf, 0xe6, + 0x49, 0x60, 0xec, 0x23, 0x68, 0xe0, 0x05, 0x21, 0x4c, 0x16, 0xb6, 0x8b, 0x73, 0xf1, 0x2b, 0xa9, + 0x31, 0xc9, 0x08, 0x9a, 0x3a, 0x3c, 0xe1, 0xd4, 0x91, 0x7b, 0x1e, 0x5f, 0x61, 0xbb, 0x2b, 0x68, + 0x97, 0xdd, 0x47, 0x4e, 0x81, 0x08, 0x2e, 0xe5, 0x92, 0xc7, 0x3c, 0x91, 0x65, 0xf7, 0x5b, 0xd8, + 0x83, 0xbd, 0xb5, 0x53, 0xf4, 0xff, 0x3f, 0xd0, 0x2e, 0x2f, 0x36, 0x93, 0xb0, 0x17, 0xda, 0xe4, + 0xaa, 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, } func (m *Version) Marshal() (dAtA []byte, err error) { @@ -609,6 +730,13 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if len(m.NextSequencerHash) > 0 { + i -= len(m.NextSequencerHash) + copy(dAtA[i:], m.NextSequencerHash) + i = encodeVarintDymint(dAtA, i, uint64(len(m.NextSequencerHash))) + i-- + dAtA[i] = 0x72 + } if len(m.ChainId) > 0 { i -= len(m.ChainId) copy(dAtA[i:], m.ChainId) @@ -616,10 +744,10 @@ func (m *Header) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x6a } - if len(m.SequencersHash) > 0 { - i -= len(m.SequencersHash) - copy(dAtA[i:], m.SequencersHash) - i = encodeVarintDymint(dAtA, i, uint64(len(m.SequencersHash))) + if len(m.SequencerHash) > 0 { + i -= len(m.SequencerHash) + copy(dAtA[i:], m.SequencerHash) + i = encodeVarintDymint(dAtA, i, uint64(len(m.SequencerHash))) i-- dAtA[i] = 0x62 } @@ -935,6 +1063,97 @@ func (m *Batch) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +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 m.Validator != nil { + { + size, err := m.Validator.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDymint(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.SettlementAddress) > 0 { + i -= len(m.SettlementAddress) + copy(dAtA[i:], m.SettlementAddress) + i = encodeVarintDymint(dAtA, i, uint64(len(m.SettlementAddress))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *SequencerSet) 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 *SequencerSet) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *SequencerSet) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.Proposer != nil { + { + size, err := m.Proposer.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDymint(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x12 + } + if len(m.Sequencers) > 0 { + for iNdEx := len(m.Sequencers) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.Sequencers[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintDymint(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + func encodeVarintDymint(dAtA []byte, offset int, v uint64) int { offset -= sovDymint(v) base := offset @@ -1009,7 +1228,7 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovDymint(uint64(l)) } - l = len(m.SequencersHash) + l = len(m.SequencerHash) if l > 0 { n += 1 + l + sovDymint(uint64(l)) } @@ -1017,6 +1236,10 @@ func (m *Header) Size() (n int) { if l > 0 { n += 1 + l + sovDymint(uint64(l)) } + l = len(m.NextSequencerHash) + if l > 0 { + n += 1 + l + sovDymint(uint64(l)) + } return n } @@ -1121,6 +1344,42 @@ func (m *Batch) Size() (n int) { return n } +func (m *Sequencer) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.SettlementAddress) + if l > 0 { + n += 1 + l + sovDymint(uint64(l)) + } + if m.Validator != nil { + l = m.Validator.Size() + n += 1 + l + sovDymint(uint64(l)) + } + return n +} + +func (m *SequencerSet) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.Sequencers) > 0 { + for _, e := range m.Sequencers { + l = e.Size() + n += 1 + l + sovDymint(uint64(l)) + } + } + if m.Proposer != nil { + l = m.Proposer.Size() + n += 1 + l + sovDymint(uint64(l)) + } + return n +} + func sovDymint(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -1592,7 +1851,7 @@ func (m *Header) Unmarshal(dAtA []byte) error { iNdEx = postIndex case 12: if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field SequencersHash", wireType) + return fmt.Errorf("proto: wrong wireType = %d for field SequencerHash", wireType) } var byteLen int for shift := uint(0); ; shift += 7 { @@ -1619,9 +1878,9 @@ func (m *Header) Unmarshal(dAtA []byte) error { if postIndex > l { return io.ErrUnexpectedEOF } - m.SequencersHash = append(m.SequencersHash[:0], dAtA[iNdEx:postIndex]...) - if m.SequencersHash == nil { - m.SequencersHash = []byte{} + m.SequencerHash = append(m.SequencerHash[:0], dAtA[iNdEx:postIndex]...) + if m.SequencerHash == nil { + m.SequencerHash = []byte{} } iNdEx = postIndex case 13: @@ -1656,6 +1915,40 @@ func (m *Header) Unmarshal(dAtA []byte) error { } m.ChainId = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 14: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field NextSequencerHash", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowDymint + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthDymint + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthDymint + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.NextSequencerHash = append(m.NextSequencerHash[:0], dAtA[iNdEx:postIndex]...) + if m.NextSequencerHash == nil { + m.NextSequencerHash = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipDymint(dAtA[iNdEx:]) @@ -2310,6 +2603,244 @@ func (m *Batch) Unmarshal(dAtA []byte) error { } return nil } +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 ErrIntOverflowDymint + } + 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 SettlementAddress", 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.SettlementAddress = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Validator", 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 + } + if m.Validator == nil { + m.Validator = &types.Validator{} + } + if err := m.Validator.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDymint(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDymint + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *SequencerSet) 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 ErrIntOverflowDymint + } + 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: SequencerSet: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: SequencerSet: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Sequencers", 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.Sequencers = append(m.Sequencers, &Sequencer{}) + if err := m.Sequencers[len(m.Sequencers)-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 Proposer", 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 + } + if m.Proposer == nil { + m.Proposer = &Sequencer{} + } + if err := m.Proposer.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipDymint(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthDymint + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipDymint(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/types/pb/dymint/state.pb.go b/types/pb/dymint/state.pb.go index a5dbdefee..ba072739a 100644 --- a/types/pb/dymint/state.pb.go +++ b/types/pb/dymint/state.pb.go @@ -37,9 +37,7 @@ type State struct { LastBlockHeight int64 `protobuf:"varint,4,opt,name=last_block_height,json=lastBlockHeight,proto3" json:"last_block_height,omitempty"` LastBlockID types.BlockID `protobuf:"bytes,5,opt,name=last_block_id,json=lastBlockId,proto3" json:"last_block_id"` LastBlockTime time.Time `protobuf:"bytes,6,opt,name=last_block_time,json=lastBlockTime,proto3,stdtime" json:"last_block_time"` - NextValidators *types.ValidatorSet `protobuf:"bytes,8,opt,name=next_validators,json=nextValidators,proto3" json:"next_validators,omitempty"` - Validators *types.ValidatorSet `protobuf:"bytes,9,opt,name=validators,proto3" json:"validators,omitempty"` - LastValidators *types.ValidatorSet `protobuf:"bytes,10,opt,name=last_validators,json=lastValidators,proto3" json:"last_validators,omitempty"` + Validators *types.ValidatorSet `protobuf:"bytes,9,opt,name=validators,proto3" json:"validators,omitempty"` // Deprecated: Do not use. LastHeightValidatorsChanged int64 `protobuf:"varint,11,opt,name=last_height_validators_changed,json=lastHeightValidatorsChanged,proto3" json:"last_height_validators_changed,omitempty"` ConsensusParams types.ConsensusParams `protobuf:"bytes,12,opt,name=consensus_params,json=consensusParams,proto3" json:"consensus_params"` LastHeightConsensusParamsChanged int64 `protobuf:"varint,13,opt,name=last_height_consensus_params_changed,json=lastHeightConsensusParamsChanged,proto3" json:"last_height_consensus_params_changed,omitempty"` @@ -47,6 +45,7 @@ type State struct { AppHash []byte `protobuf:"bytes,15,opt,name=app_hash,json=appHash,proto3" json:"app_hash,omitempty"` LastStoreHeight uint64 `protobuf:"varint,16,opt,name=last_store_height,json=lastStoreHeight,proto3" json:"last_store_height,omitempty"` BaseHeight uint64 `protobuf:"varint,17,opt,name=base_height,json=baseHeight,proto3" json:"base_height,omitempty"` + SequencerSet SequencerSet `protobuf:"bytes,18,opt,name=sequencerSet,proto3" json:"sequencerSet"` } func (m *State) Reset() { *m = State{} } @@ -124,13 +123,7 @@ func (m *State) GetLastBlockTime() time.Time { return time.Time{} } -func (m *State) GetNextValidators() *types.ValidatorSet { - if m != nil { - return m.NextValidators - } - return nil -} - +// Deprecated: Do not use. func (m *State) GetValidators() *types.ValidatorSet { if m != nil { return m.Validators @@ -138,13 +131,6 @@ func (m *State) GetValidators() *types.ValidatorSet { return nil } -func (m *State) GetLastValidators() *types.ValidatorSet { - if m != nil { - return m.LastValidators - } - return nil -} - func (m *State) GetLastHeightValidatorsChanged() int64 { if m != nil { return m.LastHeightValidatorsChanged @@ -194,6 +180,13 @@ func (m *State) GetBaseHeight() uint64 { return 0 } +func (m *State) GetSequencerSet() SequencerSet { + if m != nil { + return m.SequencerSet + } + return SequencerSet{} +} + func init() { proto.RegisterType((*State)(nil), "dymint.State") } @@ -201,46 +194,47 @@ func init() { func init() { proto.RegisterFile("types/dymint/state.proto", fileDescriptor_4b679420add07272) } var fileDescriptor_4b679420add07272 = []byte{ - // 617 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x8c, 0x94, 0xcd, 0x6e, 0x9b, 0x40, - 0x14, 0x85, 0x4d, 0xe3, 0xc4, 0xce, 0x38, 0x0e, 0x09, 0xe9, 0x82, 0xa4, 0x12, 0x90, 0xf4, 0x47, - 0x56, 0x17, 0x20, 0x35, 0xfb, 0x56, 0x22, 0x91, 0x6a, 0x57, 0x51, 0x55, 0xe1, 0x2a, 0x8b, 0x6e, - 0xd0, 0x00, 0x53, 0x18, 0x15, 0x33, 0x88, 0x19, 0x47, 0x71, 0x9f, 0x22, 0x4f, 0xd3, 0x67, 0xc8, - 0x32, 0xcb, 0xae, 0xdc, 0xca, 0x7e, 0x91, 0x6a, 0x66, 0x00, 0xd3, 0x58, 0x96, 0xb2, 0x33, 0xe7, - 0x7e, 0xf7, 0x70, 0x86, 0x7b, 0x3d, 0x40, 0x67, 0xb3, 0x1c, 0x51, 0x27, 0x9a, 0x4d, 0x70, 0xc6, - 0x1c, 0xca, 0x20, 0x43, 0x76, 0x5e, 0x10, 0x46, 0xb4, 0x1d, 0xa9, 0x9d, 0x3c, 0x8f, 0x49, 0x4c, - 0x84, 0xe4, 0xf0, 0x5f, 0xb2, 0x7a, 0x62, 0xc6, 0x84, 0xc4, 0x29, 0x72, 0xc4, 0x53, 0x30, 0xfd, - 0xee, 0x30, 0x3c, 0x41, 0x94, 0xc1, 0x49, 0x5e, 0x02, 0xa7, 0xd2, 0x98, 0xa1, 0x2c, 0x42, 0x85, - 0x30, 0x87, 0x41, 0x88, 0x1d, 0xa1, 0x96, 0xc8, 0xd9, 0x1a, 0x52, 0x0a, 0x0d, 0xe6, 0xcd, 0x06, - 0xe6, 0x06, 0xa6, 0x38, 0x82, 0x8c, 0x14, 0x25, 0xf7, 0x72, 0x03, 0x97, 0xc3, 0x02, 0x4e, 0x36, - 0xbf, 0x50, 0x1c, 0xb8, 0xf9, 0xc2, 0xb3, 0x5f, 0x1d, 0xb0, 0x3d, 0xe6, 0xaa, 0x76, 0x0e, 0x3a, - 0x37, 0xa8, 0xa0, 0x98, 0x64, 0xba, 0x62, 0x29, 0x83, 0xde, 0xbb, 0x63, 0x7b, 0xd5, 0x69, 0xcb, - 0x4f, 0x75, 0x2d, 0x01, 0xaf, 0x22, 0xb5, 0x63, 0xd0, 0x0d, 0x13, 0x88, 0x33, 0x1f, 0x47, 0xfa, - 0x33, 0x4b, 0x19, 0xec, 0x7a, 0x1d, 0xf1, 0x3c, 0x8a, 0xb4, 0xd7, 0x60, 0x1f, 0x67, 0x98, 0x61, - 0x98, 0xfa, 0x09, 0xc2, 0x71, 0xc2, 0xf4, 0x2d, 0x4b, 0x19, 0x6c, 0x79, 0xfd, 0x52, 0x1d, 0x0a, - 0x51, 0x7b, 0x0b, 0x0e, 0x53, 0x48, 0x99, 0x1f, 0xa4, 0x24, 0xfc, 0x51, 0x91, 0x6d, 0x41, 0xaa, - 0xbc, 0xe0, 0x72, 0xbd, 0x64, 0x3d, 0xd0, 0x6f, 0xb0, 0x38, 0xd2, 0xb7, 0xd7, 0x83, 0xca, 0xc3, - 0x89, 0xae, 0xd1, 0xa5, 0x7b, 0x74, 0x3f, 0x37, 0x5b, 0x8b, 0xb9, 0xd9, 0xbb, 0xaa, 0xac, 0x46, - 0x97, 0x5e, 0xaf, 0xf6, 0x1d, 0x45, 0xda, 0x15, 0x50, 0x1b, 0x9e, 0x7c, 0xac, 0xfa, 0x8e, 0x70, - 0x3d, 0xb1, 0xe5, 0xcc, 0xed, 0x6a, 0xe6, 0xf6, 0xd7, 0x6a, 0xe6, 0x6e, 0x97, 0xdb, 0xde, 0xfd, - 0x31, 0x15, 0xaf, 0x5f, 0x7b, 0xf1, 0xaa, 0xf6, 0x11, 0xa8, 0x19, 0xba, 0x65, 0x7e, 0x3d, 0x2f, - 0xaa, 0x77, 0x85, 0x9b, 0xb1, 0x9e, 0xf1, 0xba, 0x62, 0xc6, 0x88, 0x79, 0xfb, 0xbc, 0xad, 0x56, - 0xa8, 0xf6, 0x1e, 0x80, 0x86, 0xc7, 0xee, 0x93, 0x3c, 0x1a, 0x1d, 0x3c, 0x88, 0x38, 0x56, 0xc3, - 0x04, 0x3c, 0x2d, 0x08, 0x6f, 0x6b, 0x04, 0xb9, 0x00, 0x86, 0x30, 0x92, 0x93, 0x69, 0xf8, 0xf9, - 0x61, 0x02, 0xb3, 0x18, 0x45, 0x7a, 0x4f, 0x0c, 0xeb, 0x05, 0xa7, 0xe4, 0x9c, 0x56, 0xdd, 0x17, - 0x12, 0xd1, 0x3c, 0x70, 0x10, 0x92, 0x8c, 0xa2, 0x8c, 0x4e, 0xa9, 0x2f, 0x77, 0x54, 0xdf, 0x13, - 0x71, 0x4e, 0xd7, 0xe3, 0x5c, 0x54, 0xe4, 0x17, 0x01, 0xba, 0x6d, 0xfe, 0xb1, 0x3d, 0x35, 0xfc, - 0x5f, 0xd6, 0x3e, 0x83, 0x57, 0xcd, 0x60, 0x8f, 0xfd, 0xeb, 0x78, 0x7d, 0x11, 0xcf, 0x5a, 0xc5, - 0x7b, 0xe4, 0x5f, 0x65, 0xac, 0x16, 0xb1, 0x40, 0x74, 0x9a, 0x32, 0xea, 0x27, 0x90, 0x26, 0xfa, - 0xbe, 0xa5, 0x0c, 0xf6, 0xe4, 0x22, 0x7a, 0x52, 0x1f, 0x42, 0x9a, 0xf0, 0xb5, 0x87, 0x79, 0x2e, - 0x11, 0x55, 0x20, 0x1d, 0x98, 0xe7, 0xa2, 0xf4, 0xa1, 0xb4, 0xa1, 0x8c, 0x14, 0xa8, 0xda, 0xe7, - 0x03, 0x4b, 0x19, 0xb4, 0xdd, 0xa3, 0xc5, 0xdc, 0x54, 0xf9, 0x22, 0x8e, 0x79, 0x4d, 0x86, 0x91, - 0xde, 0x0d, 0x41, 0x33, 0x41, 0x2f, 0x80, 0xb4, 0x6e, 0x3d, 0xe4, 0xad, 0x1e, 0xe0, 0x92, 0x04, - 0x3e, 0xb5, 0xbb, 0x9d, 0x83, 0xae, 0x3b, 0xbc, 0x5f, 0x18, 0xca, 0xc3, 0xc2, 0x50, 0xfe, 0x2e, - 0x0c, 0xe5, 0x6e, 0x69, 0xb4, 0x1e, 0x96, 0x46, 0xeb, 0xf7, 0xd2, 0x68, 0x7d, 0xb3, 0x63, 0xcc, - 0x92, 0x69, 0x60, 0x87, 0x64, 0xc2, 0x2f, 0x3a, 0x94, 0xf1, 0x7f, 0xea, 0xed, 0xec, 0x67, 0x75, - 0xeb, 0x95, 0x37, 0x45, 0x50, 0x3e, 0x07, 0x3b, 0x62, 0xc1, 0xcf, 0xff, 0x05, 0x00, 0x00, 0xff, - 0xff, 0xaf, 0x47, 0xf8, 0xdf, 0x1c, 0x05, 0x00, 0x00, + // 635 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x74, 0x94, 0xcf, 0x4e, 0xdb, 0x4c, + 0x14, 0xc5, 0x63, 0x08, 0x89, 0x99, 0x10, 0x12, 0x06, 0x16, 0x03, 0x9f, 0xe4, 0x04, 0xbe, 0xb6, + 0x8a, 0xba, 0x70, 0xa4, 0xb2, 0x6f, 0x25, 0xc3, 0x82, 0x20, 0x54, 0x55, 0x4e, 0xc5, 0xa2, 0x1b, + 0x6b, 0x6c, 0x4f, 0xed, 0x51, 0x13, 0x8f, 0xeb, 0x99, 0xa0, 0xd2, 0xa7, 0xe0, 0xb1, 0x58, 0xb2, + 0xec, 0x8a, 0x56, 0xe1, 0x15, 0xfa, 0x00, 0xd5, 0xfc, 0x71, 0x70, 0x88, 0xb2, 0x02, 0x9f, 0xfb, + 0x9b, 0xe3, 0xe3, 0x7b, 0xef, 0x04, 0x20, 0x71, 0x9b, 0x13, 0x3e, 0x8c, 0x6f, 0xa7, 0x34, 0x13, + 0x43, 0x2e, 0xb0, 0x20, 0x6e, 0x5e, 0x30, 0xc1, 0x60, 0x43, 0x6b, 0x47, 0x07, 0x09, 0x4b, 0x98, + 0x92, 0x86, 0xf2, 0x3f, 0x5d, 0x3d, 0xea, 0x25, 0x8c, 0x25, 0x13, 0x32, 0x54, 0x4f, 0xe1, 0xec, + 0xeb, 0x50, 0xd0, 0x29, 0xe1, 0x02, 0x4f, 0x73, 0x03, 0x1c, 0x6b, 0x63, 0x41, 0xb2, 0x98, 0x14, + 0xca, 0x1c, 0x87, 0x11, 0x1d, 0x2a, 0xd5, 0x20, 0x27, 0x2b, 0x88, 0x11, 0x2a, 0xcc, 0x9b, 0x35, + 0xcc, 0x0d, 0x9e, 0xd0, 0x18, 0x0b, 0x56, 0x18, 0xee, 0xff, 0x35, 0x5c, 0x8e, 0x0b, 0x3c, 0x5d, + 0xff, 0x42, 0xf5, 0xc1, 0x4b, 0x2f, 0x3c, 0x5c, 0x6a, 0x88, 0xfe, 0xa3, 0x4b, 0x27, 0x7f, 0x1b, + 0x60, 0x6b, 0x2c, 0x0f, 0xc0, 0x53, 0xd0, 0xbc, 0x21, 0x05, 0xa7, 0x2c, 0x43, 0x56, 0xdf, 0x1a, + 0xb4, 0xde, 0x1d, 0xba, 0xcf, 0xa6, 0xae, 0xee, 0xe2, 0xb5, 0x06, 0xfc, 0x92, 0x84, 0x87, 0xc0, + 0x8e, 0x52, 0x4c, 0xb3, 0x80, 0xc6, 0x68, 0xa3, 0x6f, 0x0d, 0xb6, 0xfd, 0xa6, 0x7a, 0x1e, 0xc5, + 0xf0, 0x35, 0xd8, 0xa5, 0x19, 0x15, 0x14, 0x4f, 0x82, 0x94, 0xd0, 0x24, 0x15, 0x68, 0xb3, 0x6f, + 0x0d, 0x36, 0xfd, 0xb6, 0x51, 0x2f, 0x94, 0x08, 0xdf, 0x82, 0xbd, 0x09, 0xe6, 0x22, 0x08, 0x27, + 0x2c, 0xfa, 0x56, 0x92, 0x75, 0x45, 0x76, 0x64, 0xc1, 0x93, 0xba, 0x61, 0x7d, 0xd0, 0xae, 0xb0, + 0x34, 0x46, 0x5b, 0xab, 0x41, 0xf5, 0x77, 0xab, 0x53, 0xa3, 0x73, 0x6f, 0xff, 0xfe, 0xb1, 0x57, + 0x9b, 0x3f, 0xf6, 0x5a, 0x57, 0xa5, 0xd5, 0xe8, 0xdc, 0x6f, 0x2d, 0x7c, 0x47, 0x31, 0xbc, 0x02, + 0x9d, 0x8a, 0xa7, 0x9c, 0x38, 0x6a, 0x28, 0xd7, 0x23, 0x57, 0xaf, 0x83, 0x5b, 0xae, 0x83, 0xfb, + 0xb9, 0x5c, 0x07, 0xcf, 0x96, 0xb6, 0x77, 0xbf, 0x7b, 0x96, 0xdf, 0x5e, 0x78, 0xc9, 0x2a, 0xf4, + 0x00, 0x58, 0x4c, 0x91, 0xa3, 0x6d, 0x65, 0xe4, 0xac, 0xc6, 0xbb, 0x2e, 0x99, 0x31, 0x11, 0xde, + 0x06, 0xb2, 0xfc, 0xca, 0x29, 0x78, 0x06, 0x1c, 0x95, 0x48, 0xf7, 0x22, 0x78, 0xae, 0x04, 0x51, + 0x8a, 0xb3, 0x84, 0xc4, 0xa8, 0xa5, 0xda, 0xf3, 0x9f, 0xa4, 0x74, 0x67, 0x16, 0x7e, 0xfc, 0x4c, + 0x23, 0xd0, 0x07, 0xdd, 0x88, 0x65, 0x9c, 0x64, 0x7c, 0xc6, 0x03, 0xbd, 0x30, 0x68, 0x47, 0xc5, + 0x39, 0x5e, 0x8d, 0x73, 0x56, 0x92, 0x9f, 0x14, 0xe8, 0xd5, 0xe5, 0xe7, 0xf9, 0x9d, 0x68, 0x59, + 0x86, 0x1f, 0xc1, 0xab, 0x6a, 0xb0, 0x97, 0xfe, 0x8b, 0x78, 0x6d, 0x15, 0xaf, 0xff, 0x1c, 0xef, + 0x85, 0x7f, 0x99, 0xb1, 0x1c, 0x7d, 0x41, 0xf8, 0x6c, 0x22, 0x78, 0x90, 0x62, 0x9e, 0xa2, 0xdd, + 0xbe, 0x35, 0xd8, 0xd1, 0xa3, 0xf7, 0xb5, 0x7e, 0x81, 0x79, 0x2a, 0x17, 0x0d, 0xe7, 0xb9, 0x46, + 0x3a, 0x0a, 0x69, 0xe2, 0x3c, 0x57, 0xa5, 0x0f, 0xc6, 0x86, 0x0b, 0x56, 0x90, 0x72, 0x83, 0xba, + 0x7d, 0x6b, 0x50, 0xf7, 0xf6, 0xe7, 0x8f, 0xbd, 0x8e, 0x1c, 0xfd, 0x58, 0xd6, 0x74, 0x18, 0xed, + 0x5d, 0x11, 0x60, 0x0f, 0xb4, 0x42, 0xcc, 0x17, 0x47, 0xf7, 0xe4, 0x51, 0x1f, 0x48, 0xc9, 0x00, + 0xef, 0xc1, 0x0e, 0x27, 0xdf, 0x67, 0x24, 0x8b, 0x88, 0x9c, 0x18, 0x82, 0xaa, 0x91, 0x07, 0xae, + 0xb9, 0x49, 0xe3, 0x4a, 0xcd, 0xf4, 0x6e, 0x89, 0xbf, 0xac, 0xdb, 0xcd, 0xae, 0x7d, 0x59, 0xb7, + 0xed, 0xee, 0xf6, 0x65, 0xdd, 0x06, 0xdd, 0x96, 0x77, 0x71, 0x3f, 0x77, 0xac, 0x87, 0xb9, 0x63, + 0xfd, 0x99, 0x3b, 0xd6, 0xdd, 0x93, 0x53, 0x7b, 0x78, 0x72, 0x6a, 0xbf, 0x9e, 0x9c, 0xda, 0x17, + 0x37, 0xa1, 0x22, 0x9d, 0x85, 0x6e, 0xc4, 0xa6, 0xf2, 0xa6, 0x92, 0x4c, 0xde, 0xb3, 0x1f, 0xb7, + 0x3f, 0xcb, 0xdb, 0x6b, 0x7e, 0x02, 0x42, 0xf3, 0x1c, 0x36, 0xd4, 0x7a, 0x9e, 0xfe, 0x0b, 0x00, + 0x00, 0xff, 0xff, 0xd9, 0x7e, 0xfd, 0x94, 0xf5, 0x04, 0x00, 0x00, } func (m *State) Marshal() (dAtA []byte, err error) { @@ -263,6 +257,18 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + { + size, err := m.SequencerSet.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintState(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x92 if m.BaseHeight != 0 { i = encodeVarintState(dAtA, i, uint64(m.BaseHeight)) i-- @@ -311,18 +317,6 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x58 } - if m.LastValidators != nil { - { - size, err := m.LastValidators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x52 - } if m.Validators != nil { { size, err := m.Validators.MarshalToSizedBuffer(dAtA[:i]) @@ -335,24 +329,12 @@ func (m *State) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x4a } - if m.NextValidators != nil { - { - size, err := m.NextValidators.MarshalToSizedBuffer(dAtA[:i]) - if err != nil { - return 0, err - } - i -= size - i = encodeVarintState(dAtA, i, uint64(size)) - } - i-- - dAtA[i] = 0x42 + n4, err4 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) + if err4 != nil { + return 0, err4 } - n5, err5 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.LastBlockTime, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime):]) - if err5 != nil { - return 0, err5 - } - i -= n5 - i = encodeVarintState(dAtA, i, uint64(n5)) + i -= n4 + i = encodeVarintState(dAtA, i, uint64(n4)) i-- dAtA[i] = 0x32 { @@ -432,18 +414,10 @@ func (m *State) Size() (n int) { n += 1 + l + sovState(uint64(l)) l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastBlockTime) n += 1 + l + sovState(uint64(l)) - if m.NextValidators != nil { - l = m.NextValidators.Size() - n += 1 + l + sovState(uint64(l)) - } if m.Validators != nil { l = m.Validators.Size() n += 1 + l + sovState(uint64(l)) } - if m.LastValidators != nil { - l = m.LastValidators.Size() - n += 1 + l + sovState(uint64(l)) - } if m.LastHeightValidatorsChanged != 0 { n += 1 + sovState(uint64(m.LastHeightValidatorsChanged)) } @@ -466,6 +440,8 @@ func (m *State) Size() (n int) { if m.BaseHeight != 0 { n += 2 + sovState(uint64(m.BaseHeight)) } + l = m.SequencerSet.Size() + n += 2 + l + sovState(uint64(l)) return n } @@ -676,42 +652,6 @@ func (m *State) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 8: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field NextValidators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.NextValidators == nil { - m.NextValidators = &types.ValidatorSet{} - } - if err := m.NextValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 9: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field Validators", wireType) @@ -748,42 +688,6 @@ func (m *State) Unmarshal(dAtA []byte) error { return err } iNdEx = postIndex - case 10: - if wireType != 2 { - return fmt.Errorf("proto: wrong wireType = %d for field LastValidators", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowState - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return ErrInvalidLengthState - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return ErrInvalidLengthState - } - if postIndex > l { - return io.ErrUnexpectedEOF - } - if m.LastValidators == nil { - m.LastValidators = &types.ValidatorSet{} - } - if err := m.LastValidators.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { - return err - } - iNdEx = postIndex case 11: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field LastHeightValidatorsChanged", wireType) @@ -961,6 +865,39 @@ func (m *State) Unmarshal(dAtA []byte) error { break } } + case 18: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field SequencerSet", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowState + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthState + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthState + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if err := m.SequencerSet.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipState(dAtA[iNdEx:]) diff --git a/types/sequencer.go b/types/sequencer.go deleted file mode 100644 index 95aec1278..000000000 --- a/types/sequencer.go +++ /dev/null @@ -1,23 +0,0 @@ -package types - -import crypto "github.com/cosmos/cosmos-sdk/crypto/types" - -// TODO: remove this, as we can use the sequencers objects directly - -// SequencerStatus defines the operating status of a sequencer -type SequencerStatus int32 - -const ( - // Proposer defines a sequencer that is currently the proposer - Proposer SequencerStatus = iota - // Inactive defines a sequencer that is currently inactive - Inactive -) - -// Sequencer represents a sequencer of the rollapp -type Sequencer struct { - // PublicKey is the public key of the sequencer - PublicKey crypto.PubKey - // Status is status of the sequencer - Status SequencerStatus -} diff --git a/types/sequencer_set.go b/types/sequencer_set.go new file mode 100644 index 000000000..45ab8447b --- /dev/null +++ b/types/sequencer_set.go @@ -0,0 +1,164 @@ +package types + +import ( + "bytes" + "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 +type Sequencer struct { + // 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 + val types.Validator +} + +func NewSequencer(pubKey tmcrypto.PubKey, settlementAddress string) *Sequencer { + if pubKey == nil { + return nil + } + return &Sequencer{ + SettlementAddress: settlementAddress, + val: *types.NewValidator(pubKey, 1), + } +} + +// IsEmpty returns true if the sequencer is empty +// we check if the pubkey is nil +func (s Sequencer) IsEmpty() bool { + return s.val.PubKey == nil +} + +func (s Sequencer) TMValidator() (*types.Validator, error) { + return &s.val, nil +} + +func (s Sequencer) ConsAddress() string { + return s.val.Address.String() +} + +func (s Sequencer) PubKey() tmcrypto.PubKey { + return s.val.PubKey +} + +// Hash returns tendermint compatible hash of the sequencer +func (s Sequencer) Hash() []byte { + tempProposerSet := types.NewValidatorSet([]*types.Validator{&s.val}) + return tempProposerSet.Hash() +} + +// SequencerSet is a set of rollapp sequencers and a proposer. +type SequencerSet struct { + // Sequencers is the set of sequencers registered in the settlement layer + // it holds the entire set of sequencers, including unbonded sequencers + Sequencers []Sequencer `json:"sequencers"` + // Proposer is the sequencer that is the proposer for the current sequencer set + // can be nil if no proposer is set + // proposer is also included in the sequencers set + Proposer *Sequencer `json:"proposer"` +} + +func (s *SequencerSet) GetProposerPubKey() tmcrypto.PubKey { + if s.Proposer == nil { + return nil + } + return s.Proposer.PubKey() +} + +// ProposerHash returns the hash of the proposer +func (s *SequencerSet) ProposerHash() []byte { + if s.Proposer == nil { + return make([]byte, 0, 32) + } + return s.Proposer.Hash() +} + +// SetProposerByHash sets the proposer by hash. +// It returns an error if the hash is not found in the sequencer set +// Used when updating proposer from the L2 blocks (nextSequencerHash header field) +func (s *SequencerSet) SetProposerByHash(hash []byte) error { + for _, seq := range s.Sequencers { + if bytes.Equal(seq.Hash(), hash) { + s.SetProposer(&seq) + return 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 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 { + s.Proposer = nil + return + } + s.Proposer = proposer + + // Add proposer to bonded set if not already present + // can happen in cases where the node is not synced with the SL and the sequencer array in the set is not updated + if s.GetByConsAddress(proposer.val.Address) == nil { + s.Sequencers = append(s.Sequencers, *proposer) + } +} + +// SetSequencers sets the sequencers of the sequencer set. +func (s *SequencerSet) SetSequencers(sequencers []Sequencer) { + s.Sequencers = sequencers +} + +// GetByAddress returns the sequencer with the given settlement address. +// used when handling events from the settlement, where the settlement address is used +func (s *SequencerSet) GetByAddress(settlement_address string) *Sequencer { + for _, seq := range s.Sequencers { + if seq.SettlementAddress == settlement_address { + return &seq + } + } + return nil +} + +// GetByConsAddress returns the sequencer with the given consensus address. +func (s *SequencerSet) GetByConsAddress(cons_addr []byte) *Sequencer { + for _, seq := range s.Sequencers { + if bytes.Equal(seq.val.Address, cons_addr) { + return &seq + } + } + return nil +} + +func (s *SequencerSet) String() string { + return fmt.Sprintf("SequencerSet: %v", s.Sequencers) +} + +/* -------------------------- 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: "", + val: val, + } +} + +// LoadFromValSet sets the sequencers from a tendermint validator set. +// used for backward compatibility. should be used only for queries (used by rpc/client) +func (s *SequencerSet) LoadFromValSet(valSet *types.ValidatorSet) { + if valSet == nil { + return + } + + sequencers := make([]Sequencer, len(valSet.Validators)) + for i, val := range valSet.Validators { + sequencers[i] = *NewSequencerFromValidator(*val) + } + s.SetSequencers(sequencers) + s.SetProposer(NewSequencerFromValidator(*valSet.Proposer)) +} diff --git a/types/serialization.go b/types/serialization.go index 60baf29bf..38ea08c62 100644 --- a/types/serialization.go +++ b/types/serialization.go @@ -84,21 +84,20 @@ func (c *Commit) UnmarshalBinary(data []byte) error { // ToProto converts Header into protobuf representation and returns it. func (h *Header) ToProto() *pb.Header { return &pb.Header{ - Version: &pb.Version{ - Block: h.Version.Block, - App: h.Version.App, - }, - Height: h.Height, - Time: h.Time, - ChainId: h.ChainID, - LastHeaderHash: h.LastHeaderHash[:], - LastCommitHash: h.LastCommitHash[:], - DataHash: h.DataHash[:], - ConsensusHash: h.ConsensusHash[:], - AppHash: h.AppHash[:], - LastResultsHash: h.LastResultsHash[:], - ProposerAddress: h.ProposerAddress[:], - SequencersHash: h.SequencersHash[:], + Version: &pb.Version{Block: h.Version.Block, App: h.Version.App}, + NamespaceId: []byte{}, + Height: h.Height, + Time: h.Time, + LastHeaderHash: h.LastHeaderHash[:], + LastCommitHash: h.LastCommitHash[:], + DataHash: h.DataHash[:], + ConsensusHash: h.ConsensusHash[:], + AppHash: h.AppHash[:], + LastResultsHash: h.LastResultsHash[:], + ProposerAddress: h.ProposerAddress[:], + SequencerHash: h.SequencerHash[:], + NextSequencerHash: h.NextSequencersHash[:], + ChainId: h.ChainID, } } @@ -127,7 +126,10 @@ func (h *Header) FromProto(other *pb.Header) error { if !safeCopy(h.LastResultsHash[:], other.LastResultsHash) { return errors.New("invalid length of 'LastResultsHash'") } - if !safeCopy(h.SequencersHash[:], other.SequencersHash) { + if !safeCopy(h.SequencerHash[:], other.SequencerHash) { + return errors.New("invalid length of 'SequencerHash'") + } + if !safeCopy(h.NextSequencersHash[:], other.NextSequencerHash) { return errors.New("invalid length of 'SequencersHash'") } if len(other.ProposerAddress) > 0 { @@ -248,11 +250,7 @@ func (c *Commit) FromProto(other *pb.Commit) error { // ToProto converts State into protobuf representation and returns it. func (s *State) ToProto() (*pb.State, error) { - nextValidators, err := s.NextValidators.ToProto() - if err != nil { - return nil, err - } - validators, err := s.Validators.ToProto() + seqsProto, err := s.Sequencers.ToProto() if err != nil { return nil, err } @@ -262,10 +260,8 @@ func (s *State) ToProto() (*pb.State, error) { ChainId: s.ChainID, InitialHeight: int64(s.InitialHeight), LastBlockHeight: int64(s.Height()), - NextValidators: nextValidators, - Validators: validators, + SequencerSet: *seqsProto, BaseHeight: s.BaseHeight, - LastHeightValidatorsChanged: s.LastHeightValidatorsChanged, ConsensusParams: s.ConsensusParams, LastHeightConsensusParamsChanged: s.LastHeightConsensusParamsChanged, LastResultsHash: s.LastResultsHash[:], @@ -282,15 +278,11 @@ func (s *State) FromProto(other *pb.State) error { s.SetHeight(uint64(other.LastBlockHeight)) s.BaseHeight = other.BaseHeight - s.NextValidators, err = types.ValidatorSetFromProto(other.NextValidators) - if err != nil { - return err - } - s.Validators, err = types.ValidatorSetFromProto(other.Validators) + err = s.Sequencers.FromProto(other.SequencerSet) if err != nil { return err } - s.LastHeightValidatorsChanged = other.LastHeightValidatorsChanged + s.ConsensusParams = other.ConsensusParams s.LastHeightConsensusParamsChanged = other.LastHeightConsensusParamsChanged copy(s.LastResultsHash[:], other.LastResultsHash) @@ -299,6 +291,63 @@ func (s *State) FromProto(other *pb.State) error { return 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)) + for i := 0; i < len(s.Sequencers); i++ { + valp, err := s.Sequencers[i].val.ToProto() + if err != nil { + return nil, fmt.Errorf("ToProto: SequencerSet: %w", err) + } + seq := new(pb.Sequencer) + seq.SettlementAddress = s.Sequencers[i].SettlementAddress + seq.Validator = valp + seqsProto[i] = seq + } + protoSet.Sequencers = seqsProto + + if s.Proposer != nil { + valp, err := s.Proposer.val.ToProto() + if err != nil { + return nil, fmt.Errorf("ToProto: SequencerSet: %w", err) + } + seq := new(pb.Sequencer) + seq.Validator = valp + seq.SettlementAddress = s.Proposer.SettlementAddress + protoSet.Proposer = seq + } + + return protoSet, nil +} + +// FromProto fills SequencerSet with data from its protobuf representation. +func (s *SequencerSet) FromProto(protoSet pb.SequencerSet) error { + seqs := make([]Sequencer, len(protoSet.Sequencers)) + for i, seqProto := range protoSet.Sequencers { + val, err := types.ValidatorFromProto(seqProto.Validator) + if err != nil { + return fmt.Errorf("fromProto: SequencerSet: %w", err) + } + seqs[i].val = *val + seqs[i].SettlementAddress = seqProto.SettlementAddress + } + s.Sequencers = seqs + + if protoSet.Proposer != nil { + valProposer, err := types.ValidatorFromProto(protoSet.Proposer.Validator) + if err != nil { + return fmt.Errorf("fromProto: SequencerSet proposer: %w", err) + } + proposer := new(Sequencer) + proposer.val = *valProposer + proposer.SettlementAddress = protoSet.Proposer.SettlementAddress + s.Proposer = proposer + } + return nil +} + func txsToByteSlices(txs Txs) [][]byte { bytes := make([][]byte, len(txs)) for i := range txs { @@ -328,7 +377,7 @@ func evidenceToProto(evidence EvidenceData) []*abci.Evidence { return ret } -func evidenceFromProto(evidence []*abci.Evidence) EvidenceData { +func evidenceFromProto([]*abci.Evidence) EvidenceData { var ret EvidenceData // TODO(tzdybal): right now Evidence is just an interface without implementations return ret diff --git a/types/serialization_test.go b/types/serialization_test.go index c2cf676cc..865d75622 100644 --- a/types/serialization_test.go +++ b/types/serialization_test.go @@ -7,12 +7,11 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" - "github.com/tendermint/tendermint/crypto/ed25519" tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" tmversion "github.com/tendermint/tendermint/proto/tendermint/version" - tmtypes "github.com/tendermint/tendermint/types" + "github.com/dymensionxyz/dymint/testutil" "github.com/dymensionxyz/dymint/types" pb "github.com/dymensionxyz/dymint/types/pb/dymint" ) @@ -43,17 +42,16 @@ func TestBlockSerializationRoundTrip(t *testing.T) { Block: 1, App: 2, }, - NamespaceID: [8]byte{}, - Height: 3, - Time: 4567, - LastHeaderHash: h[0], - LastCommitHash: h[1], - DataHash: h[2], - ConsensusHash: h[3], - AppHash: h[4], - LastResultsHash: h[5], - ProposerAddress: []byte{4, 3, 2, 1}, - SequencersHash: h[6], + Height: 3, + Time: 4567, + LastHeaderHash: h[0], + LastCommitHash: h[1], + DataHash: h[2], + ConsensusHash: h[3], + AppHash: h[4], + LastResultsHash: h[5], + ProposerAddress: []byte{4, 3, 2, 1}, + NextSequencersHash: h[6], }, Data: types.Data{ Txs: nil, @@ -88,7 +86,7 @@ func TestBlockSerializationRoundTrip(t *testing.T) { func TestStateRoundTrip(t *testing.T) { t.Parallel() - valSet := getRandomValidatorSet() + valSet := testutil.GenerateRandomValidatorSet() cases := []struct { name string @@ -97,8 +95,6 @@ func TestStateRoundTrip(t *testing.T) { { "with max bytes", types.State{ - Validators: valSet, - NextValidators: valSet, ConsensusParams: tmproto.ConsensusParams{ Block: tmproto.BlockParams{ MaxBytes: 123, @@ -118,11 +114,8 @@ func TestStateRoundTrip(t *testing.T) { }, Software: "dymint", }, - ChainID: "testchain", - InitialHeight: 987, - NextValidators: valSet, - Validators: valSet, - LastHeightValidatorsChanged: 8272, + ChainID: "testchain", + InitialHeight: 987, ConsensusParams: tmproto.ConsensusParams{ Block: tmproto.BlockParams{ MaxBytes: 12345, @@ -153,6 +146,8 @@ func TestStateRoundTrip(t *testing.T) { require := require.New(t) assert := assert.New(t) + c.state.Sequencers.LoadFromValSet(valSet) + if c.state.InitialHeight != 0 { c.state.SetHeight(986321) } @@ -177,14 +172,3 @@ func TestStateRoundTrip(t *testing.T) { }) } } - -// copied from store_test.go -func getRandomValidatorSet() *tmtypes.ValidatorSet { - pubKey := ed25519.GenPrivKey().PubKey() - return &tmtypes.ValidatorSet{ - Proposer: &tmtypes.Validator{PubKey: pubKey, Address: pubKey.Address()}, - Validators: []*tmtypes.Validator{ - {PubKey: pubKey, Address: pubKey.Address()}, - }, - } -} diff --git a/types/state.go b/types/state.go index 8e45a981e..b022950c1 100644 --- a/types/state.go +++ b/types/state.go @@ -4,9 +4,9 @@ import ( "sync/atomic" // TODO(tzdybal): copy to local project? + tmstate "github.com/tendermint/tendermint/proto/tendermint/state" tmproto "github.com/tendermint/tendermint/proto/tendermint/types" - "github.com/tendermint/tendermint/types" ) // State contains information about current state of the blockchain. @@ -23,9 +23,8 @@ type State struct { // BaseHeight is the height of the first block we have in store after pruning. BaseHeight uint64 - NextValidators *types.ValidatorSet - Validators *types.ValidatorSet - LastHeightValidatorsChanged int64 + // Sequencers is the set of sequencers that are currently active on the rollapp. + Sequencers SequencerSet // Consensus parameters used for validating blocks. // Changes returned by EndBlock and updated after Commit. diff --git a/types/validation.go b/types/validation.go index 8e84f68e1..100091807 100644 --- a/types/validation.go +++ b/types/validation.go @@ -5,15 +5,16 @@ import ( "errors" "fmt" + tmcrypto "github.com/tendermint/tendermint/crypto" tmtypes "github.com/tendermint/tendermint/types" ) -func ValidateProposedTransition(state *State, block *Block, commit *Commit, proposer *Sequencer) error { +func ValidateProposedTransition(state *State, block *Block, commit *Commit, proposerPubKey tmcrypto.PubKey) error { if err := block.ValidateWithState(state); err != nil { return fmt.Errorf("block: %w", err) } - if err := commit.ValidateWithHeader(proposer, &block.Header); err != nil { + if err := commit.ValidateWithHeader(proposerPubKey, &block.Header); err != nil { return fmt.Errorf("commit: %w", err) } return nil @@ -36,6 +37,9 @@ func (b *Block) ValidateBasic() error { return err } + if b.Header.DataHash != [32]byte(GetDataHash(b)) { + return ErrInvalidHeaderDataHash + } return nil } @@ -91,25 +95,18 @@ func (c *Commit) ValidateBasic() error { return nil } -// Validate performs full validation of a commit. -func (c *Commit) Validate(proposer *Sequencer, abciHeaderBytes []byte) error { +func (c *Commit) ValidateWithHeader(proposerPubKey tmcrypto.PubKey, header *Header) error { if err := c.ValidateBasic(); err != nil { return err } - if !proposer.PublicKey.VerifySignature(abciHeaderBytes, c.Signatures[0]) { - return ErrInvalidSignature - } - return nil -} - -func (c *Commit) ValidateWithHeader(proposer *Sequencer, header *Header) error { abciHeaderPb := ToABCIHeaderPB(header) abciHeaderBytes, err := abciHeaderPb.Marshal() if err != nil { return err } - if err = c.Validate(proposer, abciHeaderBytes); err != nil { - return err + // commit is validated to have single signature + if !proposerPubKey.VerifySignature(abciHeaderBytes, c.Signatures[0]) { + return ErrInvalidSignature } return nil }