From 3ba107dc1ea6ed161f0bc9ca1eca90ee2da85785 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 27 Sep 2024 13:31:56 +0200 Subject: [PATCH 1/7] add changes to use the consensus messages --- app/app.go | 91 ++++++++++++++++++- app/app_test.go | 100 +++++++++++++++++++++ app/test_helpers.go | 209 ++++++++++++++++++++++++++++++++++++++++++++ go.mod | 5 +- go.sum | 8 +- 5 files changed, 403 insertions(+), 10 deletions(-) create mode 100644 app/app_test.go create mode 100644 app/test_helpers.go diff --git a/app/app.go b/app/app.go index 7505022..a297463 100644 --- a/app/app.go +++ b/app/app.go @@ -2,6 +2,7 @@ package app import ( "fmt" + "github.com/dymensionxyz/dymension-rdk/server/consensus" "io" "net/http" "os" @@ -14,6 +15,8 @@ import ( gaslessmodule "github.com/dymensionxyz/dymension-rdk/x/gasless" gaslesskeeper "github.com/dymensionxyz/dymension-rdk/x/gasless/keeper" gaslesstypes "github.com/dymensionxyz/dymension-rdk/x/gasless/types" + "github.com/gogo/protobuf/proto" + prototypes "github.com/gogo/protobuf/types" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" abci "github.com/tendermint/tendermint/abci/types" @@ -310,6 +313,8 @@ type App struct { // module configurator configurator module.Configurator + + consensusMessageAdmissionHandler consensus.AdmissionHandler } // NewRollapp returns a reference to an initialized blockchain app @@ -643,7 +648,7 @@ func NewRollapp( mint.NewAppModule(appCodec, app.MintKeeper, app.AccountKeeper, app.BankKeeper), distr.NewAppModule(appCodec, app.DistrKeeper, app.AccountKeeper, app.BankKeeper, app.StakingKeeper), staking.NewAppModule(appCodec, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), - sequencers.NewAppModule(appCodec, app.SequencersKeeper), + sequencers.NewAppModule(app.SequencersKeeper), epochs.NewAppModule(appCodec, app.EpochsKeeper), params.NewAppModule(app.ParamsKeeper), wasm.NewAppModule(appCodec, &app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper), @@ -810,6 +815,13 @@ func NewRollapp( // upgrade. app.setPostHandler() + // Admission handler for consensus messages + app.setAdmissionHandler(consensus.MapAdmissionHandler( + []string{ + proto.MessageName(&banktypes.MsgSend{}), + }, + )) + if loadLatest { if err := app.LoadLatestVersion(); err != nil { tmos.Exit(err.Error()) @@ -863,12 +875,87 @@ func (app *App) setPostHandler() { app.SetPostHandler(postHandler) } +func (app *App) setAdmissionHandler(handler consensus.AdmissionHandler) { + app.consensusMessageAdmissionHandler = handler +} + // Name returns the name of the App func (app *App) Name() string { return app.BaseApp.Name() } // BeginBlocker application updates every begin block func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - return app.mm.BeginBlock(ctx, req) + consensusResponses := app.processConsensusMessage(ctx, req.ConsensusMessages) + + resp := app.mm.BeginBlock(ctx, req) + resp.ConsensusMessagesResponses = consensusResponses + + return resp +} + +func (app *App) processConsensusMessage(ctx sdk.Context, consensusMsgs []*prototypes.Any) []*abci.ConsensusMessageResponse { + var responses []*abci.ConsensusMessageResponse + + for _, anyMsg := range consensusMsgs { + sdkAny := &types.Any{ + TypeUrl: "/" + anyMsg.TypeUrl, + Value: anyMsg.Value, + } + + var msg sdk.Msg + err := app.appCodec.UnpackAny(sdkAny, &msg) + if err != nil { + responses = append(responses, &abci.ConsensusMessageResponse{ + Response: &abci.ConsensusMessageResponse_Error{ + Error: fmt.Errorf("failed to unpack consensus message: %w", err).Error(), + }, + }) + + continue + } + + cacheCtx, writeCache := ctx.CacheContext() + err = app.consensusMessageAdmissionHandler(cacheCtx, msg) + if err != nil { + responses = append(responses, &abci.ConsensusMessageResponse{ + Response: &abci.ConsensusMessageResponse_Error{ + Error: fmt.Errorf("consensus message admission failed: %w", err).Error(), + }, + }) + + continue + } + + resp, err := app.MsgServiceRouter().Handler(msg)(ctx, msg) + if err != nil { + responses = append(responses, &abci.ConsensusMessageResponse{ + Response: &abci.ConsensusMessageResponse_Error{ + Error: fmt.Errorf("failed to execute consensus message: %w", err).Error(), + }, + }) + + continue + } + + theType, err := proto.Marshal(resp) + if err != nil { + return nil + } + + anyResp := &prototypes.Any{ + TypeUrl: proto.MessageName(resp), + Value: theType, + } + + responses = append(responses, &abci.ConsensusMessageResponse{ + Response: &abci.ConsensusMessageResponse_Ok{ + Ok: anyResp, + }, + }) + + writeCache() + } + + return responses } // EndBlocker application updates every end block diff --git a/app/app_test.go b/app/app_test.go new file mode 100644 index 0000000..52f37aa --- /dev/null +++ b/app/app_test.go @@ -0,0 +1,100 @@ +package app + +import ( + "testing" + + sdk "github.com/cosmos/cosmos-sdk/types" + types2 "github.com/cosmos/cosmos-sdk/x/bank/types" + "github.com/gogo/protobuf/proto" + prototypes "github.com/gogo/protobuf/types" + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" + "github.com/tendermint/tendermint/proto/tendermint/types" +) + +func TestBeginBlocker(t *testing.T) { + app, valAccount := SetupWithOneValidator(t) + ctx := app.NewUncachedContext(true, types.Header{ + Height: 1, + ChainID: "testchain_9000-1", + }) + + bankSend := &types2.MsgSend{ + FromAddress: valAccount.GetAddress().String(), + ToAddress: valAccount.GetAddress().String(), + Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), + } + msgBz, err := proto.Marshal(bankSend) + require.NoError(t, err) + + goodMessage := &prototypes.Any{ + TypeUrl: proto.MessageName(&types2.MsgSend{}), + Value: msgBz, + } + + testCases := []struct { + name string + consensusMsgs []*prototypes.Any + expectError bool + }{ + { + name: "ValidConsensusMessage", + consensusMsgs: []*prototypes.Any{ + goodMessage, + }, + expectError: false, + }, + { + name: "InvalidUnpackMessage", + consensusMsgs: []*prototypes.Any{ + { + TypeUrl: "/path.to.InvalidMsg", + Value: []byte("invalid unpack data"), + }, + }, + expectError: true, + }, + { + name: "InvalidExecutionMessage", + consensusMsgs: []*prototypes.Any{ + { + TypeUrl: "/path.to.ExecErrorMsg", + Value: []byte("execution error data"), + }, + }, + expectError: true, + }, + } + + for _, tc := range testCases { + t.Run(tc.name, func(t *testing.T) { + req := abci.RequestBeginBlock{ + Header: types.Header{ + Height: 1, + Time: ctx.BlockTime(), + ChainID: "testchain_9000-1", + }, + LastCommitInfo: abci.LastCommitInfo{}, + ByzantineValidators: []abci.Evidence{}, + ConsensusMessages: tc.consensusMsgs, + } + + res := app.BeginBlocker(ctx, req) + require.NotNil(t, res) + + if tc.expectError { + require.NotEmpty(t, res.ConsensusMessagesResponses) + for _, response := range res.ConsensusMessagesResponses { + _, isError := response.Response.(*abci.ConsensusMessageResponse_Error) + require.True(t, isError, "Expected an error response but got a success") + } + } else { + require.NotEmpty(t, res.ConsensusMessagesResponses) + for _, response := range res.ConsensusMessagesResponses { + _, isOk := response.Response.(*abci.ConsensusMessageResponse_Ok) + require.True(t, isOk, "Expected a success response but got an error") + } + } + }) + } +} diff --git a/app/test_helpers.go b/app/test_helpers.go new file mode 100644 index 0000000..108c344 --- /dev/null +++ b/app/test_helpers.go @@ -0,0 +1,209 @@ +package app + +import ( + "encoding/json" + "fmt" + appcodec "github.com/cosmos/cosmos-sdk/codec" + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + "github.com/cosmos/cosmos-sdk/crypto/codec" + "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" + "github.com/cosmos/cosmos-sdk/simapp" + "github.com/cosmos/cosmos-sdk/testutil/mock" + sdk "github.com/cosmos/cosmos-sdk/types" + authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" + stakingtypes "github.com/cosmos/cosmos-sdk/x/staking/types" + "github.com/dymensionxyz/dymension-rdk/testutil/utils" + rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" + "github.com/tendermint/tendermint/crypto/encoding" + "github.com/tendermint/tendermint/libs/log" + tmproto "github.com/tendermint/tendermint/proto/tendermint/types" + types2 "github.com/tendermint/tendermint/types" + dbm "github.com/tendermint/tm-db" + "testing" + "time" + + "github.com/stretchr/testify/require" + abci "github.com/tendermint/tendermint/abci/types" +) + +const TestChainID = "testchain_9000-1" + +func setup(withGenesis bool, invCheckPeriod uint) (*App, GenesisState) { + db := dbm.NewMemDB() + + app := NewRollapp( + log.NewNopLogger(), + db, + nil, + true, + map[int64]bool{}, + DefaultNodeHome, + invCheckPeriod, + MakeEncodingConfig(), + nil, + simapp.EmptyAppOptions{}, + nil, + ) + + if withGenesis { + return app, NewDefaultGenesisState(app.appCodec) + } + + return app, GenesisState{} +} + +// SetupWithOneValidator initializes a new App. A Nop logger is set in App. +func SetupWithOneValidator(t *testing.T) (*App, authtypes.AccountI) { + t.Helper() + + privVal := mock.NewPV() + pubKey, err := privVal.GetPubKey() + require.NoError(t, err) + + // create validator set with single validator + validator := types2.NewValidator(pubKey, 1) + valSet := types2.NewValidatorSet([]*types2.Validator{validator}) + + // generate genesis account + senderPrivKey := secp256k1.GenPrivKey() + acc := authtypes.NewBaseAccount(senderPrivKey.PubKey().Address().Bytes(), senderPrivKey.PubKey(), 0, 0) + balance := banktypes.Balance{ + Address: acc.GetAddress().String(), + Coins: sdk.NewCoins(sdk.NewCoin(sdk.DefaultBondDenom, sdk.NewInt(100000000000000))), + } + fmt.Printf("address: %s\n", acc.GetAddress().String()) + + app := SetupWithGenesisValSet(t, valSet, []authtypes.GenesisAccount{acc}, balance) + + return app, acc +} + +// SetupWithGenesisValSet initializes a new SimApp with a validator set and genesis accounts +// that also act as delegators. For simplicity, each validator is bonded with a delegation +// of one consensus engine unit in the default token of the simapp from first genesis +// account. A Nop logger is set in SimApp. +func SetupWithGenesisValSet(t *testing.T, valSet *types2.ValidatorSet, genAccs []authtypes.GenesisAccount, balances ...banktypes.Balance) *App { + t.Helper() + + app, genesisState := setup(true, 5) + genesisState = genesisStateWithValSet(t, app, genesisState, valSet, genAccs, balances...) + + genesisState = setRollappVersion(app.appCodec, genesisState, "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0") + + stateBytes, err := json.MarshalIndent(genesisState, "", " ") + require.NoError(t, err) + + proto, err := encoding.PubKeyToProto(valSet.Validators[0].PubKey) + require.NoError(t, err) + + // init chain will set the validator set and initialize the genesis accounts + app.InitChain( + abci.RequestInitChain{ + Validators: []abci.ValidatorUpdate{ + { + PubKey: proto, + Power: valSet.Validators[0].VotingPower, + }, + }, + ConsensusParams: utils.DefaultConsensusParams, + AppStateBytes: stateBytes, + ChainId: TestChainID, + }, + ) + + // commit genesis changes + app.Commit() + app.BeginBlock(abci.RequestBeginBlock{Header: tmproto.Header{ + ChainID: TestChainID, + Height: app.LastBlockHeight() + 1, + AppHash: app.LastCommitID().Hash, + ValidatorsHash: valSet.Hash(), + NextValidatorsHash: valSet.Hash(), + }}) + + return app +} + +func genesisStateWithValSet(t *testing.T, + app *App, genesisState GenesisState, + valSet *types2.ValidatorSet, genAccs []authtypes.GenesisAccount, + balances ...banktypes.Balance, +) GenesisState { + // set genesis accounts + authGenesis := authtypes.NewGenesisState(authtypes.DefaultParams(), genAccs) + genesisState[authtypes.ModuleName] = app.AppCodec().MustMarshalJSON(authGenesis) + + validators := make([]stakingtypes.Validator, 0, len(valSet.Validators)) + delegations := make([]stakingtypes.Delegation, 0, len(valSet.Validators)) + + bondAmt := sdk.DefaultPowerReduction + + for _, val := range valSet.Validators { + pk, err := codec.FromTmPubKeyInterface(val.PubKey) + require.NoError(t, err) + pkAny, err := codectypes.NewAnyWithValue(pk) + require.NoError(t, err) + validator := stakingtypes.Validator{ + OperatorAddress: sdk.ValAddress(val.Address).String(), + ConsensusPubkey: pkAny, + Jailed: false, + Status: stakingtypes.Bonded, + Tokens: bondAmt, + DelegatorShares: sdk.OneDec(), + Description: stakingtypes.Description{}, + UnbondingHeight: int64(0), + UnbondingTime: time.Unix(0, 0).UTC(), + Commission: stakingtypes.NewCommission(sdk.ZeroDec(), sdk.ZeroDec(), sdk.ZeroDec()), + MinSelfDelegation: sdk.ZeroInt(), + } + validators = append(validators, validator) + delegations = append(delegations, stakingtypes.NewDelegation(genAccs[0].GetAddress(), val.Address.Bytes(), sdk.OneDec())) + + } + // set validators and delegations + stakingGenesis := stakingtypes.NewGenesisState(stakingtypes.DefaultParams(), validators, delegations) + genesisState[stakingtypes.ModuleName] = app.AppCodec().MustMarshalJSON(stakingGenesis) + + totalSupply := sdk.NewCoins() + for _, b := range balances { + // add genesis acc tokens to total supply + totalSupply = totalSupply.Add(b.Coins...) + } + + for range delegations { + // add delegated tokens to total supply + totalSupply = totalSupply.Add(sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)) + } + + // add bonded amount to bonded pool module account + balances = append(balances, banktypes.Balance{ + Address: authtypes.NewModuleAddress(stakingtypes.BondedPoolName).String(), + Coins: sdk.Coins{sdk.NewCoin(sdk.DefaultBondDenom, bondAmt)}, + }) + + // update total supply + bankGenesis := banktypes.NewGenesisState(banktypes.DefaultGenesisState().Params, balances, totalSupply, []banktypes.Metadata{}) + genesisState[banktypes.ModuleName] = app.AppCodec().MustMarshalJSON(bankGenesis) + + return genesisState +} + +func setRollappVersion(appCodec appcodec.Codec, genesisState GenesisState, version string) GenesisState { + var rollappParamsGenesis rollappparamstypes.GenesisState + if genesisState["rollappparams"] != nil { + appCodec.MustUnmarshalJSON(genesisState["rollappparams"], &rollappParamsGenesis) + } else { + rollappParamsGenesis = rollappparamstypes.GenesisState{ + Params: rollappparamstypes.Params{ + Version: version, + }, + } + } + + rollappParamsGenesis.Params.Version = version + + genesisState["rollappparams"] = appCodec.MustMarshalJSON(&rollappParamsGenesis) + + return genesisState +} diff --git a/go.mod b/go.mod index 1a09ce2..8a11ce6 100644 --- a/go.mod +++ b/go.mod @@ -4,7 +4,7 @@ go 1.22.4 require ( cosmossdk.io/collections v0.4.0 - cosmossdk.io/core v0.10.0 + cosmossdk.io/core v0.12.0 cosmossdk.io/errors v1.0.1 github.com/CosmWasm/wasmd v0.33.0 github.com/CosmWasm/wasmvm v1.3.0 @@ -346,6 +346,7 @@ replace ( github.com/CosmWasm/wasmd => github.com/decentrio/wasmd v0.33.0-sdk46.2 github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/availproject/go-substrate-rpc-client/v4 v4.0.12-avail-1.4.0-rc1-5e286e3 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 + github.com/dymensionxyz/dymension-rdk => ../dymension-rdk // use Evmos geth fork github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26 github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 @@ -357,5 +358,5 @@ replace ( // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // use cometbft - github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e + github.com/tendermint/tendermint => ../cometbft ) diff --git a/go.sum b/go.sum index be8fa96..4d2f803 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ cosmossdk.io/api v0.7.0 h1:QsEMIWuv9xWDbF2HZnW4Lpu1/SejCztPu0LQx7t6MN4= cosmossdk.io/api v0.7.0/go.mod h1:kJFAEMLN57y0viszHDPLMmieF0471o5QAwwApa+270M= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.10.0 h1:NP28Ol9YyRODmZLJg2ko/mUl40hMegeMzhJnG+XPkcY= -cosmossdk.io/core v0.10.0/go.mod h1:MygXNld9DvMgYY4yE76DM/mdZpgfeyRjy6FPjEEehlY= +cosmossdk.io/core v0.12.0 h1:aFuvkG6eDv0IQC+UDjx86wxNWVAxdCFk7OABJ1Vh4RU= +cosmossdk.io/core v0.12.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= @@ -566,12 +566,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= -github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e h1:A5FIvuFPvdxShuf9mSHfDUEL7I/oKVcSr1AtSlmgskA= -github.com/dymensionxyz/cometbft v0.34.29-0.20240906143736-1e3959c2826e/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/dymensionxyz/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-rdk v1.6.1-0.20240916194645-3fe31b2db4b2 h1:Qex0iUhBenRhOIMwrv2eYPWNIySlWVJDZ9D70iLd9eQ= -github.com/dymensionxyz/dymension-rdk v1.6.1-0.20240916194645-3fe31b2db4b2/go.mod h1:/4liuSPJFSyxlLg19KLngisZynYpa3clYuPuB460des= 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/dymint v1.2.0-rc01.0.20240916140329-d51b961e7e0d h1:zL456H//aGkqTP3L2Al4f4zX2aoHgYW4YMLIt9X/EAA= From d33f49c36db2e5e6517fa86b162872698fc96e00 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:53:23 +0200 Subject: [PATCH 2/7] goimports --- app/app.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/app.go b/app/app.go index a297463..659d6ca 100644 --- a/app/app.go +++ b/app/app.go @@ -2,7 +2,6 @@ package app import ( "fmt" - "github.com/dymensionxyz/dymension-rdk/server/consensus" "io" "net/http" "os" @@ -143,7 +142,9 @@ import ( cwerrorsKeeper "github.com/dymensionxyz/rollapp-wasm/x/cwerrors/keeper" cwerrorsTypes "github.com/dymensionxyz/rollapp-wasm/x/cwerrors/types" - rollappparams "github.com/dymensionxyz/dymension-rdk/x/rollappparams" + "github.com/dymensionxyz/dymension-rdk/server/consensus" + + "github.com/dymensionxyz/dymension-rdk/x/rollappparams" rollappparamskeeper "github.com/dymensionxyz/dymension-rdk/x/rollappparams/keeper" rollappparamstypes "github.com/dymensionxyz/dymension-rdk/x/rollappparams/types" ) From d188a3de8878922dd2904fc3952f2f366d52c98d Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:54:41 +0200 Subject: [PATCH 3/7] use banktypes --- app/app.go | 8 +++----- app/app_test.go | 6 +++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/app.go b/app/app.go index 659d6ca..1c5654e 100644 --- a/app/app.go +++ b/app/app.go @@ -817,11 +817,9 @@ func NewRollapp( app.setPostHandler() // Admission handler for consensus messages - app.setAdmissionHandler(consensus.MapAdmissionHandler( - []string{ - proto.MessageName(&banktypes.MsgSend{}), - }, - )) + app.setAdmissionHandler(consensus.MapAdmissionHandler([]string{ + proto.MessageName(&banktypes.MsgSend{}), + })) if loadLatest { if err := app.LoadLatestVersion(); err != nil { diff --git a/app/app_test.go b/app/app_test.go index 52f37aa..c137a1c 100644 --- a/app/app_test.go +++ b/app/app_test.go @@ -4,7 +4,7 @@ import ( "testing" sdk "github.com/cosmos/cosmos-sdk/types" - types2 "github.com/cosmos/cosmos-sdk/x/bank/types" + banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/gogo/protobuf/proto" prototypes "github.com/gogo/protobuf/types" "github.com/stretchr/testify/require" @@ -19,7 +19,7 @@ func TestBeginBlocker(t *testing.T) { ChainID: "testchain_9000-1", }) - bankSend := &types2.MsgSend{ + bankSend := &banktypes.MsgSend{ FromAddress: valAccount.GetAddress().String(), ToAddress: valAccount.GetAddress().String(), Amount: sdk.NewCoins(sdk.NewCoin("stake", sdk.NewInt(100))), @@ -28,7 +28,7 @@ func TestBeginBlocker(t *testing.T) { require.NoError(t, err) goodMessage := &prototypes.Any{ - TypeUrl: proto.MessageName(&types2.MsgSend{}), + TypeUrl: proto.MessageName(&banktypes.MsgSend{}), Value: msgBz, } From 418b9b54e185bcdc118f9a1f25eacf1a2ca4e78e Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Fri, 4 Oct 2024 08:55:15 +0200 Subject: [PATCH 4/7] goimports --- app/test_helpers.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/test_helpers.go b/app/test_helpers.go index 108c344..d761fe3 100644 --- a/app/test_helpers.go +++ b/app/test_helpers.go @@ -3,6 +3,9 @@ package app import ( "encoding/json" "fmt" + "testing" + "time" + appcodec "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/crypto/codec" @@ -20,8 +23,6 @@ import ( tmproto "github.com/tendermint/tendermint/proto/tendermint/types" types2 "github.com/tendermint/tendermint/types" dbm "github.com/tendermint/tm-db" - "testing" - "time" "github.com/stretchr/testify/require" abci "github.com/tendermint/tendermint/abci/types" From 3a4370f15bea3723e5596bb701e88b0e00493a6f Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Wed, 9 Oct 2024 09:42:14 +0200 Subject: [PATCH 5/7] use process consensus messages from rdk --- app/app.go | 77 ++++++------------------------------------------------ 1 file changed, 8 insertions(+), 69 deletions(-) diff --git a/app/app.go b/app/app.go index cf03f83..a811713 100644 --- a/app/app.go +++ b/app/app.go @@ -15,7 +15,6 @@ import ( gaslesskeeper "github.com/dymensionxyz/dymension-rdk/x/gasless/keeper" gaslesstypes "github.com/dymensionxyz/dymension-rdk/x/gasless/types" "github.com/gogo/protobuf/proto" - prototypes "github.com/gogo/protobuf/types" "github.com/gorilla/mux" "github.com/rakyll/statik/fs" abci "github.com/tendermint/tendermint/abci/types" @@ -834,7 +833,7 @@ func NewRollapp( app.setPostHandler() // Admission handler for consensus messages - app.setAdmissionHandler(consensus.MapAdmissionHandler([]string{ + app.setAdmissionHandler(consensus.AllowedMessagesHandler([]string{ proto.MessageName(&banktypes.MsgSend{}), })) @@ -900,7 +899,13 @@ func (app *App) Name() string { return app.BaseApp.Name() } // BeginBlocker application updates every begin block func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.ResponseBeginBlock { - consensusResponses := app.processConsensusMessage(ctx, req.ConsensusMessages) + consensusResponses := consensus.ProcessConsensusMessages( + ctx, + app.appCodec, + app.consensusMessageAdmissionHandler, + app.MsgServiceRouter(), + req.ConsensusMessages, + ) resp := app.mm.BeginBlock(ctx, req) resp.ConsensusMessagesResponses = consensusResponses @@ -908,72 +913,6 @@ func (app *App) BeginBlocker(ctx sdk.Context, req abci.RequestBeginBlock) abci.R return resp } -func (app *App) processConsensusMessage(ctx sdk.Context, consensusMsgs []*prototypes.Any) []*abci.ConsensusMessageResponse { - var responses []*abci.ConsensusMessageResponse - - for _, anyMsg := range consensusMsgs { - sdkAny := &types.Any{ - TypeUrl: "/" + anyMsg.TypeUrl, - Value: anyMsg.Value, - } - - var msg sdk.Msg - err := app.appCodec.UnpackAny(sdkAny, &msg) - if err != nil { - responses = append(responses, &abci.ConsensusMessageResponse{ - Response: &abci.ConsensusMessageResponse_Error{ - Error: fmt.Errorf("failed to unpack consensus message: %w", err).Error(), - }, - }) - - continue - } - - cacheCtx, writeCache := ctx.CacheContext() - err = app.consensusMessageAdmissionHandler(cacheCtx, msg) - if err != nil { - responses = append(responses, &abci.ConsensusMessageResponse{ - Response: &abci.ConsensusMessageResponse_Error{ - Error: fmt.Errorf("consensus message admission failed: %w", err).Error(), - }, - }) - - continue - } - - resp, err := app.MsgServiceRouter().Handler(msg)(ctx, msg) - if err != nil { - responses = append(responses, &abci.ConsensusMessageResponse{ - Response: &abci.ConsensusMessageResponse_Error{ - Error: fmt.Errorf("failed to execute consensus message: %w", err).Error(), - }, - }) - - continue - } - - theType, err := proto.Marshal(resp) - if err != nil { - return nil - } - - anyResp := &prototypes.Any{ - TypeUrl: proto.MessageName(resp), - Value: theType, - } - - responses = append(responses, &abci.ConsensusMessageResponse{ - Response: &abci.ConsensusMessageResponse_Ok{ - Ok: anyResp, - }, - }) - - writeCache() - } - - return responses -} - // EndBlocker application updates every end block func (app *App) EndBlocker(ctx sdk.Context, req abci.RequestEndBlock) abci.ResponseEndBlock { rollappparams := app.RollappParamsKeeper.GetParams(ctx) From 7cb61d728c164c03e03af44c0dbb72810cd010e0 Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Sun, 20 Oct 2024 21:27:55 +0200 Subject: [PATCH 6/7] use last cometbft --- go.mod | 2 +- go.sum | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index b65e07d..2f8e61e 100644 --- a/go.mod +++ b/go.mod @@ -361,5 +361,5 @@ replace ( // replace broken goleveldb github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.20210819022825-2ae1ddf74ef7 // use cometbft - github.com/tendermint/tendermint => ../cometbft + github.com/tendermint/tendermint => github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f ) diff --git a/go.sum b/go.sum index 5d8647c..0785f38 100644 --- a/go.sum +++ b/go.sum @@ -566,6 +566,8 @@ github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkp github.com/dustin/go-humanize v1.0.1/go.mod h1:Mu1zIs6XwVuF/gI1OepvI0qD18qycQx+mFykh5fBlto= github.com/dvsekhvalnov/jose2go v1.5.0 h1:3j8ya4Z4kMCwT5nXIKFSV84YS+HdqSSO0VsTQxaLAeM= github.com/dvsekhvalnov/jose2go v1.5.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= +github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f h1:CclWJWRydsd8D4/R1IegIkcWtL4wqTA3MWtXrx1a6y4= +github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s= github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d h1:YZ49Dd17SA//VBTKVncav7DhV5VE6M9n4a9Slm/hQeM= From 7760b3e89c19f97440c90f43a2005658c268e80c Mon Sep 17 00:00:00 2001 From: Faulty Tolly <@faulttolerance.net> Date: Sun, 20 Oct 2024 21:30:22 +0200 Subject: [PATCH 7/7] use also real rdk --- go.mod | 33 +++++++++++++++-------------- go.sum | 65 ++++++++++++++++++++++++++++++---------------------------- 2 files changed, 50 insertions(+), 48 deletions(-) diff --git a/go.mod b/go.mod index 2f8e61e..8ca30af 100644 --- a/go.mod +++ b/go.mod @@ -15,8 +15,8 @@ require ( github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/v6 v6.3.0 github.com/dvsekhvalnov/jose2go v1.5.0 - github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241009122948-623826e0daa4 - github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d + github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241020152926-b250db7af580 + github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241015102238-a827c3784461 github.com/ethereum/go-ethereum v1.12.0 github.com/evmos/evmos/v12 v12.1.6 github.com/gogo/protobuf v1.3.3 @@ -27,7 +27,7 @@ require ( github.com/prometheus/client_golang v1.18.0 github.com/rakyll/statik v0.1.7 github.com/spf13/cast v1.5.1 - github.com/spf13/cobra v1.8.0 + github.com/spf13/cobra v1.8.1 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 github.com/tendermint/tendermint v0.34.29 @@ -78,7 +78,7 @@ require ( github.com/cenkalti/backoff/v4 v4.2.1 // indirect github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.12 // indirect github.com/cespare/xxhash v1.1.0 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect @@ -111,7 +111,8 @@ require ( github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect github.com/dgraph-io/badger/v2 v2.2007.4 // indirect github.com/dgraph-io/badger/v3 v3.2103.3 // indirect - github.com/dgraph-io/ristretto v0.1.1 // indirect + github.com/dgraph-io/badger/v4 v4.3.0 // indirect + github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dlclark/regexp2 v1.4.1-0.20201116162257-a2a8dda75c91 // indirect github.com/docker/distribution v2.8.2+incompatible // indirect @@ -143,7 +144,6 @@ require ( github.com/godbus/dbus v0.0.0-20190726142602-4481cbc300e2 // indirect github.com/godbus/dbus/v5 v5.1.0 // indirect github.com/gogo/gateway v1.1.0 // indirect - github.com/golang/glog v1.2.0 // indirect github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect github.com/golang/snappy v0.0.5-0.20220116011046-fa5810519dcb // indirect github.com/google/btree v1.1.2 // indirect @@ -203,7 +203,7 @@ require ( github.com/jbenet/goprocess v0.1.4 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.6 // indirect + github.com/klauspost/compress v1.17.9 // indirect github.com/klauspost/cpuid/v2 v2.2.7 // indirect github.com/klauspost/reedsolomon v1.11.8 // indirect github.com/koron/go-ssdp v0.0.4 // indirect @@ -317,17 +317,17 @@ require ( go.uber.org/mock v0.4.0 // indirect go.uber.org/multierr v1.11.0 // indirect go.uber.org/zap v1.27.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240213143201-ec583247a57a // indirect - golang.org/x/mod v0.15.0 // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/crypto v0.28.0 // indirect + golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c // indirect + golang.org/x/mod v0.21.0 // indirect + golang.org/x/net v0.30.0 // indirect golang.org/x/oauth2 v0.18.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.19.0 // indirect - golang.org/x/term v0.19.0 // indirect - golang.org/x/text v0.14.0 // indirect + golang.org/x/sync v0.8.0 // indirect + golang.org/x/sys v0.26.0 // indirect + golang.org/x/term v0.25.0 // indirect + golang.org/x/text v0.19.0 // indirect golang.org/x/time v0.5.0 // indirect - golang.org/x/tools v0.18.0 // indirect + golang.org/x/tools v0.26.0 // indirect golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect gonum.org/v1/gonum v0.14.0 // indirect google.golang.org/api v0.169.0 // indirect @@ -349,7 +349,6 @@ replace ( github.com/CosmWasm/wasmd => github.com/decentrio/wasmd v0.33.0-sdk46.2 github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/availproject/go-substrate-rpc-client/v4 v4.0.12-avail-1.4.0-rc1-5e286e3 github.com/confio/ics23/go => github.com/cosmos/cosmos-sdk/ics23/go v0.8.0 - github.com/dymensionxyz/dymension-rdk => ../dymension-rdk // use Evmos geth fork github.com/ethereum/go-ethereum => github.com/evmos/go-ethereum v1.10.26 github.com/evmos/evmos/v12 => github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 diff --git a/go.sum b/go.sum index 0785f38..73660bb 100644 --- a/go.sum +++ b/go.sum @@ -391,8 +391,8 @@ github.com/cespare/cp v0.1.0/go.mod h1:SOGHArjBr4JWaSDEVpWpo/hNg6RoKrls6Oh40hiwW github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= -github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= @@ -489,8 +489,8 @@ github.com/cpuguy83/go-md2man v1.0.10/go.mod h1:SmD6nW6nTyfqj6ABTjUi3V3JVMnlJmwc github.com/cpuguy83/go-md2man/v2 v2.0.0-20190314233015-f79a8a8ca69d/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= -github.com/cpuguy83/go-md2man/v2 v2.0.3 h1:qMCsGGgs+MAzDFyp9LpAe1Lqy/fY/qCovCm0qnXZOBM= -github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= +github.com/cpuguy83/go-md2man/v2 v2.0.4 h1:wfIWP927BUkWJb2NmU/kNDYIBTh/ziUX91+lVfRxZq4= +github.com/cpuguy83/go-md2man/v2 v2.0.4/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creachadair/taskgroup v0.3.2 h1:zlfutDS+5XG40AOxcHDSThxKzns8Tnr9jnr6VqkYlkM= github.com/creachadair/taskgroup v0.3.2/go.mod h1:wieWwecHVzsidg2CsUnFinW1faVN4+kq+TDlRJQ0Wbk= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= @@ -531,10 +531,13 @@ github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdw github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= github.com/dgraph-io/badger/v3 v3.2103.3 h1:s63J1pisDhKpzWslXFe+ChuthuZptpwTE6qEKoczPb4= github.com/dgraph-io/badger/v3 v3.2103.3/go.mod h1:4MPiseMeDQ3FNCYwRbbcBOGJLf5jsE0PPFzRiKjtcdw= +github.com/dgraph-io/badger/v4 v4.3.0 h1:lcsCE1/1qrRhqP+zYx6xDZb8n7U+QlwNicpc676Ub40= +github.com/dgraph-io/badger/v4 v4.3.0/go.mod h1:Sc0T595g8zqAQRDf44n+z3wG4BOqLwceaFntt8KPxUM= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= github.com/dgraph-io/ristretto v0.0.3/go.mod h1:KPxhHT9ZxKefz+PCeOGsrHpl1qZ7i70dGTu2u+Ahh6E= -github.com/dgraph-io/ristretto v0.1.1 h1:6CWw5tJNgpegArSHpNHJKldNeq03FQCwYvfMVWajOK8= github.com/dgraph-io/ristretto v0.1.1/go.mod h1:S1GPSBCYCIhmVNfcth17y2zZtQT6wzkzgwUve0VDWWA= +github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91 h1:Pux6+xANi0I7RRo5E1gflI4EZ2yx3BGZ75JkAIvGEOA= +github.com/dgraph-io/ristretto v0.1.2-0.20240116140435-c67e07994f91/go.mod h1:swkazRqnUf1N62d0Nutz7KIj2UKqsm/H8tD0nBJAXqM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-farm v0.0.0-20190423205320-6a90982ecee2/go.mod h1:SqUrOPUnsFjfmXRMNPybcSiG0BgUW2AuFH8PAnS2iTw= @@ -570,8 +573,10 @@ github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f h1:CclWJ github.com/dymensionxyz/cometbft v0.34.29-0.20241008141942-63af9d24107f/go.mod h1:L9shMfbkZ8B+7JlwANEr+NZbBcn+hBpwdbeYvA5rLCw= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13 h1:u5yeve5jZR6TdRjjR+vYT/8PWKbhwCZxUmAu+/Tnxyg= github.com/dymensionxyz/cosmosclient v0.4.2-beta.0.20240821081230-b4018b2bac13/go.mod h1:jabDQYXrccscSE0fXkh7eQFYPWJCRiuWKonFGObVq6s= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d h1:YZ49Dd17SA//VBTKVncav7DhV5VE6M9n4a9Slm/hQeM= -github.com/dymensionxyz/dymint v1.2.0-rc01.0.20240919105350-66f9b353655d/go.mod h1:eEUBqDHi7EiO3CK1Fqct5joa5UeNzcEDJnXzvXuP5oA= +github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241020152926-b250db7af580 h1:bgECFCjc/8lVq9/UQ4qCTdD/znUgKEX7a0QBOcGuuNg= +github.com/dymensionxyz/dymension-rdk v1.6.1-0.20241020152926-b250db7af580/go.mod h1:m9D/CACMkMAXKFeuU+1lkUIPWpMFb0EvGl7M5vV0HoA= +github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241015102238-a827c3784461 h1:ZNh5s2dmfcgPE9g6OlhHBFtygiAxCRr+wPKSgpSo/Bw= +github.com/dymensionxyz/dymint v1.2.0-rc01.0.20241015102238-a827c3784461/go.mod h1:FNVdsvVhveAOeL0Mj9VIfGkAUKhGskEr0iRnoM+MAkU= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2 h1:aVP3off7u2vsvRH7lHAUPTLdf9/AfnzC/rvvi0wC/co= github.com/dymensionxyz/evmos/v12 v12.1.6-dymension-v0.4.2/go.mod h1:CI6D89pkoiIm4BjoMFNnEaCLdKBEobLuwvhS0c1zh7Y= github.com/dymensionxyz/gerr-cosmos v1.0.0 h1:oi91rgOkpJWr41oX9JOyjvvBnhGY54tj513x8VlDAEc= @@ -729,8 +734,6 @@ github.com/golang-jwt/jwt/v4 v4.3.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzw github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/glog v1.2.0 h1:uCdmnmatrKCgMBlM4rMuJZWOkPDqdbZPnrMXDY4gI68= -github.com/golang/glog v1.2.0/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= @@ -1073,8 +1076,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.6 h1:60eq2E/jlfwQXtvZEeBUYADs+BwKBWURIY+Gj2eRGjI= -github.com/klauspost/compress v1.17.6/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.9 h1:6KIumPrER1LHsvBVuDa0r5xaG0Es51mhhB9BQB2qeMA= +github.com/klauspost/compress v1.17.9/go.mod h1:Di0epgTjJY877eYKx5yC51cX2A2Vl2ibi7bDH9ttBbw= github.com/klauspost/cpuid v0.0.0-20170728055534-ae7887de9fa5/go.mod h1:Pj4uuM528wm8OyEC2QMXAi2YiTZ96dNQPGgoMS4s3ek= github.com/klauspost/cpuid/v2 v2.2.7 h1:ZWSB3igEs+d0qvnxR/ZBzXVmxkgt8DdzP6m9pfuVLDM= github.com/klauspost/cpuid/v2 v2.2.7/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws= @@ -1507,8 +1510,8 @@ github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ= github.com/spf13/cobra v0.0.5/go.mod h1:3K3wKZymM7VvHMDS9+Akkh4K60UwM26emMESw8tLCHU= -github.com/spf13/cobra v1.8.0 h1:7aJaZx1B85qltLMc546zn58BxxfZdR/W22ej9CFoEf0= -github.com/spf13/cobra v1.8.0/go.mod h1:WXLWApfZ71AjXPya3WOlMsY9yMs7YeiHhFVlvLyhcho= +github.com/spf13/cobra v1.8.1 h1:e5/vxKd/rZsfSJMUX1agtjeTDf+qv1/JdBF8gg5k9ZM= +github.com/spf13/cobra v1.8.1/go.mod h1:wHxEcudfqmLYa8iTfL+OuZPbBZkmvliBWKIezN3kD9Y= github.com/spf13/jwalterweatherman v1.0.0/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= @@ -1735,8 +1738,8 @@ golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm golang.org/x/crypto v0.0.0-20210711020723-a769d52b0f97/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= +golang.org/x/crypto v0.28.0 h1:GBDwsMXVQi34v5CCYUm2jkJvu4cbtru2U4TN2PSyQnw= +golang.org/x/crypto v0.28.0/go.mod h1:rmgy+3RHxRZMyY0jjAJShp2zgEdOqj2AO7U0pYmeQ7U= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -1752,8 +1755,8 @@ golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EH golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= golang.org/x/exp v0.0.0-20220426173459-3bcf042a4bf5/go.mod h1:lgLbSvA5ygNOMpwM/9anMpWVlVJ7Z+cHWq/eFuinpGE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a h1:HinSgX1tJRX3KsL//Gxynpw5CTOAIPhgL4W8PNiIpVE= -golang.org/x/exp v0.0.0-20240213143201-ec583247a57a/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c h1:7dEasQXItcW1xKJ2+gg5VOiBnqWrJc+rq0DPKyvvdbY= +golang.org/x/exp v0.0.0-20241009180824-f66d83c29e7c/go.mod h1:NQtJDoLvd6faHhE7m4T/1IY708gDefGGjR/iUW8yQQ8= golang.org/x/image v0.0.0-20180708004352-c73c2afc3b81/go.mod h1:ux5Hcp/YLpHSI86hEcLt0YII63i6oz57MZXIpbrjZUs= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= @@ -1784,8 +1787,8 @@ golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.5.1/go.mod h1:5OXOZSfqPIIbmVBIIKWRFfZjPR0E5r58TLhUjH0a2Ro= golang.org/x/mod v0.6.0-dev.0.20211013180041-c96bc1413d57/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= -golang.org/x/mod v0.15.0 h1:SernR4v+D55NyBH2QiEQrlBAnj1ECL6AGrA5+dPaMY8= -golang.org/x/mod v0.15.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= +golang.org/x/mod v0.21.0 h1:vvrHzRwRfVKSiLrG+d4FMl/Qi4ukBCE6kZlTUkDYRT0= +golang.org/x/mod v0.21.0/go.mod h1:6SkKJ3Xj0I0BrPOZoBy3bdMptDDU9oJrpohJ3eWZ1fY= golang.org/x/net v0.0.0-20180719180050-a680a1efc54d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1854,8 +1857,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.0.0-20220909164309-bea034e7d591/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.0.0-20221014081412-f15817d10f9b/go.mod h1:YDH+HFinaLZZlnHAfSS6ZXJJ9M9t4Dl22yv3iI2vPwk= golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.30.0 h1:AcW1SDZMkb8IpzCdQUaIq2sP4sZ4zw+55h6ynffypl4= +golang.org/x/net v0.30.0/go.mod h1:2wGyMJ5iFasEhkwi13ChkO/t1ECNC4X4eBKkVFyYFlU= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181017192945-9dcd33a902f4/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20181203162652-d668ce993890/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= @@ -1900,8 +1903,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ= +golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180810173357-98c5dad5d1a0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -2019,14 +2022,14 @@ golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.26.0 h1:KHjCJyddX0LoSTb3J+vWpupP9p0oznkqVk/IfjymZbo= +golang.org/x/sys v0.26.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/term v0.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= -golang.org/x/term v0.19.0 h1:+ThwsDv+tYfnJFhF4L8jITxu1tdTWRTZpdsWgEgjL6Q= -golang.org/x/term v0.19.0/go.mod h1:2CuTdWZ7KHSQwUzKva0cbMg6q2DMI3Mmxp+gKJbskEk= +golang.org/x/term v0.25.0 h1:WtHI/ltw4NvSUig5KARz9h521QvRC8RmF/cuYqifU24= +golang.org/x/term v0.25.0/go.mod h1:RPyXicDX+6vLxogjjRxjgD2TKtmAO6NZBsBRfrOLu7M= golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -2038,8 +2041,8 @@ golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/text v0.3.8/go.mod h1:E6s5w1FMmriuDzIBO73fBruAKo1PCIq6d2Q6DHfQ8WQ= golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= -golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +golang.org/x/text v0.19.0 h1:kTxAhCbGbxhK0IwgSKiMO5awPoDQ0RpfiVYBfK860YM= +golang.org/x/text v0.19.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= golang.org/x/time v0.0.0-20180412165947-fbb02b2291d2/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= @@ -2115,8 +2118,8 @@ golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.8-0.20211029000441-d6a9af8af023/go.mod h1:nABZi5QlRsZVlzPpHl034qft6wpY4eDcsTt5AaioBiU= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= -golang.org/x/tools v0.18.0 h1:k8NLag8AGHnn+PHbl7g43CtqZAwG60vZkLqgyZgIHgQ= -golang.org/x/tools v0.18.0/go.mod h1:GL7B4CwcLLeo59yx/9UWWuNOW1n3VZ4f5axWfML7Lcg= +golang.org/x/tools v0.26.0 h1:v/60pFQmzmT9ExmjDv2gGIfi3OqfKoEP6I5+umXlbnQ= +golang.org/x/tools v0.26.0/go.mod h1:TPVVj70c7JJ3WCazhD8OdXcZg/og+b9+tH/KxylGwH0= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=