From d78c893dcfcf0adcf58dc2473921330d386f7dfe Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 22 Mar 2024 09:14:32 +0800 Subject: [PATCH 01/37] Problem: parallel tx execution is not supported (#205) add basic support in sdk: - add a TxExecutor baseapp option - add TxIndex/TxCount/MsgIndex in context Update CHANGELOG.md Signed-off-by: yihuang fix misspell fix lint run gci fix lint gci seems not compatible with gofumpt --- .golangci.yml | 9 ---- CHANGELOG.md | 8 +++- baseapp/abci.go | 91 ++++++++++++++++++++++++++--------------- baseapp/baseapp.go | 27 +++++++++--- baseapp/genesis.go | 2 +- baseapp/options.go | 10 +++++ baseapp/test_helpers.go | 4 +- baseapp/txexecutor.go | 16 ++++++++ types/context.go | 35 ++++++++++++++++ 9 files changed, 151 insertions(+), 51 deletions(-) create mode 100644 baseapp/txexecutor.go diff --git a/.golangci.yml b/.golangci.yml index 3f61e47a961e..7f51609abf1d 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -20,7 +20,6 @@ linters: - exportloopref - goconst - gocritic - - gci - gofumpt - gosec - gosimple @@ -63,14 +62,6 @@ issues: max-same-issues: 10000 linters-settings: - gci: - custom-order: true - sections: - - standard # Standard section: captures all standard packages. - - default # Default section: contains all imports that could not be matched to another section type. - - prefix(cosmossdk.io) - - prefix(github.com/cosmos/cosmos-sdk) - gosec: # To select a subset of rules to run. # Available rules: https://github.com/securego/gosec#available-rules diff --git a/CHANGELOG.md b/CHANGELOG.md index ec5b80873dff..cb45d1180abe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -38,7 +38,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] -## Bug Fixes +### Features + +* (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Add `TxExecutor` baseapp option, add `TxIndex`/`TxCount`/`MsgIndex`/`BlockGasUsed` fields to `Context, to support tx parallel execution. + +## [Unreleased-Upstream] + +### Bug Fixes * (crypto) [#19691](https://github.com/cosmos/cosmos-sdk/pull/19745) Fix tx sign doesn't throw an error when incorrect Ledger is used. diff --git a/baseapp/abci.go b/baseapp/abci.go index f80d4e2c3ab7..04ef73f002f4 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -336,11 +336,11 @@ func (app *BaseApp) ApplySnapshotChunk(req *abci.RequestApplySnapshotChunk) (*ab func (app *BaseApp) CheckTx(req *abci.RequestCheckTx) (*abci.ResponseCheckTx, error) { var mode execMode - switch { - case req.Type == abci.CheckTxType_New: + switch req.Type { + case abci.CheckTxType_New: mode = execModeCheck - case req.Type == abci.CheckTxType_Recheck: + case abci.CheckTxType_Recheck: mode = execModeReCheck default: @@ -775,48 +775,34 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request // Reset the gas meter so that the AnteHandlers aren't required to gasMeter = app.getBlockGasMeter(app.finalizeBlockState.Context()) - app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) + app.finalizeBlockState.SetContext( + app.finalizeBlockState.Context(). + WithBlockGasMeter(gasMeter). + WithTxCount(len(req.Txs)), + ) // Iterate over all raw transactions in the proposal and attempt to execute // them, gathering the execution results. // // NOTE: Not all raw transactions may adhere to the sdk.Tx interface, e.g. // vote extensions, so skip those. - txResults := make([]*abci.ExecTxResult, 0, len(req.Txs)) - for _, rawTx := range req.Txs { - var response *abci.ExecTxResult - - if _, err := app.txDecoder(rawTx); err == nil { - response = app.deliverTx(rawTx) - } else { - // In the case where a transaction included in a block proposal is malformed, - // we still want to return a default response to comet. This is because comet - // expects a response for each transaction included in a block proposal. - response = sdkerrors.ResponseExecTxResultWithEvents( - sdkerrors.ErrTxDecode, - 0, - 0, - nil, - false, - ) - } - - // check after every tx if we should abort - select { - case <-ctx.Done(): - return nil, ctx.Err() - default: - // continue - } - - txResults = append(txResults, response) + txResults, err := app.executeTxs(ctx, req.Txs) + if err != nil { + // usually due to canceled + return nil, err } if app.finalizeBlockState.ms.TracingEnabled() { app.finalizeBlockState.ms = app.finalizeBlockState.ms.SetTracingContext(nil).(storetypes.CacheMultiStore) } - endBlock, err := app.endBlock(app.finalizeBlockState.Context()) + var blockGasUsed uint64 + for _, res := range txResults { + blockGasUsed += uint64(res.GasUsed) + } + sdkCtx := app.finalizeBlockState.Context().WithBlockGasUsed(blockGasUsed) + + endBlock, err := app.endBlock(sdkCtx) if err != nil { return nil, err } @@ -840,6 +826,45 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request }, nil } +func (app *BaseApp) executeTxs(ctx context.Context, txs [][]byte) ([]*abci.ExecTxResult, error) { + if app.txExecutor != nil { + return app.txExecutor(ctx, len(txs), app.finalizeBlockState.ms, func(i int, ms storetypes.MultiStore) *abci.ExecTxResult { + return app.deliverTxWithMultiStore(txs[i], i, ms) + }) + } + + txResults := make([]*abci.ExecTxResult, 0, len(txs)) + for i, rawTx := range txs { + var response *abci.ExecTxResult + + if _, err := app.txDecoder(rawTx); err == nil { + response = app.deliverTx(rawTx, i) + } else { + // In the case where a transaction included in a block proposal is malformed, + // we still want to return a default response to comet. This is because comet + // expects a response for each transaction included in a block proposal. + response = sdkerrors.ResponseExecTxResultWithEvents( + sdkerrors.ErrTxDecode, + 0, + 0, + nil, + false, + ) + } + + // check after every tx if we should abort + select { + case <-ctx.Done(): + return nil, ctx.Err() + default: + // continue + } + + txResults = append(txResults, response) + } + return txResults, nil +} + // FinalizeBlock will execute the block proposal provided by RequestFinalizeBlock. // Specifically, it will execute an application's BeginBlock (if defined), followed // by the transactions in the proposal, finally followed by the application's diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index c7e6e616f497..998cd19fa25b 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -193,6 +193,9 @@ type BaseApp struct { // // SAFETY: it's safe to do if validators validate the total gas wanted in the `ProcessProposal`, which is the case in the default handler. disableBlockGasMeter bool + + // Optional alternative tx executor, used for block-stm parallel transaction execution. + txExecutor TxExecutor } // NewBaseApp returns a reference to an initialized BaseApp. It accepts a @@ -659,13 +662,14 @@ func (app *BaseApp) getBlockGasMeter(ctx sdk.Context) storetypes.GasMeter { } // retrieve the context for the tx w/ txBytes and other memoized values. -func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context { +func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte, txIndex int) sdk.Context { modeState := app.getState(mode) if modeState == nil { panic(fmt.Sprintf("state is nil for mode %v", mode)) } ctx := modeState.Context(). - WithTxBytes(txBytes) + WithTxBytes(txBytes). + WithTxIndex(txIndex) // WithVoteInfos(app.voteInfos) // TODO: identify if this is needed ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) @@ -746,7 +750,11 @@ func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) (sdk.BeginBlock, return resp, nil } -func (app *BaseApp) deliverTx(tx []byte) *abci.ExecTxResult { +func (app *BaseApp) deliverTx(tx []byte, txIndex int) *abci.ExecTxResult { + return app.deliverTxWithMultiStore(tx, txIndex, nil) +} + +func (app *BaseApp) deliverTxWithMultiStore(tx []byte, txIndex int, txMultiStore storetypes.MultiStore) *abci.ExecTxResult { gInfo := sdk.GasInfo{} resultStr := "successful" @@ -759,7 +767,7 @@ func (app *BaseApp) deliverTx(tx []byte) *abci.ExecTxResult { telemetry.SetGauge(float32(gInfo.GasWanted), "tx", "gas", "wanted") }() - gInfo, result, anteEvents, err := app.runTx(execModeFinalize, tx) + gInfo, result, anteEvents, err := app.runTxWithMultiStore(execModeFinalize, tx, txIndex, txMultiStore) if err != nil { resultStr = "failed" resp = sdkerrors.ResponseExecTxResultWithEvents( @@ -817,12 +825,19 @@ func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) { // returned if the tx does not run out of gas and if all the messages are valid // and execute successfully. An error is returned otherwise. func (app *BaseApp) runTx(mode execMode, txBytes []byte) (gInfo sdk.GasInfo, result *sdk.Result, anteEvents []abci.Event, err error) { + return app.runTxWithMultiStore(mode, txBytes, -1, nil) +} + +func (app *BaseApp) runTxWithMultiStore(mode execMode, txBytes []byte, txIndex int, txMultiStore storetypes.MultiStore) (gInfo sdk.GasInfo, result *sdk.Result, anteEvents []abci.Event, err error) { // NOTE: GasWanted should be returned by the AnteHandler. GasUsed is // determined by the GasMeter. We need access to the context to get the gas // meter, so we initialize upfront. var gasWanted uint64 - ctx := app.getContextForTx(mode, txBytes) + ctx := app.getContextForTx(mode, txBytes, txIndex) + if txMultiStore != nil { + ctx = ctx.WithMultiStore(txMultiStore) + } ms := ctx.MultiStore() // only run the tx if there is block gas remaining @@ -1000,6 +1015,8 @@ func (app *BaseApp) runMsgs(ctx sdk.Context, msgs []sdk.Msg, msgsV2 []protov2.Me break } + ctx = ctx.WithMsgIndex(i) + handler := app.msgServiceRouter.Handler(msg) if handler == nil { return nil, errorsmod.Wrapf(sdkerrors.ErrUnknownRequest, "no message handler found for %T", msg) diff --git a/baseapp/genesis.go b/baseapp/genesis.go index 4a6b0082b656..e9f611772e08 100644 --- a/baseapp/genesis.go +++ b/baseapp/genesis.go @@ -13,7 +13,7 @@ var _ genesis.TxHandler = (*BaseApp)(nil) // ExecuteGenesisTx implements genesis.GenesisState from // cosmossdk.io/core/genesis to set initial state in genesis func (ba BaseApp) ExecuteGenesisTx(tx []byte) error { - res := ba.deliverTx(tx) + res := ba.deliverTx(tx, -1) if res.Code != types.CodeTypeOK { return errors.New(res.Log) diff --git a/baseapp/options.go b/baseapp/options.go index 08cbf77ee297..13f5c9afb580 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -122,6 +122,11 @@ func DisableBlockGasMeter() func(*BaseApp) { return func(app *BaseApp) { app.SetDisableBlockGasMeter(true) } } +// SetTxExecutor sets a custom tx executor for the BaseApp, usually for parallel execution. +func SetTxExecutor(executor TxExecutor) func(*BaseApp) { + return func(app *BaseApp) { app.txExecutor = executor } +} + func (app *BaseApp) SetName(name string) { if app.sealed { panic("SetName() on sealed BaseApp") @@ -372,3 +377,8 @@ func (app *BaseApp) SetStreamingManager(manager storetypes.StreamingManager) { func (app *BaseApp) SetDisableBlockGasMeter(disableBlockGasMeter bool) { app.disableBlockGasMeter = disableBlockGasMeter } + +// SetTxExecutor sets a custom tx executor for the BaseApp, usually for parallel execution. +func (app *BaseApp) SetTxExecutor(executor TxExecutor) { + app.txExecutor = executor +} diff --git a/baseapp/test_helpers.go b/baseapp/test_helpers.go index db603f2f2982..53fd891c4823 100644 --- a/baseapp/test_helpers.go +++ b/baseapp/test_helpers.go @@ -70,9 +70,9 @@ func (app *BaseApp) NewUncachedContext(isCheckTx bool, header cmtproto.Header) s } func (app *BaseApp) GetContextForFinalizeBlock(txBytes []byte) sdk.Context { - return app.getContextForTx(execModeFinalize, txBytes) + return app.getContextForTx(execModeFinalize, txBytes, -1) } func (app *BaseApp) GetContextForCheckTx(txBytes []byte) sdk.Context { - return app.getContextForTx(execModeCheck, txBytes) + return app.getContextForTx(execModeCheck, txBytes, -1) } diff --git a/baseapp/txexecutor.go b/baseapp/txexecutor.go new file mode 100644 index 000000000000..230250ce9992 --- /dev/null +++ b/baseapp/txexecutor.go @@ -0,0 +1,16 @@ +package baseapp + +import ( + "context" + + abci "github.com/cometbft/cometbft/abci/types" + + "cosmossdk.io/store/types" +) + +type TxExecutor func( + ctx context.Context, + blockSize int, + cms types.MultiStore, + deliverTxWithMultiStore func(int, types.MultiStore) *abci.ExecTxResult, +) ([]*abci.ExecTxResult, error) diff --git a/types/context.go b/types/context.go index c07689e5b12b..36c5ccdc8094 100644 --- a/types/context.go +++ b/types/context.go @@ -64,6 +64,15 @@ type Context struct { streamingManager storetypes.StreamingManager cometInfo comet.BlockInfo headerInfo header.Info + + // the index of the current tx in the block, -1 means not in finalize block context + txIndex int + // the index of the current msg in the tx, -1 means not in finalize block context + msgIndex int + // the total number of transactions in current block + txCount int + // sum the gas used by all the transactions in the current block, only accessible by end blocker + blockGasUsed uint64 } // Proposed rename, not done to avoid API breakage @@ -91,6 +100,10 @@ func (c Context) TransientKVGasConfig() storetypes.GasConfig { return c.trans func (c Context) StreamingManager() storetypes.StreamingManager { return c.streamingManager } func (c Context) CometInfo() comet.BlockInfo { return c.cometInfo } func (c Context) HeaderInfo() header.Info { return c.headerInfo } +func (c Context) TxIndex() int { return c.txIndex } +func (c Context) MsgIndex() int { return c.msgIndex } +func (c Context) TxCount() int { return c.txCount } +func (c Context) BlockGasUsed() uint64 { return c.blockGasUsed } // clone the header before returning func (c Context) BlockHeader() cmtproto.Header { @@ -137,6 +150,8 @@ func NewContext(ms storetypes.MultiStore, header cmtproto.Header, isCheckTx bool eventManager: NewEventManager(), kvGasConfig: storetypes.KVGasConfig(), transientKVGasConfig: storetypes.TransientGasConfig(), + txIndex: -1, + msgIndex: -1, } } @@ -310,6 +325,26 @@ func (c Context) WithHeaderInfo(headerInfo header.Info) Context { return c } +func (c Context) WithTxIndex(txIndex int) Context { + c.txIndex = txIndex + return c +} + +func (c Context) WithTxCount(txCount int) Context { + c.txCount = txCount + return c +} + +func (c Context) WithMsgIndex(msgIndex int) Context { + c.msgIndex = msgIndex + return c +} + +func (c Context) WithBlockGasUsed(gasUsed uint64) Context { + c.blockGasUsed = gasUsed + return c +} + // TODO: remove??? func (c Context) IsZero() bool { return c.ms == nil From 56cb96c52a1bc32f757438169015cc507d2d3ca5 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 25 Mar 2024 09:34:37 +0800 Subject: [PATCH 02/37] Problem: CacheWrapWithTrace api is not used (#207) Solution: - remove the api changelog --- store/CHANGELOG.md | 6 ++++++ store/cachekv/store.go | 7 ------- store/cachemulti/store.go | 5 ----- store/dbadapter/store.go | 8 -------- store/dbadapter/store_test.go | 3 --- store/gaskv/store.go | 7 ------- store/gaskv/store_test.go | 1 - store/iavl/store.go | 7 ------- store/iavl/store_test.go | 3 --- store/listenkv/store.go | 8 -------- store/listenkv/store_test.go | 5 ----- store/mem/mem_test.go | 3 --- store/mem/store.go | 8 -------- store/prefix/store.go | 7 ------- store/prefix/store_test.go | 3 --- store/rootmulti/store.go | 5 ----- store/rootmulti/store_test.go | 6 ++---- store/tracekv/store.go | 6 ------ store/tracekv/store_test.go | 5 ----- store/types/store.go | 6 ------ 20 files changed, 8 insertions(+), 101 deletions(-) diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index cdd7bb1c59fa..95a55120ae45 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -23,6 +23,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [Unreleased] + +### Improvements + +* [#207](https://github.com/crypto-org-chain/cosmos-sdk/pull/207) Remove api CacheWrapWithTrace. + ## v1.1.0 (March 20, 2024) ### Improvements diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 08cfc2b325f6..9c062c8ce619 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -2,7 +2,6 @@ package cachekv import ( "bytes" - "io" "sort" "sync" @@ -12,7 +11,6 @@ import ( "cosmossdk.io/store/cachekv/internal" "cosmossdk.io/store/internal/conv" "cosmossdk.io/store/internal/kv" - "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" ) @@ -166,11 +164,6 @@ func (store *Store) CacheWrap() types.CacheWrap { return NewStore(store) } -// CacheWrapWithTrace implements the CacheWrapper interface. -func (store *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return NewStore(tracekv.NewStore(store, w, tc)) -} - //---------------------------------------- // Iteration diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 696911370c5d..37fadb7790f2 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -132,11 +132,6 @@ func (cms Store) CacheWrap() types.CacheWrap { return cms.CacheMultiStore().(types.CacheWrap) } -// CacheWrapWithTrace implements the CacheWrapper interface. -func (cms Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { - return cms.CacheWrap() -} - // Implements MultiStore. func (cms Store) CacheMultiStore() types.CacheMultiStore { return newCacheMultiStoreFromCMS(cms) diff --git a/store/dbadapter/store.go b/store/dbadapter/store.go index 013e26df2030..804ed4d38d8b 100644 --- a/store/dbadapter/store.go +++ b/store/dbadapter/store.go @@ -1,12 +1,9 @@ package dbadapter import ( - "io" - dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/store/cachekv" - "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" ) @@ -81,10 +78,5 @@ func (dsa Store) CacheWrap() types.CacheWrap { return cachekv.NewStore(dsa) } -// CacheWrapWithTrace implements KVStore. -func (dsa Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(dsa, w, tc)) -} - // dbm.DB implements KVStore so we can CacheKVStore it. var _ types.KVStore = Store{} diff --git a/store/dbadapter/store_test.go b/store/dbadapter/store_test.go index 9685887f9126..515fd38c2bab 100644 --- a/store/dbadapter/store_test.go +++ b/store/dbadapter/store_test.go @@ -80,7 +80,4 @@ func TestCacheWraps(t *testing.T) { cacheWrapper := store.CacheWrap() require.IsType(t, &cachekv.Store{}, cacheWrapper) - - cacheWrappedWithTrace := store.CacheWrapWithTrace(nil, nil) - require.IsType(t, &cachekv.Store{}, cacheWrappedWithTrace) } diff --git a/store/gaskv/store.go b/store/gaskv/store.go index e0f96af7151e..59247d80008a 100644 --- a/store/gaskv/store.go +++ b/store/gaskv/store.go @@ -1,8 +1,6 @@ package gaskv import ( - "io" - "cosmossdk.io/store/types" ) @@ -87,11 +85,6 @@ func (gs *Store) CacheWrap() types.CacheWrap { panic("cannot CacheWrap a GasKVStore") } -// CacheWrapWithTrace implements the KVStore interface. -func (gs *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { - panic("cannot CacheWrapWithTrace a GasKVStore") -} - func (gs *Store) iterator(start, end []byte, ascending bool) types.Iterator { var parent types.Iterator if ascending { diff --git a/store/gaskv/store_test.go b/store/gaskv/store_test.go index 354832d17c40..d4fd70778cd9 100644 --- a/store/gaskv/store_test.go +++ b/store/gaskv/store_test.go @@ -24,7 +24,6 @@ func TestGasKVStoreBasic(t *testing.T) { require.Equal(t, types.StoreTypeDB, st.GetStoreType()) require.Panics(t, func() { st.CacheWrap() }) - require.Panics(t, func() { st.CacheWrapWithTrace(nil, nil) }) require.Panics(t, func() { st.Set(nil, []byte("value")) }, "setting a nil key should panic") require.Panics(t, func() { st.Set([]byte(""), []byte("value")) }, "setting an empty key should panic") diff --git a/store/iavl/store.go b/store/iavl/store.go index 7bdcb1df9177..e73dcd6c1fdd 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -3,7 +3,6 @@ package iavl import ( "errors" "fmt" - "io" cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" dbm "github.com/cosmos/cosmos-db" @@ -16,7 +15,6 @@ import ( "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" - "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" "cosmossdk.io/store/wrapper" ) @@ -179,11 +177,6 @@ func (st *Store) CacheWrap() types.CacheWrap { return cachekv.NewStore(st) } -// CacheWrapWithTrace implements the Store interface. -func (st *Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(st, w, tc)) -} - // Implements types.KVStore. func (st *Store) Set(key, value []byte) { types.AssertValidKey(key) diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index 7ad24d7fe33d..46d9fa62371c 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -663,9 +663,6 @@ func TestCacheWraps(t *testing.T) { cacheWrapper := store.CacheWrap() require.IsType(t, &cachekv.Store{}, cacheWrapper) - - cacheWrappedWithTrace := store.CacheWrapWithTrace(nil, nil) - require.IsType(t, &cachekv.Store{}, cacheWrappedWithTrace) } func TestChangeSets(t *testing.T) { diff --git a/store/listenkv/store.go b/store/listenkv/store.go index b08a6e395071..343be611b9f0 100644 --- a/store/listenkv/store.go +++ b/store/listenkv/store.go @@ -1,8 +1,6 @@ package listenkv import ( - "io" - "cosmossdk.io/store/types" ) @@ -134,9 +132,3 @@ func (s *Store) GetStoreType() types.StoreType { func (s *Store) CacheWrap() types.CacheWrap { panic("cannot CacheWrap a ListenKVStore") } - -// CacheWrapWithTrace implements the KVStore interface. It panics as a -// Store cannot be cache wrapped. -func (s *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { - panic("cannot CacheWrapWithTrace a ListenKVStore") -} diff --git a/store/listenkv/store_test.go b/store/listenkv/store_test.go index 51b88912c2e1..1f9ca4b2942e 100644 --- a/store/listenkv/store_test.go +++ b/store/listenkv/store_test.go @@ -274,8 +274,3 @@ func TestListenKVStoreCacheWrap(t *testing.T) { store := newEmptyListenKVStore(nil) require.Panics(t, func() { store.CacheWrap() }) } - -func TestListenKVStoreCacheWrapWithTrace(t *testing.T) { - store := newEmptyListenKVStore(nil) - require.Panics(t, func() { store.CacheWrapWithTrace(nil, nil) }) -} diff --git a/store/mem/mem_test.go b/store/mem/mem_test.go index 6595b45dce17..23eb731fe648 100644 --- a/store/mem/mem_test.go +++ b/store/mem/mem_test.go @@ -30,9 +30,6 @@ func TestStore(t *testing.T) { cacheWrapper := db.CacheWrap() require.IsType(t, &cachekv.Store{}, cacheWrapper) - - cacheWrappedWithTrace := db.CacheWrapWithTrace(nil, nil) - require.IsType(t, &cachekv.Store{}, cacheWrappedWithTrace) } func TestCommit(t *testing.T) { diff --git a/store/mem/store.go b/store/mem/store.go index b819d7536302..2b2bc228ddcd 100644 --- a/store/mem/store.go +++ b/store/mem/store.go @@ -1,14 +1,11 @@ package mem import ( - "io" - dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/store/cachekv" "cosmossdk.io/store/dbadapter" pruningtypes "cosmossdk.io/store/pruning/types" - "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" ) @@ -41,11 +38,6 @@ func (s Store) CacheWrap() types.CacheWrap { return cachekv.NewStore(s) } -// CacheWrapWithTrace implements KVStore. -func (s Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(s, w, tc)) -} - // Commit performs a no-op as entries are persistent between commitments. func (s *Store) Commit() (id types.CommitID) { return } diff --git a/store/prefix/store.go b/store/prefix/store.go index 32b9e8247e2c..10f50b3ea795 100644 --- a/store/prefix/store.go +++ b/store/prefix/store.go @@ -3,10 +3,8 @@ package prefix import ( "bytes" "errors" - "io" "cosmossdk.io/store/cachekv" - "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" ) @@ -52,11 +50,6 @@ func (s Store) CacheWrap() types.CacheWrap { return cachekv.NewStore(s) } -// CacheWrapWithTrace implements the KVStore interface. -func (s Store) CacheWrapWithTrace(w io.Writer, tc types.TraceContext) types.CacheWrap { - return cachekv.NewStore(tracekv.NewStore(s, w, tc)) -} - // Implements KVStore func (s Store) Get(key []byte) []byte { res := s.parent.Get(s.key(key)) diff --git a/store/prefix/store_test.go b/store/prefix/store_test.go index 738835770425..818733033e09 100644 --- a/store/prefix/store_test.go +++ b/store/prefix/store_test.go @@ -445,7 +445,4 @@ func TestCacheWraps(t *testing.T) { cacheWrapper := store.CacheWrap() require.IsType(t, &cachekv.Store{}, cacheWrapper) - - cacheWrappedWithTrace := store.CacheWrapWithTrace(nil, nil) - require.IsType(t, &cachekv.Store{}, cacheWrappedWithTrace) } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 94336bc5faa8..39b6d35e5f43 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -544,11 +544,6 @@ func (rs *Store) CacheWrap() types.CacheWrap { return rs.CacheMultiStore().(types.CacheWrap) } -// CacheWrapWithTrace implements the CacheWrapper interface. -func (rs *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { - return rs.CacheWrap() -} - // CacheMultiStore creates ephemeral branch of the multi-store and returns a CacheMultiStore. // It implements the MultiStore interface. func (rs *Store) CacheMultiStore() types.CacheMultiStore { diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 2702f3e08623..983fc411f3da 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -17,6 +17,7 @@ import ( sdkmaps "cosmossdk.io/store/internal/maps" "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" + "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" ) @@ -690,9 +691,6 @@ func TestCacheWraps(t *testing.T) { cacheWrapper := multi.CacheWrap() require.IsType(t, cachemulti.Store{}, cacheWrapper) - - cacheWrappedWithTrace := multi.CacheWrapWithTrace(nil, nil) - require.IsType(t, cachemulti.Store{}, cacheWrappedWithTrace) } func TestTraceConcurrency(t *testing.T) { @@ -710,7 +708,7 @@ func TestTraceConcurrency(t *testing.T) { cms := multi.CacheMultiStore() store1 := cms.GetKVStore(key) - cw := store1.CacheWrapWithTrace(b, tc) + cw := tracekv.NewStore(store1.CacheWrap().(types.KVStore), b, tc) _ = cw require.NotNil(t, store1) diff --git a/store/tracekv/store.go b/store/tracekv/store.go index ba6df431da16..7df8b0f97ba7 100644 --- a/store/tracekv/store.go +++ b/store/tracekv/store.go @@ -167,12 +167,6 @@ func (tkv *Store) CacheWrap() types.CacheWrap { panic("cannot CacheWrap a TraceKVStore") } -// CacheWrapWithTrace implements the KVStore interface. It panics as a -// Store cannot be branched. -func (tkv *Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { - panic("cannot CacheWrapWithTrace a TraceKVStore") -} - // writeOperation writes a KVStore operation to the underlying io.Writer as // JSON-encoded data where the key/value pair is base64 encoded. func writeOperation(w io.Writer, op operation, tc types.TraceContext, key, value []byte) { diff --git a/store/tracekv/store_test.go b/store/tracekv/store_test.go index 2c42734baefd..d276accd530a 100644 --- a/store/tracekv/store_test.go +++ b/store/tracekv/store_test.go @@ -285,8 +285,3 @@ func TestTraceKVStoreCacheWrap(t *testing.T) { store := newEmptyTraceKVStore(nil) require.Panics(t, func() { store.CacheWrap() }) } - -func TestTraceKVStoreCacheWrapWithTrace(t *testing.T) { - store := newEmptyTraceKVStore(nil) - require.Panics(t, func() { store.CacheWrapWithTrace(nil, nil) }) -} diff --git a/store/types/store.go b/store/types/store.go index 8980179950e2..f37e9860baaa 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -297,17 +297,11 @@ type CacheWrap interface { // CacheWrap recursively wraps again. CacheWrap() CacheWrap - - // CacheWrapWithTrace recursively wraps again with tracing enabled. - CacheWrapWithTrace(w io.Writer, tc TraceContext) CacheWrap } type CacheWrapper interface { // CacheWrap branches a store. CacheWrap() CacheWrap - - // CacheWrapWithTrace branches a store with tracing enabled. - CacheWrapWithTrace(w io.Writer, tc TraceContext) CacheWrap } func (cid CommitID) IsZero() bool { From 20ee0a3525ac4fe3d6820286773f409f65877bd5 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 25 Mar 2024 11:45:24 +0800 Subject: [PATCH 03/37] Problem: dependencies in store is not consistent (#235) * Revert "build(deps): Bump github.com/cosmos/iavl from 1.0.1 to 1.1.1 in store (#19770)" This reverts commit ff30f6e0a4463f6de19678581e8d1114646cb1c7. * Problem: store package has dependency issues Solution: - revert the iavl bump, v1.0.2 is the version referenced by outer packages --- go.mod | 1 + go.sum | 2 -- simapp/go.mod | 1 + simapp/go.sum | 2 -- store/CHANGELOG.md | 4 ---- store/cache/cache_test.go | 11 +++++------ store/go.mod | 16 ++++++++-------- store/go.sum | 36 ++++++++++++++++++------------------ store/iavl/store.go | 3 +-- store/iavl/store_test.go | 21 ++++++++++----------- store/iavl/tree.go | 5 +++-- store/iavl/tree_test.go | 3 +-- store/prefix/store_test.go | 3 +-- store/wrapper/wrapper.go | 34 ---------------------------------- 14 files changed, 49 insertions(+), 93 deletions(-) delete mode 100644 store/wrapper/wrapper.go diff --git a/go.mod b/go.mod index 22ae5fe8ebed..cf4eb93e189a 100644 --- a/go.mod +++ b/go.mod @@ -169,6 +169,7 @@ require ( // Below are the long-lived replace of the Cosmos SDK replace ( + cosmossdk.io/store => ./store // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. diff --git a/go.sum b/go.sum index a7a2741a8ed3..2dcc7475ba29 100644 --- a/go.sum +++ b/go.sum @@ -14,8 +14,6 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= diff --git a/simapp/go.mod b/simapp/go.mod index c8dd9837ccc4..19c716a5db9c 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -207,6 +207,7 @@ require ( // Below are the long-lived replace of the SimApp replace ( + cosmossdk.io/store => ../store // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // Simapp always use the latest version of the cosmos-sdk diff --git a/simapp/go.sum b/simapp/go.sum index c2b293c55ffc..304effe160a3 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -200,8 +200,6 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 95a55120ae45..b56a47dd9af1 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -31,10 +31,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## v1.1.0 (March 20, 2024) -### Improvements - -* [#19770](https://github.com/cosmos/cosmos-sdk/pull/19770) Upgrade IAVL to IAVL v1.1.1. - ## v1.0.2 (January 10, 2024) ### Bug Fixes diff --git a/store/cache/cache_test.go b/store/cache/cache_test.go index efbf22c8e18e..0340f7ecbd8d 100644 --- a/store/cache/cache_test.go +++ b/store/cache/cache_test.go @@ -13,11 +13,10 @@ import ( "cosmossdk.io/store/cachekv" iavlstore "cosmossdk.io/store/iavl" "cosmossdk.io/store/types" - "cosmossdk.io/store/wrapper" ) func TestGetOrSetStoreCache(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -30,7 +29,7 @@ func TestGetOrSetStoreCache(t *testing.T) { } func TestUnwrap(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -43,7 +42,7 @@ func TestUnwrap(t *testing.T) { } func TestStoreCache(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -69,7 +68,7 @@ func TestStoreCache(t *testing.T) { } func TestReset(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -89,7 +88,7 @@ func TestReset(t *testing.T) { } func TestCacheWrap(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") diff --git a/store/go.mod b/store/go.mod index f587701c2fdf..c9950b02ce56 100644 --- a/store/go.mod +++ b/store/go.mod @@ -9,7 +9,7 @@ require ( github.com/cometbft/cometbft v0.38.6 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/gogoproto v1.4.11 - github.com/cosmos/iavl v1.1.1 + github.com/cosmos/iavl v1.0.1 github.com/cosmos/ics23/go v0.10.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 // indirect @@ -20,7 +20,7 @@ require ( github.com/spf13/cast v1.6.0 // indirect github.com/stretchr/testify v1.8.4 github.com/tidwall/btree v1.7.0 - golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f + golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 google.golang.org/grpc v1.60.0 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 @@ -61,17 +61,17 @@ require ( github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.50.0 // indirect - github.com/prometheus/procfs v0.13.0 // indirect + github.com/prometheus/common v0.47.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/zerolog v1.32.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/crypto v0.21.0 // indirect - golang.org/x/net v0.22.0 // indirect - golang.org/x/sys v0.18.0 // indirect + golang.org/x/crypto v0.19.0 // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/store/go.sum b/store/go.sum index a2692063e174..5b83ff072607 100644 --- a/store/go.sum +++ b/store/go.sum @@ -50,8 +50,8 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= 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/iavl v1.1.1 h1:64nTi8s3gEoGqhA8TyAWFWfz7/pg0anKzHNSc1ETc7Q= -github.com/cosmos/iavl v1.1.1/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= +github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= +github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -211,8 +211,8 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= -github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= +github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= +github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -220,13 +220,13 @@ github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZ github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.50.0 h1:YSZE6aa9+luNa2da6/Tik0q0A5AbR+U003TItK57CPQ= -github.com/prometheus/common v0.50.0/go.mod h1:wHFBCEVWVmHMUpg7pYcOm2QUR/ocQdYSJVQJKnHc3xQ= +github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= +github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= -github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -260,10 +260,10 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f h1:3CW0unweImhOzd5FmYuRsD4Y4oQFKZIjAnKbjV4WIrw= -golang.org/x/exp v0.0.0-20240314144324-c7f7c6466f7f/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= +golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= +golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -279,8 +279,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.22.0 h1:9sGLhx7iRIHEiX0oAJ3MRZMUCElJgy7Br1nO+AMN3Tc= -golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -288,8 +288,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= +golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -320,8 +320,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= diff --git a/store/iavl/store.go b/store/iavl/store.go index e73dcd6c1fdd..c52feb89544d 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -16,7 +16,6 @@ import ( "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/types" - "cosmossdk.io/store/wrapper" ) const ( @@ -50,7 +49,7 @@ func LoadStore(db dbm.DB, logger log.Logger, key types.StoreKey, id types.Commit // provided DB. An error is returned if the version fails to load, or if called with a positive // version on an empty tree. func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, initialVersion uint64, cacheSize int, disableFastNode bool, metrics metrics.StoreMetrics) (types.CommitKVStore, error) { - tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, disableFastNode, logger, iavl.InitialVersionOption(initialVersion)) + tree := iavl.NewMutableTree(db, cacheSize, disableFastNode, logger, iavl.InitialVersionOption(initialVersion)) isUpgradeable, err := tree.IsUpgradeable() if err != nil { diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index 46d9fa62371c..d9a47b21fb7b 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -17,7 +17,6 @@ import ( "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/metrics" "cosmossdk.io/store/types" - "cosmossdk.io/store/wrapper" ) var ( @@ -38,7 +37,7 @@ func randBytes(numBytes int) []byte { // make a tree with data from above and save it func newAlohaTree(t *testing.T, db dbm.DB) (*iavl.MutableTree, types.CommitID) { t.Helper() - tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) for k, v := range treeData { _, err := tree.Set([]byte(k), []byte(v)) @@ -286,7 +285,7 @@ func TestIAVLIterator(t *testing.T) { } func TestIAVLReverseIterator(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) @@ -320,7 +319,7 @@ func TestIAVLReverseIterator(t *testing.T) { } func TestIAVLPrefixIterator(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -383,7 +382,7 @@ func TestIAVLPrefixIterator(t *testing.T) { } func TestIAVLReversePrefixIterator(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -450,7 +449,7 @@ func nextVersion(iavl *Store) { } func TestIAVLNoPrune(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -468,7 +467,7 @@ func TestIAVLNoPrune(t *testing.T) { } func TestIAVLStoreQuery(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -580,7 +579,7 @@ func TestIAVLStoreQuery(t *testing.T) { func BenchmarkIAVLIteratorNext(b *testing.B) { b.ReportAllocs() - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() treeSize := 1000 tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) @@ -616,7 +615,7 @@ func TestSetInitialVersion(t *testing.T) { { "works with a mutable tree", func(db *dbm.MemDB) *Store { - tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) store := UnsafeNewStore(tree) return store @@ -625,7 +624,7 @@ func TestSetInitialVersion(t *testing.T) { { "throws error on immutable tree", func(db *dbm.MemDB) *Store { - tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) store := UnsafeNewStore(tree) _, version, err := store.tree.SaveVersion() require.NoError(t, err) @@ -670,7 +669,7 @@ func TestChangeSets(t *testing.T) { treeSize := 1000 treeVersion := int64(10) targetVersion := int64(6) - tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger(), iavl.FlushThresholdOption(math.MaxInt)) + tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger(), iavl.FlushThresholdOption(math.MaxInt)) for j := int64(0); j < treeVersion; j++ { keys := [][]byte{} diff --git a/store/iavl/tree.go b/store/iavl/tree.go index 889fc1d5a07f..a44559784a86 100644 --- a/store/iavl/tree.go +++ b/store/iavl/tree.go @@ -4,7 +4,8 @@ import ( "fmt" "github.com/cosmos/iavl" - idb "github.com/cosmos/iavl/db" + + "cosmossdk.io/store/types" ) var ( @@ -31,7 +32,7 @@ type ( GetVersioned(key []byte, version int64) ([]byte, error) GetImmutable(version int64) (*iavl.ImmutableTree, error) SetInitialVersion(version uint64) - Iterator(start, end []byte, ascending bool) (idb.Iterator, error) + Iterator(start, end []byte, ascending bool) (types.Iterator, error) AvailableVersions() []int LoadVersionForOverwriting(targetVersion int64) error TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error diff --git a/store/iavl/tree_test.go b/store/iavl/tree_test.go index 243355e42e08..63a12a2e5d28 100644 --- a/store/iavl/tree_test.go +++ b/store/iavl/tree_test.go @@ -8,12 +8,11 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/log" - "cosmossdk.io/store/wrapper" ) func TestImmutableTreePanics(t *testing.T) { t.Parallel() - immTree := iavl.NewImmutableTree(wrapper.NewDBWrapper(dbm.NewMemDB()), 100, false, log.NewNopLogger()) + immTree := iavl.NewImmutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) it := &immutableTree{immTree} require.Panics(t, func() { _, err := it.Set([]byte{}, []byte{}) diff --git a/store/prefix/store_test.go b/store/prefix/store_test.go index 818733033e09..af2605818c52 100644 --- a/store/prefix/store_test.go +++ b/store/prefix/store_test.go @@ -14,7 +14,6 @@ import ( "cosmossdk.io/store/gaskv" "cosmossdk.io/store/iavl" "cosmossdk.io/store/types" - "cosmossdk.io/store/wrapper" ) // copied from iavl/store_test.go @@ -91,7 +90,7 @@ func testPrefixStore(t *testing.T, baseStore types.KVStore, prefix []byte) { } func TestIAVLStorePrefix(t *testing.T) { - db := wrapper.NewDBWrapper(dbm.NewMemDB()) + db := dbm.NewMemDB() tree := tiavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := iavl.UnsafeNewStore(tree) diff --git a/store/wrapper/wrapper.go b/store/wrapper/wrapper.go deleted file mode 100644 index 5ccb4aef4698..000000000000 --- a/store/wrapper/wrapper.go +++ /dev/null @@ -1,34 +0,0 @@ -package wrapper - -import ( - dbm "github.com/cosmos/cosmos-db" - idb "github.com/cosmos/iavl/db" -) - -var _ idb.DB = &DBWrapper{} - -// DBwrapper is a simple wrapper of dbm.DB that implements the iavl.DB interface. -type DBWrapper struct { - dbm.DB -} - -// NewDBWrapper creates a new DBWrapper instance. -func NewDBWrapper(db dbm.DB) *DBWrapper { - return &DBWrapper{db} -} - -func (dbw *DBWrapper) NewBatch() idb.Batch { - return dbw.DB.NewBatch() -} - -func (dbw *DBWrapper) NewBatchWithSize(size int) idb.Batch { - return dbw.DB.NewBatchWithSize(size) -} - -func (dbw *DBWrapper) Iterator(start, end []byte) (idb.Iterator, error) { - return dbw.DB.Iterator(start, end) -} - -func (dbw *DBWrapper) ReverseIterator(start, end []byte) (idb.Iterator, error) { - return dbw.DB.ReverseIterator(start, end) -} From 90f30482d04e521bbb830b7361548b8f11807c26 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 25 Mar 2024 14:12:34 +0800 Subject: [PATCH 04/37] Support object store (#206) generic interface generic btree generic cachekv generic transient store support ObjStore changelog Update CHANGELOG.md Signed-off-by: yihuang object store key Apply review suggestions fix merge conflict fix snapshot revert dependers --- .github/workflows/test.yml | 14 +-- CHANGELOG.md | 1 + baseapp/baseapp.go | 11 ++ runtime/store.go | 11 +- server/mock/store.go | 8 +- store/CHANGELOG.md | 1 + store/cachekv/internal/mergeiterator.go | 43 ++++--- store/cachekv/search_benchmark_test.go | 12 +- store/cachekv/store.go | 119 +++++++++++------- store/cachemulti/store.go | 45 +++++-- store/gaskv/store.go | 116 +++++++++++------ store/iavl/tree.go | 5 +- .../internal => internal/btree}/btree.go | 48 +++---- .../internal => internal/btree}/btree_test.go | 8 +- .../btree}/memiterator.go | 39 +++--- store/internal/btreeadaptor.go | 52 ++++++++ store/listenkv/store.go | 3 +- store/listenkv/store_test.go | 2 +- store/rootmulti/store.go | 109 ++++++++++------ store/rootmulti/store_test.go | 33 ++--- store/tracekv/store.go | 3 +- store/tracekv/store_test.go | 2 +- store/transient/store.go | 63 +++++++--- store/types/store.go | 91 +++++++++++--- store/types/validity.go | 11 +- tests/go.mod | 1 + tests/go.sum | 2 - types/context.go | 5 + x/group/internal/orm/testsupport.go | 4 +- 29 files changed, 582 insertions(+), 280 deletions(-) rename store/{cachekv/internal => internal/btree}/btree.go (63%) rename store/{cachekv/internal => internal/btree}/btree_test.go (98%) rename store/{cachekv/internal => internal/btree}/memiterator.go (64%) create mode 100644 store/internal/btreeadaptor.go diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 24ca58bfb2a4..8236052e83cf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -291,7 +291,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: core/go.sum @@ -322,7 +322,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: depinject/go.sum @@ -351,7 +351,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: errors/go.sum @@ -382,7 +382,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: math/go.sum @@ -480,7 +480,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: orm/go.sum @@ -604,7 +604,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: store/go.sum @@ -635,7 +635,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v4 with: - go-version: "1.20" + go-version: "1.21" check-latest: true cache: true cache-dependency-path: log/go.sum diff --git a/CHANGELOG.md b/CHANGELOG.md index cb45d1180abe..330a5499f075 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Add `TxExecutor` baseapp option, add `TxIndex`/`TxCount`/`MsgIndex`/`BlockGasUsed` fields to `Context, to support tx parallel execution. +* (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Support mount object store in baseapp, add `ObjectStore` api in context.. ## [Unreleased-Upstream] diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 998cd19fa25b..eeb8a414d643 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -344,6 +344,17 @@ func (app *BaseApp) MountMemoryStores(keys map[string]*storetypes.MemoryStoreKey } } +// MountObjectStores mounts all transient object stores with the BaseApp's internal +// commit multi-store. +func (app *BaseApp) MountObjectStores(keys map[string]*storetypes.ObjectStoreKey) { + skeys := maps.Keys(keys) + sort.Strings(skeys) + for _, key := range skeys { + memKey := keys[key] + app.MountStore(memKey, storetypes.StoreTypeObject) + } +} + // MountStore mounts a store to the provided key in the BaseApp multistore, // using the default DB. func (app *BaseApp) MountStore(key storetypes.StoreKey, typ storetypes.StoreType) { diff --git a/runtime/store.go b/runtime/store.go index 230f53c38c5d..aee2487b5c9d 100644 --- a/runtime/store.go +++ b/runtime/store.go @@ -2,9 +2,6 @@ package runtime import ( "context" - "io" - - dbm "github.com/cosmos/cosmos-db" "cosmossdk.io/core/store" storetypes "cosmossdk.io/store/types" @@ -104,10 +101,6 @@ func (kvStoreAdapter) CacheWrap() storetypes.CacheWrap { panic("unimplemented") } -func (kvStoreAdapter) CacheWrapWithTrace(w io.Writer, tc storetypes.TraceContext) storetypes.CacheWrap { - panic("unimplemented") -} - func (kvStoreAdapter) GetStoreType() storetypes.StoreType { panic("unimplemented") } @@ -142,7 +135,7 @@ func (s kvStoreAdapter) Set(key, value []byte) { } } -func (s kvStoreAdapter) Iterator(start, end []byte) dbm.Iterator { +func (s kvStoreAdapter) Iterator(start, end []byte) storetypes.Iterator { it, err := s.store.Iterator(start, end) if err != nil { panic(err) @@ -150,7 +143,7 @@ func (s kvStoreAdapter) Iterator(start, end []byte) dbm.Iterator { return it } -func (s kvStoreAdapter) ReverseIterator(start, end []byte) dbm.Iterator { +func (s kvStoreAdapter) ReverseIterator(start, end []byte) storetypes.Iterator { it, err := s.store.ReverseIterator(start, end) if err != nil { panic(err) diff --git a/server/mock/store.go b/server/mock/store.go index 6e8a30364614..c6829bb18b6b 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -114,6 +114,10 @@ func (ms multiStore) GetKVStore(key storetypes.StoreKey) storetypes.KVStore { return ms.kv[key] } +func (ms multiStore) GetObjKVStore(storetypes.StoreKey) storetypes.ObjKVStore { + panic("not implemented") +} + func (ms multiStore) GetStore(key storetypes.StoreKey) storetypes.Store { panic("not implemented") } @@ -178,10 +182,6 @@ func (kv kvStore) CacheWrap() storetypes.CacheWrap { panic("not implemented") } -func (kv kvStore) CacheWrapWithTrace(w io.Writer, tc storetypes.TraceContext) storetypes.CacheWrap { - panic("not implemented") -} - func (kv kvStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { panic("not implemented") } diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index b56a47dd9af1..4066039f3f7e 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -28,6 +28,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * [#207](https://github.com/crypto-org-chain/cosmos-sdk/pull/207) Remove api CacheWrapWithTrace. +* [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Support object store. ## v1.1.0 (March 20, 2024) diff --git a/store/cachekv/internal/mergeiterator.go b/store/cachekv/internal/mergeiterator.go index 58e9497b3028..c9a1e7d3a677 100644 --- a/store/cachekv/internal/mergeiterator.go +++ b/store/cachekv/internal/mergeiterator.go @@ -14,21 +14,24 @@ import ( // cache shadows (overrides) the parent. // // TODO: Optimize by memoizing. -type cacheMergeIterator struct { - parent types.Iterator - cache types.Iterator +type cacheMergeIterator[V any] struct { + parent types.GIterator[V] + cache types.GIterator[V] ascending bool valid bool + + isZero func(V) bool } -var _ types.Iterator = (*cacheMergeIterator)(nil) +var _ types.Iterator = (*cacheMergeIterator[[]byte])(nil) -func NewCacheMergeIterator(parent, cache types.Iterator, ascending bool) types.Iterator { - iter := &cacheMergeIterator{ +func NewCacheMergeIterator[V any](parent, cache types.GIterator[V], ascending bool, isZero func(V) bool) types.GIterator[V] { + iter := &cacheMergeIterator[V]{ parent: parent, cache: cache, ascending: ascending, + isZero: isZero, } iter.valid = iter.skipUntilExistsOrInvalid() @@ -37,17 +40,17 @@ func NewCacheMergeIterator(parent, cache types.Iterator, ascending bool) types.I // Domain implements Iterator. // Returns parent domain because cache and parent domains are the same. -func (iter *cacheMergeIterator) Domain() (start, end []byte) { +func (iter *cacheMergeIterator[V]) Domain() (start, end []byte) { return iter.parent.Domain() } // Valid implements Iterator. -func (iter *cacheMergeIterator) Valid() bool { +func (iter *cacheMergeIterator[V]) Valid() bool { return iter.valid } // Next implements Iterator -func (iter *cacheMergeIterator) Next() { +func (iter *cacheMergeIterator[V]) Next() { iter.assertValid() switch { @@ -74,7 +77,7 @@ func (iter *cacheMergeIterator) Next() { } // Key implements Iterator -func (iter *cacheMergeIterator) Key() []byte { +func (iter *cacheMergeIterator[V]) Key() []byte { iter.assertValid() // If parent is invalid, get the cache key. @@ -104,7 +107,7 @@ func (iter *cacheMergeIterator) Key() []byte { } // Value implements Iterator -func (iter *cacheMergeIterator) Value() []byte { +func (iter *cacheMergeIterator[V]) Value() V { iter.assertValid() // If parent is invalid, get the cache value. @@ -134,7 +137,7 @@ func (iter *cacheMergeIterator) Value() []byte { } // Close implements Iterator -func (iter *cacheMergeIterator) Close() error { +func (iter *cacheMergeIterator[V]) Close() error { err1 := iter.cache.Close() if err := iter.parent.Close(); err != nil { return err @@ -145,7 +148,7 @@ func (iter *cacheMergeIterator) Close() error { // Error returns an error if the cacheMergeIterator is invalid defined by the // Valid method. -func (iter *cacheMergeIterator) Error() error { +func (iter *cacheMergeIterator[V]) Error() error { if !iter.Valid() { return errors.New("invalid cacheMergeIterator") } @@ -155,14 +158,14 @@ func (iter *cacheMergeIterator) Error() error { // If not valid, panics. // NOTE: May have side-effect of iterating over cache. -func (iter *cacheMergeIterator) assertValid() { +func (iter *cacheMergeIterator[V]) assertValid() { if err := iter.Error(); err != nil { panic(err) } } // Like bytes.Compare but opposite if not ascending. -func (iter *cacheMergeIterator) compare(a, b []byte) int { +func (iter *cacheMergeIterator[V]) compare(a, b []byte) int { if iter.ascending { return bytes.Compare(a, b) } @@ -175,9 +178,9 @@ func (iter *cacheMergeIterator) compare(a, b []byte) int { // If the current cache item is not a delete item, does nothing. // If `until` is nil, there is no limit, and cache may end up invalid. // CONTRACT: cache is valid. -func (iter *cacheMergeIterator) skipCacheDeletes(until []byte) { +func (iter *cacheMergeIterator[V]) skipCacheDeletes(until []byte) { for iter.cache.Valid() && - iter.cache.Value() == nil && + iter.isZero(iter.cache.Value()) && (until == nil || iter.compare(iter.cache.Key(), until) < 0) { iter.cache.Next() } @@ -186,7 +189,7 @@ func (iter *cacheMergeIterator) skipCacheDeletes(until []byte) { // Fast forwards cache (or parent+cache in case of deleted items) until current // item exists, or until iterator becomes invalid. // Returns whether the iterator is valid. -func (iter *cacheMergeIterator) skipUntilExistsOrInvalid() bool { +func (iter *cacheMergeIterator[V]) skipUntilExistsOrInvalid() bool { for { // If parent is invalid, fast-forward cache. if !iter.parent.Valid() { @@ -211,7 +214,7 @@ func (iter *cacheMergeIterator) skipUntilExistsOrInvalid() bool { case 0: // parent == cache. // Skip over if cache item is a delete. valueC := iter.cache.Value() - if valueC == nil { + if iter.isZero(valueC) { iter.parent.Next() iter.cache.Next() @@ -223,7 +226,7 @@ func (iter *cacheMergeIterator) skipUntilExistsOrInvalid() bool { case 1: // cache < parent // Skip over if cache item is a delete. valueC := iter.cache.Value() - if valueC == nil { + if iter.isZero(valueC) { iter.skipCacheDeletes(keyP) continue } diff --git a/store/cachekv/search_benchmark_test.go b/store/cachekv/search_benchmark_test.go index ecdc86a8e43a..f0e29bc4ec18 100644 --- a/store/cachekv/search_benchmark_test.go +++ b/store/cachekv/search_benchmark_test.go @@ -4,7 +4,7 @@ import ( "strconv" "testing" - "cosmossdk.io/store/cachekv/internal" + "cosmossdk.io/store/internal/btree" ) func BenchmarkLargeUnsortedMisses(b *testing.B) { @@ -22,23 +22,23 @@ func BenchmarkLargeUnsortedMisses(b *testing.B) { } func generateStore() *Store { - cache := map[string]*cValue{} + cache := map[string]*cValue[[]byte]{} unsorted := map[string]struct{}{} for i := 0; i < 5000; i++ { key := "A" + strconv.Itoa(i) unsorted[key] = struct{}{} - cache[key] = &cValue{} + cache[key] = &cValue[[]byte]{} } for i := 0; i < 5000; i++ { key := "Z" + strconv.Itoa(i) unsorted[key] = struct{}{} - cache[key] = &cValue{} + cache[key] = &cValue[[]byte]{} } - return &Store{ + return &GStore[[]byte]{ cache: cache, unsortedCache: unsorted, - sortedCache: internal.NewBTree(), + sortedCache: btree.NewBTree[[]byte](), } } diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 9c062c8ce619..9f7ff680db60 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -9,46 +9,70 @@ import ( "cosmossdk.io/math" "cosmossdk.io/store/cachekv/internal" + "cosmossdk.io/store/internal/btree" "cosmossdk.io/store/internal/conv" - "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/types" ) // cValue represents a cached value. // If dirty is true, it indicates the cached value is different from the underlying value. -type cValue struct { - value []byte +type cValue[V any] struct { + value V dirty bool } -// Store wraps an in-memory cache around an underlying types.KVStore. -type Store struct { - mtx sync.Mutex - cache map[string]*cValue - unsortedCache map[string]struct{} - sortedCache internal.BTree // always ascending sorted - parent types.KVStore +type kvPair[V any] struct { + Key []byte + Value V } +type Store = GStore[[]byte] + var _ types.CacheKVStore = (*Store)(nil) -// NewStore creates a new Store object func NewStore(parent types.KVStore) *Store { - return &Store{ - cache: make(map[string]*cValue), + return NewGStore( + parent, + func(v []byte) bool { return v == nil }, + func(v []byte) int { return len(v) }, + ) +} + +// GStore wraps an in-memory cache around an underlying types.KVStore. +type GStore[V any] struct { + mtx sync.Mutex + cache map[string]*cValue[V] + unsortedCache map[string]struct{} + sortedCache btree.BTree[V] // always ascending sorted + parent types.GKVStore[V] + + // isZero is a function that returns true if the value is considered "zero", for []byte and pointers the zero value + // is `nil`, zero value is not allowed to set to a key, and it's returned if the key is not found. + isZero func(V) bool + zeroValue V + // valueLen validates the value before it's set + valueLen func(V) int +} + +// NewStore creates a new Store object +func NewGStore[V any](parent types.GKVStore[V], isZero func(V) bool, valueLen func(V) int) *GStore[V] { + return &GStore[V]{ + cache: make(map[string]*cValue[V]), unsortedCache: make(map[string]struct{}), - sortedCache: internal.NewBTree(), + sortedCache: btree.NewBTree[V](), parent: parent, + isZero: isZero, + valueLen: valueLen, } } // GetStoreType implements Store. -func (store *Store) GetStoreType() types.StoreType { +func (store *GStore[V]) GetStoreType() types.StoreType { return store.parent.GetStoreType() } // Get implements types.KVStore. -func (store *Store) Get(key []byte) (value []byte) { +func (store *GStore[V]) Get(key []byte) (value V) { store.mtx.Lock() defer store.mtx.Unlock() @@ -65,10 +89,17 @@ func (store *Store) Get(key []byte) (value []byte) { return value } +func (store *GStore[V]) assertValidValue(value V) { + if store.isZero(value) { + panic("value is nil") + } + types.AssertValidValueLength(store.valueLen(value)) +} + // Set implements types.KVStore. -func (store *Store) Set(key, value []byte) { +func (store *GStore[V]) Set(key []byte, value V) { types.AssertValidKey(key) - types.AssertValidValue(value) + store.assertValidValue(value) store.mtx.Lock() defer store.mtx.Unlock() @@ -76,28 +107,28 @@ func (store *Store) Set(key, value []byte) { } // Has implements types.KVStore. -func (store *Store) Has(key []byte) bool { +func (store *GStore[V]) Has(key []byte) bool { value := store.Get(key) - return value != nil + return !store.isZero(value) } // Delete implements types.KVStore. -func (store *Store) Delete(key []byte) { +func (store *GStore[V]) Delete(key []byte) { types.AssertValidKey(key) store.mtx.Lock() defer store.mtx.Unlock() - store.setCacheValue(key, nil, true) + store.setCacheValue(key, store.zeroValue, true) } -func (store *Store) resetCaches() { +func (store *GStore[V]) resetCaches() { if len(store.cache) > 100_000 { // Cache is too large. We likely did something linear time // (e.g. Epoch block, Genesis block, etc). Free the old caches from memory, and let them get re-allocated. // TODO: In a future CacheKV redesign, such linear workloads should get into a different cache instantiation. // 100_000 is arbitrarily chosen as it solved Osmosis' InitGenesis RAM problem. - store.cache = make(map[string]*cValue) + store.cache = make(map[string]*cValue[V]) store.unsortedCache = make(map[string]struct{}) } else { // Clear the cache using the map clearing idiom @@ -110,22 +141,22 @@ func (store *Store) resetCaches() { delete(store.unsortedCache, key) } } - store.sortedCache = internal.NewBTree() + store.sortedCache = btree.NewBTree[V]() } // Implements Cachetypes.KVStore. -func (store *Store) Write() { +func (store *GStore[V]) Write() { store.mtx.Lock() defer store.mtx.Unlock() if len(store.cache) == 0 && len(store.unsortedCache) == 0 { - store.sortedCache = internal.NewBTree() + store.sortedCache = btree.NewBTree[V]() return } type cEntry struct { key string - val *cValue + val *cValue[V] } // We need a copy of all of the keys. @@ -150,7 +181,7 @@ func (store *Store) Write() { // be sure if the underlying store might do a save with the byteslice or // not. Once we get confirmation that .Delete is guaranteed not to // save the byteslice, then we can assume only a read-only copy is sufficient. - if obj.val.value != nil { + if !store.isZero(obj.val.value) { // It already exists in the parent, hence update it. store.parent.Set([]byte(obj.key), obj.val.value) } else { @@ -160,24 +191,24 @@ func (store *Store) Write() { } // CacheWrap implements CacheWrapper. -func (store *Store) CacheWrap() types.CacheWrap { - return NewStore(store) +func (store *GStore[V]) CacheWrap() types.CacheWrap { + return NewGStore(store, store.isZero, store.valueLen) } //---------------------------------------- // Iteration // Iterator implements types.KVStore. -func (store *Store) Iterator(start, end []byte) types.Iterator { +func (store *GStore[V]) Iterator(start, end []byte) types.GIterator[V] { return store.iterator(start, end, true) } // ReverseIterator implements types.KVStore. -func (store *Store) ReverseIterator(start, end []byte) types.Iterator { +func (store *GStore[V]) ReverseIterator(start, end []byte) types.GIterator[V] { return store.iterator(start, end, false) } -func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { +func (store *GStore[V]) iterator(start, end []byte, ascending bool) types.GIterator[V] { store.mtx.Lock() defer store.mtx.Unlock() @@ -186,7 +217,7 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { var ( err error - parent, cache types.Iterator + parent, cache types.GIterator[V] ) if ascending { @@ -200,7 +231,7 @@ func (store *Store) iterator(start, end []byte, ascending bool) types.Iterator { panic(err) } - return internal.NewCacheMergeIterator(parent, cache, ascending) + return internal.NewCacheMergeIterator(parent, cache, ascending, store.isZero) } func findStartIndex(strL []string, startQ string) int { @@ -286,7 +317,7 @@ const ( const minSortSize = 1024 // Constructs a slice of dirty items, to use w/ memIterator. -func (store *Store) dirtyItems(start, end []byte) { +func (store *GStore[V]) dirtyItems(start, end []byte) { startStr, endStr := conv.UnsafeBytesToStr(start), conv.UnsafeBytesToStr(end) if end != nil && startStr > endStr { // Nothing to do here. @@ -294,7 +325,7 @@ func (store *Store) dirtyItems(start, end []byte) { } n := len(store.unsortedCache) - unsorted := make([]*kv.Pair, 0) + unsorted := make([]*kvPair[V], 0) // If the unsortedCache is too big, its costs too much to determine // whats in the subset we are concerned about. // If you are interleaving iterator calls with writes, this can easily become an @@ -306,7 +337,7 @@ func (store *Store) dirtyItems(start, end []byte) { // dbm.IsKeyInDomain is nil safe and returns true iff key is greater than start if dbm.IsKeyInDomain(conv.UnsafeStrToBytes(key), start, end) { cacheValue := store.cache[key] - unsorted = append(unsorted, &kv.Pair{Key: []byte(key), Value: cacheValue.value}) + unsorted = append(unsorted, &kvPair[V]{Key: []byte(key), Value: cacheValue.value}) } } store.clearUnsortedCacheSubset(unsorted, stateUnsorted) @@ -349,18 +380,18 @@ func (store *Store) dirtyItems(start, end []byte) { } } - kvL := make([]*kv.Pair, 0, 1+endIndex-startIndex) + kvL := make([]*kvPair[V], 0, 1+endIndex-startIndex) for i := startIndex; i <= endIndex; i++ { key := strL[i] cacheValue := store.cache[key] - kvL = append(kvL, &kv.Pair{Key: []byte(key), Value: cacheValue.value}) + kvL = append(kvL, &kvPair[V]{Key: []byte(key), Value: cacheValue.value}) } // kvL was already sorted so pass it in as is. store.clearUnsortedCacheSubset(kvL, stateAlreadySorted) } -func (store *Store) clearUnsortedCacheSubset(unsorted []*kv.Pair, sortState sortState) { +func (store *GStore[V]) clearUnsortedCacheSubset(unsorted []*kvPair[V], sortState sortState) { n := len(store.unsortedCache) if len(unsorted) == n { // This pattern allows the Go compiler to emit the map clearing idiom for the entire map. for key := range store.unsortedCache { @@ -389,9 +420,9 @@ func (store *Store) clearUnsortedCacheSubset(unsorted []*kv.Pair, sortState sort // Only entrypoint to mutate store.cache. // A `nil` value means a deletion. -func (store *Store) setCacheValue(key, value []byte, dirty bool) { +func (store *GStore[V]) setCacheValue(key []byte, value V, dirty bool) { keyStr := conv.UnsafeBytesToStr(key) - store.cache[keyStr] = &cValue{ + store.cache[keyStr] = &cValue[V]{ value: value, dirty: dirty, } diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 37fadb7790f2..5f6b4856052b 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -6,7 +6,6 @@ import ( dbm "github.com/cosmos/cosmos-db" - "cosmossdk.io/store/cachekv" "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" @@ -24,7 +23,7 @@ const storeNameCtxKey = "store_name" // NOTE: a Store (and MultiStores in general) should never expose the // keys for the substores. type Store struct { - db types.CacheKVStore + db types.CacheWrap stores map[types.StoreKey]types.CacheWrap keys map[string]types.StoreKey @@ -38,11 +37,11 @@ var _ types.CacheMultiStore = Store{} // CacheWrapper objects and a KVStore as the database. Each CacheWrapper store // is a branched store. func NewFromKVStore( - store types.KVStore, stores map[types.StoreKey]types.CacheWrapper, + store types.CacheWrapper, stores map[types.StoreKey]types.CacheWrapper, keys map[string]types.StoreKey, traceWriter io.Writer, traceContext types.TraceContext, ) Store { cms := Store{ - db: cachekv.NewStore(store), + db: store.CacheWrap(), stores: make(map[types.StoreKey]types.CacheWrap, len(stores)), keys: keys, traceWriter: traceWriter, @@ -51,13 +50,16 @@ func NewFromKVStore( for key, store := range stores { if cms.TracingEnabled() { - tctx := cms.traceContext.Clone().Merge(types.TraceContext{ - storeNameCtxKey: key.Name(), - }) - - store = tracekv.NewStore(store.(types.KVStore), cms.traceWriter, tctx) + // only support tracing on KVStore. + if kvstore, ok := store.(types.KVStore); ok { + tctx := cms.traceContext.Clone().Merge(types.TraceContext{ + storeNameCtxKey: key.Name(), + }) + + store = tracekv.NewStore(kvstore, cms.traceWriter, tctx) + } } - cms.stores[key] = cachekv.NewStore(store.(types.KVStore)) + cms.stores[key] = store.CacheWrap() } return cms @@ -155,11 +157,28 @@ func (cms Store) GetStore(key types.StoreKey) types.Store { return s.(types.Store) } -// GetKVStore returns an underlying KVStore by key. -func (cms Store) GetKVStore(key types.StoreKey) types.KVStore { +func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { store := cms.stores[key] if key == nil || store == nil { panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) } - return store.(types.KVStore) + return store +} + +// GetKVStore returns an underlying KVStore by key. +func (cms Store) GetKVStore(key types.StoreKey) types.KVStore { + store, ok := cms.getCacheWrap(key).(types.KVStore) + if !ok { + panic(fmt.Sprintf("store with key %v is not KVStore", key)) + } + return store +} + +// GetObjKVStore returns an underlying KVStore by key. +func (cms Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { + store, ok := cms.getCacheWrap(key).(types.ObjKVStore) + if !ok { + panic(fmt.Sprintf("store with key %v is not ObjKVStore", key)) + } + return store } diff --git a/store/gaskv/store.go b/store/gaskv/store.go index 59247d80008a..7aab63b0863a 100644 --- a/store/gaskv/store.go +++ b/store/gaskv/store.go @@ -1,65 +1,102 @@ package gaskv -import ( - "cosmossdk.io/store/types" -) +import "cosmossdk.io/store/types" + +// ObjectValueLength is the emulated number of bytes for storing transient objects in gas accounting. +const ObjectValueLength = 16 var _ types.KVStore = &Store{} -// Store applies gas tracking to an underlying KVStore. It implements the +type Store = GStore[[]byte] + +func NewStore(parent types.KVStore, gasMeter types.GasMeter, gasConfig types.GasConfig) *Store { + return NewGStore(parent, gasMeter, gasConfig, + func(v []byte) bool { return v == nil }, + func(v []byte) int { return len(v) }, + ) +} + +type ObjStore = GStore[any] + +func NewObjStore(parent types.ObjKVStore, gasMeter types.GasMeter, gasConfig types.GasConfig) *ObjStore { + return NewGStore(parent, gasMeter, gasConfig, + func(v any) bool { return v == nil }, + func(v any) int { return ObjectValueLength }, + ) +} + +// GStore applies gas tracking to an underlying KVStore. It implements the // KVStore interface. -type Store struct { +type GStore[V any] struct { gasMeter types.GasMeter gasConfig types.GasConfig - parent types.KVStore + parent types.GKVStore[V] + + isZero func(V) bool + valueLen func(V) int } -// NewStore returns a reference to a new GasKVStore. -func NewStore(parent types.KVStore, gasMeter types.GasMeter, gasConfig types.GasConfig) *Store { - kvs := &Store{ +// NewGStore returns a reference to a new GasKVStore. +func NewGStore[V any]( + parent types.GKVStore[V], + gasMeter types.GasMeter, + gasConfig types.GasConfig, + isZero func(V) bool, + valueLen func(V) int, +) *GStore[V] { + kvs := &GStore[V]{ gasMeter: gasMeter, gasConfig: gasConfig, parent: parent, + isZero: isZero, + valueLen: valueLen, } return kvs } // Implements Store. -func (gs *Store) GetStoreType() types.StoreType { +func (gs *GStore[V]) GetStoreType() types.StoreType { return gs.parent.GetStoreType() } // Implements KVStore. -func (gs *Store) Get(key []byte) (value []byte) { +func (gs *GStore[V]) Get(key []byte) (value V) { gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostFlat, types.GasReadCostFlatDesc) value = gs.parent.Get(key) // TODO overflow-safe math? gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostPerByte*types.Gas(len(key)), types.GasReadPerByteDesc) - gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostPerByte*types.Gas(len(value)), types.GasReadPerByteDesc) + gs.gasMeter.ConsumeGas(gs.gasConfig.ReadCostPerByte*types.Gas(gs.valueLen(value)), types.GasReadPerByteDesc) return value } +func (gs *GStore[V]) assertValidValue(value V) { + if gs.isZero(value) { + panic("value is nil") + } + types.AssertValidValueLength(gs.valueLen(value)) +} + // Implements KVStore. -func (gs *Store) Set(key, value []byte) { +func (gs *GStore[V]) Set(key []byte, value V) { types.AssertValidKey(key) - types.AssertValidValue(value) + gs.assertValidValue(value) gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostFlat, types.GasWriteCostFlatDesc) // TODO overflow-safe math? gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(len(key)), types.GasWritePerByteDesc) - gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(len(value)), types.GasWritePerByteDesc) + gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(gs.valueLen(value)), types.GasWritePerByteDesc) gs.parent.Set(key, value) } // Implements KVStore. -func (gs *Store) Has(key []byte) bool { +func (gs *GStore[V]) Has(key []byte) bool { gs.gasMeter.ConsumeGas(gs.gasConfig.HasCost, types.GasHasDesc) return gs.parent.Has(key) } // Implements KVStore. -func (gs *Store) Delete(key []byte) { +func (gs *GStore[V]) Delete(key []byte) { // charge gas to prevent certain attack vectors even though space is being freed gs.gasMeter.ConsumeGas(gs.gasConfig.DeleteCost, types.GasDeleteDesc) gs.parent.Delete(key) @@ -68,7 +105,7 @@ func (gs *Store) Delete(key []byte) { // Iterator implements the KVStore interface. It returns an iterator which // incurs a flat gas cost for seeking to the first key/value pair and a variable // gas cost based on the current value's length if the iterator is valid. -func (gs *Store) Iterator(start, end []byte) types.Iterator { +func (gs *GStore[V]) Iterator(start, end []byte) types.GIterator[V] { return gs.iterator(start, end, true) } @@ -76,94 +113,95 @@ func (gs *Store) Iterator(start, end []byte) types.Iterator { // iterator which incurs a flat gas cost for seeking to the first key/value pair // and a variable gas cost based on the current value's length if the iterator // is valid. -func (gs *Store) ReverseIterator(start, end []byte) types.Iterator { +func (gs *GStore[V]) ReverseIterator(start, end []byte) types.GIterator[V] { return gs.iterator(start, end, false) } // Implements KVStore. -func (gs *Store) CacheWrap() types.CacheWrap { +func (gs *GStore[V]) CacheWrap() types.CacheWrap { panic("cannot CacheWrap a GasKVStore") } -func (gs *Store) iterator(start, end []byte, ascending bool) types.Iterator { - var parent types.Iterator +func (gs *GStore[V]) iterator(start, end []byte, ascending bool) types.GIterator[V] { + var parent types.GIterator[V] if ascending { parent = gs.parent.Iterator(start, end) } else { parent = gs.parent.ReverseIterator(start, end) } - gi := newGasIterator(gs.gasMeter, gs.gasConfig, parent) - gi.(*gasIterator).consumeSeekGas() + gi := newGasIterator(gs.gasMeter, gs.gasConfig, parent, gs.valueLen) + gi.consumeSeekGas() return gi } -type gasIterator struct { +type gasIterator[V any] struct { gasMeter types.GasMeter gasConfig types.GasConfig - parent types.Iterator + parent types.GIterator[V] + valueLen func(V) int } -func newGasIterator(gasMeter types.GasMeter, gasConfig types.GasConfig, parent types.Iterator) types.Iterator { - return &gasIterator{ +func newGasIterator[V any](gasMeter types.GasMeter, gasConfig types.GasConfig, parent types.GIterator[V], valueLen func(V) int) *gasIterator[V] { + return &gasIterator[V]{ gasMeter: gasMeter, gasConfig: gasConfig, parent: parent, + valueLen: valueLen, } } // Implements Iterator. -func (gi *gasIterator) Domain() (start, end []byte) { +func (gi *gasIterator[V]) Domain() (start, end []byte) { return gi.parent.Domain() } // Implements Iterator. -func (gi *gasIterator) Valid() bool { +func (gi *gasIterator[V]) Valid() bool { return gi.parent.Valid() } // Next implements the Iterator interface. It seeks to the next key/value pair // in the iterator. It incurs a flat gas cost for seeking and a variable gas // cost based on the current value's length if the iterator is valid. -func (gi *gasIterator) Next() { +func (gi *gasIterator[V]) Next() { gi.consumeSeekGas() gi.parent.Next() } // Key implements the Iterator interface. It returns the current key and it does // not incur any gas cost. -func (gi *gasIterator) Key() (key []byte) { +func (gi *gasIterator[V]) Key() (key []byte) { key = gi.parent.Key() return key } // Value implements the Iterator interface. It returns the current value and it // does not incur any gas cost. -func (gi *gasIterator) Value() (value []byte) { - value = gi.parent.Value() - return value +func (gi *gasIterator[V]) Value() (value V) { + return gi.parent.Value() } // Implements Iterator. -func (gi *gasIterator) Close() error { +func (gi *gasIterator[V]) Close() error { return gi.parent.Close() } // Error delegates the Error call to the parent iterator. -func (gi *gasIterator) Error() error { +func (gi *gasIterator[V]) Error() error { return gi.parent.Error() } // consumeSeekGas consumes on each iteration step a flat gas cost and a variable gas cost // based on the current value's length. -func (gi *gasIterator) consumeSeekGas() { +func (gi *gasIterator[V]) consumeSeekGas() { if gi.Valid() { key := gi.Key() value := gi.Value() gi.gasMeter.ConsumeGas(gi.gasConfig.ReadCostPerByte*types.Gas(len(key)), types.GasValuePerByteDesc) - gi.gasMeter.ConsumeGas(gi.gasConfig.ReadCostPerByte*types.Gas(len(value)), types.GasValuePerByteDesc) + gi.gasMeter.ConsumeGas(gi.gasConfig.ReadCostPerByte*types.Gas(gi.valueLen(value)), types.GasValuePerByteDesc) } gi.gasMeter.ConsumeGas(gi.gasConfig.IterNextCostFlat, types.GasIterNextCostFlatDesc) } diff --git a/store/iavl/tree.go b/store/iavl/tree.go index a44559784a86..6819029f2642 100644 --- a/store/iavl/tree.go +++ b/store/iavl/tree.go @@ -3,9 +3,8 @@ package iavl import ( "fmt" + dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" - - "cosmossdk.io/store/types" ) var ( @@ -32,7 +31,7 @@ type ( GetVersioned(key []byte, version int64) ([]byte, error) GetImmutable(version int64) (*iavl.ImmutableTree, error) SetInitialVersion(version uint64) - Iterator(start, end []byte, ascending bool) (types.Iterator, error) + Iterator(start, end []byte, ascending bool) (dbm.Iterator, error) AvailableVersions() []int LoadVersionForOverwriting(targetVersion int64) error TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error diff --git a/store/cachekv/internal/btree.go b/store/internal/btree/btree.go similarity index 63% rename from store/cachekv/internal/btree.go rename to store/internal/btree/btree.go index 209f7e58c4dd..0fe28def41ee 100644 --- a/store/cachekv/internal/btree.go +++ b/store/internal/btree/btree.go @@ -1,4 +1,4 @@ -package internal +package btree import ( "bytes" @@ -22,44 +22,46 @@ var errKeyEmpty = errors.New("key cannot be empty") // we need it to be as fast as possible, while `MemDB` is mainly used as a mocking db in unit tests. // // We choose tidwall/btree over google/btree here because it provides API to implement step iterator directly. -type BTree struct { - tree *btree.BTreeG[item] +type BTree[V any] struct { + tree *btree.BTreeG[item[V]] } // NewBTree creates a wrapper around `btree.BTreeG`. -func NewBTree() BTree { - return BTree{ - tree: btree.NewBTreeGOptions(byKeys, btree.Options{ +func NewBTree[V any]() BTree[V] { + return BTree[V]{ + tree: btree.NewBTreeGOptions(byKeys[V], btree.Options{ Degree: bTreeDegree, NoLocks: false, }), } } -func (bt BTree) Set(key, value []byte) { +func (bt BTree[V]) Set(key []byte, value V) { bt.tree.Set(newItem(key, value)) } -func (bt BTree) Get(key []byte) []byte { - i, found := bt.tree.Get(newItem(key, nil)) +func (bt BTree[V]) Get(key []byte) V { + var empty V + i, found := bt.tree.Get(newItem(key, empty)) if !found { - return nil + return empty } return i.value } -func (bt BTree) Delete(key []byte) { - bt.tree.Delete(newItem(key, nil)) +func (bt BTree[V]) Delete(key []byte) { + var empty V + bt.tree.Delete(newItem(key, empty)) } -func (bt BTree) Iterator(start, end []byte) (types.Iterator, error) { +func (bt BTree[V]) Iterator(start, end []byte) (types.GIterator[V], error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, errKeyEmpty } return newMemIterator(start, end, bt, true), nil } -func (bt BTree) ReverseIterator(start, end []byte) (types.Iterator, error) { +func (bt BTree[V]) ReverseIterator(start, end []byte) (types.GIterator[V], error) { if (start != nil && len(start) == 0) || (end != nil && len(end) == 0) { return nil, errKeyEmpty } @@ -68,24 +70,28 @@ func (bt BTree) ReverseIterator(start, end []byte) (types.Iterator, error) { // Copy the tree. This is a copy-on-write operation and is very fast because // it only performs a shadowed copy. -func (bt BTree) Copy() BTree { - return BTree{ +func (bt BTree[V]) Copy() BTree[V] { + return BTree[V]{ tree: bt.tree.Copy(), } } +func (bt BTree[V]) Clear() { + bt.tree.Clear() +} + // item is a btree item with byte slices as keys and values -type item struct { +type item[V any] struct { key []byte - value []byte + value V } // byKeys compares the items by key -func byKeys(a, b item) bool { +func byKeys[V any](a, b item[V]) bool { return bytes.Compare(a.key, b.key) == -1 } // newItem creates a new pair item. -func newItem(key, value []byte) item { - return item{key: key, value: value} +func newItem[V any](key []byte, value V) item[V] { + return item[V]{key: key, value: value} } diff --git a/store/cachekv/internal/btree_test.go b/store/internal/btree/btree_test.go similarity index 98% rename from store/cachekv/internal/btree_test.go rename to store/internal/btree/btree_test.go index 06437997f636..89b5827e6156 100644 --- a/store/cachekv/internal/btree_test.go +++ b/store/internal/btree/btree_test.go @@ -1,4 +1,4 @@ -package internal +package btree import ( "testing" @@ -9,7 +9,7 @@ import ( ) func TestGetSetDelete(t *testing.T) { - db := NewBTree() + db := NewBTree[[]byte]() // A nonexistent key should return nil. value := db.Get([]byte("a")) @@ -40,7 +40,7 @@ func TestGetSetDelete(t *testing.T) { } func TestDBIterator(t *testing.T) { - db := NewBTree() + db := NewBTree[[]byte]() for i := 0; i < 10; i++ { if i != 6 { // but skip 6. @@ -171,7 +171,7 @@ func TestDBIterator(t *testing.T) { []int64(nil), "reverse iterator from 2 (ex) to 4") // Ensure that the iterators don't panic with an empty database. - db2 := NewBTree() + db2 := NewBTree[[]byte]() itr, err = db2.Iterator(nil, nil) require.NoError(t, err) diff --git a/store/cachekv/internal/memiterator.go b/store/internal/btree/memiterator.go similarity index 64% rename from store/cachekv/internal/memiterator.go rename to store/internal/btree/memiterator.go index 9dbba7587071..e98ae9cd834e 100644 --- a/store/cachekv/internal/memiterator.go +++ b/store/internal/btree/memiterator.go @@ -1,4 +1,4 @@ -package internal +package btree import ( "bytes" @@ -9,13 +9,13 @@ import ( "cosmossdk.io/store/types" ) -var _ types.Iterator = (*memIterator)(nil) +var _ types.Iterator = (*memIterator[[]byte])(nil) // memIterator iterates over iterKVCache items. // if value is nil, means it was deleted. // Implements Iterator. -type memIterator struct { - iter btree.IterG[item] +type memIterator[V any] struct { + iter btree.IterG[item[V]] start []byte end []byte @@ -23,18 +23,21 @@ type memIterator struct { valid bool } -func newMemIterator(start, end []byte, items BTree, ascending bool) *memIterator { +func newMemIterator[V any](start, end []byte, items BTree[V], ascending bool) *memIterator[V] { + var ( + valid bool + empty V + ) iter := items.tree.Iter() - var valid bool if ascending { if start != nil { - valid = iter.Seek(newItem(start, nil)) + valid = iter.Seek(newItem(start, empty)) } else { valid = iter.First() } } else { if end != nil { - valid = iter.Seek(newItem(end, nil)) + valid = iter.Seek(newItem(end, empty)) if !valid { valid = iter.Last() } else { @@ -46,7 +49,7 @@ func newMemIterator(start, end []byte, items BTree, ascending bool) *memIterator } } - mi := &memIterator{ + mi := &memIterator[V]{ iter: iter, start: start, end: end, @@ -61,27 +64,27 @@ func newMemIterator(start, end []byte, items BTree, ascending bool) *memIterator return mi } -func (mi *memIterator) Domain() (start, end []byte) { +func (mi *memIterator[V]) Domain() (start, end []byte) { return mi.start, mi.end } -func (mi *memIterator) Close() error { +func (mi *memIterator[V]) Close() error { mi.iter.Release() return nil } -func (mi *memIterator) Error() error { +func (mi *memIterator[V]) Error() error { if !mi.Valid() { return errors.New("invalid memIterator") } return nil } -func (mi *memIterator) Valid() bool { +func (mi *memIterator[V]) Valid() bool { return mi.valid } -func (mi *memIterator) Next() { +func (mi *memIterator[V]) Next() { mi.assertValid() if mi.ascending { @@ -95,7 +98,7 @@ func (mi *memIterator) Next() { } } -func (mi *memIterator) keyInRange(key []byte) bool { +func (mi *memIterator[V]) keyInRange(key []byte) bool { if mi.ascending && mi.end != nil && bytes.Compare(key, mi.end) >= 0 { return false } @@ -105,15 +108,15 @@ func (mi *memIterator) keyInRange(key []byte) bool { return true } -func (mi *memIterator) Key() []byte { +func (mi *memIterator[V]) Key() []byte { return mi.iter.Item().key } -func (mi *memIterator) Value() []byte { +func (mi *memIterator[V]) Value() V { return mi.iter.Item().value } -func (mi *memIterator) assertValid() { +func (mi *memIterator[V]) assertValid() { if err := mi.Error(); err != nil { panic(err) } diff --git a/store/internal/btreeadaptor.go b/store/internal/btreeadaptor.go new file mode 100644 index 000000000000..322e0f4152fe --- /dev/null +++ b/store/internal/btreeadaptor.go @@ -0,0 +1,52 @@ +package internal + +import ( + "cosmossdk.io/store/cachekv" + "cosmossdk.io/store/internal/btree" + "cosmossdk.io/store/types" +) + +var _ types.KVStore = (*BTreeStore[[]byte])(nil) + +// BTreeStore is a wrapper for a BTree with GKVStore[V] implementation +type BTreeStore[V any] struct { + btree.BTree[V] + isZero func(V) bool + valueLen func(V) int +} + +// NewBTreeStore constructs new BTree adapter +func NewBTreeStore[V any](btree btree.BTree[V], isZero func(V) bool, valueLen func(V) int) *BTreeStore[V] { + return &BTreeStore[V]{btree, isZero, valueLen} +} + +// Hash Implements GKVStore. +func (ts *BTreeStore[V]) Has(key []byte) bool { + return !ts.isZero(ts.Get(key)) +} + +func (ts *BTreeStore[V]) Iterator(start, end []byte) types.GIterator[V] { + it, err := ts.BTree.Iterator(start, end) + if err != nil { + panic(err) + } + return it +} + +func (ts *BTreeStore[V]) ReverseIterator(start, end []byte) types.GIterator[V] { + it, err := ts.BTree.ReverseIterator(start, end) + if err != nil { + panic(err) + } + return it +} + +// GetStoreType returns the type of the store. +func (ts *BTreeStore[V]) GetStoreType() types.StoreType { + return types.StoreTypeDB +} + +// CacheWrap branches the underlying store. +func (ts *BTreeStore[V]) CacheWrap() types.CacheWrap { + return cachekv.NewGStore(ts, ts.isZero, ts.valueLen) +} diff --git a/store/listenkv/store.go b/store/listenkv/store.go index 343be611b9f0..43d69fa663fc 100644 --- a/store/listenkv/store.go +++ b/store/listenkv/store.go @@ -1,6 +1,7 @@ package listenkv import ( + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/types" ) @@ -130,5 +131,5 @@ func (s *Store) GetStoreType() types.StoreType { // CacheWrap implements the KVStore interface. It panics as a Store // cannot be cache wrapped. func (s *Store) CacheWrap() types.CacheWrap { - panic("cannot CacheWrap a ListenKVStore") + return cachekv.NewStore(s) } diff --git a/store/listenkv/store_test.go b/store/listenkv/store_test.go index 1f9ca4b2942e..f688f5c4c0d9 100644 --- a/store/listenkv/store_test.go +++ b/store/listenkv/store_test.go @@ -272,5 +272,5 @@ func TestListenKVStoreGetStoreType(t *testing.T) { func TestListenKVStoreCacheWrap(t *testing.T) { store := newEmptyListenKVStore(nil) - require.Panics(t, func() { store.CacheWrap() }) + store.CacheWrap() } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 39b6d35e5f43..7908ac118303 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -63,17 +63,18 @@ type Store struct { iavlCacheSize int iavlDisableFastNode bool storesParams map[types.StoreKey]storeParams - stores map[types.StoreKey]types.CommitKVStore - keysByName map[string]types.StoreKey - initialVersion int64 - removalMap map[types.StoreKey]bool - traceWriter io.Writer - traceContext types.TraceContext - traceContextMutex sync.Mutex - interBlockCache types.MultiStorePersistentCache - listeners map[types.StoreKey]*types.MemoryListener - metrics metrics.StoreMetrics - commitHeader cmtproto.Header + // CommitStore is a common interface to unify generic CommitKVStore of different value types + stores map[types.StoreKey]types.CommitStore + keysByName map[string]types.StoreKey + initialVersion int64 + removalMap map[types.StoreKey]bool + traceWriter io.Writer + traceContext types.TraceContext + traceContextMutex sync.Mutex + interBlockCache types.MultiStorePersistentCache + listeners map[types.StoreKey]*types.MemoryListener + metrics metrics.StoreMetrics + commitHeader cmtproto.Header } var ( @@ -92,7 +93,7 @@ func NewStore(db dbm.DB, logger log.Logger, metricGatherer metrics.StoreMetrics) iavlCacheSize: iavl.DefaultIAVLCacheSize, iavlDisableFastNode: iavlDisablefastNodeDefault, storesParams: make(map[types.StoreKey]storeParams), - stores: make(map[types.StoreKey]types.CommitKVStore), + stores: make(map[types.StoreKey]types.CommitStore), keysByName: make(map[string]types.StoreKey), listeners: make(map[types.StoreKey]*types.MemoryListener), removalMap: make(map[types.StoreKey]bool), @@ -155,12 +156,6 @@ func (rs *Store) MountStoreWithDB(key types.StoreKey, typ types.StoreType, db db // GetCommitStore returns a mounted CommitStore for a given StoreKey. If the // store is wrapped in an inter-block cache, it will be unwrapped before returning. func (rs *Store) GetCommitStore(key types.StoreKey) types.CommitStore { - return rs.GetCommitKVStore(key) -} - -// GetCommitKVStore returns a mounted CommitKVStore for a given StoreKey. If the -// store is wrapped in an inter-block cache, it will be unwrapped before returning. -func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore { // If the Store has an inter-block cache, first attempt to lookup and unwrap // the underlying CommitKVStore by StoreKey. If it does not exist, fallback to // the main mapping of CommitKVStores. @@ -173,6 +168,17 @@ func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore { return rs.stores[key] } +// GetCommitKVStore returns a mounted CommitKVStore for a given StoreKey. If the +// store is wrapped in an inter-block cache, it will be unwrapped before returning. +func (rs *Store) GetCommitKVStore(key types.StoreKey) types.CommitKVStore { + store, ok := rs.GetCommitStore(key).(types.CommitKVStore) + if !ok { + panic(fmt.Sprintf("store with key %v is not CommitKVStore", key)) + } + + return store +} + // StoreKeysByName returns mapping storeNames -> StoreKeys func (rs *Store) StoreKeysByName() map[string]types.StoreKey { return rs.keysByName @@ -221,7 +227,7 @@ func (rs *Store) loadVersion(ver int64, upgrades *types.StoreUpgrades) error { } // load each Store (note this doesn't panic on unmounted keys now) - newStores := make(map[types.StoreKey]types.CommitKVStore) + newStores := make(map[types.StoreKey]types.CommitStore) storesKeys := make([]types.StoreKey, 0, len(rs.storesParams)) @@ -549,11 +555,13 @@ func (rs *Store) CacheWrap() types.CacheWrap { func (rs *Store) CacheMultiStore() types.CacheMultiStore { stores := make(map[types.StoreKey]types.CacheWrapper) for k, v := range rs.stores { - store := types.KVStore(v) - // Wire the listenkv.Store to allow listeners to observe the writes from the cache store, - // set same listeners on cache store will observe duplicated writes. - if rs.ListeningEnabled(k) { - store = listenkv.NewStore(store, k, rs.listeners[k]) + store := types.CacheWrapper(v) + if kv, ok := store.(types.KVStore); ok { + // Wire the listenkv.Store to allow listeners to observe the writes from the cache store, + // set same listeners on cache store will observe duplicated writes. + if rs.ListeningEnabled(k) { + store = listenkv.NewStore(kv, k, rs.listeners[k]) + } } stores[k] = store } @@ -569,7 +577,7 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor var commitInfo *types.CommitInfo storeInfos := map[string]bool{} for key, store := range rs.stores { - var cacheStore types.KVStore + var cacheStore types.CacheWrapper switch store.GetStoreType() { case types.StoreTypeIAVL: // If the store is wrapped with an inter-block cache, we must first unwrap @@ -608,10 +616,12 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor cacheStore = store } - // Wire the listenkv.Store to allow listeners to observe the writes from the cache store, - // set same listeners on cache store will observe duplicated writes. - if rs.ListeningEnabled(key) { - cacheStore = listenkv.NewStore(cacheStore, key, rs.listeners[key]) + if kv, ok := cacheStore.(types.KVStore); ok { + // Wire the listenkv.Store to allow listeners to observe the writes from the cache store, + // set same listeners on cache store will observe duplicated writes. + if rs.ListeningEnabled(key) { + cacheStore = listenkv.NewStore(kv, key, rs.listeners[key]) + } } cachedStores[key] = cacheStore @@ -627,7 +637,7 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor // TODO: This isn't used directly upstream. Consider returning the Store as-is // instead of unwrapping. func (rs *Store) GetStore(key types.StoreKey) types.Store { - store := rs.GetCommitKVStore(key) + store := rs.GetCommitStore(key) if store == nil { panic(fmt.Sprintf("store does not exist for key: %s", key.Name())) } @@ -646,7 +656,10 @@ func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore { if s == nil { panic(fmt.Sprintf("store does not exist for key: %s", key.Name())) } - store := types.KVStore(s) + store, ok := s.(types.KVStore) + if !ok { + panic(fmt.Sprintf("store with key %v is not KVStore", key)) + } if rs.TracingEnabled() { store = tracekv.NewStore(store, rs.traceWriter, rs.getTracingContext()) @@ -658,6 +671,20 @@ func (rs *Store) GetKVStore(key types.StoreKey) types.KVStore { return store } +// GetObjKVStore returns a mounted ObjKVStore for a given StoreKey. +func (rs *Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { + s := rs.stores[key] + if s == nil { + panic(fmt.Sprintf("store does not exist for key: %s", key.Name())) + } + store, ok := s.(types.ObjKVStore) + if !ok { + panic(fmt.Sprintf("store with key %v is not ObjKVStore", key)) + } + + return store +} + func (rs *Store) handlePruning(version int64) error { pruneHeight := rs.pruningManager.GetPruningHeight(version) rs.logger.Debug("prune start", "height", version) @@ -709,7 +736,7 @@ func (rs *Store) GetStoreByName(name string) types.Store { return nil } - return rs.GetCommitKVStore(key) + return rs.GetCommitStore(key) } // Query calls substore.Query with the same `req` where `req.Path` is @@ -824,7 +851,7 @@ func (rs *Store) Snapshot(height uint64, protoWriter protoio.Writer) error { stores := []namedStore{} keys := keysFromStoreKeyMap(rs.stores) for _, key := range keys { - switch store := rs.GetCommitKVStore(key).(type) { + switch store := rs.GetCommitStore(key).(type) { case *iavl.Store: stores = append(stores, namedStore{name: key.Name(), Store: store}) case *transient.Store, *mem.Store: @@ -988,7 +1015,7 @@ loop: return snapshotItem, rs.LoadLatestVersion() } -func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID, params storeParams) (types.CommitKVStore, error) { +func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID, params storeParams) (types.CommitStore, error) { var db dbm.DB if params.db != nil { @@ -1037,12 +1064,20 @@ func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID return transient.NewStore(), nil case types.StoreTypeMemory: + _, ok := key.(*types.ObjectStoreKey) + if !ok { + return nil, fmt.Errorf("invalid StoreKey for StoreTypeTransient: %s", key.String()) + } + if _, ok := key.(*types.MemoryStoreKey); !ok { return nil, fmt.Errorf("unexpected key type for a MemoryStoreKey; got: %s", key.String()) } return mem.NewStore(), nil + case types.StoreTypeObject: + return transient.NewObjStore(), nil + default: panic(fmt.Sprintf("unrecognized store type %v", params.typ)) } @@ -1054,7 +1089,7 @@ func (rs *Store) buildCommitInfo(version int64) *types.CommitInfo { for _, key := range keys { store := rs.stores[key] storeType := store.GetStoreType() - if storeType == types.StoreTypeTransient || storeType == types.StoreTypeMemory { + if storeType == types.StoreTypeTransient || storeType == types.StoreTypeMemory || storeType == types.StoreTypeObject { continue } storeInfos = append(storeInfos, types.StoreInfo{ @@ -1172,7 +1207,7 @@ func GetLatestVersion(db dbm.DB) int64 { } // Commits each store and returns a new commitInfo. -func commitStores(version int64, storeMap map[types.StoreKey]types.CommitKVStore, removalMap map[types.StoreKey]bool) *types.CommitInfo { +func commitStores(version int64, storeMap map[types.StoreKey]types.CommitStore, removalMap map[types.StoreKey]bool) *types.CommitInfo { storeInfos := make([]types.StoreInfo, 0, len(storeMap)) storeKeys := keysFromStoreKeyMap(storeMap) @@ -1192,7 +1227,7 @@ func commitStores(version int64, storeMap map[types.StoreKey]types.CommitKVStore } storeType := store.GetStoreType() - if storeType == types.StoreTypeTransient || storeType == types.StoreTypeMemory { + if storeType == types.StoreTypeTransient || storeType == types.StoreTypeMemory || storeType == types.StoreTypeObject { continue } diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 983fc411f3da..34a3d8b1f626 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -786,6 +786,7 @@ var ( testStoreKey1 = types.NewKVStoreKey("store1") testStoreKey2 = types.NewKVStoreKey("store2") testStoreKey3 = types.NewKVStoreKey("store3") + testStoreKey4 = types.NewKVStoreKey("store4") ) func newMultiStoreWithMounts(db dbm.DB, pruningOpts pruningtypes.PruningOptions) *Store { @@ -858,7 +859,7 @@ func getExpectedCommitID(store *Store, ver int64) types.CommitID { } } -func hashStores(stores map[types.StoreKey]types.CommitKVStore) []byte { +func hashStores(stores map[types.StoreKey]types.CommitStore) []byte { m := make(map[string][]byte, len(stores)) for key, store := range stores { name := key.Name() @@ -913,35 +914,39 @@ func TestStateListeners(t *testing.T) { require.Empty(t, ms.PopStateCache()) } -type commitKVStoreStub struct { - types.CommitKVStore +type commitStoreStub struct { + types.CommitStore Committed int } -func (stub *commitKVStoreStub) Commit() types.CommitID { - commitID := stub.CommitKVStore.Commit() +func (stub *commitStoreStub) Commit() types.CommitID { + commitID := stub.CommitStore.Commit() stub.Committed++ return commitID } -func prepareStoreMap() (map[types.StoreKey]types.CommitKVStore, error) { +func prepareStoreMap() (map[types.StoreKey]types.CommitStore, error) { var db dbm.DB = dbm.NewMemDB() store := NewStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) store.MountStoreWithDB(types.NewKVStoreKey("iavl1"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewKVStoreKey("iavl2"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewTransientStoreKey("trans1"), types.StoreTypeTransient, nil) + store.MountStoreWithDB(types.NewObjectStoreKey("obj1"), types.StoreTypeObject, nil) if err := store.LoadLatestVersion(); err != nil { return nil, err } - return map[types.StoreKey]types.CommitKVStore{ - testStoreKey1: &commitKVStoreStub{ - CommitKVStore: store.GetStoreByName("iavl1").(types.CommitKVStore), + return map[types.StoreKey]types.CommitStore{ + testStoreKey1: &commitStoreStub{ + CommitStore: store.GetStoreByName("iavl1").(types.CommitStore), }, - testStoreKey2: &commitKVStoreStub{ - CommitKVStore: store.GetStoreByName("iavl2").(types.CommitKVStore), + testStoreKey2: &commitStoreStub{ + CommitStore: store.GetStoreByName("iavl2").(types.CommitStore), }, - testStoreKey3: &commitKVStoreStub{ - CommitKVStore: store.GetStoreByName("trans1").(types.CommitKVStore), + testStoreKey3: &commitStoreStub{ + CommitStore: store.GetStoreByName("trans1").(types.CommitStore), + }, + testStoreKey4: &commitStoreStub{ + CommitStore: store.GetStoreByName("obj1").(types.CommitStore), }, }, nil } @@ -972,7 +977,7 @@ func TestCommitStores(t *testing.T) { t.Run(tc.name, func(t *testing.T) { storeMap, err := prepareStoreMap() require.NoError(t, err) - store := storeMap[testStoreKey1].(*commitKVStoreStub) + store := storeMap[testStoreKey1].(*commitStoreStub) for i := tc.committed; i > 0; i-- { store.Commit() } diff --git a/store/tracekv/store.go b/store/tracekv/store.go index 7df8b0f97ba7..9fbc1bb4a3ef 100644 --- a/store/tracekv/store.go +++ b/store/tracekv/store.go @@ -6,6 +6,7 @@ import ( "io" "cosmossdk.io/errors" + "cosmossdk.io/store/cachekv" "cosmossdk.io/store/types" ) @@ -164,7 +165,7 @@ func (tkv *Store) GetStoreType() types.StoreType { // CacheWrap implements the KVStore interface. It panics because a Store // cannot be branched. func (tkv *Store) CacheWrap() types.CacheWrap { - panic("cannot CacheWrap a TraceKVStore") + return cachekv.NewStore(tkv) } // writeOperation writes a KVStore operation to the underlying io.Writer as diff --git a/store/tracekv/store_test.go b/store/tracekv/store_test.go index d276accd530a..00e4406c7574 100644 --- a/store/tracekv/store_test.go +++ b/store/tracekv/store_test.go @@ -283,5 +283,5 @@ func TestTraceKVStoreGetStoreType(t *testing.T) { func TestTraceKVStoreCacheWrap(t *testing.T) { store := newEmptyTraceKVStore(nil) - require.Panics(t, func() { store.CacheWrap() }) + store.CacheWrap() } diff --git a/store/transient/store.go b/store/transient/store.go index 6f393279f571..53332e9f33c1 100644 --- a/store/transient/store.go +++ b/store/transient/store.go @@ -1,9 +1,8 @@ package transient import ( - dbm "github.com/cosmos/cosmos-db" - - "cosmossdk.io/store/dbadapter" + "cosmossdk.io/store/internal" + "cosmossdk.io/store/internal/btree" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/types" ) @@ -11,43 +10,73 @@ import ( var ( _ types.Committer = (*Store)(nil) _ types.KVStore = (*Store)(nil) + + _ types.Committer = (*ObjStore)(nil) + _ types.ObjKVStore = (*ObjStore)(nil) ) // Store is a wrapper for a MemDB with Commiter implementation +type GStore[V any] struct { + internal.BTreeStore[V] +} + +// NewGStore constructs new generic transient store +func NewGStore[V any](isZero func(V) bool, valueLen func(V) int) *GStore[V] { + return &GStore[V]{*internal.NewBTreeStore(btree.NewBTree[V](), isZero, valueLen)} +} + +// Store specializes GStore for []byte type Store struct { - dbadapter.Store + GStore[[]byte] } -// Constructs new MemDB adapter func NewStore() *Store { - return &Store{Store: dbadapter.Store{DB: dbm.NewMemDB()}} + return &Store{*NewGStore( + func(v []byte) bool { return v == nil }, + func(v []byte) int { return len(v) }, + )} +} + +func (*Store) GetStoreType() types.StoreType { + return types.StoreTypeTransient +} + +// ObjStore specializes GStore for any +type ObjStore struct { + GStore[any] +} + +func NewObjStore() *ObjStore { + return &ObjStore{*NewGStore( + func(v any) bool { return v == nil }, + func(v any) int { return 1 }, // for value length validation + )} +} + +func (*ObjStore) GetStoreType() types.StoreType { + return types.StoreTypeObject } // Implements CommitStore // Commit cleans up Store. -func (ts *Store) Commit() (id types.CommitID) { - ts.Store = dbadapter.Store{DB: dbm.NewMemDB()} +func (ts *GStore[V]) Commit() (id types.CommitID) { + ts.Clear() return } -func (ts *Store) SetPruning(_ pruningtypes.PruningOptions) {} +func (ts *GStore[V]) SetPruning(_ pruningtypes.PruningOptions) {} // GetPruning is a no-op as pruning options cannot be directly set on this store. // They must be set on the root commit multi-store. -func (ts *Store) GetPruning() pruningtypes.PruningOptions { +func (ts *GStore[V]) GetPruning() pruningtypes.PruningOptions { return pruningtypes.NewPruningOptions(pruningtypes.PruningUndefined) } // Implements CommitStore -func (ts *Store) LastCommitID() types.CommitID { +func (ts *GStore[V]) LastCommitID() types.CommitID { return types.CommitID{} } -func (ts *Store) WorkingHash() []byte { +func (ts *GStore[V]) WorkingHash() []byte { return []byte{} } - -// Implements Store. -func (ts *Store) GetStoreType() types.StoreType { - return types.StoreTypeTransient -} diff --git a/store/types/store.go b/store/types/store.go index f37e9860baaa..2def13f3f2d3 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -136,6 +136,7 @@ type MultiStore interface { // If the store does not exist, panics. GetStore(StoreKey) Store GetKVStore(StoreKey) KVStore + GetObjKVStore(StoreKey) ObjKVStore // TracingEnabled returns if tracing is enabled for the MultiStore. TracingEnabled() bool @@ -229,25 +230,25 @@ type CommitMultiStore interface { //---------subsp------------------------------- // KVStore -// BasicKVStore is a simple interface to get/set data -type BasicKVStore interface { +// GBasicKVStore is a simple interface to get/set data +type GBasicKVStore[V any] interface { // Get returns nil if key doesn't exist. Panics on nil key. - Get(key []byte) []byte + Get(key []byte) V // Has checks if a key exists. Panics on nil key. Has(key []byte) bool // Set sets the key. Panics on nil key or value. - Set(key, value []byte) + Set(key []byte, value V) // Delete deletes the key. Panics on nil key. Delete(key []byte) } -// KVStore additionally provides iteration and deletion -type KVStore interface { +// GKVStore additionally provides iteration and deletion +type GKVStore[V any] interface { Store - BasicKVStore + GBasicKVStore[V] // Iterator over a domain of keys in ascending order. End is exclusive. // Start must be less than end, or the Iterator is invalid. @@ -255,18 +256,54 @@ type KVStore interface { // To iterate over entire domain, use store.Iterator(nil, nil) // CONTRACT: No writes may happen within a domain while an iterator exists over it. // Exceptionally allowed for cachekv.Store, safe to write in the modules. - Iterator(start, end []byte) Iterator + Iterator(start, end []byte) GIterator[V] // Iterator over a domain of keys in descending order. End is exclusive. // Start must be less than end, or the Iterator is invalid. // Iterator must be closed by caller. // CONTRACT: No writes may happen within a domain while an iterator exists over it. // Exceptionally allowed for cachekv.Store, safe to write in the modules. - ReverseIterator(start, end []byte) Iterator + ReverseIterator(start, end []byte) GIterator[V] } -// Iterator is an alias db's Iterator for convenience. -type Iterator = dbm.Iterator +// GIterator is the generic version of dbm's Iterator +type GIterator[V any] interface { + // Domain returns the start (inclusive) and end (exclusive) limits of the iterator. + // CONTRACT: start, end readonly []byte + Domain() (start, end []byte) + + // Valid returns whether the current iterator is valid. Once invalid, the Iterator remains + // invalid forever. + Valid() bool + + // Next moves the iterator to the next key in the database, as defined by order of iteration. + // If Valid returns false, this method will panic. + Next() + + // Key returns the key at the current position. Panics if the iterator is invalid. + // CONTRACT: key readonly []byte + Key() (key []byte) + + // Value returns the value at the current position. Panics if the iterator is invalid. + // CONTRACT: value readonly []byte + Value() (value V) + + // Error returns the last error encountered by the iterator, if any. + Error() error + + // Close closes the iterator, relasing any allocated resources. + Close() error +} + +type ( + Iterator = GIterator[[]byte] + BasicKVStore = GBasicKVStore[[]byte] + KVStore = GKVStore[[]byte] + + ObjIterator = GIterator[any] + ObjBasicKVStore = GBasicKVStore[any] + ObjKVStore = GKVStore[any] +) // CacheKVStore branches a KVStore and provides read cache functionality. // After calling .Write() on the CacheKVStore, all previously created @@ -292,11 +329,10 @@ type CommitKVStore interface { // a Committer, since Commit ephemeral store make no sense. It can return KVStore, // HeapStore, SpaceStore, etc. type CacheWrap interface { + CacheWrapper + // Write syncs with the underlying store. Write() - - // CacheWrap recursively wraps again. - CacheWrap() CacheWrap } type CacheWrapper interface { @@ -326,6 +362,7 @@ const ( StoreTypeMemory StoreTypeSMT StoreTypePersistent + StoreTypeObject ) func (st StoreType) String() string { @@ -350,6 +387,9 @@ func (st StoreType) String() string { case StoreTypePersistent: return "StoreTypePersistent" + + case StoreTypeObject: + return "StoreTypeObject" } return "unknown store type" @@ -429,6 +469,29 @@ func (key *TransientStoreKey) String() string { return fmt.Sprintf("TransientStoreKey{%p, %s}", key, key.name) } +// ObjectStoreKey is used for indexing transient stores in a MultiStore +type ObjectStoreKey struct { + name string +} + +// Constructs new ObjectStoreKey +// Must return a pointer according to the ocap principle +func NewObjectStoreKey(name string) *ObjectStoreKey { + return &ObjectStoreKey{ + name: name, + } +} + +// Implements StoreKey +func (key *ObjectStoreKey) Name() string { + return key.name +} + +// Implements StoreKey +func (key *ObjectStoreKey) String() string { + return fmt.Sprintf("ObjectStoreKey{%p, %s}", key, key.name) +} + // MemoryStoreKey defines a typed key to be used with an in-memory KVStore. type MemoryStoreKey struct { name string diff --git a/store/types/validity.go b/store/types/validity.go index a1fbaba999c7..a1363ff28b1d 100644 --- a/store/types/validity.go +++ b/store/types/validity.go @@ -1,5 +1,7 @@ package types +import "errors" + var ( // 128K - 1 MaxKeyLength = (1 << 17) - 1 @@ -22,7 +24,12 @@ func AssertValidValue(value []byte) { if value == nil { panic("value is nil") } - if len(value) > MaxValueLength { - panic("value is too large") + AssertValidValueLength(len(value)) +} + +// AssertValidValueLength checks if the value length is within length limit +func AssertValidValueLength(l int) { + if l > MaxValueLength { + panic(errors.New("value is too large")) } } diff --git a/tests/go.mod b/tests/go.mod index c5e52f2bf018..4dd82ea6c82e 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -207,6 +207,7 @@ require ( replace ( // We always want to test against the latest version of the simapp. cosmossdk.io/simapp => ../simapp + cosmossdk.io/store => ../store github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 // We always want to test against the latest version of the SDK. github.com/cosmos/cosmos-sdk => ../. diff --git a/tests/go.sum b/tests/go.sum index e97a332d6581..9853a5bdfd93 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -200,8 +200,6 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.2 h1:lSg5BTvJBHUDwswNNyeh4K/CbqiHER73VU4nDNb8uk0= -cosmossdk.io/store v1.0.2/go.mod h1:EFtENTqVTuWwitGW1VwaBct+yDagk7oG/axBMPH+FXs= cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= diff --git a/types/context.go b/types/context.go index 36c5ccdc8094..248b5af95793 100644 --- a/types/context.go +++ b/types/context.go @@ -377,6 +377,11 @@ func (c Context) TransientStore(key storetypes.StoreKey) storetypes.KVStore { return gaskv.NewStore(c.ms.GetKVStore(key), c.gasMeter, c.transientKVGasConfig) } +// ObjectStore fetches an object store from the MultiStore, +func (c Context) OjectStore(key storetypes.StoreKey) storetypes.ObjKVStore { + return gaskv.NewObjStore(c.ms.GetObjKVStore(key), c.gasMeter, c.transientKVGasConfig) +} + // CacheContext returns a new Context with the multi-store cached and a new // EventManager. The cached context is written to the context when writeCache // is called. Note, events are automatically emitted on the parent context's diff --git a/x/group/internal/orm/testsupport.go b/x/group/internal/orm/testsupport.go index b4fe3d0354ee..b03fcec42ba9 100644 --- a/x/group/internal/orm/testsupport.go +++ b/x/group/internal/orm/testsupport.go @@ -26,8 +26,8 @@ func NewMockContext() *MockContext { } func (m MockContext) KVStore(key storetypes.StoreKey) storetypes.KVStore { - if s := m.store.GetCommitKVStore(key); s != nil { - return s + if s := m.store.GetCommitStore(key); s != nil { + return s.(storetypes.KVStore) } m.store.MountStoreWithDB(key, storetypes.StoreTypeIAVL, m.db) if err := m.store.LoadLatestVersion(); err != nil { From 4d32911156ac49e4ee932721a3aa3c102f63517a Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 27 Mar 2024 12:24:20 +0800 Subject: [PATCH 05/37] prefix store support object store (#236) --- store/cachekv/store.go | 9 +--- store/gaskv/store.go | 9 +--- store/prefix/store.go | 91 ++++++++++++++++++++++++++++------------- store/types/store.go | 14 +++++++ store/types/validity.go | 8 ++++ types/context.go | 2 +- 6 files changed, 87 insertions(+), 46 deletions(-) diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 9f7ff680db60..7c7cf7513845 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -89,17 +89,10 @@ func (store *GStore[V]) Get(key []byte) (value V) { return value } -func (store *GStore[V]) assertValidValue(value V) { - if store.isZero(value) { - panic("value is nil") - } - types.AssertValidValueLength(store.valueLen(value)) -} - // Set implements types.KVStore. func (store *GStore[V]) Set(key []byte, value V) { types.AssertValidKey(key) - store.assertValidValue(value) + types.AssertValidValueGeneric(value, store.isZero, store.valueLen) store.mtx.Lock() defer store.mtx.Unlock() diff --git a/store/gaskv/store.go b/store/gaskv/store.go index 7aab63b0863a..7033d7360036 100644 --- a/store/gaskv/store.go +++ b/store/gaskv/store.go @@ -71,17 +71,10 @@ func (gs *GStore[V]) Get(key []byte) (value V) { return value } -func (gs *GStore[V]) assertValidValue(value V) { - if gs.isZero(value) { - panic("value is nil") - } - types.AssertValidValueLength(gs.valueLen(value)) -} - // Implements KVStore. func (gs *GStore[V]) Set(key []byte, value V) { types.AssertValidKey(key) - gs.assertValidValue(value) + types.AssertValidValueGeneric(value, gs.isZero, gs.valueLen) gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostFlat, types.GasWriteCostFlatDesc) // TODO overflow-safe math? gs.gasMeter.ConsumeGas(gs.gasConfig.WriteCostPerByte*types.Gas(len(key)), types.GasWritePerByteDesc) diff --git a/store/prefix/store.go b/store/prefix/store.go index 10f50b3ea795..908f70210b55 100644 --- a/store/prefix/store.go +++ b/store/prefix/store.go @@ -8,20 +8,53 @@ import ( "cosmossdk.io/store/types" ) -var _ types.KVStore = Store{} +type ( + Store = GStore[[]byte] + ObjStore = GStore[any] +) + +var ( + _ types.KVStore = Store{} + _ types.ObjKVStore = ObjStore{} +) + +func NewStore(parent types.KVStore, prefix []byte) Store { + return NewGStore( + parent, prefix, + func(v []byte) bool { return v == nil }, + func(v []byte) int { return len(v) }, + ) +} -// Store is similar with cometbft/cometbft/libs/db/prefix_db +func NewObjStore(parent types.ObjKVStore, prefix []byte) ObjStore { + return NewGStore( + parent, prefix, + func(v any) bool { return v == nil }, + func(v any) int { return 1 }, + ) +} + +// GStore is similar with cometbft/cometbft/libs/db/prefix_db // both gives access only to the limited subset of the store // for convinience or safety -type Store struct { - parent types.KVStore +type GStore[V any] struct { + parent types.GKVStore[V] prefix []byte + + isZero func(V) bool + valueLen func(V) int } -func NewStore(parent types.KVStore, prefix []byte) Store { - return Store{ +func NewGStore[V any]( + parent types.GKVStore[V], prefix []byte, + isZero func(V) bool, valueLen func(V) int, +) GStore[V] { + return GStore[V]{ parent: parent, prefix: prefix, + + isZero: isZero, + valueLen: valueLen, } } @@ -32,7 +65,7 @@ func cloneAppend(bz, tail []byte) (res []byte) { return } -func (s Store) key(key []byte) (res []byte) { +func (s GStore[V]) key(key []byte) (res []byte) { if key == nil { panic("nil key on Store") } @@ -41,41 +74,41 @@ func (s Store) key(key []byte) (res []byte) { } // Implements Store -func (s Store) GetStoreType() types.StoreType { +func (s GStore[V]) GetStoreType() types.StoreType { return s.parent.GetStoreType() } // Implements CacheWrap -func (s Store) CacheWrap() types.CacheWrap { - return cachekv.NewStore(s) +func (s GStore[V]) CacheWrap() types.CacheWrap { + return cachekv.NewGStore(s, s.isZero, s.valueLen) } // Implements KVStore -func (s Store) Get(key []byte) []byte { +func (s GStore[V]) Get(key []byte) V { res := s.parent.Get(s.key(key)) return res } // Implements KVStore -func (s Store) Has(key []byte) bool { +func (s GStore[V]) Has(key []byte) bool { return s.parent.Has(s.key(key)) } // Implements KVStore -func (s Store) Set(key, value []byte) { +func (s GStore[V]) Set(key []byte, value V) { types.AssertValidKey(key) - types.AssertValidValue(value) + types.AssertValidValueGeneric(value, s.isZero, s.valueLen) s.parent.Set(s.key(key), value) } // Implements KVStore -func (s Store) Delete(key []byte) { +func (s GStore[V]) Delete(key []byte) { s.parent.Delete(s.key(key)) } // Implements KVStore // Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L106 -func (s Store) Iterator(start, end []byte) types.Iterator { +func (s GStore[V]) Iterator(start, end []byte) types.GIterator[V] { newstart := cloneAppend(s.prefix, start) var newend []byte @@ -92,7 +125,7 @@ func (s Store) Iterator(start, end []byte) types.Iterator { // ReverseIterator implements KVStore // Check https://github.com/cometbft/cometbft/blob/master/libs/db/prefix_db.go#L129 -func (s Store) ReverseIterator(start, end []byte) types.Iterator { +func (s GStore[V]) ReverseIterator(start, end []byte) types.GIterator[V] { newstart := cloneAppend(s.prefix, start) var newend []byte @@ -107,18 +140,18 @@ func (s Store) ReverseIterator(start, end []byte) types.Iterator { return newPrefixIterator(s.prefix, start, end, iter) } -var _ types.Iterator = (*prefixIterator)(nil) +var _ types.Iterator = (*prefixIterator[[]byte])(nil) -type prefixIterator struct { +type prefixIterator[V any] struct { prefix []byte start []byte end []byte - iter types.Iterator + iter types.GIterator[V] valid bool } -func newPrefixIterator(prefix, start, end []byte, parent types.Iterator) *prefixIterator { - return &prefixIterator{ +func newPrefixIterator[V any](prefix, start, end []byte, parent types.GIterator[V]) *prefixIterator[V] { + return &prefixIterator[V]{ prefix: prefix, start: start, end: end, @@ -128,17 +161,17 @@ func newPrefixIterator(prefix, start, end []byte, parent types.Iterator) *prefix } // Implements Iterator -func (pi *prefixIterator) Domain() ([]byte, []byte) { +func (pi *prefixIterator[V]) Domain() ([]byte, []byte) { return pi.start, pi.end } // Implements Iterator -func (pi *prefixIterator) Valid() bool { +func (pi *prefixIterator[V]) Valid() bool { return pi.valid && pi.iter.Valid() } // Implements Iterator -func (pi *prefixIterator) Next() { +func (pi *prefixIterator[V]) Next() { if !pi.valid { panic("prefixIterator invalid, cannot call Next()") } @@ -150,7 +183,7 @@ func (pi *prefixIterator) Next() { } // Implements Iterator -func (pi *prefixIterator) Key() (key []byte) { +func (pi *prefixIterator[V]) Key() (key []byte) { if !pi.valid { panic("prefixIterator invalid, cannot call Key()") } @@ -162,7 +195,7 @@ func (pi *prefixIterator) Key() (key []byte) { } // Implements Iterator -func (pi *prefixIterator) Value() []byte { +func (pi *prefixIterator[V]) Value() V { if !pi.valid { panic("prefixIterator invalid, cannot call Value()") } @@ -171,13 +204,13 @@ func (pi *prefixIterator) Value() []byte { } // Implements Iterator -func (pi *prefixIterator) Close() error { +func (pi *prefixIterator[V]) Close() error { return pi.iter.Close() } // Error returns an error if the prefixIterator is invalid defined by the Valid // method. -func (pi *prefixIterator) Error() error { +func (pi *prefixIterator[V]) Error() error { if !pi.Valid() { return errors.New("invalid prefixIterator") } diff --git a/store/types/store.go b/store/types/store.go index 2def13f3f2d3..08f8044b30dc 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -589,3 +589,17 @@ func NewMemoryStoreKeys(names ...string) map[string]*MemoryStoreKey { return keys } + +// NewObjectStoreKeys constructs a new map matching store key names to their +// respective ObjectStoreKey references. +// The function will panic if there is a potential conflict in names (see `assertNoPrefix` +// function for more details). +func NewObjectStoreKeys(names ...string) map[string]*ObjectStoreKey { + assertNoCommonPrefix(names) + keys := make(map[string]*ObjectStoreKey) + for _, n := range names { + keys[n] = NewObjectStoreKey(n) + } + + return keys +} diff --git a/store/types/validity.go b/store/types/validity.go index a1363ff28b1d..cfb6088c8a32 100644 --- a/store/types/validity.go +++ b/store/types/validity.go @@ -27,6 +27,14 @@ func AssertValidValue(value []byte) { AssertValidValueLength(len(value)) } +// AssertValidValueGeneric checks if the value is valid(value is not nil and within length limit) +func AssertValidValueGeneric[V any](value V, isZero func(V) bool, valueLen func(V) int) { + if isZero(value) { + panic("value is nil") + } + AssertValidValueLength(valueLen(value)) +} + // AssertValidValueLength checks if the value length is within length limit func AssertValidValueLength(l int) { if l > MaxValueLength { diff --git a/types/context.go b/types/context.go index 248b5af95793..27df031ada9b 100644 --- a/types/context.go +++ b/types/context.go @@ -378,7 +378,7 @@ func (c Context) TransientStore(key storetypes.StoreKey) storetypes.KVStore { } // ObjectStore fetches an object store from the MultiStore, -func (c Context) OjectStore(key storetypes.StoreKey) storetypes.ObjKVStore { +func (c Context) ObjectStore(key storetypes.StoreKey) storetypes.ObjKVStore { return gaskv.NewObjStore(c.ms.GetObjKVStore(key), c.gasMeter, c.transientKVGasConfig) } From 9ef65ec01b186dcece87ad08777968afd157b0b1 Mon Sep 17 00:00:00 2001 From: yihuang Date: Thu, 28 Mar 2024 12:08:04 +0800 Subject: [PATCH 06/37] Problem: fee collection not compatible with parallel execution (#237) * Problem: no efficient way to collect fee Solution: - support an idea of virtual account in bank module, where the incoming coins are accumulated in a per-tx object store first, then accumulate and credit to the real account at end blocker. it's nesserary to support parallel tx execution, where we try not to access shared states. more efficient sum support SendCoinsFromModuleToAccountVirtual fix test fix test * fix lint * fix test * fix test * fix test * fix test * fix test * fix mock keeper * try fix lint * try fix lint * reuse code * try fix linter * Update x/bank/keeper/send.go Signed-off-by: yihuang * algin panic call * fix error handling * try fix lint * nolintlint generate falst postiive --------- Signed-off-by: yihuang --- .golangci.yml | 1 - CHANGELOG.md | 3 +- baseapp/baseapp.go | 3 + runtime/module.go | 7 + simapp/app.go | 6 + simapp/app_config.go | 1 + .../bank/keeper/deterministic_test.go | 4 +- .../distribution/keeper/msg_server_test.go | 6 +- .../evidence/keeper/infraction_test.go | 6 +- tests/integration/gov/keeper/keeper_test.go | 6 +- .../slashing/keeper/keeper_test.go | 4 +- .../integration/staking/keeper/common_test.go | 6 +- .../staking/keeper/determinstic_test.go | 4 +- testutil/context.go | 14 ++ testutil/integration/example_test.go | 4 +- testutil/integration/router.go | 6 +- x/bank/keeper/collections_test.go | 4 +- x/bank/keeper/keeper.go | 9 +- x/bank/keeper/keeper_test.go | 47 ++++- x/bank/keeper/send.go | 17 +- x/bank/keeper/virtual.go | 178 ++++++++++++++++++ x/bank/module.go | 10 +- x/bank/types/keys.go | 3 + x/gov/testutil/expected_keepers_mocks.go | 23 +++ 24 files changed, 353 insertions(+), 19 deletions(-) create mode 100644 x/bank/keeper/virtual.go diff --git a/.golangci.yml b/.golangci.yml index 7f51609abf1d..5ad15c222fb2 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,7 +27,6 @@ linters: - ineffassign - misspell - nakedret - - nolintlint - staticcheck - revive - stylecheck diff --git a/CHANGELOG.md b/CHANGELOG.md index 330a5499f075..3706134b62a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,7 +41,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Add `TxExecutor` baseapp option, add `TxIndex`/`TxCount`/`MsgIndex`/`BlockGasUsed` fields to `Context, to support tx parallel execution. -* (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Support mount object store in baseapp, add `ObjectStore` api in context.. +* (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context.. +* (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins. ## [Unreleased-Upstream] diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index eeb8a414d643..1b39ffba0bf3 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -305,6 +305,9 @@ func (app *BaseApp) MountStores(keys ...storetypes.StoreKey) { case *storetypes.MemoryStoreKey: app.MountStore(key, storetypes.StoreTypeMemory) + case *storetypes.ObjectStoreKey: + app.MountStore(key, storetypes.StoreTypeObject) + default: panic(fmt.Sprintf("Unrecognized store key type :%T", key)) } diff --git a/runtime/module.go b/runtime/module.go index cdc6a1a3a33f..148efb40fa8d 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -67,6 +67,7 @@ func init() { ProvideKVStoreKey, ProvideTransientStoreKey, ProvideMemoryStoreKey, + ProvideObjectStoreKey, ProvideGenesisTxHandler, ProvideKVStoreService, ProvideMemoryStoreService, @@ -222,6 +223,12 @@ func ProvideMemoryStoreKey(key depinject.ModuleKey, app *AppBuilder) *storetypes return storeKey } +func ProvideObjectStoreKey(key depinject.ModuleKey, app *AppBuilder) *storetypes.ObjectStoreKey { + storeKey := storetypes.NewObjectStoreKey(fmt.Sprintf("object:%s", key.Name())) + registerStoreKey(app, storeKey) + return storeKey +} + func ProvideGenesisTxHandler(appBuilder *AppBuilder) genesis.TxHandler { return appBuilder.app } diff --git a/simapp/app.go b/simapp/app.go index 3c27030af82d..6268e5a9daaf 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -146,6 +146,7 @@ type SimApp struct { // keys to access the substores keys map[string]*storetypes.KVStoreKey tkeys map[string]*storetypes.TransientStoreKey + okeys map[string]*storetypes.ObjectStoreKey // keepers AccountKeeper authkeeper.AccountKeeper @@ -266,6 +267,7 @@ func NewSimApp( } tkeys := storetypes.NewTransientStoreKeys(paramstypes.TStoreKey) + okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey) app := &SimApp{ BaseApp: bApp, legacyAmino: legacyAmino, @@ -274,6 +276,7 @@ func NewSimApp( interfaceRegistry: interfaceRegistry, keys: keys, tkeys: tkeys, + okeys: okeys, } app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) @@ -288,6 +291,7 @@ func NewSimApp( app.BankKeeper = bankkeeper.NewBaseKeeper( appCodec, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], app.AccountKeeper, BlockedAddresses(), authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -456,6 +460,7 @@ func NewSimApp( authz.ModuleName, ) app.ModuleManager.SetOrderEndBlockers( + banktypes.ModuleName, crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, @@ -516,6 +521,7 @@ func NewSimApp( // initialize stores app.MountKVStores(keys) app.MountTransientStores(tkeys) + app.MountObjectStores(okeys) // initialize BaseApp app.SetInitChainer(app.InitChainer) diff --git a/simapp/app_config.go b/simapp/app_config.go index 2b11313e60dd..d799fe52e283 100644 --- a/simapp/app_config.go +++ b/simapp/app_config.go @@ -122,6 +122,7 @@ var ( authz.ModuleName, }, EndBlockers: []string{ + banktypes.ModuleName, crisistypes.ModuleName, govtypes.ModuleName, stakingtypes.ModuleName, diff --git a/tests/integration/bank/keeper/deterministic_test.go b/tests/integration/bank/keeper/deterministic_test.go index 86bce291117c..fe4c6b4b2e42 100644 --- a/tests/integration/bank/keeper/deterministic_test.go +++ b/tests/integration/bank/keeper/deterministic_test.go @@ -64,10 +64,11 @@ type deterministicFixture struct { func initDeterministicFixture(t *testing.T) *deterministicFixture { keys := storetypes.NewKVStoreKeys(authtypes.StoreKey, banktypes.StoreKey) + okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, bank.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) @@ -93,6 +94,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { bankKeeper := keeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/tests/integration/distribution/keeper/msg_server_test.go b/tests/integration/distribution/keeper/msg_server_test.go index 86a2d8e626e2..fb6e82ad755d 100644 --- a/tests/integration/distribution/keeper/msg_server_test.go +++ b/tests/integration/distribution/keeper/msg_server_test.go @@ -61,10 +61,13 @@ func initFixture(t testing.TB) *fixture { keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, distrtypes.StoreKey, stakingtypes.StoreKey, ) + okeys := storetypes.NewObjectStoreKeys( + banktypes.ObjectStoreKey, + ) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, distribution.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, types.Header{}, true, logger) @@ -92,6 +95,7 @@ func initFixture(t testing.TB) *fixture { bankKeeper := bankkeeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/tests/integration/evidence/keeper/infraction_test.go b/tests/integration/evidence/keeper/infraction_test.go index 0c17797754bf..596bca82418b 100644 --- a/tests/integration/evidence/keeper/infraction_test.go +++ b/tests/integration/evidence/keeper/infraction_test.go @@ -83,10 +83,13 @@ func initFixture(t testing.TB) *fixture { keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, paramtypes.StoreKey, consensusparamtypes.StoreKey, evidencetypes.StoreKey, stakingtypes.StoreKey, slashingtypes.StoreKey, ) + okeys := storetypes.NewObjectStoreKeys( + banktypes.ObjectStoreKey, + ) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, evidence.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) @@ -114,6 +117,7 @@ func initFixture(t testing.TB) *fixture { bankKeeper := bankkeeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/tests/integration/gov/keeper/keeper_test.go b/tests/integration/gov/keeper/keeper_test.go index 4e385e8f0d70..1d8001878588 100644 --- a/tests/integration/gov/keeper/keeper_test.go +++ b/tests/integration/gov/keeper/keeper_test.go @@ -52,10 +52,13 @@ func initFixture(t testing.TB) *fixture { keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, distrtypes.StoreKey, stakingtypes.StoreKey, types.StoreKey, ) + okeys := storetypes.NewObjectStoreKeys( + banktypes.ObjectStoreKey, + ) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, bank.AppModuleBasic{}, gov.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) @@ -85,6 +88,7 @@ func initFixture(t testing.TB) *fixture { bankKeeper := bankkeeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/tests/integration/slashing/keeper/keeper_test.go b/tests/integration/slashing/keeper/keeper_test.go index d43c07f1df85..74aacdf36859 100644 --- a/tests/integration/slashing/keeper/keeper_test.go +++ b/tests/integration/slashing/keeper/keeper_test.go @@ -54,10 +54,11 @@ func initFixture(t testing.TB) *fixture { keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, slashingtypes.StoreKey, stakingtypes.StoreKey, ) + okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) @@ -85,6 +86,7 @@ func initFixture(t testing.TB) *fixture { bankKeeper := bankkeeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/tests/integration/staking/keeper/common_test.go b/tests/integration/staking/keeper/common_test.go index f4958b1b86da..b5e2815efb27 100644 --- a/tests/integration/staking/keeper/common_test.go +++ b/tests/integration/staking/keeper/common_test.go @@ -95,10 +95,13 @@ func initFixture(t testing.TB) *fixture { keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, types.StoreKey, ) + okeys := storetypes.NewObjectStoreKeys( + banktypes.ObjectStoreKey, + ) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, staking.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, cmtprototypes.Header{}, true, logger) @@ -127,6 +130,7 @@ func initFixture(t testing.TB) *fixture { bankKeeper := bankkeeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/tests/integration/staking/keeper/determinstic_test.go b/tests/integration/staking/keeper/determinstic_test.go index c6c0f6377d37..99f2a86a47ee 100644 --- a/tests/integration/staking/keeper/determinstic_test.go +++ b/tests/integration/staking/keeper/determinstic_test.go @@ -68,10 +68,11 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { keys := storetypes.NewKVStoreKeys( authtypes.StoreKey, banktypes.StoreKey, stakingtypes.StoreKey, ) + okeys := storetypes.NewObjectStoreKeys(banktypes.ObjectStoreKey) cdc := moduletestutil.MakeTestEncodingConfig(auth.AppModuleBasic{}, distribution.AppModuleBasic{}).Codec logger := log.NewTestLogger(t) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, okeys, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) @@ -100,6 +101,7 @@ func initDeterministicFixture(t *testing.T) *deterministicFixture { bankKeeper := bankkeeper.NewBaseKeeper( cdc, runtime.NewKVStoreService(keys[banktypes.StoreKey]), + okeys[banktypes.ObjectStoreKey], accountKeeper, blockedAddresses, authority.String(), diff --git a/testutil/context.go b/testutil/context.go index a43e96295ae2..6eed70f8523a 100644 --- a/testutil/context.go +++ b/testutil/context.go @@ -79,3 +79,17 @@ func DefaultContextWithDB(t testing.TB, key, tkey storetypes.StoreKey) TestConte return TestContext{ctx, db, cms} } + +func DefaultContextWithObjectStore(t testing.TB, key, tkey, okey storetypes.StoreKey) TestContext { + db := dbm.NewMemDB() + cms := store.NewCommitMultiStore(db, log.NewNopLogger(), metrics.NewNoOpMetrics()) + cms.MountStoreWithDB(key, storetypes.StoreTypeIAVL, db) + cms.MountStoreWithDB(tkey, storetypes.StoreTypeTransient, nil) + cms.MountStoreWithDB(okey, storetypes.StoreTypeObject, nil) + err := cms.LoadLatestVersion() + assert.NoError(t, err) + + ctx := sdk.NewContext(cms, cmtproto.Header{Time: time.Now()}, false, log.NewNopLogger()) + + return TestContext{ctx, db, cms} +} diff --git a/testutil/integration/example_test.go b/testutil/integration/example_test.go index b395324c1917..698bcbd5d4c4 100644 --- a/testutil/integration/example_test.go +++ b/testutil/integration/example_test.go @@ -37,7 +37,7 @@ func Example() { // replace the logger by testing values in a real test case (e.g. log.NewTestLogger(t)) logger := log.NewNopLogger() - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, nil, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) accountKeeper := authkeeper.NewAccountKeeper( @@ -126,7 +126,7 @@ func Example_oneModule() { // replace the logger by testing values in a real test case (e.g. log.NewTestLogger(t)) logger := log.NewLogger(io.Discard) - cms := integration.CreateMultiStore(keys, logger) + cms := integration.CreateMultiStore(keys, nil, logger) newCtx := sdk.NewContext(cms, cmtproto.Header{}, true, logger) accountKeeper := authkeeper.NewAccountKeeper( diff --git a/testutil/integration/router.go b/testutil/integration/router.go index 4270d493ad8c..033f4f9186b0 100644 --- a/testutil/integration/router.go +++ b/testutil/integration/router.go @@ -177,7 +177,7 @@ func (app *App) QueryHelper() *baseapp.QueryServiceTestHelper { } // CreateMultiStore is a helper for setting up multiple stores for provided modules. -func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) storetypes.CommitMultiStore { +func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, okeys map[string]*storetypes.ObjectStoreKey, logger log.Logger) storetypes.CommitMultiStore { db := dbm.NewMemDB() cms := store.NewCommitMultiStore(db, logger, metrics.NewNoOpMetrics()) @@ -185,6 +185,10 @@ func CreateMultiStore(keys map[string]*storetypes.KVStoreKey, logger log.Logger) cms.MountStoreWithDB(keys[key], storetypes.StoreTypeIAVL, db) } + for key := range okeys { + cms.MountStoreWithDB(okeys[key], storetypes.StoreTypeObject, nil) + } + _ = cms.LoadLatestVersion() return cms } diff --git a/x/bank/keeper/collections_test.go b/x/bank/keeper/collections_test.go index e1af343cce56..364f923d3e29 100644 --- a/x/bank/keeper/collections_test.go +++ b/x/bank/keeper/collections_test.go @@ -26,7 +26,8 @@ import ( func TestBankStateCompatibility(t *testing.T) { key := storetypes.NewKVStoreKey(banktypes.StoreKey) - testCtx := testutil.DefaultContextWithDB(t, key, storetypes.NewTransientStoreKey("transient_test")) + okey := storetypes.NewObjectStoreKey(banktypes.ObjectStoreKey) + testCtx := testutil.DefaultContextWithObjectStore(t, key, storetypes.NewTransientStoreKey("transient_test"), okey) ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() @@ -40,6 +41,7 @@ func TestBankStateCompatibility(t *testing.T) { k := keeper.NewBaseKeeper( encCfg.Codec, storeService, + okey, authKeeper, map[string]bool{accAddrs[4].String(): true}, authtypes.NewModuleAddress("gov").String(), diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index bfa45d23f64e..26dceca9b66b 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -8,6 +8,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" @@ -46,9 +47,14 @@ type Keeper interface { MintCoins(ctx context.Context, moduleName string, amt sdk.Coins) error BurnCoins(ctx context.Context, moduleName string, amt sdk.Coins) error + SendCoinsFromAccountToModuleVirtual(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + SendCoinsFromModuleToAccountVirtual(ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins) error + DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr sdk.AccAddress, amt sdk.Coins) error UndelegateCoins(ctx context.Context, moduleAccAddr, delegatorAddr sdk.AccAddress, amt sdk.Coins) error + CreditVirtualAccounts(ctx context.Context) error + types.QueryServer } @@ -84,6 +90,7 @@ func (k BaseKeeper) GetPaginatedTotalSupply(ctx context.Context, pagination *que func NewBaseKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, + objStoreKey storetypes.StoreKey, ak types.AccountKeeper, blockedAddrs map[string]bool, authority string, @@ -97,7 +104,7 @@ func NewBaseKeeper( logger = logger.With(log.ModuleKey, "x/"+types.ModuleName) return BaseKeeper{ - BaseSendKeeper: NewBaseSendKeeper(cdc, storeService, ak, blockedAddrs, authority, logger), + BaseSendKeeper: NewBaseSendKeeper(cdc, storeService, objStoreKey, ak, blockedAddrs, authority, logger), ak: ak, cdc: cdc, storeService: storeService, diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 4bb11862eb62..d3ed16599137 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -130,7 +130,8 @@ func TestKeeperTestSuite(t *testing.T) { func (suite *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(banktypes.StoreKey) - testCtx := testutil.DefaultContextWithDB(suite.T(), key, storetypes.NewTransientStoreKey("transient_test")) + okey := storetypes.NewObjectStoreKey(banktypes.ObjectStoreKey) + testCtx := testutil.DefaultContextWithObjectStore(suite.T(), key, storetypes.NewTransientStoreKey("transient_test"), okey) ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{Time: cmttime.Now()}) encCfg := moduletestutil.MakeTestEncodingConfig() @@ -145,6 +146,7 @@ func (suite *KeeperTestSuite) SetupTest() { suite.bankKeeper = keeper.NewBaseKeeper( encCfg.Codec, storeService, + okey, suite.authKeeper, map[string]bool{accAddrs[4].String(): true}, authtypes.NewModuleAddress(govtypes.ModuleName).String(), @@ -196,6 +198,16 @@ func (suite *KeeperTestSuite) mockSendCoinsFromAccountToModule(acc *authtypes.Ba suite.authKeeper.EXPECT().HasAccount(suite.ctx, moduleAcc.GetAddress()).Return(true) } +func (suite *KeeperTestSuite) mockSendCoinsFromAccountToModuleVirtual(acc *authtypes.BaseAccount, moduleAcc *authtypes.ModuleAccount) { + suite.authKeeper.EXPECT().GetModuleAccount(suite.ctx, moduleAcc.Name).Return(moduleAcc) + suite.authKeeper.EXPECT().GetAccount(suite.ctx, acc.GetAddress()).Return(acc) +} + +func (suite *KeeperTestSuite) mockSendCoinsFromModuleToAccountVirtual(moduleAcc *authtypes.ModuleAccount, accAddr sdk.AccAddress) { + suite.authKeeper.EXPECT().GetModuleAddress(moduleAcc.Name).Return(moduleAcc.GetAddress()) + suite.authKeeper.EXPECT().HasAccount(suite.ctx, accAddr).Return(true) +} + func (suite *KeeperTestSuite) mockSendCoins(ctx context.Context, sender sdk.AccountI, receiver sdk.AccAddress) { suite.authKeeper.EXPECT().GetAccount(ctx, sender.GetAddress()).Return(sender) suite.authKeeper.EXPECT().HasAccount(ctx, receiver).Return(true) @@ -316,6 +328,7 @@ func (suite *KeeperTestSuite) TestGetAuthority() { return keeper.NewBaseKeeper( moduletestutil.MakeTestEncodingConfig().Codec, storeService, + nil, suite.authKeeper, nil, authority, @@ -632,6 +645,38 @@ func (suite *KeeperTestSuite) TestSendCoinsNewAccount() { require.Equal(acc1Balances, updatedAcc1Bal) } +func (suite *KeeperTestSuite) TestSendCoinsVirtual() { + ctx := suite.ctx + require := suite.Require() + keeper := suite.bankKeeper + sdkCtx := sdk.UnwrapSDKContext(ctx) + acc0 := authtypes.NewBaseAccountWithAddress(accAddrs[0]) + feeDenom1 := "fee1" + feeDenom2 := "fee2" + + balances := sdk.NewCoins(sdk.NewInt64Coin(feeDenom1, 100), sdk.NewInt64Coin(feeDenom2, 100)) + suite.mockFundAccount(accAddrs[0]) + require.NoError(banktestutil.FundAccount(ctx, suite.bankKeeper, accAddrs[0], balances)) + + sendAmt := sdk.NewCoins(sdk.NewInt64Coin(feeDenom1, 50), sdk.NewInt64Coin(feeDenom2, 50)) + suite.mockSendCoinsFromAccountToModuleVirtual(acc0, burnerAcc) + require.NoError( + keeper.SendCoinsFromAccountToModuleVirtual(sdkCtx, accAddrs[0], authtypes.Burner, sendAmt), + ) + + refundAmt := sdk.NewCoins(sdk.NewInt64Coin(feeDenom1, 25), sdk.NewInt64Coin(feeDenom2, 25)) + suite.mockSendCoinsFromModuleToAccountVirtual(burnerAcc, accAddrs[0]) + require.NoError( + keeper.SendCoinsFromModuleToAccountVirtual(sdkCtx, authtypes.Burner, accAddrs[0], refundAmt), + ) + + suite.authKeeper.EXPECT().HasAccount(suite.ctx, burnerAcc.GetAddress()).Return(true) + require.NoError(keeper.CreditVirtualAccounts(ctx)) + + require.Equal(math.NewInt(25), keeper.GetBalance(suite.ctx, burnerAcc.GetAddress(), feeDenom1).Amount) + require.Equal(math.NewInt(25), keeper.GetBalance(suite.ctx, burnerAcc.GetAddress(), feeDenom2).Amount) +} + func (suite *KeeperTestSuite) TestInputOutputNewAccount() { ctx := suite.ctx require := suite.Require() diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 3bcc6d315c33..7f9bd6016506 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -9,6 +9,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" "cosmossdk.io/math" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" "github.com/cosmos/cosmos-sdk/telemetry" @@ -60,6 +61,7 @@ type BaseSendKeeper struct { ak types.AccountKeeper storeService store.KVStoreService logger log.Logger + objStoreKey storetypes.StoreKey // list of addresses that are restricted from receiving transactions blockedAddrs map[string]bool @@ -74,6 +76,7 @@ type BaseSendKeeper struct { func NewBaseSendKeeper( cdc codec.BinaryCodec, storeService store.KVStoreService, + objStoreKey storetypes.StoreKey, ak types.AccountKeeper, blockedAddrs map[string]bool, authority string, @@ -88,6 +91,7 @@ func NewBaseSendKeeper( cdc: cdc, ak: ak, storeService: storeService, + objStoreKey: objStoreKey, blockedAddrs: blockedAddrs, authority: authority, logger: logger, @@ -222,6 +226,12 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA return err } + k.ensureAccountCreated(ctx, toAddr) + k.emitSendCoinsEvents(ctx, fromAddr, toAddr, amt) + return nil +} + +func (k BaseSendKeeper) ensureAccountCreated(ctx context.Context, toAddr sdk.AccAddress) { // Create account if recipient does not exist. // // NOTE: This should ultimately be removed in favor a more flexible approach @@ -231,7 +241,10 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA defer telemetry.IncrCounter(1, "new", "account") k.ak.SetAccount(ctx, k.ak.NewAccountWithAddress(ctx, toAddr)) } +} +// emitSendCoinsEvents emit send coins events. +func (k BaseSendKeeper) emitSendCoinsEvents(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) { // bech32 encoding is expensive! Only do it once for fromAddr fromAddrString := fromAddr.String() sdkCtx := sdk.UnwrapSDKContext(ctx) @@ -244,11 +257,9 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA ), sdk.NewEvent( sdk.EventTypeMessage, - sdk.NewAttribute(types.AttributeKeySender, fromAddr.String()), + sdk.NewAttribute(types.AttributeKeySender, fromAddrString), ), }) - - return nil } // subUnlockedCoins removes the unlocked amt coins of the given account. An error is diff --git a/x/bank/keeper/virtual.go b/x/bank/keeper/virtual.go new file mode 100644 index 000000000000..f7288e7e0b52 --- /dev/null +++ b/x/bank/keeper/virtual.go @@ -0,0 +1,178 @@ +package keeper + +import ( + "bytes" + "context" + "encoding/binary" + "encoding/hex" + "fmt" + + errorsmod "cosmossdk.io/errors" + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +// SendCoinsFromAccountToModuleVirtual sends coins from account to a virtual module account. +func (k BaseSendKeeper) SendCoinsFromAccountToModuleVirtual( + ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins, +) error { + recipientAcc := k.ak.GetModuleAccount(ctx, recipientModule) + if recipientAcc == nil { + panic(errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", recipientModule)) + } + + return k.SendCoinsToVirtual(ctx, senderAddr, recipientAcc.GetAddress(), amt) +} + +// SendCoinsFromModuleToAccountVirtual sends coins from account to a virtual module account. +func (k BaseSendKeeper) SendCoinsFromModuleToAccountVirtual( + ctx context.Context, senderModule string, recipientAddr sdk.AccAddress, amt sdk.Coins, +) error { + senderAddr := k.ak.GetModuleAddress(senderModule) + if senderAddr == nil { + panic(errorsmod.Wrapf(sdkerrors.ErrUnknownAddress, "module account %s does not exist", senderModule)) + } + + if k.BlockedAddr(recipientAddr) { + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", recipientAddr) + } + + return k.SendCoinsFromVirtual(ctx, senderAddr, recipientAddr, amt) +} + +// SendCoinsToVirtual accumulate the recipient's coins in a per-transaction transient state, +// which are sumed up and added to the real account at the end of block. +// Events are emiited the same as normal send. +func (k BaseSendKeeper) SendCoinsToVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { + var err error + err = k.subUnlockedCoins(ctx, fromAddr, amt) + if err != nil { + return err + } + + toAddr, err = k.sendRestriction.apply(ctx, fromAddr, toAddr, amt) + if err != nil { + return err + } + + k.addVirtualCoins(ctx, toAddr, amt) + k.emitSendCoinsEvents(ctx, fromAddr, toAddr, amt) + return nil +} + +// SendCoinsFromVirtual deduct coins from virtual from account and send to recipient account. +func (k BaseSendKeeper) SendCoinsFromVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { + var err error + err = k.subVirtualCoins(ctx, fromAddr, amt) + if err != nil { + return err + } + + toAddr, err = k.sendRestriction.apply(ctx, fromAddr, toAddr, amt) + if err != nil { + return err + } + + err = k.addCoins(ctx, toAddr, amt) + if err != nil { + return err + } + + k.ensureAccountCreated(ctx, toAddr) + k.emitSendCoinsEvents(ctx, fromAddr, toAddr, amt) + return nil +} + +func (k BaseSendKeeper) addVirtualCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + store := sdkCtx.ObjectStore(k.objStoreKey) + + key := make([]byte, len(addr)+8) + copy(key, addr) + binary.BigEndian.PutUint64(key[len(addr):], uint64(sdkCtx.TxIndex())) + + var coins sdk.Coins + value := store.Get(key) + if value != nil { + coins = value.(sdk.Coins) + } + coins = coins.Add(amt...) + store.Set(key, coins) +} + +func (k BaseSendKeeper) subVirtualCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { + sdkCtx := sdk.UnwrapSDKContext(ctx) + store := sdkCtx.ObjectStore(k.objStoreKey) + + key := make([]byte, len(addr)+8) + copy(key, addr) + binary.BigEndian.PutUint64(key[len(addr):], uint64(sdkCtx.TxIndex())) + + value := store.Get(key) + if value == nil { + return errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance 0 is smaller than %s", + amt, + ) + } + spendable := value.(sdk.Coins) + balance, hasNeg := spendable.SafeSub(amt...) + if hasNeg { + return errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance %s is smaller than %s", + spendable, amt, + ) + } + if balance.IsZero() { + store.Delete(key) + } else { + store.Set(key, balance) + } + + return nil +} + +// CreditVirtualAccounts sum up the transient coins and add them to the real account, +// should be called at end blocker. +func (k BaseSendKeeper) CreditVirtualAccounts(ctx context.Context) error { + store := sdk.UnwrapSDKContext(ctx).ObjectStore(k.objStoreKey) + + var toAddr sdk.AccAddress + sum := sdk.NewMapCoins(nil) + flushCurrentAddr := func() error { + if len(sum) == 0 { + // nothing to flush + return nil + } + + if err := k.addCoins(ctx, toAddr, sum.ToCoins()); err != nil { + return err + } + clear(sum) + + k.ensureAccountCreated(ctx, toAddr) + return nil + } + + it := store.Iterator(nil, nil) + defer it.Close() + for ; it.Valid(); it.Next() { + if len(it.Key()) <= 8 { + return fmt.Errorf("unexpected key length: %s", hex.EncodeToString(it.Key())) + } + + addr := it.Key()[:len(it.Key())-8] + if !bytes.Equal(toAddr, addr) { + if err := flushCurrentAddr(); err != nil { + return err + } + toAddr = addr + } + + sum.Add(it.Value().(sdk.Coins)...) + } + + return flushCurrentAddr() +} diff --git a/x/bank/module.go b/x/bank/module.go index 315a6ecfc744..ff5e21331f93 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -15,6 +15,7 @@ import ( corestore "cosmossdk.io/core/store" "cosmossdk.io/depinject" "cosmossdk.io/log" + storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" @@ -43,7 +44,8 @@ var ( _ module.HasServices = AppModule{} _ module.HasInvariants = AppModule{} - _ appmodule.AppModule = AppModule{} + _ appmodule.AppModule = AppModule{} + _ appmodule.HasEndBlocker = AppModule{} ) // AppModuleBasic defines the basic application module used by the bank module. @@ -195,6 +197,10 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp ) } +func (am AppModule) EndBlock(ctx context.Context) error { + return am.keeper.CreditVirtualAccounts(ctx) +} + // App Wiring Setup func init() { @@ -210,6 +216,7 @@ type ModuleInputs struct { Cdc codec.Codec StoreService corestore.KVStoreService Logger log.Logger + ObjStoreKey *storetypes.ObjectStoreKey AccountKeeper types.AccountKeeper @@ -249,6 +256,7 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { bankKeeper := keeper.NewBaseKeeper( in.Cdc, in.StoreService, + in.ObjStoreKey, in.AccountKeeper, blockedAddresses, authority.String(), diff --git a/x/bank/types/keys.go b/x/bank/types/keys.go index b4ea683d4b69..485d1cdb9ef0 100644 --- a/x/bank/types/keys.go +++ b/x/bank/types/keys.go @@ -17,6 +17,9 @@ const ( // RouterKey defines the module's message routing key RouterKey = ModuleName + + // ObjectStoreKey defines the store name for the object store + ObjectStoreKey = "object:" + ModuleName ) // KVStore keys diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 5970d3822f6a..43d2e05fd41e 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -784,6 +784,22 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, sende return ret0 } +// SendCoinsFromAccountToModuleVirtual mocks base method. +func (m *MockBankKeeper) SendCoinsFromAccountToModuleVirtual(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromAccountToModuleVirtual", ctx, senderAddr, recipientModule, amt) + ret0, _ := ret[0].(error) + return ret0 +} + +// SendCoinsFromModuleToAccountVirtual mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToAccountVirtual(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccountVirtual", ctx, senderModule, recipientAddr, amt) + ret0, _ := ret[0].(error) + return ret0 +} + // SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() @@ -812,6 +828,13 @@ func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, sender return ret0 } +func (m *MockBankKeeper) CreditVirtualAccounts(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreditVirtualAccounts", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + // SendCoinsFromModuleToModule indicates an expected call of SendCoinsFromModuleToModule. func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderModule, recipientModule, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() From b693dd98bb627f03bf1586e9c08947a8eb1fde11 Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 29 Mar 2024 13:07:32 +0800 Subject: [PATCH 07/37] Problem: no efficient bank api to support evm add/sub balances (#239) fix Update CHANGELOG.md Signed-off-by: yihuang don't change interface --- CHANGELOG.md | 3 +- x/bank/keeper/keeper.go | 35 +++++++++++++++++++++++ x/bank/keeper/send.go | 63 ++++++++++++++++++++++------------------- 3 files changed, 71 insertions(+), 30 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3706134b62a2..464d497b4525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,8 +41,9 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Add `TxExecutor` baseapp option, add `TxIndex`/`TxCount`/`MsgIndex`/`BlockGasUsed` fields to `Context, to support tx parallel execution. -* (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context.. +* (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context. * (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins. +* (x/bank) [#239](https://github.com/crypto-org-chain/cosmos-sdk/pull/239) Add low level `AddBalance`,`SubBalance` APIs to bank keeper. ## [Unreleased-Upstream] diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 26dceca9b66b..1a31ffc0f220 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -419,6 +419,41 @@ func (k BaseKeeper) BurnCoins(ctx context.Context, moduleName string, amounts sd return nil } +// AddBalance is low level api to update balance directly, mainly used by evm integration, +// caller should make sure the total supply of the denom not changed and the account exists. +// it's for evm integration, call at your own risk. +// it emits mint event. +func (k BaseKeeper) AddBalance(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin) error { + if err := k.addCoin(ctx, addr, coin); err != nil { + return err + } + + // emit mint event + sdkCtx := sdk.UnwrapSDKContext(ctx) + sdkCtx.EventManager().EmitEvent( + types.NewCoinMintEvent(addr, sdk.NewCoins(coin)), + ) + return nil +} + +// SubBalance is low level api to update balance directly, mainly used by evm integration, +// caller should make sure the total supply of the denom not changed. +// it's for evm integration, call at your own risk. +// it emits burn event. +func (k BaseKeeper) SubBalance(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin) error { + lockedCoins := k.LockedCoins(ctx, addr) + if err := k.subCoin(ctx, addr, coin, lockedCoins); err != nil { + return err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + // emit burn event + sdkCtx.EventManager().EmitEvent( + types.NewCoinBurnEvent(addr, sdk.NewCoins(coin)), + ) + return nil +} + // setSupply sets the supply for the given coin func (k BaseKeeper) setSupply(ctx context.Context, coin sdk.Coin) { // Bank invariants and IBC requires to remove zero coins. diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 7f9bd6016506..037bc83265a8 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -8,7 +8,6 @@ import ( "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" - "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" @@ -273,29 +272,7 @@ func (k BaseSendKeeper) subUnlockedCoins(ctx context.Context, addr sdk.AccAddres lockedCoins := k.LockedCoins(ctx, addr) for _, coin := range amt { - balance := k.GetBalance(ctx, addr, coin.Denom) - locked := sdk.NewCoin(coin.Denom, lockedCoins.AmountOf(coin.Denom)) - - spendable, hasNeg := sdk.Coins{balance}.SafeSub(locked) - if hasNeg { - return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, - "locked amount exceeds account balance funds: %s > %s", locked, balance) - } - - if _, hasNeg := spendable.SafeSub(coin); hasNeg { - if len(spendable) == 0 { - spendable = sdk.Coins{sdk.NewCoin(coin.Denom, math.ZeroInt())} - } - return errorsmod.Wrapf( - sdkerrors.ErrInsufficientFunds, - "spendable balance %s is smaller than %s", - spendable, coin, - ) - } - - newBalance := balance.Sub(coin) - - if err := k.setBalance(ctx, addr, newBalance); err != nil { + if err := k.subCoin(ctx, addr, coin, lockedCoins); err != nil { return err } } @@ -308,6 +285,32 @@ func (k BaseSendKeeper) subUnlockedCoins(ctx context.Context, addr sdk.AccAddres return nil } +func (k BaseSendKeeper) subCoin(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin, lockedCoins sdk.Coins) error { + var ( + spendable sdk.Coin + err error + ) + balance := k.GetBalance(ctx, addr, coin.Denom) + locked := sdk.NewCoin(coin.Denom, lockedCoins.AmountOf(coin.Denom)) + if locked.IsZero() { + spendable = balance + } else { + spendable, err = balance.SafeSub(locked) + if err != nil { + return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, + "locked amount exceeds account balance funds: %s > %s", locked, balance) + } + } + if spendable.Amount.LT(coin.Amount) { + return errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance %s is smaller than %s", + spendable, coin, + ) + } + return k.setBalance(ctx, addr, balance.Sub(coin)) +} + // addCoins increase the addr balance by the given amt. Fails if the provided // amt is invalid. It emits a coin received event. func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { @@ -316,11 +319,7 @@ func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt s } for _, coin := range amt { - balance := k.GetBalance(ctx, addr, coin.Denom) - newBalance := balance.Add(coin) - - err := k.setBalance(ctx, addr, newBalance) - if err != nil { + if err := k.addCoin(ctx, addr, coin); err != nil { return err } } @@ -334,6 +333,12 @@ func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt s return nil } +func (k BaseSendKeeper) addCoin(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin) error { + balance := k.GetBalance(ctx, addr, coin.Denom) + newBalance := balance.Add(coin) + return k.setBalance(ctx, addr, newBalance) +} + // setBalance sets the coin balance for an account by address. func (k BaseSendKeeper) setBalance(ctx context.Context, addr sdk.AccAddress, balance sdk.Coin) error { if !balance.IsValid() { From 5051618a2936b8a36491040340da79aae095ad4c Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 29 Mar 2024 15:59:45 +0800 Subject: [PATCH 08/37] Problem: MultiStore interface is bloated (#240) * Problem: MultiStore interface is bloated Solution: - Split out specialied methods from it, keeping the MultiStore generic * Update store/CHANGELOG.md Signed-off-by: yihuang --------- Signed-off-by: yihuang --- baseapp/abci.go | 2 +- baseapp/baseapp.go | 2 +- baseapp/options.go | 2 +- server/mock/store.go | 2 +- store/CHANGELOG.md | 1 + store/cachemulti/store.go | 14 -------------- store/types/store.go | 14 +++++++++----- 7 files changed, 14 insertions(+), 23 deletions(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index 04ef73f002f4..ff391460f536 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -1213,7 +1213,7 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e // use custom query multi-store if provided qms := app.qms if qms == nil { - qms = app.cms.(storetypes.MultiStore) + qms = storetypes.RootMultiStore(app.cms) } lastBlockHeight := qms.LatestVersion() diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 1b39ffba0bf3..aee79df5f658 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -65,7 +65,7 @@ type BaseApp struct { name string // application name from abci.BlockInfo db dbm.DB // common DB backend cms storetypes.CommitMultiStore // Main (uncached) state - qms storetypes.MultiStore // Optional alternative multistore for querying only. + qms storetypes.RootMultiStore // Optional alternative multistore for querying only. storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages diff --git a/baseapp/options.go b/baseapp/options.go index 13f5c9afb580..0c28e3755c12 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -314,7 +314,7 @@ func (app *BaseApp) SetTxEncoder(txEncoder sdk.TxEncoder) { // SetQueryMultiStore set a alternative MultiStore implementation to support grpc query service. // // Ref: https://github.com/cosmos/cosmos-sdk/issues/13317 -func (app *BaseApp) SetQueryMultiStore(ms storetypes.MultiStore) { +func (app *BaseApp) SetQueryMultiStore(ms storetypes.RootMultiStore) { app.qms = ms } diff --git a/server/mock/store.go b/server/mock/store.go index c6829bb18b6b..9c756eed4964 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -12,7 +12,7 @@ import ( storetypes "cosmossdk.io/store/types" ) -var _ storetypes.MultiStore = multiStore{} +var _ storetypes.CommitMultiStore = multiStore{} type multiStore struct { kv map[storetypes.StoreKey]kvStore diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 4066039f3f7e..13c55db25952 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -29,6 +29,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#207](https://github.com/crypto-org-chain/cosmos-sdk/pull/207) Remove api CacheWrapWithTrace. * [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Support object store. +* [#240](https://github.com/crypto-org-chain/cosmos-sdk/pull/240) Split methods from `MultiStore` into specialized `RootMultiStore`, keep `MultiStore` generic. ## v1.1.0 (March 20, 2024) diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 5f6b4856052b..57734bbb770b 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -111,11 +111,6 @@ func (cms Store) TracingEnabled() bool { return cms.traceWriter != nil } -// LatestVersion returns the branch version of the store -func (cms Store) LatestVersion() int64 { - panic("cannot get latest version from branch cached multi-store") -} - // GetStoreType returns the type of the store. func (cms Store) GetStoreType() types.StoreType { return types.StoreTypeMulti @@ -139,15 +134,6 @@ func (cms Store) CacheMultiStore() types.CacheMultiStore { return newCacheMultiStoreFromCMS(cms) } -// CacheMultiStoreWithVersion implements the MultiStore interface. It will panic -// as an already cached multi-store cannot load previous versions. -// -// TODO: The store implementation can possibly be modified to support this as it -// seems safe to load previous versions (heights). -func (cms Store) CacheMultiStoreWithVersion(_ int64) (types.CacheMultiStore, error) { - panic("cannot branch cached multi-store with a version") -} - // GetStore returns an underlying Store by key. func (cms Store) GetStore(key types.StoreKey) types.Store { s := cms.stores[key] diff --git a/store/types/store.go b/store/types/store.go index 08f8044b30dc..239e4ae94b3f 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -128,10 +128,6 @@ type MultiStore interface { // call CacheMultiStore.Write(). CacheMultiStore() CacheMultiStore - // CacheMultiStoreWithVersion branches the underlying MultiStore where - // each stored is loaded at a specific version (height). - CacheMultiStoreWithVersion(version int64) (CacheMultiStore, error) - // Convenience for fetching substores. // If the store does not exist, panics. GetStore(StoreKey) Store @@ -150,6 +146,14 @@ type MultiStore interface { // implied that the caller should update the context when necessary between // tracing operations. The modified MultiStore is returned. SetTracingContext(TraceContext) MultiStore +} + +type RootMultiStore interface { + MultiStore + + // CacheMultiStoreWithVersion branches the underlying MultiStore where + // each stored is loaded at a specific version (height). + CacheMultiStoreWithVersion(version int64) (CacheMultiStore, error) // LatestVersion returns the latest version in the store LatestVersion() int64 @@ -164,7 +168,7 @@ type CacheMultiStore interface { // CommitMultiStore is an interface for a MultiStore without cache capabilities. type CommitMultiStore interface { Committer - MultiStore + RootMultiStore snapshottypes.Snapshotter // Mount a store of type using the given db. From 2484db05d4f727957c57d79a6b68253122da2edf Mon Sep 17 00:00:00 2001 From: yihuang Date: Sat, 30 Mar 2024 00:32:58 +0800 Subject: [PATCH 09/37] Problem: nested cache store not efficient (#241) * Problem: nested cache store not efficient Solution: - introduce copy-on-write btree based cache store temp * changelog * rename * Update store/cachekv/store.go Signed-off-by: yihuang --------- Signed-off-by: yihuang --- store/CHANGELOG.md | 1 + store/cachekv/search_benchmark_test.go | 44 --- store/cachekv/search_test.go | 141 ---------- store/cachekv/store.go | 368 ++++--------------------- store/internal/btree/btree.go | 25 +- store/internal/btree/btree_test.go | 23 +- store/internal/btreeadaptor.go | 8 +- store/types/store.go | 6 + 8 files changed, 100 insertions(+), 516 deletions(-) delete mode 100644 store/cachekv/search_benchmark_test.go delete mode 100644 store/cachekv/search_test.go diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 13c55db25952..e4ea8fd42e84 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -30,6 +30,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#207](https://github.com/crypto-org-chain/cosmos-sdk/pull/207) Remove api CacheWrapWithTrace. * [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Support object store. * [#240](https://github.com/crypto-org-chain/cosmos-sdk/pull/240) Split methods from `MultiStore` into specialized `RootMultiStore`, keep `MultiStore` generic. +* [#241](https://github.com/crypto-org-chain/cosmos-sdk/pull/241) Refactor the cache store to be btree backed, prepare to support copy-on-write atomic branching. ## v1.1.0 (March 20, 2024) diff --git a/store/cachekv/search_benchmark_test.go b/store/cachekv/search_benchmark_test.go deleted file mode 100644 index f0e29bc4ec18..000000000000 --- a/store/cachekv/search_benchmark_test.go +++ /dev/null @@ -1,44 +0,0 @@ -package cachekv - -import ( - "strconv" - "testing" - - "cosmossdk.io/store/internal/btree" -) - -func BenchmarkLargeUnsortedMisses(b *testing.B) { - for i := 0; i < b.N; i++ { - b.StopTimer() - store := generateStore() - b.StartTimer() - - for k := 0; k < 10000; k++ { - // cache has A + Z values - // these are within range, but match nothing - store.dirtyItems([]byte("B1"), []byte("B2")) - } - } -} - -func generateStore() *Store { - cache := map[string]*cValue[[]byte]{} - unsorted := map[string]struct{}{} - for i := 0; i < 5000; i++ { - key := "A" + strconv.Itoa(i) - unsorted[key] = struct{}{} - cache[key] = &cValue[[]byte]{} - } - - for i := 0; i < 5000; i++ { - key := "Z" + strconv.Itoa(i) - unsorted[key] = struct{}{} - cache[key] = &cValue[[]byte]{} - } - - return &GStore[[]byte]{ - cache: cache, - unsortedCache: unsorted, - sortedCache: btree.NewBTree[[]byte](), - } -} diff --git a/store/cachekv/search_test.go b/store/cachekv/search_test.go deleted file mode 100644 index 41321c076eae..000000000000 --- a/store/cachekv/search_test.go +++ /dev/null @@ -1,141 +0,0 @@ -package cachekv - -import "testing" - -func TestFindStartIndex(t *testing.T) { - tests := []struct { - name string - sortedL []string - query string - want int - }{ - { - name: "non-existent value", - sortedL: []string{"a", "b", "c", "d", "e", "l", "m", "n", "u", "v", "w", "x", "y", "z"}, - query: "o", - want: 8, - }, - { - name: "dupes start at index 0", - sortedL: []string{"a", "a", "a", "b", "c", "d", "e", "l", "m", "n", "u", "v", "w", "x", "y", "z"}, - query: "a", - want: 0, - }, - { - name: "dupes start at non-index 0", - sortedL: []string{"a", "c", "c", "c", "c", "d", "e", "l", "m", "n", "u", "v", "w", "x", "y", "z"}, - query: "c", - want: 1, - }, - { - name: "at end", - sortedL: []string{"a", "e", "u", "v", "w", "x", "y", "z"}, - query: "z", - want: 7, - }, - { - name: "dupes at end", - sortedL: []string{"a", "e", "u", "v", "w", "x", "y", "z", "z", "z", "z"}, - query: "z", - want: 7, - }, - { - name: "entirely dupes", - sortedL: []string{"z", "z", "z", "z", "z"}, - query: "z", - want: 0, - }, - { - name: "non-existent but within >=start", - sortedL: []string{"z", "z", "z", "z", "z"}, - query: "p", - want: 0, - }, - { - name: "non-existent and out of range", - sortedL: []string{"d", "e", "f", "g", "h"}, - query: "z", - want: -1, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - body := tt.sortedL - got := findStartIndex(body, tt.query) - if got != tt.want { - t.Fatalf("Got: %d, want: %d", got, tt.want) - } - }) - } -} - -func TestFindEndIndex(t *testing.T) { - tests := []struct { - name string - sortedL []string - query string - want int - }{ - { - name: "non-existent value", - sortedL: []string{"a", "b", "c", "d", "e", "l", "m", "n", "u", "v", "w", "x", "y", "z"}, - query: "o", - want: 7, - }, - { - name: "dupes start at index 0", - sortedL: []string{"a", "a", "a", "b", "c", "d", "e", "l", "m", "n", "u", "v", "w", "x", "y", "z"}, - query: "a", - want: 0, - }, - { - name: "dupes start at non-index 0", - sortedL: []string{"a", "c", "c", "c", "c", "d", "e", "l", "m", "n", "u", "v", "w", "x", "y", "z"}, - query: "c", - want: 1, - }, - { - name: "at end", - sortedL: []string{"a", "e", "u", "v", "w", "x", "y", "z"}, - query: "z", - want: 7, - }, - { - name: "dupes at end", - sortedL: []string{"a", "e", "u", "v", "w", "x", "y", "z", "z", "z", "z"}, - query: "z", - want: 7, - }, - { - name: "entirely dupes", - sortedL: []string{"z", "z", "z", "z", "z"}, - query: "z", - want: 0, - }, - { - name: "non-existent and out of range", - sortedL: []string{"z", "z", "z", "z", "z"}, - query: "p", - want: -1, - }, - { - name: "non-existent and out of range", - sortedL: []string{"d", "e", "f", "g", "h"}, - query: "z", - want: 4, - }, - } - - for _, tt := range tests { - tt := tt - t.Run(tt.name, func(t *testing.T) { - body := tt.sortedL - got := findEndIndex(body, tt.query) - if got != tt.want { - t.Fatalf("Got: %d, want: %d", got, tt.want) - } - }) - } -} diff --git a/store/cachekv/store.go b/store/cachekv/store.go index 7c7cf7513845..df47dfc3e6ae 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -1,34 +1,18 @@ package cachekv import ( - "bytes" - "sort" - "sync" - - dbm "github.com/cosmos/cosmos-db" - - "cosmossdk.io/math" "cosmossdk.io/store/cachekv/internal" "cosmossdk.io/store/internal/btree" - "cosmossdk.io/store/internal/conv" "cosmossdk.io/store/types" ) -// cValue represents a cached value. -// If dirty is true, it indicates the cached value is different from the underlying value. -type cValue[V any] struct { - value V - dirty bool -} - -type kvPair[V any] struct { - Key []byte - Value V -} - type Store = GStore[[]byte] -var _ types.CacheKVStore = (*Store)(nil) +var ( + _ types.CacheKVStore = (*Store)(nil) + _ types.CacheWrap = (*Store)(nil) + _ types.BranchStore = (*Store)(nil) +) func NewStore(parent types.KVStore) *Store { return NewGStore( @@ -40,11 +24,8 @@ func NewStore(parent types.KVStore) *Store { // GStore wraps an in-memory cache around an underlying types.KVStore. type GStore[V any] struct { - mtx sync.Mutex - cache map[string]*cValue[V] - unsortedCache map[string]struct{} - sortedCache btree.BTree[V] // always ascending sorted - parent types.GKVStore[V] + writeSet btree.BTree[V] // always ascending sorted + parent types.GKVStore[V] // isZero is a function that returns true if the value is considered "zero", for []byte and pointers the zero value // is `nil`, zero value is not allowed to set to a key, and it's returned if the key is not found. @@ -57,12 +38,10 @@ type GStore[V any] struct { // NewStore creates a new Store object func NewGStore[V any](parent types.GKVStore[V], isZero func(V) bool, valueLen func(V) int) *GStore[V] { return &GStore[V]{ - cache: make(map[string]*cValue[V]), - unsortedCache: make(map[string]struct{}), - sortedCache: btree.NewBTree[V](), - parent: parent, - isZero: isZero, - valueLen: valueLen, + writeSet: btree.NewBTree[V](), + parent: parent, + isZero: isZero, + valueLen: valueLen, } } @@ -71,21 +50,35 @@ func (store *GStore[V]) GetStoreType() types.StoreType { return store.parent.GetStoreType() } -// Get implements types.KVStore. -func (store *GStore[V]) Get(key []byte) (value V) { - store.mtx.Lock() - defer store.mtx.Unlock() +// Clone creates a copy-on-write snapshot of the cache store, +// it only performs a shallow copy so is very fast. +func (store *GStore[V]) Clone() types.BranchStore { + return &GStore[V]{ + writeSet: store.writeSet.Copy(), + parent: store.parent, + } +} + +// swapCache swap out the internal cache store and leave the current store unusable. +func (store *GStore[V]) swapCache() btree.BTree[V] { + cache := store.writeSet + store.writeSet = btree.BTree[V]{} + return cache +} +// Restore restores the store cache to a given snapshot, leaving the snapshot unusable. +func (store *GStore[V]) Restore(s types.BranchStore) { + store.writeSet = s.(*GStore[V]).swapCache() +} + +// Get implements types.KVStore. +func (store *GStore[V]) Get(key []byte) V { types.AssertValidKey(key) - cacheValue, ok := store.cache[conv.UnsafeBytesToStr(key)] - if !ok { - value = store.parent.Get(key) - store.setCacheValue(key, value, false) - } else { - value = cacheValue.value + value, found := store.writeSet.Get(key) + if !found { + return store.parent.Get(key) } - return value } @@ -94,93 +87,37 @@ func (store *GStore[V]) Set(key []byte, value V) { types.AssertValidKey(key) types.AssertValidValueGeneric(value, store.isZero, store.valueLen) - store.mtx.Lock() - defer store.mtx.Unlock() - store.setCacheValue(key, value, true) + store.writeSet.Set(key, value) } // Has implements types.KVStore. func (store *GStore[V]) Has(key []byte) bool { - value := store.Get(key) + types.AssertValidKey(key) + + value, found := store.writeSet.Get(key) + if !found { + return store.parent.Has(key) + } return !store.isZero(value) } // Delete implements types.KVStore. func (store *GStore[V]) Delete(key []byte) { types.AssertValidKey(key) - - store.mtx.Lock() - defer store.mtx.Unlock() - - store.setCacheValue(key, store.zeroValue, true) -} - -func (store *GStore[V]) resetCaches() { - if len(store.cache) > 100_000 { - // Cache is too large. We likely did something linear time - // (e.g. Epoch block, Genesis block, etc). Free the old caches from memory, and let them get re-allocated. - // TODO: In a future CacheKV redesign, such linear workloads should get into a different cache instantiation. - // 100_000 is arbitrarily chosen as it solved Osmosis' InitGenesis RAM problem. - store.cache = make(map[string]*cValue[V]) - store.unsortedCache = make(map[string]struct{}) - } else { - // Clear the cache using the map clearing idiom - // and not allocating fresh objects. - // Please see https://bencher.orijtech.com/perfclinic/mapclearing/ - for key := range store.cache { - delete(store.cache, key) - } - for key := range store.unsortedCache { - delete(store.unsortedCache, key) - } - } - store.sortedCache = btree.NewBTree[V]() + store.writeSet.Set(key, store.zeroValue) } // Implements Cachetypes.KVStore. func (store *GStore[V]) Write() { - store.mtx.Lock() - defer store.mtx.Unlock() - - if len(store.cache) == 0 && len(store.unsortedCache) == 0 { - store.sortedCache = btree.NewBTree[V]() - return - } - - type cEntry struct { - key string - val *cValue[V] - } - - // We need a copy of all of the keys. - // Not the best. To reduce RAM pressure, we copy the values as well - // and clear out the old caches right after the copy. - sortedCache := make([]cEntry, 0, len(store.cache)) - - for key, dbValue := range store.cache { - if dbValue.dirty { - sortedCache = append(sortedCache, cEntry{key, dbValue}) - } - } - store.resetCaches() - sort.Slice(sortedCache, func(i, j int) bool { - return sortedCache[i].key < sortedCache[j].key - }) - - // TODO: Consider allowing usage of Batch, which would allow the write to - // at least happen atomically. - for _, obj := range sortedCache { - // We use []byte(key) instead of conv.UnsafeStrToBytes because we cannot - // be sure if the underlying store might do a save with the byteslice or - // not. Once we get confirmation that .Delete is guaranteed not to - // save the byteslice, then we can assume only a read-only copy is sufficient. - if !store.isZero(obj.val.value) { - // It already exists in the parent, hence update it. - store.parent.Set([]byte(obj.key), obj.val.value) + store.writeSet.Scan(func(key []byte, value V) bool { + if store.isZero(value) { + store.parent.Delete(key) } else { - store.parent.Delete([]byte(obj.key)) + store.parent.Set(key, value) } - } + return true + }) + store.writeSet.Clear() } // CacheWrap implements CacheWrapper. @@ -202,11 +139,7 @@ func (store *GStore[V]) ReverseIterator(start, end []byte) types.GIterator[V] { } func (store *GStore[V]) iterator(start, end []byte, ascending bool) types.GIterator[V] { - store.mtx.Lock() - defer store.mtx.Unlock() - - store.dirtyItems(start, end) - isoSortedCache := store.sortedCache.Copy() + isoSortedCache := store.writeSet.Copy() var ( err error @@ -226,200 +159,3 @@ func (store *GStore[V]) iterator(start, end []byte, ascending bool) types.GItera return internal.NewCacheMergeIterator(parent, cache, ascending, store.isZero) } - -func findStartIndex(strL []string, startQ string) int { - // Modified binary search to find the very first element in >=startQ. - if len(strL) == 0 { - return -1 - } - - var left, right, mid int - right = len(strL) - 1 - for left <= right { - mid = (left + right) >> 1 - midStr := strL[mid] - if midStr == startQ { - // Handle condition where there might be multiple values equal to startQ. - // We are looking for the very first value < midStL, that i+1 will be the first - // element >= midStr. - for i := mid - 1; i >= 0; i-- { - if strL[i] != midStr { - return i + 1 - } - } - return 0 - } - if midStr < startQ { - left = mid + 1 - } else { // midStrL > startQ - right = mid - 1 - } - } - if left >= 0 && left < len(strL) && strL[left] >= startQ { - return left - } - return -1 -} - -func findEndIndex(strL []string, endQ string) int { - if len(strL) == 0 { - return -1 - } - - // Modified binary search to find the very first element > 1 - midStr := strL[mid] - if midStr == endQ { - // Handle condition where there might be multiple values equal to startQ. - // We are looking for the very first value < midStL, that i+1 will be the first - // element >= midStr. - for i := mid - 1; i >= 0; i-- { - if strL[i] < midStr { - return i + 1 - } - } - return 0 - } - if midStr < endQ { - left = mid + 1 - } else { // midStrL > startQ - right = mid - 1 - } - } - - // Binary search failed, now let's find a value less than endQ. - for i := right; i >= 0; i-- { - if strL[i] < endQ { - return i - } - } - - return -1 -} - -type sortState int - -const ( - stateUnsorted sortState = iota - stateAlreadySorted -) - -const minSortSize = 1024 - -// Constructs a slice of dirty items, to use w/ memIterator. -func (store *GStore[V]) dirtyItems(start, end []byte) { - startStr, endStr := conv.UnsafeBytesToStr(start), conv.UnsafeBytesToStr(end) - if end != nil && startStr > endStr { - // Nothing to do here. - return - } - - n := len(store.unsortedCache) - unsorted := make([]*kvPair[V], 0) - // If the unsortedCache is too big, its costs too much to determine - // whats in the subset we are concerned about. - // If you are interleaving iterator calls with writes, this can easily become an - // O(N^2) overhead. - // Even without that, too many range checks eventually becomes more expensive - // than just not having the cache. - if n < minSortSize { - for key := range store.unsortedCache { - // dbm.IsKeyInDomain is nil safe and returns true iff key is greater than start - if dbm.IsKeyInDomain(conv.UnsafeStrToBytes(key), start, end) { - cacheValue := store.cache[key] - unsorted = append(unsorted, &kvPair[V]{Key: []byte(key), Value: cacheValue.value}) - } - } - store.clearUnsortedCacheSubset(unsorted, stateUnsorted) - return - } - - // Otherwise it is large so perform a modified binary search to find - // the target ranges for the keys that we should be looking for. - strL := make([]string, 0, n) - for key := range store.unsortedCache { - strL = append(strL, key) - } - sort.Strings(strL) - - // Now find the values within the domain - // [start, end) - startIndex := findStartIndex(strL, startStr) - if startIndex < 0 { - startIndex = 0 - } - - var endIndex int - if end == nil { - endIndex = len(strL) - 1 - } else { - endIndex = findEndIndex(strL, endStr) - } - if endIndex < 0 { - endIndex = len(strL) - 1 - } - - // Since we spent cycles to sort the values, we should process and remove a reasonable amount - // ensure start to end is at least minSortSize in size - // if below minSortSize, expand it to cover additional values - // this amortizes the cost of processing elements across multiple calls - if endIndex-startIndex < minSortSize { - endIndex = math.Min(startIndex+minSortSize, len(strL)-1) - if endIndex-startIndex < minSortSize { - startIndex = math.Max(endIndex-minSortSize, 0) - } - } - - kvL := make([]*kvPair[V], 0, 1+endIndex-startIndex) - for i := startIndex; i <= endIndex; i++ { - key := strL[i] - cacheValue := store.cache[key] - kvL = append(kvL, &kvPair[V]{Key: []byte(key), Value: cacheValue.value}) - } - - // kvL was already sorted so pass it in as is. - store.clearUnsortedCacheSubset(kvL, stateAlreadySorted) -} - -func (store *GStore[V]) clearUnsortedCacheSubset(unsorted []*kvPair[V], sortState sortState) { - n := len(store.unsortedCache) - if len(unsorted) == n { // This pattern allows the Go compiler to emit the map clearing idiom for the entire map. - for key := range store.unsortedCache { - delete(store.unsortedCache, key) - } - } else { // Otherwise, normally delete the unsorted keys from the map. - for _, kv := range unsorted { - delete(store.unsortedCache, conv.UnsafeBytesToStr(kv.Key)) - } - } - - if sortState == stateUnsorted { - sort.Slice(unsorted, func(i, j int) bool { - return bytes.Compare(unsorted[i].Key, unsorted[j].Key) < 0 - }) - } - - for _, item := range unsorted { - // sortedCache is able to store `nil` value to represent deleted items. - store.sortedCache.Set(item.Key, item.Value) - } -} - -//---------------------------------------- -// etc - -// Only entrypoint to mutate store.cache. -// A `nil` value means a deletion. -func (store *GStore[V]) setCacheValue(key []byte, value V, dirty bool) { - keyStr := conv.UnsafeBytesToStr(key) - store.cache[keyStr] = &cValue[V]{ - value: value, - dirty: dirty, - } - if dirty { - store.unsortedCache[keyStr] = struct{}{} - } -} diff --git a/store/internal/btree/btree.go b/store/internal/btree/btree.go index 0fe28def41ee..bef4309412ff 100644 --- a/store/internal/btree/btree.go +++ b/store/internal/btree/btree.go @@ -36,22 +36,18 @@ func NewBTree[V any]() BTree[V] { } } +// Set supports nil as value when used as overlay func (bt BTree[V]) Set(key []byte, value V) { bt.tree.Set(newItem(key, value)) } -func (bt BTree[V]) Get(key []byte) V { - var empty V - i, found := bt.tree.Get(newItem(key, empty)) - if !found { - return empty - } - return i.value +func (bt BTree[V]) Get(key []byte) (V, bool) { + i, found := bt.tree.Get(newItemWithKey[V](key)) + return i.value, found } func (bt BTree[V]) Delete(key []byte) { - var empty V - bt.tree.Delete(newItem(key, empty)) + bt.tree.Delete(newItemWithKey[V](key)) } func (bt BTree[V]) Iterator(start, end []byte) (types.GIterator[V], error) { @@ -80,6 +76,12 @@ func (bt BTree[V]) Clear() { bt.tree.Clear() } +func (bt BTree[V]) Scan(cb func(key []byte, value V) bool) { + bt.tree.Scan(func(i item[V]) bool { + return cb(i.key, i.value) + }) +} + // item is a btree item with byte slices as keys and values type item[V any] struct { key []byte @@ -95,3 +97,8 @@ func byKeys[V any](a, b item[V]) bool { func newItem[V any](key []byte, value V) item[V] { return item[V]{key: key, value: value} } + +// newItem creates a new pair item with empty value. +func newItemWithKey[V any](key []byte) item[V] { + return item[V]{key: key} +} diff --git a/store/internal/btree/btree_test.go b/store/internal/btree/btree_test.go index 89b5827e6156..75613ebbb69c 100644 --- a/store/internal/btree/btree_test.go +++ b/store/internal/btree/btree_test.go @@ -12,17 +12,20 @@ func TestGetSetDelete(t *testing.T) { db := NewBTree[[]byte]() // A nonexistent key should return nil. - value := db.Get([]byte("a")) + value, found := db.Get([]byte("a")) require.Nil(t, value) + require.False(t, found) // Set and get a value. db.Set([]byte("a"), []byte{0x01}) db.Set([]byte("b"), []byte{0x02}) - value = db.Get([]byte("a")) + value, found = db.Get([]byte("a")) require.Equal(t, []byte{0x01}, value) + require.True(t, found) - value = db.Get([]byte("b")) + value, found = db.Get([]byte("b")) require.Equal(t, []byte{0x02}, value) + require.True(t, found) // Deleting a non-existent value is fine. db.Delete([]byte("x")) @@ -30,13 +33,23 @@ func TestGetSetDelete(t *testing.T) { // Delete a value. db.Delete([]byte("a")) - value = db.Get([]byte("a")) + value, found = db.Get([]byte("a")) require.Nil(t, value) + require.False(t, found) db.Delete([]byte("b")) - value = db.Get([]byte("b")) + value, found = db.Get([]byte("b")) require.Nil(t, value) + require.False(t, found) +} + +func TestNilValue(t *testing.T) { + db := NewBTree[[]byte]() + db.Set([]byte("a"), nil) + value, found := db.Get([]byte("a")) + require.Nil(t, value) + require.True(t, found) } func TestDBIterator(t *testing.T) { diff --git a/store/internal/btreeadaptor.go b/store/internal/btreeadaptor.go index 322e0f4152fe..318c67bfda89 100644 --- a/store/internal/btreeadaptor.go +++ b/store/internal/btreeadaptor.go @@ -20,9 +20,15 @@ func NewBTreeStore[V any](btree btree.BTree[V], isZero func(V) bool, valueLen fu return &BTreeStore[V]{btree, isZero, valueLen} } +func (ts *BTreeStore[V]) Get(key []byte) (value V) { + value, _ = ts.BTree.Get(key) + return +} + // Hash Implements GKVStore. func (ts *BTreeStore[V]) Has(key []byte) bool { - return !ts.isZero(ts.Get(key)) + _, found := ts.BTree.Get(key) + return found } func (ts *BTreeStore[V]) Iterator(start, end []byte) types.GIterator[V] { diff --git a/store/types/store.go b/store/types/store.go index 239e4ae94b3f..19e45dbda43c 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -352,6 +352,12 @@ func (cid CommitID) String() string { return fmt.Sprintf("CommitID{%v:%X}", cid.Hash, cid.Version) } +// BranchStore +type BranchStore interface { + Clone() BranchStore + Restore(BranchStore) +} + //---------------------------------------- // Store types From 56f3e15f178c8880413435d86cc02c9c479fc2bb Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 1 Apr 2024 11:07:18 +0800 Subject: [PATCH 10/37] Problem: many memory allocs in cache store wrapping (#242) Solution: - init cachestore on cachestore lazily. - cleanup some unused stuff. Update store/CHANGELOG.md Signed-off-by: yihuang --- store/CHANGELOG.md | 1 + store/cachemulti/store.go | 75 ++++++++++++++++++++------------------- store/rootmulti/store.go | 4 +-- 3 files changed, 42 insertions(+), 38 deletions(-) diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index e4ea8fd42e84..df94d0bc57f3 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -31,6 +31,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Support object store. * [#240](https://github.com/crypto-org-chain/cosmos-sdk/pull/240) Split methods from `MultiStore` into specialized `RootMultiStore`, keep `MultiStore` generic. * [#241](https://github.com/crypto-org-chain/cosmos-sdk/pull/241) Refactor the cache store to be btree backed, prepare to support copy-on-write atomic branching. +* [#242](https://github.com/crypto-org-chain/cosmos-sdk/pull/242) Init cache on cache lazily, save memory allocations. ## v1.1.0 (March 20, 2024) diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 57734bbb770b..6b6aba8dc6bf 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -4,9 +4,6 @@ import ( "fmt" "io" - dbm "github.com/cosmos/cosmos-db" - - "cosmossdk.io/store/dbadapter" "cosmossdk.io/store/tracekv" "cosmossdk.io/store/types" ) @@ -23,12 +20,11 @@ const storeNameCtxKey = "store_name" // NOTE: a Store (and MultiStores in general) should never expose the // keys for the substores. type Store struct { - db types.CacheWrap stores map[types.StoreKey]types.CacheWrap - keys map[string]types.StoreKey traceWriter io.Writer traceContext types.TraceContext + parentStore func(types.StoreKey) types.CacheWrap } var _ types.CacheMultiStore = Store{} @@ -37,29 +33,17 @@ var _ types.CacheMultiStore = Store{} // CacheWrapper objects and a KVStore as the database. Each CacheWrapper store // is a branched store. func NewFromKVStore( - store types.CacheWrapper, stores map[types.StoreKey]types.CacheWrapper, - keys map[string]types.StoreKey, traceWriter io.Writer, traceContext types.TraceContext, + stores map[types.StoreKey]types.CacheWrapper, + traceWriter io.Writer, traceContext types.TraceContext, ) Store { cms := Store{ - db: store.CacheWrap(), stores: make(map[types.StoreKey]types.CacheWrap, len(stores)), - keys: keys, traceWriter: traceWriter, traceContext: traceContext, } for key, store := range stores { - if cms.TracingEnabled() { - // only support tracing on KVStore. - if kvstore, ok := store.(types.KVStore); ok { - tctx := cms.traceContext.Clone().Merge(types.TraceContext{ - storeNameCtxKey: key.Name(), - }) - - store = tracekv.NewStore(kvstore, cms.traceWriter, tctx) - } - } - cms.stores[key] = store.CacheWrap() + cms.initStore(key, store) } return cms @@ -68,19 +52,35 @@ func NewFromKVStore( // NewStore creates a new Store object from a mapping of store keys to // CacheWrapper objects. Each CacheWrapper store is a branched store. func NewStore( - db dbm.DB, stores map[types.StoreKey]types.CacheWrapper, keys map[string]types.StoreKey, + stores map[types.StoreKey]types.CacheWrapper, traceWriter io.Writer, traceContext types.TraceContext, ) Store { - return NewFromKVStore(dbadapter.Store{DB: db}, stores, keys, traceWriter, traceContext) + return NewFromKVStore(stores, traceWriter, traceContext) } func newCacheMultiStoreFromCMS(cms Store) Store { - stores := make(map[types.StoreKey]types.CacheWrapper) - for k, v := range cms.stores { - stores[k] = v + return Store{ + stores: make(map[types.StoreKey]types.CacheWrap), + traceWriter: cms.traceWriter, + traceContext: cms.traceContext, + parentStore: cms.getCacheWrap, } +} + +func (cms Store) initStore(key types.StoreKey, store types.CacheWrapper) types.CacheWrap { + if cms.TracingEnabled() { + // only support tracing on KVStore. + if kvstore, ok := store.(types.KVStore); ok { + tctx := cms.traceContext.Clone().Merge(types.TraceContext{ + storeNameCtxKey: key.Name(), + }) - return NewFromKVStore(cms.db, stores, nil, cms.traceWriter, cms.traceContext) + store = tracekv.NewStore(kvstore, cms.traceWriter, tctx) + } + } + cache := store.CacheWrap() + cms.stores[key] = cache + return cache } // SetTracer sets the tracer for the MultiStore that the underlying @@ -118,7 +118,6 @@ func (cms Store) GetStoreType() types.StoreType { // Write calls Write on each underlying store. func (cms Store) Write() { - cms.db.Write() for _, store := range cms.stores { store.Write() } @@ -134,19 +133,23 @@ func (cms Store) CacheMultiStore() types.CacheMultiStore { return newCacheMultiStoreFromCMS(cms) } -// GetStore returns an underlying Store by key. -func (cms Store) GetStore(key types.StoreKey) types.Store { - s := cms.stores[key] - if key == nil || s == nil { +func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { + store, ok := cms.stores[key] + if !ok && cms.parentStore != nil { + // load on demand + store = cms.initStore(key, cms.parentStore(key)) + } + if key == nil || store == nil { panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) } - return s.(types.Store) + return store } -func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { - store := cms.stores[key] - if key == nil || store == nil { - panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) +// GetStore returns an underlying Store by key. +func (cms Store) GetStore(key types.StoreKey) types.Store { + store, ok := cms.getCacheWrap(key).(types.Store) + if !ok { + panic(fmt.Sprintf("store with key %v is not Store", key)) } return store } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 7908ac118303..10e2d54592df 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -565,7 +565,7 @@ func (rs *Store) CacheMultiStore() types.CacheMultiStore { } stores[k] = store } - return cachemulti.NewStore(rs.db, stores, rs.keysByName, rs.traceWriter, rs.getTracingContext()) + return cachemulti.NewStore(stores, rs.traceWriter, rs.getTracingContext()) } // CacheMultiStoreWithVersion is analogous to CacheMultiStore except that it @@ -627,7 +627,7 @@ func (rs *Store) CacheMultiStoreWithVersion(version int64) (types.CacheMultiStor cachedStores[key] = cacheStore } - return cachemulti.NewStore(rs.db, cachedStores, rs.keysByName, rs.traceWriter, rs.getTracingContext()), nil + return cachemulti.NewStore(cachedStores, rs.traceWriter, rs.getTracingContext()), nil } // GetStore returns a mounted Store for a given StoreKey. If the StoreKey does From 7d01116b7b767231bf20f573d011f72fc7fa15cb Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 1 Apr 2024 14:46:42 +0800 Subject: [PATCH 11/37] Problem: no API to use the new CoW branch store (#243) * Support RunAtomic API * add unit test --- CHANGELOG.md | 1 + store/CHANGELOG.md | 1 + store/cachekv/store.go | 7 ++--- store/cachekv/store_test.go | 14 +++++++++ store/cachemulti/store.go | 53 ++++++++++++++++++++++++++++++---- store/cachemulti/store_test.go | 30 +++++++++++++++++++ store/internal/btreeadaptor.go | 5 +++- store/types/store.go | 2 ++ types/context.go | 21 ++++++++++++++ 9 files changed, 123 insertions(+), 11 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 464d497b4525..20da25bf0bfd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context. * (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins. * (x/bank) [#239](https://github.com/crypto-org-chain/cosmos-sdk/pull/239) Add low level `AddBalance`,`SubBalance` APIs to bank keeper. +* [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API in `Context` to use new CoW branched cache store. ## [Unreleased-Upstream] diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index df94d0bc57f3..850f6a98f19d 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -32,6 +32,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#240](https://github.com/crypto-org-chain/cosmos-sdk/pull/240) Split methods from `MultiStore` into specialized `RootMultiStore`, keep `MultiStore` generic. * [#241](https://github.com/crypto-org-chain/cosmos-sdk/pull/241) Refactor the cache store to be btree backed, prepare to support copy-on-write atomic branching. * [#242](https://github.com/crypto-org-chain/cosmos-sdk/pull/242) Init cache on cache lazily, save memory allocations. +* [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API to use new CoW cache store. ## v1.1.0 (March 20, 2024) diff --git a/store/cachekv/store.go b/store/cachekv/store.go index df47dfc3e6ae..c11ddd9e2b21 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -53,10 +53,9 @@ func (store *GStore[V]) GetStoreType() types.StoreType { // Clone creates a copy-on-write snapshot of the cache store, // it only performs a shallow copy so is very fast. func (store *GStore[V]) Clone() types.BranchStore { - return &GStore[V]{ - writeSet: store.writeSet.Copy(), - parent: store.parent, - } + v := *store + v.writeSet = store.writeSet.Copy() + return &v } // swapCache swap out the internal cache store and leave the current store unusable. diff --git a/store/cachekv/store_test.go b/store/cachekv/store_test.go index 3c5622355403..140df66e3b94 100644 --- a/store/cachekv/store_test.go +++ b/store/cachekv/store_test.go @@ -447,6 +447,20 @@ func TestIteratorDeadlock(t *testing.T) { defer it2.Close() } +func TestBranchStore(t *testing.T) { + mem := dbadapter.Store{DB: dbm.NewMemDB()} + store := cachekv.NewStore(mem) + + store.Set([]byte("key1"), []byte("value1")) + + branch := store.Clone().(types.CacheKVStore) + branch.Set([]byte("key1"), []byte("value2")) + + require.Equal(t, []byte("value1"), store.Get([]byte("key1"))) + store.Restore(branch.(types.BranchStore)) + require.Equal(t, []byte("value2"), store.Get([]byte("key1"))) +} + //------------------------------------------------------------------------------------------- // do some random ops diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 6b6aba8dc6bf..3c1164018072 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -25,6 +25,8 @@ type Store struct { traceWriter io.Writer traceContext types.TraceContext parentStore func(types.StoreKey) types.CacheWrap + + branched bool } var _ types.CacheMultiStore = Store{} @@ -43,7 +45,7 @@ func NewFromKVStore( } for key, store := range stores { - cms.initStore(key, store) + cms.stores[key] = cms.initStore(key, store) } return cms @@ -78,9 +80,7 @@ func (cms Store) initStore(key types.StoreKey, store types.CacheWrapper) types.C store = tracekv.NewStore(kvstore, cms.traceWriter, tctx) } } - cache := store.CacheWrap() - cms.stores[key] = cache - return cache + return store.CacheWrap() } // SetTracer sets the tracer for the MultiStore that the underlying @@ -118,6 +118,9 @@ func (cms Store) GetStoreType() types.StoreType { // Write calls Write on each underlying store. func (cms Store) Write() { + if cms.branched { + panic("cannot Write on branched store") + } for _, store := range cms.stores { store.Write() } @@ -135,9 +138,14 @@ func (cms Store) CacheMultiStore() types.CacheMultiStore { func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { store, ok := cms.stores[key] - if !ok && cms.parentStore != nil { + if !ok { // load on demand - store = cms.initStore(key, cms.parentStore(key)) + if cms.branched { + store = cms.parentStore(key).(types.BranchStore).Clone().(types.CacheWrap) + } else if cms.parentStore != nil { + store = cms.initStore(key, cms.parentStore(key)) + } + cms.stores[key] = store } if key == nil || store == nil { panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) @@ -171,3 +179,36 @@ func (cms Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { } return store } + +func (cms Store) Clone() Store { + return Store{ + stores: make(map[types.StoreKey]types.CacheWrap), + + traceWriter: cms.traceWriter, + traceContext: cms.traceContext, + parentStore: cms.getCacheWrap, + + branched: true, + } +} + +func (cms Store) Restore(other Store) { + if !other.branched { + panic("cannot restore from non-branched store") + } + + // restore the stores + for k, v := range other.stores { + cms.stores[k].(types.BranchStore).Restore(v.(types.BranchStore)) + } +} + +func (cms Store) RunAtomic(cb func(types.CacheMultiStore) error) error { + branch := cms.Clone() + if err := cb(branch); err != nil { + return err + } + + cms.Restore(branch) + return nil +} diff --git a/store/cachemulti/store_test.go b/store/cachemulti/store_test.go index 0ea7785bff93..8029282eafc4 100644 --- a/store/cachemulti/store_test.go +++ b/store/cachemulti/store_test.go @@ -4,8 +4,12 @@ import ( "fmt" "testing" + dbm "github.com/cosmos/cosmos-db" "github.com/stretchr/testify/require" + "cosmossdk.io/store/dbadapter" + "cosmossdk.io/store/internal" + "cosmossdk.io/store/internal/btree" "cosmossdk.io/store/types" ) @@ -22,3 +26,29 @@ func TestStoreGetKVStore(t *testing.T) { require.PanicsWithValue(errMsg, func() { s.GetKVStore(key) }) } + +func TestRunAtomic(t *testing.T) { + store := dbadapter.Store{DB: dbm.NewMemDB()} + objStore := internal.NewBTreeStore(btree.NewBTree[any](), + func(v any) bool { return v == nil }, + func(v any) int { return 1 }, + ) + keys := map[string]types.StoreKey{ + "abc": types.NewKVStoreKey("abc"), + "obj": types.NewObjectStoreKey("obj"), + "lazy": types.NewKVStoreKey("lazy"), + } + s := Store{stores: map[types.StoreKey]types.CacheWrap{ + keys["abc"]: store.CacheWrap(), + keys["obj"]: objStore.CacheWrap(), + keys["lazy"]: nil, + }} + + s.RunAtomic(func(ms types.CacheMultiStore) error { + ms.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value")) + ms.GetObjKVStore(keys["obj"]).Set([]byte("key"), "value") + return nil + }) + require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key"))) + require.Equal(t, "value", s.GetObjKVStore(keys["obj"]).Get([]byte("key")).(string)) +} diff --git a/store/internal/btreeadaptor.go b/store/internal/btreeadaptor.go index 318c67bfda89..dbc212779177 100644 --- a/store/internal/btreeadaptor.go +++ b/store/internal/btreeadaptor.go @@ -6,7 +6,10 @@ import ( "cosmossdk.io/store/types" ) -var _ types.KVStore = (*BTreeStore[[]byte])(nil) +var ( + _ types.KVStore = (*BTreeStore[[]byte])(nil) + _ types.ObjKVStore = (*BTreeStore[any])(nil) +) // BTreeStore is a wrapper for a BTree with GKVStore[V] implementation type BTreeStore[V any] struct { diff --git a/store/types/store.go b/store/types/store.go index 19e45dbda43c..e63ad6d9a79b 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -163,6 +163,8 @@ type RootMultiStore interface { type CacheMultiStore interface { MultiStore Write() // Writes operations to underlying KVStore + + RunAtomic(func(CacheMultiStore) error) error } // CommitMultiStore is an interface for a MultiStore without cache capabilities. diff --git a/types/context.go b/types/context.go index 27df031ada9b..27f9b588842d 100644 --- a/types/context.go +++ b/types/context.go @@ -2,6 +2,7 @@ package types import ( "context" + "errors" "time" abci "github.com/cometbft/cometbft/abci/types" @@ -398,6 +399,26 @@ func (c Context) CacheContext() (cc Context, writeCache func()) { return cc, writeCache } +// RunAtomic execute the callback function atomically, i.e. the state and event changes are +// only persisted if the callback returns no error, or discarded as a whole. +// It uses an efficient approach than CacheContext, without wrapping stores. +func (c Context) RunAtomic(cb func(Context) error) error { + evtManager := NewEventManager() + cacheMS, ok := c.ms.(storetypes.CacheMultiStore) + if !ok { + return errors.New("multistore is not a CacheMultiStore") + } + if err := cacheMS.RunAtomic(func(ms storetypes.CacheMultiStore) error { + ctx := c.WithMultiStore(ms).WithEventManager(evtManager) + return cb(ctx) + }); err != nil { + return err + } + + c.EventManager().EmitEvents(evtManager.Events()) + return nil +} + var ( _ context.Context = Context{} _ storetypes.Context = Context{} From 77efecc0520d11ede2a0d6b2f39fcbe084010110 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 1 Apr 2024 16:07:07 +0800 Subject: [PATCH 12/37] Problem: store key type assertion is incorrect (#244) fix and add test --- store/cachemulti/store_test.go | 9 +++++++++ store/rootmulti/store.go | 16 +++++++--------- store/rootmulti/store_test.go | 1 + 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/store/cachemulti/store_test.go b/store/cachemulti/store_test.go index 8029282eafc4..03053c4e5633 100644 --- a/store/cachemulti/store_test.go +++ b/store/cachemulti/store_test.go @@ -1,6 +1,7 @@ package cachemulti import ( + "errors" "fmt" "testing" @@ -51,4 +52,12 @@ func TestRunAtomic(t *testing.T) { }) require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key"))) require.Equal(t, "value", s.GetObjKVStore(keys["obj"]).Get([]byte("key")).(string)) + + require.Error(t, s.RunAtomic(func(ms types.CacheMultiStore) error { + ms.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value2")) + ms.GetObjKVStore(keys["obj"]).Set([]byte("key"), "value2") + return errors.New("failure") + })) + require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key"))) + require.Equal(t, "value", s.GetObjKVStore(keys["obj"]).Get([]byte("key")).(string)) } diff --git a/store/rootmulti/store.go b/store/rootmulti/store.go index 10e2d54592df..a3f00f342958 100644 --- a/store/rootmulti/store.go +++ b/store/rootmulti/store.go @@ -1056,26 +1056,24 @@ func (rs *Store) loadCommitStoreFromParams(key types.StoreKey, id types.CommitID return commitDBStoreAdapter{Store: dbadapter.Store{DB: db}}, nil case types.StoreTypeTransient: - _, ok := key.(*types.TransientStoreKey) - if !ok { - return nil, fmt.Errorf("invalid StoreKey for StoreTypeTransient: %s", key.String()) + if _, ok := key.(*types.TransientStoreKey); !ok { + return nil, fmt.Errorf("unexpected key type for a TransientStoreKey; got: %s, %T", key.String(), key) } return transient.NewStore(), nil case types.StoreTypeMemory: - _, ok := key.(*types.ObjectStoreKey) - if !ok { - return nil, fmt.Errorf("invalid StoreKey for StoreTypeTransient: %s", key.String()) - } - if _, ok := key.(*types.MemoryStoreKey); !ok { - return nil, fmt.Errorf("unexpected key type for a MemoryStoreKey; got: %s", key.String()) + return nil, fmt.Errorf("unexpected key type for a MemoryStoreKey; got: %s, %T", key.String(), key) } return mem.NewStore(), nil case types.StoreTypeObject: + if _, ok := key.(*types.ObjectStoreKey); !ok { + return nil, fmt.Errorf("unexpected key type for a ObjectStoreKey; got: %s, %T", key.String(), key) + } + return transient.NewObjStore(), nil default: diff --git a/store/rootmulti/store_test.go b/store/rootmulti/store_test.go index 34a3d8b1f626..3d7dca809d2f 100644 --- a/store/rootmulti/store_test.go +++ b/store/rootmulti/store_test.go @@ -931,6 +931,7 @@ func prepareStoreMap() (map[types.StoreKey]types.CommitStore, error) { store.MountStoreWithDB(types.NewKVStoreKey("iavl1"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewKVStoreKey("iavl2"), types.StoreTypeIAVL, nil) store.MountStoreWithDB(types.NewTransientStoreKey("trans1"), types.StoreTypeTransient, nil) + store.MountStoreWithDB(types.NewMemoryStoreKey("mem1"), types.StoreTypeMemory, nil) store.MountStoreWithDB(types.NewObjectStoreKey("obj1"), types.StoreTypeObject, nil) if err := store.LoadLatestVersion(); err != nil { return nil, err From ec314e8e2d0791eace329be206e19f88b01d2272 Mon Sep 17 00:00:00 2001 From: yihuang Date: Tue, 2 Apr 2024 09:54:25 +0800 Subject: [PATCH 13/37] Problem: Restore don't work snapshot revert usage (#245) Solution: - fix and add test to support the usage pattern in ethermint add Discard method to CacheWrap better testing --- store/CHANGELOG.md | 1 + store/cachekv/store.go | 4 +++ store/cachemulti/store.go | 47 ++++++++++++++++++++++++---------- store/cachemulti/store_test.go | 39 +++++++++++++++++++++++----- store/types/store.go | 3 +++ 5 files changed, 73 insertions(+), 21 deletions(-) diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 850f6a98f19d..39cfdacfa33a 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -33,6 +33,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#241](https://github.com/crypto-org-chain/cosmos-sdk/pull/241) Refactor the cache store to be btree backed, prepare to support copy-on-write atomic branching. * [#242](https://github.com/crypto-org-chain/cosmos-sdk/pull/242) Init cache on cache lazily, save memory allocations. * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API to use new CoW cache store. +* [#244](https://github.com/crypto-org-chain/cosmos-sdk/pull/244) Add `Discard` method to CacheWrap to discard the write buffer. ## v1.1.0 (March 20, 2024) diff --git a/store/cachekv/store.go b/store/cachekv/store.go index c11ddd9e2b21..5d174acaaeb8 100644 --- a/store/cachekv/store.go +++ b/store/cachekv/store.go @@ -119,6 +119,10 @@ func (store *GStore[V]) Write() { store.writeSet.Clear() } +func (store *GStore[V]) Discard() { + store.writeSet.Clear() +} + // CacheWrap implements CacheWrapper. func (store *GStore[V]) CacheWrap() types.CacheWrap { return NewGStore(store, store.isZero, store.valueLen) diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 3c1164018072..a78a4b92dd12 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -45,7 +45,7 @@ func NewFromKVStore( } for key, store := range stores { - cms.stores[key] = cms.initStore(key, store) + cms.initStore(key, store) } return cms @@ -80,7 +80,9 @@ func (cms Store) initStore(key types.StoreKey, store types.CacheWrapper) types.C store = tracekv.NewStore(kvstore, cms.traceWriter, tctx) } } - return store.CacheWrap() + cache := store.CacheWrap() + cms.stores[key] = cache + return cache } // SetTracer sets the tracer for the MultiStore that the underlying @@ -126,6 +128,12 @@ func (cms Store) Write() { } } +func (cms Store) Discard() { + for _, store := range cms.stores { + store.Discard() + } +} + // Implements CacheWrapper. func (cms Store) CacheWrap() types.CacheWrap { return cms.CacheMultiStore().(types.CacheWrap) @@ -138,14 +146,9 @@ func (cms Store) CacheMultiStore() types.CacheMultiStore { func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { store, ok := cms.stores[key] - if !ok { + if !ok && cms.parentStore != nil { // load on demand - if cms.branched { - store = cms.parentStore(key).(types.BranchStore).Clone().(types.CacheWrap) - } else if cms.parentStore != nil { - store = cms.initStore(key, cms.parentStore(key)) - } - cms.stores[key] = store + store = cms.initStore(key, cms.parentStore(key)) } if key == nil || store == nil { panic(fmt.Sprintf("kv store with key %v has not been registered in stores", key)) @@ -181,12 +184,15 @@ func (cms Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { } func (cms Store) Clone() Store { + stores := make(map[types.StoreKey]types.CacheWrap, len(cms.stores)) + for k, v := range cms.stores { + stores[k] = v.(types.BranchStore).Clone().(types.CacheWrap) + } return Store{ - stores: make(map[types.StoreKey]types.CacheWrap), - + stores: stores, traceWriter: cms.traceWriter, traceContext: cms.traceContext, - parentStore: cms.getCacheWrap, + parentStore: cms.parentStore, branched: true, } @@ -197,9 +203,22 @@ func (cms Store) Restore(other Store) { panic("cannot restore from non-branched store") } - // restore the stores + // discard the non-exists stores + for k, v := range cms.stores { + if _, ok := other.stores[k]; !ok { + // clear the cache store if it's not in the other + v.Discard() + } + } + + // restore the other stores for k, v := range other.stores { - cms.stores[k].(types.BranchStore).Restore(v.(types.BranchStore)) + store, ok := cms.stores[k] + if !ok { + store = cms.initStore(k, cms.parentStore(k)) + } + + store.(types.BranchStore).Restore(v.(types.BranchStore)) } } diff --git a/store/cachemulti/store_test.go b/store/cachemulti/store_test.go index 03053c4e5633..01c7a810bf91 100644 --- a/store/cachemulti/store_test.go +++ b/store/cachemulti/store_test.go @@ -35,22 +35,22 @@ func TestRunAtomic(t *testing.T) { func(v any) int { return 1 }, ) keys := map[string]types.StoreKey{ - "abc": types.NewKVStoreKey("abc"), - "obj": types.NewObjectStoreKey("obj"), - "lazy": types.NewKVStoreKey("lazy"), + "abc": types.NewKVStoreKey("abc"), + "obj": types.NewObjectStoreKey("obj"), } - s := Store{stores: map[types.StoreKey]types.CacheWrap{ - keys["abc"]: store.CacheWrap(), - keys["obj"]: objStore.CacheWrap(), - keys["lazy"]: nil, + parent := Store{stores: map[types.StoreKey]types.CacheWrap{ + keys["abc"]: store.CacheWrap(), + keys["obj"]: objStore.CacheWrap(), }} + s := Store{stores: map[types.StoreKey]types.CacheWrap{}, parentStore: parent.getCacheWrap} s.RunAtomic(func(ms types.CacheMultiStore) error { ms.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value")) ms.GetObjKVStore(keys["obj"]).Set([]byte("key"), "value") return nil }) require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key"))) + require.Equal(t, []byte(nil), s.GetKVStore(keys["abc"]).Get([]byte("key-non-exist"))) require.Equal(t, "value", s.GetObjKVStore(keys["obj"]).Get([]byte("key")).(string)) require.Error(t, s.RunAtomic(func(ms types.CacheMultiStore) error { @@ -61,3 +61,28 @@ func TestRunAtomic(t *testing.T) { require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key"))) require.Equal(t, "value", s.GetObjKVStore(keys["obj"]).Get([]byte("key")).(string)) } + +func TestBranchStore(t *testing.T) { + store := dbadapter.Store{DB: dbm.NewMemDB()} + objStore := internal.NewBTreeStore(btree.NewBTree[any](), + func(v any) bool { return v == nil }, + func(v any) int { return 1 }, + ) + keys := map[string]types.StoreKey{ + "abc": types.NewKVStoreKey("abc"), + "obj": types.NewObjectStoreKey("obj"), + } + parent := Store{stores: map[types.StoreKey]types.CacheWrap{ + keys["abc"]: store.CacheWrap(), + keys["obj"]: objStore.CacheWrap(), + }} + + s := Store{stores: map[types.StoreKey]types.CacheWrap{}, parentStore: parent.getCacheWrap} + s.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value")) + snapshot := s.Clone() + s.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value2")) + s.GetObjKVStore(keys["obj"]).Set([]byte("key"), "value") + s.Restore(snapshot) + require.Equal(t, []byte("value"), s.GetKVStore(keys["abc"]).Get([]byte("key"))) + require.Equal(t, nil, s.GetObjKVStore(keys["obj"]).Get([]byte("key"))) +} diff --git a/store/types/store.go b/store/types/store.go index e63ad6d9a79b..67bd140f5e75 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -339,6 +339,9 @@ type CacheWrap interface { // Write syncs with the underlying store. Write() + + // Discard the write set + Discard() } type CacheWrapper interface { From 829c542758943d04a681050e6ee39d3f98418a6e Mon Sep 17 00:00:00 2001 From: yihuang Date: Tue, 2 Apr 2024 14:44:32 +0800 Subject: [PATCH 14/37] Revert "Problem: no efficient bank api to support evm add/sub balances (#239)" (#247) This reverts commit b693dd98bb627f03bf1586e9c08947a8eb1fde11. --- CHANGELOG.md | 1 - x/bank/keeper/keeper.go | 35 ----------------------- x/bank/keeper/send.go | 63 +++++++++++++++++++---------------------- 3 files changed, 29 insertions(+), 70 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 20da25bf0bfd..a69702176003 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -43,7 +43,6 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (baseapp) [#205](https://github.com/crypto-org-chain/cosmos-sdk/pull/205) Add `TxExecutor` baseapp option, add `TxIndex`/`TxCount`/`MsgIndex`/`BlockGasUsed` fields to `Context, to support tx parallel execution. * (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context. * (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins. -* (x/bank) [#239](https://github.com/crypto-org-chain/cosmos-sdk/pull/239) Add low level `AddBalance`,`SubBalance` APIs to bank keeper. * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API in `Context` to use new CoW branched cache store. ## [Unreleased-Upstream] diff --git a/x/bank/keeper/keeper.go b/x/bank/keeper/keeper.go index 1a31ffc0f220..26dceca9b66b 100644 --- a/x/bank/keeper/keeper.go +++ b/x/bank/keeper/keeper.go @@ -419,41 +419,6 @@ func (k BaseKeeper) BurnCoins(ctx context.Context, moduleName string, amounts sd return nil } -// AddBalance is low level api to update balance directly, mainly used by evm integration, -// caller should make sure the total supply of the denom not changed and the account exists. -// it's for evm integration, call at your own risk. -// it emits mint event. -func (k BaseKeeper) AddBalance(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin) error { - if err := k.addCoin(ctx, addr, coin); err != nil { - return err - } - - // emit mint event - sdkCtx := sdk.UnwrapSDKContext(ctx) - sdkCtx.EventManager().EmitEvent( - types.NewCoinMintEvent(addr, sdk.NewCoins(coin)), - ) - return nil -} - -// SubBalance is low level api to update balance directly, mainly used by evm integration, -// caller should make sure the total supply of the denom not changed. -// it's for evm integration, call at your own risk. -// it emits burn event. -func (k BaseKeeper) SubBalance(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin) error { - lockedCoins := k.LockedCoins(ctx, addr) - if err := k.subCoin(ctx, addr, coin, lockedCoins); err != nil { - return err - } - - sdkCtx := sdk.UnwrapSDKContext(ctx) - // emit burn event - sdkCtx.EventManager().EmitEvent( - types.NewCoinBurnEvent(addr, sdk.NewCoins(coin)), - ) - return nil -} - // setSupply sets the supply for the given coin func (k BaseKeeper) setSupply(ctx context.Context, coin sdk.Coin) { // Bank invariants and IBC requires to remove zero coins. diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 037bc83265a8..7f9bd6016506 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -8,6 +8,7 @@ import ( "cosmossdk.io/core/store" errorsmod "cosmossdk.io/errors" "cosmossdk.io/log" + "cosmossdk.io/math" storetypes "cosmossdk.io/store/types" "github.com/cosmos/cosmos-sdk/codec" @@ -272,7 +273,29 @@ func (k BaseSendKeeper) subUnlockedCoins(ctx context.Context, addr sdk.AccAddres lockedCoins := k.LockedCoins(ctx, addr) for _, coin := range amt { - if err := k.subCoin(ctx, addr, coin, lockedCoins); err != nil { + balance := k.GetBalance(ctx, addr, coin.Denom) + locked := sdk.NewCoin(coin.Denom, lockedCoins.AmountOf(coin.Denom)) + + spendable, hasNeg := sdk.Coins{balance}.SafeSub(locked) + if hasNeg { + return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, + "locked amount exceeds account balance funds: %s > %s", locked, balance) + } + + if _, hasNeg := spendable.SafeSub(coin); hasNeg { + if len(spendable) == 0 { + spendable = sdk.Coins{sdk.NewCoin(coin.Denom, math.ZeroInt())} + } + return errorsmod.Wrapf( + sdkerrors.ErrInsufficientFunds, + "spendable balance %s is smaller than %s", + spendable, coin, + ) + } + + newBalance := balance.Sub(coin) + + if err := k.setBalance(ctx, addr, newBalance); err != nil { return err } } @@ -285,32 +308,6 @@ func (k BaseSendKeeper) subUnlockedCoins(ctx context.Context, addr sdk.AccAddres return nil } -func (k BaseSendKeeper) subCoin(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin, lockedCoins sdk.Coins) error { - var ( - spendable sdk.Coin - err error - ) - balance := k.GetBalance(ctx, addr, coin.Denom) - locked := sdk.NewCoin(coin.Denom, lockedCoins.AmountOf(coin.Denom)) - if locked.IsZero() { - spendable = balance - } else { - spendable, err = balance.SafeSub(locked) - if err != nil { - return errorsmod.Wrapf(sdkerrors.ErrInsufficientFunds, - "locked amount exceeds account balance funds: %s > %s", locked, balance) - } - } - if spendable.Amount.LT(coin.Amount) { - return errorsmod.Wrapf( - sdkerrors.ErrInsufficientFunds, - "spendable balance %s is smaller than %s", - spendable, coin, - ) - } - return k.setBalance(ctx, addr, balance.Sub(coin)) -} - // addCoins increase the addr balance by the given amt. Fails if the provided // amt is invalid. It emits a coin received event. func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { @@ -319,7 +316,11 @@ func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt s } for _, coin := range amt { - if err := k.addCoin(ctx, addr, coin); err != nil { + balance := k.GetBalance(ctx, addr, coin.Denom) + newBalance := balance.Add(coin) + + err := k.setBalance(ctx, addr, newBalance) + if err != nil { return err } } @@ -333,12 +334,6 @@ func (k BaseSendKeeper) addCoins(ctx context.Context, addr sdk.AccAddress, amt s return nil } -func (k BaseSendKeeper) addCoin(ctx context.Context, addr sdk.AccAddress, coin sdk.Coin) error { - balance := k.GetBalance(ctx, addr, coin.Denom) - newBalance := balance.Add(coin) - return k.setBalance(ctx, addr, newBalance) -} - // setBalance sets the coin balance for an account by address. func (k BaseSendKeeper) setBalance(ctx context.Context, addr sdk.AccAddress, balance sdk.Coin) error { if !balance.IsValid() { From 1c80a4793160f21afb835c0986a35ee2c0ce08c5 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 3 Apr 2024 09:43:14 +0800 Subject: [PATCH 15/37] feat: save some memory allocations on un-used cache store (#248) * feat: save some memory allocations on un-used cache store * Update CHANGELOG.md Signed-off-by: yihuang * Update store/internal/btree/btree.go Signed-off-by: yihuang --------- Signed-off-by: yihuang --- CHANGELOG.md | 1 + store/internal/btree/btree.go | 36 +++++++++++++++++++++++------ store/internal/btree/memiterator.go | 9 ++++++++ 3 files changed, 39 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a69702176003..28720c3441ed 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (baseapp) [#206](https://github.com/crypto-org-chain/cosmos-sdk/pull/206) Support mount object store in baseapp, add `ObjectStore` api in context. * (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins. * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API in `Context` to use new CoW branched cache store. +* [#248](https://github.com/crypto-org-chain/cosmos-sdk/pull/248) Init btree store lazily to save allocations when no content insert into it. ## [Unreleased-Upstream] diff --git a/store/internal/btree/btree.go b/store/internal/btree/btree.go index bef4309412ff..920b373ff491 100644 --- a/store/internal/btree/btree.go +++ b/store/internal/btree/btree.go @@ -28,25 +28,38 @@ type BTree[V any] struct { // NewBTree creates a wrapper around `btree.BTreeG`. func NewBTree[V any]() BTree[V] { - return BTree[V]{ - tree: btree.NewBTreeGOptions(byKeys[V], btree.Options{ - Degree: bTreeDegree, - NoLocks: false, - }), + return BTree[V]{} +} + +func (bt *BTree[V]) init() { + if bt.tree != nil { + return } + bt.tree = btree.NewBTreeGOptions(byKeys[V], btree.Options{ + Degree: bTreeDegree, + NoLocks: false, + }) } // Set supports nil as value when used as overlay -func (bt BTree[V]) Set(key []byte, value V) { +func (bt *BTree[V]) Set(key []byte, value V) { + bt.init() bt.tree.Set(newItem(key, value)) } func (bt BTree[V]) Get(key []byte) (V, bool) { + if bt.tree == nil { + var zero V + return zero, false + } i, found := bt.tree.Get(newItemWithKey[V](key)) return i.value, found } -func (bt BTree[V]) Delete(key []byte) { +func (bt *BTree[V]) Delete(key []byte) { + if bt.tree == nil { + return + } bt.tree.Delete(newItemWithKey[V](key)) } @@ -67,16 +80,25 @@ func (bt BTree[V]) ReverseIterator(start, end []byte) (types.GIterator[V], error // Copy the tree. This is a copy-on-write operation and is very fast because // it only performs a shadowed copy. func (bt BTree[V]) Copy() BTree[V] { + if bt.tree == nil { + return BTree[V]{} + } return BTree[V]{ tree: bt.tree.Copy(), } } func (bt BTree[V]) Clear() { + if bt.tree == nil { + return + } bt.tree.Clear() } func (bt BTree[V]) Scan(cb func(key []byte, value V) bool) { + if bt.tree == nil { + return + } bt.tree.Scan(func(i item[V]) bool { return cb(i.key, i.value) }) diff --git a/store/internal/btree/memiterator.go b/store/internal/btree/memiterator.go index e98ae9cd834e..b3caabd4584b 100644 --- a/store/internal/btree/memiterator.go +++ b/store/internal/btree/memiterator.go @@ -24,6 +24,15 @@ type memIterator[V any] struct { } func newMemIterator[V any](start, end []byte, items BTree[V], ascending bool) *memIterator[V] { + if items.tree == nil { + return &memIterator[V]{ + start: start, + end: end, + ascending: ascending, + valid: false, + } + } + var ( valid bool empty V From fecb1b042e721c23b7d5191b6803432281096039 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 3 Apr 2024 15:15:22 +0800 Subject: [PATCH 16/37] Problem: block gas used not set in context (#252) Solution: - fix the way context is updated --- CHANGELOG.md | 1 + baseapp/abci.go | 14 +++++++++++--- baseapp/baseapp.go | 2 +- types/context.go | 8 ++++++++ 4 files changed, 21 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 28720c3441ed..2160073cfb55 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (bank) [#237](https://github.com/crypto-org-chain/cosmos-sdk/pull/237) Support virtual accounts in sending coins. * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API in `Context` to use new CoW branched cache store. * [#248](https://github.com/crypto-org-chain/cosmos-sdk/pull/248) Init btree store lazily to save allocations when no content insert into it. +* [#252](https://github.com/crypto-org-chain/cosmos-sdk/pull/252) Add `BlockGasWanted` to `Context` to support feemarket module. ## [Unreleased-Upstream] diff --git a/baseapp/abci.go b/baseapp/abci.go index ff391460f536..25efa3b224f6 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -796,13 +796,21 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request app.finalizeBlockState.ms = app.finalizeBlockState.ms.SetTracingContext(nil).(storetypes.CacheMultiStore) } - var blockGasUsed uint64 + var ( + blockGasUsed uint64 + blockGasWanted uint64 + ) for _, res := range txResults { blockGasUsed += uint64(res.GasUsed) + blockGasWanted += uint64(res.GasWanted) } - sdkCtx := app.finalizeBlockState.Context().WithBlockGasUsed(blockGasUsed) + app.finalizeBlockState.SetContext( + app.finalizeBlockState.Context(). + WithBlockGasUsed(blockGasUsed). + WithBlockGasWanted(blockGasWanted), + ) - endBlock, err := app.endBlock(sdkCtx) + endBlock, err := app.endBlock(ctx) if err != nil { return nil, err } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index aee79df5f658..99bbdcd1d2c7 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -807,7 +807,7 @@ func (app *BaseApp) deliverTxWithMultiStore(tx []byte, txIndex int, txMultiStore // endBlock is an application-defined function that is called after transactions // have been processed in FinalizeBlock. -func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) { +func (app *BaseApp) endBlock(_ context.Context) (sdk.EndBlock, error) { var endblock sdk.EndBlock if app.endBlocker != nil { diff --git a/types/context.go b/types/context.go index 27f9b588842d..50452e13b79e 100644 --- a/types/context.go +++ b/types/context.go @@ -74,6 +74,8 @@ type Context struct { txCount int // sum the gas used by all the transactions in the current block, only accessible by end blocker blockGasUsed uint64 + // sum the gas wanted by all the transactions in the current block, only accessible by end blocker + blockGasWanted uint64 } // Proposed rename, not done to avoid API breakage @@ -105,6 +107,7 @@ func (c Context) TxIndex() int { return c.txInd func (c Context) MsgIndex() int { return c.msgIndex } func (c Context) TxCount() int { return c.txCount } func (c Context) BlockGasUsed() uint64 { return c.blockGasUsed } +func (c Context) BlockGasWanted() uint64 { return c.blockGasWanted } // clone the header before returning func (c Context) BlockHeader() cmtproto.Header { @@ -346,6 +349,11 @@ func (c Context) WithBlockGasUsed(gasUsed uint64) Context { return c } +func (c Context) WithBlockGasWanted(gasWanted uint64) Context { + c.blockGasWanted = gasWanted + return c +} + // TODO: remove??? func (c Context) IsZero() bool { return c.ms == nil From 29d3142f7596f16dc2e00e6eb194cfe59cd11075 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 3 Apr 2024 16:57:42 +0800 Subject: [PATCH 17/37] Problem: invalid tx returns negative gas wanted (#253) Solution: - add checks --- baseapp/abci.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index 25efa3b224f6..027f94763944 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -801,8 +801,14 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request blockGasWanted uint64 ) for _, res := range txResults { - blockGasUsed += uint64(res.GasUsed) - blockGasWanted += uint64(res.GasWanted) + // GasUsed should not be -1 but just in case + if res.GasUsed > 0 { + blockGasUsed += uint64(res.GasUsed) + } + // GasWanted could be -1 if the tx is invalid + if res.GasWanted > 0 { + blockGasWanted += uint64(res.GasWanted) + } } app.finalizeBlockState.SetContext( app.finalizeBlockState.Context(). From 0bb12ec2d092e38b2f3b3499774e876c46d64297 Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 5 Apr 2024 11:19:53 +0800 Subject: [PATCH 18/37] Problem: no api to create cachemulti store from external cache store (#258) Solution: - add API NewFromParent to cache multistore. Update store/CHANGELOG.md Signed-off-by: yihuang fix test fix lint --- store/CHANGELOG.md | 1 + store/cachemulti/store.go | 25 +++++++++++++++---------- store/cachemulti/store_test.go | 4 ++-- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 39cfdacfa33a..b5e06dc3f03a 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -34,6 +34,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#242](https://github.com/crypto-org-chain/cosmos-sdk/pull/242) Init cache on cache lazily, save memory allocations. * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API to use new CoW cache store. * [#244](https://github.com/crypto-org-chain/cosmos-sdk/pull/244) Add `Discard` method to CacheWrap to discard the write buffer. +* [#258](https://github.com/crypto-org-chain/cosmos-sdk/pull/258) Add `NewFromParent` API to cachemulti store to create a new store from block-stm multiversion data structure. ## v1.1.0 (March 20, 2024) diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index a78a4b92dd12..96aafd41e656 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -24,7 +24,7 @@ type Store struct { traceWriter io.Writer traceContext types.TraceContext - parentStore func(types.StoreKey) types.CacheWrap + parentStore func(types.StoreKey) types.CacheWrapper branched bool } @@ -60,12 +60,17 @@ func NewStore( return NewFromKVStore(stores, traceWriter, traceContext) } -func newCacheMultiStoreFromCMS(cms Store) Store { +// NewFromParent constructs a cache multistore with a parent store lazily, +// the parent is usually another cache multistore or the block-stm multiversion store. +func NewFromParent( + parentStore func(types.StoreKey) types.CacheWrapper, + traceWriter io.Writer, traceContext types.TraceContext, +) Store { return Store{ stores: make(map[types.StoreKey]types.CacheWrap), - traceWriter: cms.traceWriter, - traceContext: cms.traceContext, - parentStore: cms.getCacheWrap, + traceWriter: traceWriter, + traceContext: traceContext, + parentStore: parentStore, } } @@ -141,10 +146,10 @@ func (cms Store) CacheWrap() types.CacheWrap { // Implements MultiStore. func (cms Store) CacheMultiStore() types.CacheMultiStore { - return newCacheMultiStoreFromCMS(cms) + return NewFromParent(cms.getCacheWrapper, cms.traceWriter, cms.traceContext) } -func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { +func (cms Store) getCacheWrapper(key types.StoreKey) types.CacheWrapper { store, ok := cms.stores[key] if !ok && cms.parentStore != nil { // load on demand @@ -158,7 +163,7 @@ func (cms Store) getCacheWrap(key types.StoreKey) types.CacheWrap { // GetStore returns an underlying Store by key. func (cms Store) GetStore(key types.StoreKey) types.Store { - store, ok := cms.getCacheWrap(key).(types.Store) + store, ok := cms.getCacheWrapper(key).(types.Store) if !ok { panic(fmt.Sprintf("store with key %v is not Store", key)) } @@ -167,7 +172,7 @@ func (cms Store) GetStore(key types.StoreKey) types.Store { // GetKVStore returns an underlying KVStore by key. func (cms Store) GetKVStore(key types.StoreKey) types.KVStore { - store, ok := cms.getCacheWrap(key).(types.KVStore) + store, ok := cms.getCacheWrapper(key).(types.KVStore) if !ok { panic(fmt.Sprintf("store with key %v is not KVStore", key)) } @@ -176,7 +181,7 @@ func (cms Store) GetKVStore(key types.StoreKey) types.KVStore { // GetObjKVStore returns an underlying KVStore by key. func (cms Store) GetObjKVStore(key types.StoreKey) types.ObjKVStore { - store, ok := cms.getCacheWrap(key).(types.ObjKVStore) + store, ok := cms.getCacheWrapper(key).(types.ObjKVStore) if !ok { panic(fmt.Sprintf("store with key %v is not ObjKVStore", key)) } diff --git a/store/cachemulti/store_test.go b/store/cachemulti/store_test.go index 01c7a810bf91..38d1182cdf7a 100644 --- a/store/cachemulti/store_test.go +++ b/store/cachemulti/store_test.go @@ -43,7 +43,7 @@ func TestRunAtomic(t *testing.T) { keys["obj"]: objStore.CacheWrap(), }} - s := Store{stores: map[types.StoreKey]types.CacheWrap{}, parentStore: parent.getCacheWrap} + s := Store{stores: map[types.StoreKey]types.CacheWrap{}, parentStore: parent.getCacheWrapper} s.RunAtomic(func(ms types.CacheMultiStore) error { ms.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value")) ms.GetObjKVStore(keys["obj"]).Set([]byte("key"), "value") @@ -77,7 +77,7 @@ func TestBranchStore(t *testing.T) { keys["obj"]: objStore.CacheWrap(), }} - s := Store{stores: map[types.StoreKey]types.CacheWrap{}, parentStore: parent.getCacheWrap} + s := Store{stores: map[types.StoreKey]types.CacheWrap{}, parentStore: parent.getCacheWrapper} s.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value")) snapshot := s.Clone() s.GetKVStore(keys["abc"]).Set([]byte("key"), []byte("value2")) From 56c165536d0afd1ede382c4efa77b8ae9621450c Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 8 Apr 2024 09:44:08 +0800 Subject: [PATCH 19/37] small optimisations (#261) * mutex don't cover GetSigners don't clone header in context * Update CHANGELOG.md Signed-off-by: yihuang * update comment --------- Signed-off-by: yihuang --- CHANGELOG.md | 4 ++++ types/context.go | 6 ++---- types/mempool/priority_nonce.go | 5 +++-- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2160073cfb55..006a157a4479 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#248](https://github.com/crypto-org-chain/cosmos-sdk/pull/248) Init btree store lazily to save allocations when no content insert into it. * [#252](https://github.com/crypto-org-chain/cosmos-sdk/pull/252) Add `BlockGasWanted` to `Context` to support feemarket module. +### Improvements + +* [#261](https://github.com/crypto-org-chain/cosmos-sdk/pull/261) `ctx.BlockHeader` don't do protobuf deep copy, shallow copy seems enough, reduce scope of mutex in `PriorityNonceMempool.Remove`. + ## [Unreleased-Upstream] ### Bug Fixes diff --git a/types/context.go b/types/context.go index 50452e13b79e..e03d53c84c92 100644 --- a/types/context.go +++ b/types/context.go @@ -7,7 +7,6 @@ import ( abci "github.com/cometbft/cometbft/abci/types" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" - "github.com/cosmos/gogoproto/proto" "cosmossdk.io/core/comet" "cosmossdk.io/core/header" @@ -109,10 +108,9 @@ func (c Context) TxCount() int { return c.txCou func (c Context) BlockGasUsed() uint64 { return c.blockGasUsed } func (c Context) BlockGasWanted() uint64 { return c.blockGasWanted } -// clone the header before returning +// BlockHeader returns the header by value (shallow copy). func (c Context) BlockHeader() cmtproto.Header { - msg := proto.Clone(&c.header).(*cmtproto.Header) - return *msg + return c.header } // HeaderHash returns a copy of the header hash obtained during abci.RequestBeginBlock diff --git a/types/mempool/priority_nonce.go b/types/mempool/priority_nonce.go index f0df79e70882..03e909475696 100644 --- a/types/mempool/priority_nonce.go +++ b/types/mempool/priority_nonce.go @@ -429,8 +429,6 @@ func (mp *PriorityNonceMempool[C]) CountTx() int { // Remove removes a transaction from the mempool in O(log n) time, returning an // error if unsuccessful. func (mp *PriorityNonceMempool[C]) Remove(tx sdk.Tx) error { - mp.mtx.Lock() - defer mp.mtx.Unlock() sigs, err := mp.cfg.SignerExtractor.GetSigners(tx) if err != nil { return err @@ -443,6 +441,9 @@ func (mp *PriorityNonceMempool[C]) Remove(tx sdk.Tx) error { sender := sig.Signer.String() nonce := sig.Sequence + mp.mtx.Lock() + defer mp.mtx.Unlock() + scoreKey := txMeta[C]{nonce: nonce, sender: sender} score, ok := mp.scores[scoreKey] if !ok { From 5ad2d9a9dca1f0bed8428643ca061569ca8dec13 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 8 Apr 2024 15:56:16 +0800 Subject: [PATCH 20/37] Problem: can't extend abci listeners in streaming manager (#269) Solution: - add API StreamingManager to allow extending the abci listeners, mainly for versiondb support Update CHANGELOG.md Signed-off-by: yihuang cleanup --- CHANGELOG.md | 1 + baseapp/baseapp.go | 4 ++++ server/mock/store.go | 12 ------------ 3 files changed, 5 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 006a157a4479..021533364551 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -46,6 +46,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#243](https://github.com/crypto-org-chain/cosmos-sdk/pull/243) Support `RunAtomic` API in `Context` to use new CoW branched cache store. * [#248](https://github.com/crypto-org-chain/cosmos-sdk/pull/248) Init btree store lazily to save allocations when no content insert into it. * [#252](https://github.com/crypto-org-chain/cosmos-sdk/pull/252) Add `BlockGasWanted` to `Context` to support feemarket module. +* [#269](https://github.com/crypto-org-chain/cosmos-sdk/pull/269) Add `StreamingManager` to baseapp to extend the abci listeners. ### Improvements diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 99bbdcd1d2c7..a084367dba4a 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -1164,6 +1164,10 @@ func (app *BaseApp) TxEncode(tx sdk.Tx) ([]byte, error) { return app.txEncoder(tx) } +func (app *BaseApp) StreamingManager() storetypes.StreamingManager { + return app.streamingManager +} + // Close is called in start cmd to gracefully cleanup resources. func (app *BaseApp) Close() error { var errs []error diff --git a/server/mock/store.go b/server/mock/store.go index 9c756eed4964..a73c57272f42 100644 --- a/server/mock/store.go +++ b/server/mock/store.go @@ -30,14 +30,6 @@ func (ms multiStore) CacheWrap() storetypes.CacheWrap { panic("not implemented") } -func (ms multiStore) CacheWrapWithTrace(_ io.Writer, _ storetypes.TraceContext) storetypes.CacheWrap { - panic("not implemented") -} - -func (ms multiStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { - panic("not implemented") -} - func (ms multiStore) TracingEnabled() bool { panic("not implemented") } @@ -182,10 +174,6 @@ func (kv kvStore) CacheWrap() storetypes.CacheWrap { panic("not implemented") } -func (kv kvStore) CacheWrapWithListeners(_ storetypes.StoreKey, _ []storetypes.MemoryListener) storetypes.CacheWrap { - panic("not implemented") -} - func (kv kvStore) GetStoreType() storetypes.StoreType { panic("not implemented") } From b2be50da950e41d4ad3cd2a07e8aed2c218e5862 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 10 Apr 2024 11:31:23 +0800 Subject: [PATCH 21/37] Problem: x/tx not up to date to the released version (#279) * Problem: x/tx not up to date to the released version Solution: - reset to the x/tx/0.13.1 * fix lint --- x/tx/CHANGELOG.md | 57 + x/tx/decode/adr027.go | 8 + x/tx/decode/decode.go | 32 +- x/tx/decode/decode_test.go | 33 +- x/tx/decode/fuzz_test.go | 140 + x/tx/decode/unknown.go | 9 + x/tx/go.mod | 33 +- x/tx/go.sum | 60 +- x/tx/internal/testpb/signers.proto | 35 + x/tx/internal/testpb/signers.pulsar.go | 4240 +++++++++++++++-- x/tx/signing/aminojson/aminojson.go | 6 +- x/tx/signing/aminojson/any.go | 22 +- x/tx/signing/aminojson/bench_test.go | 2 + x/tx/signing/aminojson/encoder.go | 13 +- x/tx/signing/aminojson/fuzz_test.go | 75 + .../internal/aminojsonpb/aminojson.proto | 5 +- .../internal/aminojsonpb/aminojson.pulsar.go | 187 +- x/tx/signing/aminojson/internal/buf.lock | 4 +- .../aminojson/internal/testpb/test.proto | 5 + .../aminojson/internal/testpb/test.pulsar.go | 656 ++- x/tx/signing/aminojson/json_marshal.go | 178 +- x/tx/signing/aminojson/json_marshal_test.go | 159 +- x/tx/signing/aminojson/options.go | 33 +- x/tx/signing/aminojson/options_test.go | 30 + x/tx/signing/aminojson/time.go | 16 +- x/tx/signing/context.go | 146 +- x/tx/signing/context_test.go | 76 +- x/tx/signing/direct/direct.go | 9 +- x/tx/signing/directaux/direct_aux.go | 10 +- x/tx/signing/directaux/direct_aux_test.go | 4 - x/tx/signing/testutil/util.go | 8 +- x/tx/signing/textual/any.go | 5 +- x/tx/signing/textual/coin_test.go | 3 +- x/tx/signing/textual/coins.go | 100 +- x/tx/signing/textual/coins_test.go | 67 +- x/tx/signing/textual/dec_test.go | 1 + x/tx/signing/textual/e2e_test.go | 4 + x/tx/signing/textual/fuzz_test.go | 198 + x/tx/signing/textual/handler.go | 5 +- x/tx/signing/textual/int_test.go | 1 + .../textual/internal/testdata/coin.json | 7 +- .../textual/internal/testdata/e2e.json | 13 +- .../signing/textual/internal/testdata/tx.json | 11 +- .../textual/internal/textualpb/textual.proto | 2 - .../FuzzCoinsJSONTestcases/4d81af7cc74558bf | 2 + x/tx/signing/textual/timestamp_test.go | 1 + x/tx/signing/textual/tx.go | 16 +- x/tx/signing/textual/tx_test.go | 1 + 48 files changed, 5952 insertions(+), 776 deletions(-) create mode 100644 x/tx/decode/fuzz_test.go create mode 100644 x/tx/signing/aminojson/fuzz_test.go create mode 100644 x/tx/signing/aminojson/options_test.go create mode 100644 x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 742122009eb3..4d475d2c64d0 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -31,6 +31,63 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## v0.13.1 + +### Features + +* [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Add enum as string option to encoder. + +### Improvements + +* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` from `core/coins` to this package under `signing/textual`. + +### Bug Fixes + +* [#19265](https://github.com/cosmos/cosmos-sdk/pull/19265) Reject denoms that contain a comma. + +## v0.13.0 + +### Improvements + +* [#18740](https://github.com/cosmos/cosmos-sdk/pull/18740) Support nested messages when fetching signers up to a default depth of 32. + +## v0.12.0 + +### Improvements + +* [#18309](https://github.com/cosmos/cosmos-sdk/pull/18309) Update encoder so that amino types default to msg type url. + +## v0.11.0 + +### Improvements + +* [#17787](https://github.com/cosmos/cosmos-sdk/pull/17787) Drop tip support. + +## v0.10.0 + +### Features + +* [#17681](https://github.com/cosmos/cosmos-sdk/pull/17681) Add encoder `DefineTypeEncoding` method for defining custom type encodings. +* [#17600](https://github.com/cosmos/cosmos-sdk/pull/17600) Add encoder `DefineScalarEncoding` method for defining custom scalar encodings. +* [#17600](https://github.com/cosmos/cosmos-sdk/pull/17600) Add indent option to encoder. + +## v0.9.1 + +### Improvements + +* [#16936](https://github.com/cosmos/cosmos-sdk/pull/16936) Remove extra whitespace when marshalling module accounts. + +## v0.9.0 + +### Bug Fixes + +* [#16681](https://github.com/cosmos/cosmos-sdk/pull/16681): Catch and fix `(*Decoder).Decode` crash from invalid length prefix in Tx bytes. + +### Improvements + +* [#16846](https://github.com/cosmos/cosmos-sdk/pull/16846): Harmonize interface `signing.TypeResolver` with the rest of the codebase (orm and client/v2). +* [#16684](https://github.com/cosmos/cosmos-sdk/pull/16684): Use `io.WriteString`+`fmt.Fprintf` to remove unnecessary `string`->`[]byte` roundtrip. + ## v0.8.0 ### Improvements diff --git a/x/tx/decode/adr027.go b/x/tx/decode/adr027.go index 0588acbaa9fd..f6d46c223be7 100644 --- a/x/tx/decode/adr027.go +++ b/x/tx/decode/adr027.go @@ -24,6 +24,14 @@ func rejectNonADR027TxRaw(txBytes []byte) error { if m < 0 { return fmt.Errorf("invalid length; %w", protowire.ParseError(m)) } + + // Paranoia from possible varint decoding which can trivially + // be wrong due to the precarious nature of the format being tricked: + // https://cyber.orijtech.com/advisory/varint-decode-limitless + if m > len(txBytes) { + return fmt.Errorf("invalid length from decoding (%d) > len(txBytes) (%d)", m, len(txBytes)) + } + // TxRaw only has bytes fields. if wireType != protowire.BytesType { return fmt.Errorf("expected %d wire type, got %d", protowire.BytesType, wireType) diff --git a/x/tx/decode/decode.go b/x/tx/decode/decode.go index ba1414ece7f4..4dafe9549af4 100644 --- a/x/tx/decode/decode.go +++ b/x/tx/decode/decode.go @@ -1,13 +1,13 @@ package decode import ( - "fmt" + "errors" "github.com/cosmos/cosmos-proto/anyutil" "google.golang.org/protobuf/proto" v1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" - "cosmossdk.io/errors" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/tx/signing" ) @@ -33,7 +33,7 @@ type Options struct { // NewDecoder creates a new Decoder for decoding transactions. func NewDecoder(options Options) (*Decoder, error) { if options.SigningContext == nil { - return nil, fmt.Errorf("signing context is required") + return nil, errors.New("signing context is required") } return &Decoder{ @@ -46,7 +46,7 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // Make sure txBytes follow ADR-027. err := rejectNonADR027TxRaw(txBytes) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } var raw v1beta1.TxRaw @@ -55,7 +55,7 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { fileResolver := d.signingCtx.FileResolver() err = RejectUnknownFieldsStrict(txBytes, raw.ProtoReflect().Descriptor(), fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(txBytes, &raw) @@ -68,12 +68,12 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // allow non-critical unknown fields in TxBody txBodyHasUnknownNonCriticals, err := RejectUnknownFields(raw.BodyBytes, body.ProtoReflect().Descriptor(), true, fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(raw.BodyBytes, &body) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } var authInfo v1beta1.AuthInfo @@ -81,12 +81,12 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { // reject all unknown proto fields in AuthInfo err = RejectUnknownFieldsStrict(raw.AuthInfoBytes, authInfo.ProtoReflect().Descriptor(), fileResolver) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } err = proto.Unmarshal(raw.AuthInfoBytes, &authInfo) if err != nil { - return nil, errors.Wrap(ErrTxDecode, err.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, err.Error()) } theTx := &v1beta1.Tx{ @@ -97,17 +97,25 @@ func (d *Decoder) Decode(txBytes []byte) (*DecodedTx, error) { var signers [][]byte var msgs []proto.Message + seenSigners := map[string]struct{}{} for _, anyMsg := range body.Messages { msg, signerErr := anyutil.Unpack(anyMsg, fileResolver, d.signingCtx.TypeResolver()) if signerErr != nil { - return nil, errors.Wrap(ErrTxDecode, signerErr.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, signerErr.Error()) } msgs = append(msgs, msg) ss, signerErr := d.signingCtx.GetSigners(msg) if signerErr != nil { - return nil, errors.Wrap(ErrTxDecode, signerErr.Error()) + return nil, errorsmod.Wrap(ErrTxDecode, signerErr.Error()) + } + for _, s := range ss { + _, seen := seenSigners[string(s)] + if seen { + continue + } + signers = append(signers, s) + seenSigners[string(s)] = struct{}{} } - signers = append(signers, ss...) } return &DecodedTx{ diff --git a/x/tx/decode/decode_test.go b/x/tx/decode/decode_test.go index c4bb10ffeed4..a54702cbe9df 100644 --- a/x/tx/decode/decode_test.go +++ b/x/tx/decode/decode_test.go @@ -3,6 +3,7 @@ package decode_test import ( "encoding/hex" "fmt" + "strings" "testing" "github.com/cosmos/cosmos-proto/anyutil" @@ -85,10 +86,6 @@ func TestDecode(t *testing.T) { Payer: "payer", Granter: "", }, - Tip: &txv1beta1.Tip{ //nolint:staticcheck // we still need this deprecated struct - Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, - Tipper: "tipper", - }, }, Signatures: nil, } @@ -118,3 +115,31 @@ func (d dummyAddressCodec) StringToBytes(text string) ([]byte, error) { func (d dummyAddressCodec) BytesToString(bz []byte) (string, error) { return hex.EncodeToString(bz), nil } + +func TestDecodeTxBodyPanic(t *testing.T) { + crashVector := []byte{ + 0x0a, 0x0a, 0x09, 0xe7, 0xbf, 0xba, 0xe6, 0x82, 0x9a, 0xe6, 0xaa, 0x30, + } + + cdc := new(dummyAddressCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + t.Fatal(err) + } + dec, err := decode.NewDecoder(decode.Options{ + SigningContext: signingCtx, + }) + if err != nil { + t.Fatal(err) + } + _, err = dec.Decode(crashVector) + if err == nil { + t.Fatal("expected a non-nil error") + } + if g, w := err.Error(), "could not consume length prefix"; !strings.Contains(g, w) { + t.Fatalf("error mismatch\n%s\nodes not contain\n\t%q", g, w) + } +} diff --git a/x/tx/decode/fuzz_test.go b/x/tx/decode/fuzz_test.go new file mode 100644 index 000000000000..38262a20070f --- /dev/null +++ b/x/tx/decode/fuzz_test.go @@ -0,0 +1,140 @@ +package decode + +import ( + "encoding/hex" + "testing" + + "github.com/cosmos/cosmos-proto/anyutil" + fuzz "github.com/google/gofuzz" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing" +) + +var ( + accSeq = uint64(2) + + signerInfo = []*txv1beta1.SignerInfo{ + { + PublicKey: pkAny, + ModeInfo: &txv1beta1.ModeInfo{ + Sum: &txv1beta1.ModeInfo_Single_{ + Single: &txv1beta1.ModeInfo_Single{ + Mode: signingv1beta1.SignMode_SIGN_MODE_DIRECT, + }, + }, + }, + Sequence: accSeq, + }, + } + + anyMsg, _ = anyutil.New(&bankv1beta1.MsgSend{}) + + pkAny, _ = anyutil.New(&secp256k1.PubKey{Key: []byte("foo")}) +) + +func generateAndAddSeedsFromTx(f *testing.F) { + f.Helper() + // 1. Add some seeds. + tx := &txv1beta1.Tx{ + Body: &txv1beta1.TxBody{ + Messages: []*anypb.Any{anyMsg}, + Memo: "memo", + TimeoutHeight: 0, + }, + AuthInfo: &txv1beta1.AuthInfo{ + SignerInfos: signerInfo, + Fee: &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, + GasLimit: 100, + Payer: "payer", + Granter: "", + }, + }, + Signatures: nil, + } + f.Add(mustMarshal(f, tx)) + fz := fuzz.New() + // 1.1. Mutate tx as much and add those as seeds. + for i := 0; i < 1e4; i++ { + func() { + defer func() { + _ = recover() // Catch any panics and continue + }() + fz.Fuzz(tx) + f.Add(mustMarshal(f, tx)) + }() + } +} + +func FuzzInternal_rejectNonADR027TxRaw(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now run the fuzzer. + f.Fuzz(func(t *testing.T, in []byte) { + // Just ensure it doesn't crash. + _ = rejectNonADR027TxRaw(in) + }) +} + +func FuzzDecode(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now fuzz it. + cdc := new(asHexCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + return + } + dec, err := NewDecoder(Options{ + SigningContext: signingCtx, + }) + if err != nil { + return + } + + f.Fuzz(func(t *testing.T, in []byte) { + txr, err := dec.Decode(in) + if err == nil && txr == nil { + t.Fatal("inconsistency: err==nil yet tx==nil") + } + }) +} + +func mustMarshal(f *testing.F, m proto.Message) []byte { + f.Helper() + blob, err := proto.Marshal(m) + if err != nil { + f.Fatal(err) + } + return blob +} + +type asHexCodec int + +func (d asHexCodec) StringToBytes(text string) ([]byte, error) { + return hex.DecodeString(text) +} + +func (d asHexCodec) BytesToString(bz []byte) (string, error) { + return hex.EncodeToString(bz), nil +} diff --git a/x/tx/decode/unknown.go b/x/tx/decode/unknown.go index ed6c56400b9a..fed2c1be8ff8 100644 --- a/x/tx/decode/unknown.go +++ b/x/tx/decode/unknown.go @@ -85,6 +85,15 @@ func RejectUnknownFields(bz []byte, desc protoreflect.MessageDescriptor, allowUn // consume length prefix of nested message _, o := protowire.ConsumeVarint(fieldBytes) + if o < 0 { + err = fmt.Errorf("could not consume length prefix fieldBytes for nested message: %v: %w", + fieldMessage, protowire.ParseError(o)) + return hasUnknownNonCriticals, err + } else if o > len(fieldBytes) { + err = fmt.Errorf("length prefix > len(fieldBytes) for nested message: %v", fieldMessage) + return hasUnknownNonCriticals, err + } + fieldBytes = fieldBytes[o:] var err error diff --git a/x/tx/go.mod b/x/tx/go.mod index 10d989a41b68..b6841dc64c4c 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -3,33 +3,38 @@ module cosmossdk.io/x/tx go 1.21 require ( - cosmossdk.io/api v0.7.2 + cosmossdk.io/api v0.7.3 cosmossdk.io/core v0.11.0 - cosmossdk.io/errors v1.0.0-beta.7 + cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/gogoproto v1.4.11 github.com/google/go-cmp v0.6.0 - github.com/iancoleman/strcase v0.2.0 + github.com/google/gofuzz v1.2.0 + github.com/iancoleman/strcase v0.3.0 github.com/pkg/errors v0.9.1 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 - google.golang.org/protobuf v1.33.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) require ( - github.com/cosmos/gogoproto v1.4.11 // indirect github.com/davecgh/go-spew v1.1.1 // indirect - github.com/golang/protobuf v1.5.4 // indirect + github.com/golang/protobuf v1.5.3 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.17.0 // indirect - golang.org/x/sys v0.13.0 // indirect - golang.org/x/text v0.13.0 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect - google.golang.org/grpc v1.58.3 // indirect + golang.org/x/net v0.21.0 // indirect + golang.org/x/sys v0.17.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/grpc v1.62.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) + +// NOTE: we do not want to replace to the development version of cosmossdk.io/api yet +// Until https://github.com/cosmos/cosmos-sdk/issues/19228 is resolved +// We are tagging x/tx from main and must keep using released versions of x/tx dependencies diff --git a/x/tx/go.sum b/x/tx/go.sum index b8d889462d5b..68c6a1e7ee63 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -1,9 +1,9 @@ -cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= -cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= +cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/errors v1.0.0-beta.7 h1:gypHW76pTQGVnHKo6QBkb4yFOJjC+sUGRc5Al3Odj1w= -cosmossdk.io/errors v1.0.0-beta.7/go.mod h1:mz6FQMJRku4bY7aqS/Gwfcmr/ue91roMEKAmDUDpBfE= +cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= +cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= @@ -14,14 +14,17 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSs github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/golang/protobuf v1.3.0/go.mod h1:Qd/q+1AKNOZr9uGQzbzCmRO6sUih6GTPZv6a1/R87v0= -github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= -github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg= +github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf h1:+RRA9JqSOZFfKrOeqr2z77+8R2RKyh8PG66dcu1V0ck= github.com/google/gofuzz v0.0.0-20170612174753-24818f796faf/go.mod h1:HP5RmnzzSNb993RKQDq4+1A4ia9nllfqcQFTQJedwGI= -github.com/iancoleman/strcase v0.2.0 h1:05I4QRnGpI0m37iZQRuskXh+w77mr6Z41lwQzuHLwW0= -github.com/iancoleman/strcase v0.2.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= +github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= +github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/iancoleman/strcase v0.3.0 h1:nTXanmYxhfFAMjZL34Ov6gkzEsSJZ5DbhxWjvSASxEI= +github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47ZCWhYzw7ho= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= @@ -34,32 +37,35 @@ github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDN github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/tendermint/go-amino v0.16.0 h1:GyhmgQKvqF82e2oZeuMSp9JTN0N09emoSZlb2lyGa2E= github.com/tendermint/go-amino v0.16.0/go.mod h1:TQU0M1i/ImAo+tYpZi73AU3V/dKeCoMC9Sphe2ZwGME= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.17.0 h1:pVaXccu2ozPjCXewfr1S7xza/zcXTity9cCdXQYSjIM= -golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= +golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= +golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sys v0.13.0 h1:Af8nKPmuFypiUBjVoU9V20FiaFXOcuZI21p0ycVYYGE= -golang.org/x/sys v0.13.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k= -golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= +golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= +golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= +google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= +google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= +google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/x/tx/internal/testpb/signers.proto b/x/tx/internal/testpb/signers.proto index 3104bf5d19fe..63eb38cba43b 100644 --- a/x/tx/internal/testpb/signers.proto +++ b/x/tx/internal/testpb/signers.proto @@ -55,6 +55,41 @@ message RepeatedNestedRepeatedSigner { } } +message DeeplyNestedSigner { + option (cosmos.msg.v1.signer) = "inner_one"; + InnerOne inner_one = 1; + + message InnerOne { + option (cosmos.msg.v1.signer) = "inner_two"; + InnerTwo inner_two = 1; + + message InnerTwo { + option (cosmos.msg.v1.signer) = "signer"; + string signer = 1; + } + } +} + +message DeeplyNestedRepeatedSigner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Inner inner = 1; + + message Inner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Inner inner = 1; + + message Inner { + option (cosmos.msg.v1.signer) = "inner"; + repeated Bottom inner = 1; + + message Bottom { + option (cosmos.msg.v1.signer) = "signer"; + repeated string signer = 1; + } + } + } +} + message BadSigner { option (cosmos.msg.v1.signer) = "signer"; bytes signer = 1; diff --git a/x/tx/internal/testpb/signers.pulsar.go b/x/tx/internal/testpb/signers.pulsar.go index 51c8cf163e39..f6e3a3d081c1 100644 --- a/x/tx/internal/testpb/signers.pulsar.go +++ b/x/tx/internal/testpb/signers.pulsar.go @@ -1369,7 +1369,7 @@ func (x *NestedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *NestedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[9] + mi := &file_signers_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2283,7 +2283,7 @@ func (x *RepeatedNestedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *RepeatedNestedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[10] + mi := &file_signers_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3184,7 +3184,7 @@ func (x *NestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message { } func (x *NestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[11] + mi := &file_signers_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4158,7 +4158,7 @@ func (x *RepeatedNestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message } func (x *RepeatedNestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[12] + mi := &file_signers_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4573,25 +4573,25 @@ func (x *fastReflection_RepeatedNestedRepeatedSigner_Inner) ProtoMethods() *prot } var ( - md_BadSigner protoreflect.MessageDescriptor - fd_BadSigner_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_inner_one protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_BadSigner = File_signers_proto.Messages().ByName("BadSigner") - fd_BadSigner_signer = md_BadSigner.Fields().ByName("signer") + md_DeeplyNestedSigner = File_signers_proto.Messages().ByName("DeeplyNestedSigner") + fd_DeeplyNestedSigner_inner_one = md_DeeplyNestedSigner.Fields().ByName("inner_one") } -var _ protoreflect.Message = (*fastReflection_BadSigner)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner)(nil) -type fastReflection_BadSigner BadSigner +type fastReflection_DeeplyNestedSigner DeeplyNestedSigner -func (x *BadSigner) ProtoReflect() protoreflect.Message { - return (*fastReflection_BadSigner)(x) +func (x *DeeplyNestedSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner)(x) } -func (x *BadSigner) slowProtoReflect() protoreflect.Message { +func (x *DeeplyNestedSigner) slowProtoReflect() protoreflect.Message { mi := &file_signers_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) @@ -4603,43 +4603,43 @@ func (x *BadSigner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_BadSigner_messageType fastReflection_BadSigner_messageType -var _ protoreflect.MessageType = fastReflection_BadSigner_messageType{} +var _fastReflection_DeeplyNestedSigner_messageType fastReflection_DeeplyNestedSigner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_messageType{} -type fastReflection_BadSigner_messageType struct{} +type fastReflection_DeeplyNestedSigner_messageType struct{} -func (x fastReflection_BadSigner_messageType) Zero() protoreflect.Message { - return (*fastReflection_BadSigner)(nil) +func (x fastReflection_DeeplyNestedSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner)(nil) } -func (x fastReflection_BadSigner_messageType) New() protoreflect.Message { - return new(fastReflection_BadSigner) +func (x fastReflection_DeeplyNestedSigner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner) } -func (x fastReflection_BadSigner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_BadSigner +func (x fastReflection_DeeplyNestedSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor { - return md_BadSigner +func (x *fastReflection_DeeplyNestedSigner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_BadSigner) Type() protoreflect.MessageType { - return _fastReflection_BadSigner_messageType +func (x *fastReflection_DeeplyNestedSigner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_BadSigner) New() protoreflect.Message { - return new(fastReflection_BadSigner) +func (x *fastReflection_DeeplyNestedSigner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { - return (*BadSigner)(x) +func (x *fastReflection_DeeplyNestedSigner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner)(x) } // Range iterates over every populated field in an undefined order, @@ -4647,10 +4647,10 @@ func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) - if !f(fd_BadSigner_signer, value) { +func (x *fastReflection_DeeplyNestedSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InnerOne != nil { + value := protoreflect.ValueOfMessage(x.InnerOne.ProtoReflect()) + if !f(fd_DeeplyNestedSigner_inner_one, value) { return } } @@ -4667,15 +4667,15 @@ func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, pr // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "BadSigner.signer": - return len(x.Signer) != 0 + case "DeeplyNestedSigner.inner_one": + return x.InnerOne != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4685,15 +4685,15 @@ func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "BadSigner.signer": - x.Signer = nil + case "DeeplyNestedSigner.inner_one": + x.InnerOne = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4703,16 +4703,16 @@ func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "BadSigner.signer": - value := x.Signer - return protoreflect.ValueOfBytes(value) + case "DeeplyNestedSigner.inner_one": + value := x.InnerOne + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", descriptor.FullName())) } } @@ -4726,15 +4726,15 @@ func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_DeeplyNestedSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "BadSigner.signer": - x.Signer = value.Bytes() + case "DeeplyNestedSigner.inner_one": + x.InnerOne = value.Message().Interface().(*DeeplyNestedSigner_InnerOne) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } @@ -4748,40 +4748,44 @@ func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value pr // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "BadSigner.signer": - panic(fmt.Errorf("field signer of message BadSigner is not mutable")) + case "DeeplyNestedSigner.inner_one": + if x.InnerOne == nil { + x.InnerOne = new(DeeplyNestedSigner_InnerOne) + } + return protoreflect.ValueOfMessage(x.InnerOne.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "BadSigner.signer": - return protoreflect.ValueOfBytes(nil) + case "DeeplyNestedSigner.inner_one": + m := new(DeeplyNestedSigner_InnerOne) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner")) } - panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_DeeplyNestedSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in BadSigner", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner", d.FullName())) } panic("unreachable") } @@ -4789,7 +4793,7 @@ func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) pr // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_BadSigner) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_DeeplyNestedSigner) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -4800,7 +4804,7 @@ func (x *fastReflection_BadSigner) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_BadSigner) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_DeeplyNestedSigner) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -4812,7 +4816,7 @@ func (x *fastReflection_BadSigner) SetUnknown(fields protoreflect.RawFields) { // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_BadSigner) IsValid() bool { +func (x *fastReflection_DeeplyNestedSigner) IsValid() bool { return x != nil } @@ -4822,9 +4826,9 @@ func (x *fastReflection_BadSigner) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_DeeplyNestedSigner) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4836,8 +4840,8 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.InnerOne != nil { + l = options.Size(x.InnerOne) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -4850,7 +4854,7 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4869,10 +4873,17 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.InnerOne != nil { + encoded, err := options.Marshal(x.InnerOne) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -4887,7 +4898,7 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*BadSigner) + x := input.Message.Interface().(*DeeplyNestedSigner) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -4919,17 +4930,17 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InnerOne", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -4939,24 +4950,26 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} + if x.InnerOne == nil { + x.InnerOne = &DeeplyNestedSigner_InnerOne{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InnerOne); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -4995,26 +5008,26 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } var ( - md_NoSignerOption protoreflect.MessageDescriptor - fd_NoSignerOption_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner_InnerOne protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_InnerOne_inner_two protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_NoSignerOption = File_signers_proto.Messages().ByName("NoSignerOption") - fd_NoSignerOption_signer = md_NoSignerOption.Fields().ByName("signer") + md_DeeplyNestedSigner_InnerOne = File_signers_proto.Messages().ByName("DeeplyNestedSigner").Messages().ByName("InnerOne") + fd_DeeplyNestedSigner_InnerOne_inner_two = md_DeeplyNestedSigner_InnerOne.Fields().ByName("inner_two") } -var _ protoreflect.Message = (*fastReflection_NoSignerOption)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner_InnerOne)(nil) -type fastReflection_NoSignerOption NoSignerOption +type fastReflection_DeeplyNestedSigner_InnerOne DeeplyNestedSigner_InnerOne -func (x *NoSignerOption) ProtoReflect() protoreflect.Message { - return (*fastReflection_NoSignerOption)(x) +func (x *DeeplyNestedSigner_InnerOne) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne)(x) } -func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[7] +func (x *DeeplyNestedSigner_InnerOne) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5025,43 +5038,43 @@ func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_NoSignerOption_messageType fastReflection_NoSignerOption_messageType -var _ protoreflect.MessageType = fastReflection_NoSignerOption_messageType{} +var _fastReflection_DeeplyNestedSigner_InnerOne_messageType fastReflection_DeeplyNestedSigner_InnerOne_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_InnerOne_messageType{} -type fastReflection_NoSignerOption_messageType struct{} +type fastReflection_DeeplyNestedSigner_InnerOne_messageType struct{} -func (x fastReflection_NoSignerOption_messageType) Zero() protoreflect.Message { - return (*fastReflection_NoSignerOption)(nil) +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne)(nil) } -func (x fastReflection_NoSignerOption_messageType) New() protoreflect.Message { - return new(fastReflection_NoSignerOption) +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne) } -func (x fastReflection_NoSignerOption_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_NoSignerOption +func (x fastReflection_DeeplyNestedSigner_InnerOne_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_NoSignerOption) Descriptor() protoreflect.MessageDescriptor { - return md_NoSignerOption +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_NoSignerOption) Type() protoreflect.MessageType { - return _fastReflection_NoSignerOption_messageType +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_InnerOne_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_NoSignerOption) New() protoreflect.Message { - return new(fastReflection_NoSignerOption) +func (x *fastReflection_DeeplyNestedSigner_InnerOne) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { - return (*NoSignerOption)(x) +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner_InnerOne)(x) } // Range iterates over every populated field in an undefined order, @@ -5069,10 +5082,10 @@ func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) - if !f(fd_NoSignerOption_signer, value) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.InnerTwo != nil { + value := protoreflect.ValueOfMessage(x.InnerTwo.ProtoReflect()) + if !f(fd_DeeplyNestedSigner_InnerOne_inner_two, value) { return } } @@ -5089,15 +5102,15 @@ func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescripto // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "NoSignerOption.signer": - return len(x.Signer) != 0 + case "DeeplyNestedSigner.InnerOne.inner_two": + return x.InnerTwo != nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5107,15 +5120,15 @@ func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) boo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "NoSignerOption.signer": - x.Signer = nil + case "DeeplyNestedSigner.InnerOne.inner_two": + x.InnerTwo = nil default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5125,16 +5138,16 @@ func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "NoSignerOption.signer": - value := x.Signer - return protoreflect.ValueOfBytes(value) + case "DeeplyNestedSigner.InnerOne.inner_two": + value := x.InnerTwo + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", descriptor.FullName())) } } @@ -5148,15 +5161,15 @@ func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescrip // empty, read-only value, then it panics. // // Set is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { - case "NoSignerOption.signer": - x.Signer = value.Bytes() + case "DeeplyNestedSigner.InnerOne.inner_two": + x.InnerTwo = value.Message().Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } @@ -5170,40 +5183,44 @@ func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, val // It panics if the field does not contain a composite type. // // Mutable is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "NoSignerOption.signer": - panic(fmt.Errorf("field signer of message NoSignerOption is not mutable")) + case "DeeplyNestedSigner.InnerOne.inner_two": + if x.InnerTwo == nil { + x.InnerTwo = new(DeeplyNestedSigner_InnerOne_InnerTwo) + } + return protoreflect.ValueOfMessage(x.InnerTwo.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } // NewField returns a new value that is assignable to the field // for the given descriptor. For scalars, this returns the default value. // For lists, maps, and messages, this returns a new, empty, mutable value. -func (x *fastReflection_NoSignerOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { - case "NoSignerOption.signer": - return protoreflect.ValueOfBytes(nil) + case "DeeplyNestedSigner.InnerOne.inner_two": + m := new(DeeplyNestedSigner_InnerOne_InnerTwo) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne")) } - panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne does not contain field %s", fd.FullName())) } } // WhichOneof reports which field within the oneof is populated, // returning nil if none are populated. // It panics if the oneof descriptor does not belong to this message. -func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { switch d.FullName() { default: - panic(fmt.Errorf("%s is not a oneof field in NoSignerOption", d.FullName())) + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner.InnerOne", d.FullName())) } panic("unreachable") } @@ -5211,7 +5228,7 @@ func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescripto // GetUnknown retrieves the entire list of unknown fields. // The caller may only mutate the contents of the RawFields // if the mutated bytes are stored back into the message with SetUnknown. -func (x *fastReflection_NoSignerOption) GetUnknown() protoreflect.RawFields { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) GetUnknown() protoreflect.RawFields { return x.unknownFields } @@ -5222,7 +5239,7 @@ func (x *fastReflection_NoSignerOption) GetUnknown() protoreflect.RawFields { // An empty RawFields may be passed to clear the fields. // // SetUnknown is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_NoSignerOption) SetUnknown(fields protoreflect.RawFields) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) SetUnknown(fields protoreflect.RawFields) { x.unknownFields = fields } @@ -5234,7 +5251,7 @@ func (x *fastReflection_NoSignerOption) SetUnknown(fields protoreflect.RawFields // message type, but the details are implementation dependent. // Validity is not part of the protobuf data model, and may not // be preserved in marshaling or other operations. -func (x *fastReflection_NoSignerOption) IsValid() bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) IsValid() bool { return x != nil } @@ -5244,9 +5261,9 @@ func (x *fastReflection_NoSignerOption) IsValid() bool { // The returned methods type is identical to // "google.golang.org/protobuf/runtime/protoiface".Methods. // Consult the protoiface package documentation for details. -func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { +func (x *fastReflection_DeeplyNestedSigner_InnerOne) ProtoMethods() *protoiface.Methods { size := func(input protoiface.SizeInput) protoiface.SizeOutput { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.SizeOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5258,8 +5275,8 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { + if x.InnerTwo != nil { + l = options.Size(x.InnerTwo) n += 1 + l + runtime.Sov(uint64(l)) } if x.unknownFields != nil { @@ -5272,7 +5289,7 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.MarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5291,10 +5308,17 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.InnerTwo != nil { + encoded, err := options.Marshal(x.InnerTwo) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) i-- dAtA[i] = 0xa } @@ -5309,7 +5333,7 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { }, nil } unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { - x := input.Message.Interface().(*NoSignerOption) + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne) if x == nil { return protoiface.UnmarshalOutput{ NoUnkeyedLiterals: input.NoUnkeyedLiterals, @@ -5341,17 +5365,17 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { fieldNum := int32(wire >> 3) wireType := int(wire & 0x7) if wireType == 4 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: wiretype end group for non-group") + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne: wiretype end group for non-group") } if fieldNum <= 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: illegal tag %d (wire type %d)", fieldNum, wire) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field InnerTwo", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -5361,24 +5385,26 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + msglen |= int(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { + if msglen < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength } if postIndex > l { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF } - x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} + if x.InnerTwo == nil { + x.InnerTwo = &DeeplyNestedSigner_InnerOne_InnerTwo{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InnerTwo); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex default: @@ -5417,26 +5443,26 @@ func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { } var ( - md_ValidatorSigner protoreflect.MessageDescriptor - fd_ValidatorSigner_signer protoreflect.FieldDescriptor + md_DeeplyNestedSigner_InnerOne_InnerTwo protoreflect.MessageDescriptor + fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer protoreflect.FieldDescriptor ) func init() { file_signers_proto_init() - md_ValidatorSigner = File_signers_proto.Messages().ByName("ValidatorSigner") - fd_ValidatorSigner_signer = md_ValidatorSigner.Fields().ByName("signer") + md_DeeplyNestedSigner_InnerOne_InnerTwo = File_signers_proto.Messages().ByName("DeeplyNestedSigner").Messages().ByName("InnerOne").Messages().ByName("InnerTwo") + fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer = md_DeeplyNestedSigner_InnerOne_InnerTwo.Fields().ByName("signer") } -var _ protoreflect.Message = (*fastReflection_ValidatorSigner)(nil) +var _ protoreflect.Message = (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(nil) -type fastReflection_ValidatorSigner ValidatorSigner +type fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo DeeplyNestedSigner_InnerOne_InnerTwo -func (x *ValidatorSigner) ProtoReflect() protoreflect.Message { - return (*fastReflection_ValidatorSigner)(x) +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(x) } -func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { - mi := &file_signers_proto_msgTypes[8] +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5447,43 +5473,43 @@ func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { return mi.MessageOf(x) } -var _fastReflection_ValidatorSigner_messageType fastReflection_ValidatorSigner_messageType -var _ protoreflect.MessageType = fastReflection_ValidatorSigner_messageType{} +var _fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType{} -type fastReflection_ValidatorSigner_messageType struct{} +type fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType struct{} -func (x fastReflection_ValidatorSigner_messageType) Zero() protoreflect.Message { - return (*fastReflection_ValidatorSigner)(nil) +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo)(nil) } -func (x fastReflection_ValidatorSigner_messageType) New() protoreflect.Message { - return new(fastReflection_ValidatorSigner) +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) } -func (x fastReflection_ValidatorSigner_messageType) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorSigner +func (x fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne_InnerTwo } // Descriptor returns message descriptor, which contains only the protobuf // type information for the message. -func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor { - return md_ValidatorSigner +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedSigner_InnerOne_InnerTwo } // Type returns the message type, which encapsulates both Go and protobuf // type information. If the Go type information is not needed, // it is recommended that the message descriptor be used instead. -func (x *fastReflection_ValidatorSigner) Type() protoreflect.MessageType { - return _fastReflection_ValidatorSigner_messageType +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo_messageType } // New returns a newly allocated and mutable empty message. -func (x *fastReflection_ValidatorSigner) New() protoreflect.Message { - return new(fastReflection_ValidatorSigner) +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) } // Interface unwraps the message reflection interface and // returns the underlying ProtoMessage interface. -func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { - return (*ValidatorSigner)(x) +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedSigner_InnerOne_InnerTwo)(x) } // Range iterates over every populated field in an undefined order, @@ -5491,10 +5517,10 @@ func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { // Range returns immediately if f returns false. // While iterating, mutating operations may only be performed // on the current field descriptor. -func (x *fastReflection_ValidatorSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { if x.Signer != "" { value := protoreflect.ValueOfString(x.Signer) - if !f(fd_ValidatorSigner_signer, value) { + if !f(fd_DeeplyNestedSigner_InnerOne_InnerTwo_signer, value) { return } } @@ -5511,15 +5537,15 @@ func (x *fastReflection_ValidatorSigner) Range(f func(protoreflect.FieldDescript // In other cases (aside from the nullable cases above), // a proto3 scalar field is populated if it contains a non-zero value, and // a repeated field is populated if it is non-empty. -func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bool { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": return x.Signer != "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) } } @@ -5529,15 +5555,15 @@ func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bo // associated with the given field number. // // Clear is a mutating operation and unsafe for concurrent use. -func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": x.Signer = "" default: if fd.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) } } @@ -5547,16 +5573,3242 @@ func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) // the default value of a bytes scalar is guaranteed to be a copy. // For unpopulated composite types, it returns an empty, read-only view // of the value; to obtain a mutable reference, use Mutable. -func (x *fastReflection_ValidatorSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { switch descriptor.FullName() { - case "ValidatorSigner.signer": + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": value := x.Signer return protoreflect.ValueOfString(value) default: if descriptor.IsExtension() { - panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) } - panic(fmt.Errorf("message ValidatorSigner does not contain field %s", descriptor.FullName())) + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + x.Signer = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + panic(fmt.Errorf("field signer of message DeeplyNestedSigner.InnerOne.InnerTwo is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedSigner.InnerOne.InnerTwo.signer": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedSigner.InnerOne.InnerTwo")) + } + panic(fmt.Errorf("message DeeplyNestedSigner.InnerOne.InnerTwo does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedSigner.InnerOne.InnerTwo", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedSigner_InnerOne_InnerTwo) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedSigner_InnerOne_InnerTwo) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne_InnerTwo: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedSigner_InnerOne_InnerTwo: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner") + fd_DeeplyNestedRepeatedSigner_inner = md_DeeplyNestedRepeatedSigner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner DeeplyNestedRepeatedSigner + +func (x *DeeplyNestedRepeatedSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner)(x) +} + +func (x *DeeplyNestedRepeatedSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[7] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_messageType fastReflection_DeeplyNestedRepeatedSigner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_inner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner{} + } + value := &_DeeplyNestedRepeatedSigner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Inner) > 0 { + for _, e := range x.Inner { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_Inner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner_Inner +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner") + fd_DeeplyNestedRepeatedSigner_Inner_inner = md_DeeplyNestedRepeatedSigner_Inner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner DeeplyNestedRepeatedSigner_Inner + +func (x *DeeplyNestedRepeatedSigner_Inner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[17] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_inner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner_Inner{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner_Inner{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Inner) > 0 { + for _, e := range x.Inner { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner_Inner{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_Inner_Inner_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_Inner_1_list struct { + list *[]*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) AppendMutable() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) NewElement() protoreflect.Value { + v := new(DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner_Inner protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner_Inner = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner").Messages().ByName("Inner") + fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner = md_DeeplyNestedRepeatedSigner_Inner_Inner.Fields().ByName("inner") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner DeeplyNestedRepeatedSigner_Inner_Inner + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[18] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner_Inner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Inner) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_Inner_inner, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + return len(x.Inner) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + x.Inner = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + if len(x.Inner) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_Inner_1_list) + x.Inner = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + if x.Inner == nil { + x.Inner = []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &x.Inner} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.inner": + list := []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner.Inner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Inner) > 0 { + for _, e := range x.Inner { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Inner) > 0 { + for iNdEx := len(x.Inner) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.Inner[iNdEx]) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Inner", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Inner = append(x.Inner, &DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Inner[len(x.Inner)-1]); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var _ protoreflect.List = (*_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list)(nil) + +type _DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list struct { + list *[]string +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message DeeplyNestedRepeatedSigner_Inner_Inner_Bottom at list field Signer as it is not of Message kind")) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom protoreflect.MessageDescriptor + fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom = File_signers_proto.Messages().ByName("DeeplyNestedRepeatedSigner").Messages().ByName("Inner").Messages().ByName("Inner").Messages().ByName("Bottom") + fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer = md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil) + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom DeeplyNestedRepeatedSigner_Inner_Inner_Bottom + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoReflect() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(x) +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[19] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType +var _ protoreflect.MessageType = fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType{} + +type fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType struct{} + +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) Zero() protoreflect.Message { + return (*fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) +} +func (x fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Descriptor() protoreflect.MessageDescriptor { + return md_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Type() protoreflect.MessageType { + return _fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) New() protoreflect.Message { + return new(fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Interface() protoreflect.ProtoMessage { + return (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer}) + if !f(fd_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + if len(x.Signer) == 0 { + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{}) + } + listValue := &_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer} + return protoreflect.ValueOfList(listValue) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + lv := value.List() + clv := lv.(*_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list) + x.Signer = *clv.list + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + if x.Signer == nil { + x.Signer = []string{} + } + value := &_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &x.Signer} + return protoreflect.ValueOfList(value) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "DeeplyNestedRepeatedSigner.Inner.Inner.Bottom.signer": + list := []string{} + return protoreflect.ValueOfList(&_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom_1_list{list: &list}) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom")) + } + panic(fmt.Errorf("message DeeplyNestedRepeatedSigner.Inner.Inner.Bottom does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in DeeplyNestedRepeatedSigner.Inner.Inner.Bottom", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if len(x.Signer) > 0 { + for _, s := range x.Signer { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + for iNdEx := len(x.Signer) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.Signer[iNdEx]) + copy(dAtA[i:], x.Signer[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer[iNdEx]))) + i-- + dAtA[i] = 0xa + } + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner_Bottom: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: DeeplyNestedRepeatedSigner_Inner_Inner_Bottom: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = append(x.Signer, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_BadSigner protoreflect.MessageDescriptor + fd_BadSigner_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_BadSigner = File_signers_proto.Messages().ByName("BadSigner") + fd_BadSigner_signer = md_BadSigner.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_BadSigner)(nil) + +type fastReflection_BadSigner BadSigner + +func (x *BadSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_BadSigner)(x) +} + +func (x *BadSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[8] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_BadSigner_messageType fastReflection_BadSigner_messageType +var _ protoreflect.MessageType = fastReflection_BadSigner_messageType{} + +type fastReflection_BadSigner_messageType struct{} + +func (x fastReflection_BadSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_BadSigner)(nil) +} +func (x fastReflection_BadSigner_messageType) New() protoreflect.Message { + return new(fastReflection_BadSigner) +} +func (x fastReflection_BadSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_BadSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_BadSigner) Descriptor() protoreflect.MessageDescriptor { + return md_BadSigner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_BadSigner) Type() protoreflect.MessageType { + return _fastReflection_BadSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_BadSigner) New() protoreflect.Message { + return new(fastReflection_BadSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { + return (*BadSigner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfBytes(x.Signer) + if !f(fd_BadSigner_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "BadSigner.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "BadSigner.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "BadSigner.signer": + value := x.Signer + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "BadSigner.signer": + x.Signer = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "BadSigner.signer": + panic(fmt.Errorf("field signer of message BadSigner is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "BadSigner.signer": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) + } + panic(fmt.Errorf("message BadSigner does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_BadSigner) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in BadSigner", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_BadSigner) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_BadSigner) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_BadSigner) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*BadSigner) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*BadSigner) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*BadSigner) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: BadSigner: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) + if x.Signer == nil { + x.Signer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_NoSignerOption protoreflect.MessageDescriptor + fd_NoSignerOption_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_NoSignerOption = File_signers_proto.Messages().ByName("NoSignerOption") + fd_NoSignerOption_signer = md_NoSignerOption.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_NoSignerOption)(nil) + +type fastReflection_NoSignerOption NoSignerOption + +func (x *NoSignerOption) ProtoReflect() protoreflect.Message { + return (*fastReflection_NoSignerOption)(x) +} + +func (x *NoSignerOption) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[9] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_NoSignerOption_messageType fastReflection_NoSignerOption_messageType +var _ protoreflect.MessageType = fastReflection_NoSignerOption_messageType{} + +type fastReflection_NoSignerOption_messageType struct{} + +func (x fastReflection_NoSignerOption_messageType) Zero() protoreflect.Message { + return (*fastReflection_NoSignerOption)(nil) +} +func (x fastReflection_NoSignerOption_messageType) New() protoreflect.Message { + return new(fastReflection_NoSignerOption) +} +func (x fastReflection_NoSignerOption_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_NoSignerOption +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_NoSignerOption) Descriptor() protoreflect.MessageDescriptor { + return md_NoSignerOption +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_NoSignerOption) Type() protoreflect.MessageType { + return _fastReflection_NoSignerOption_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_NoSignerOption) New() protoreflect.Message { + return new(fastReflection_NoSignerOption) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_NoSignerOption) Interface() protoreflect.ProtoMessage { + return (*NoSignerOption)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_NoSignerOption) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.Signer) != 0 { + value := protoreflect.ValueOfBytes(x.Signer) + if !f(fd_NoSignerOption_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_NoSignerOption) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "NoSignerOption.signer": + return len(x.Signer) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "NoSignerOption.signer": + x.Signer = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_NoSignerOption) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "NoSignerOption.signer": + value := x.Signer + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "NoSignerOption.signer": + x.Signer = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "NoSignerOption.signer": + panic(fmt.Errorf("field signer of message NoSignerOption is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_NoSignerOption) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "NoSignerOption.signer": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: NoSignerOption")) + } + panic(fmt.Errorf("message NoSignerOption does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_NoSignerOption) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in NoSignerOption", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_NoSignerOption) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_NoSignerOption) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_NoSignerOption) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_NoSignerOption) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*NoSignerOption) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + l = len(x.Signer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*NoSignerOption) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if len(x.Signer) > 0 { + i -= len(x.Signer) + copy(dAtA[i:], x.Signer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*NoSignerOption) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: NoSignerOption: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) + if x.Signer == nil { + x.Signer = []byte{} + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_ValidatorSigner protoreflect.MessageDescriptor + fd_ValidatorSigner_signer protoreflect.FieldDescriptor +) + +func init() { + file_signers_proto_init() + md_ValidatorSigner = File_signers_proto.Messages().ByName("ValidatorSigner") + fd_ValidatorSigner_signer = md_ValidatorSigner.Fields().ByName("signer") +} + +var _ protoreflect.Message = (*fastReflection_ValidatorSigner)(nil) + +type fastReflection_ValidatorSigner ValidatorSigner + +func (x *ValidatorSigner) ProtoReflect() protoreflect.Message { + return (*fastReflection_ValidatorSigner)(x) +} + +func (x *ValidatorSigner) slowProtoReflect() protoreflect.Message { + mi := &file_signers_proto_msgTypes[10] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_ValidatorSigner_messageType fastReflection_ValidatorSigner_messageType +var _ protoreflect.MessageType = fastReflection_ValidatorSigner_messageType{} + +type fastReflection_ValidatorSigner_messageType struct{} + +func (x fastReflection_ValidatorSigner_messageType) Zero() protoreflect.Message { + return (*fastReflection_ValidatorSigner)(nil) +} +func (x fastReflection_ValidatorSigner_messageType) New() protoreflect.Message { + return new(fastReflection_ValidatorSigner) +} +func (x fastReflection_ValidatorSigner_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorSigner +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ValidatorSigner) Descriptor() protoreflect.MessageDescriptor { + return md_ValidatorSigner +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_ValidatorSigner) Type() protoreflect.MessageType { + return _fastReflection_ValidatorSigner_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ValidatorSigner) New() protoreflect.Message { + return new(fastReflection_ValidatorSigner) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ValidatorSigner) Interface() protoreflect.ProtoMessage { + return (*ValidatorSigner)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_ValidatorSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Signer != "" { + value := protoreflect.ValueOfString(x.Signer) + if !f(fd_ValidatorSigner_signer, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_ValidatorSigner) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "ValidatorSigner.signer": + return x.Signer != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_ValidatorSigner) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "ValidatorSigner.signer": + x.Signer = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_ValidatorSigner) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "ValidatorSigner.signer": + value := x.Signer + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: ValidatorSigner")) + } + panic(fmt.Errorf("message ValidatorSigner does not contain field %s", descriptor.FullName())) } } @@ -5982,77 +9234,147 @@ func (*RepeatedNestedSigner) Descriptor() ([]byte, []int) { return file_signers_proto_rawDescGZIP(), []int{3} } -func (x *RepeatedNestedSigner) GetInner() []*RepeatedNestedSigner_Inner { +func (x *RepeatedNestedSigner) GetInner() []*RepeatedNestedSigner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type NestedRepeatedSigner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner *NestedRepeatedSigner_Inner `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *NestedRepeatedSigner) Reset() { + *x = NestedRepeatedSigner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *NestedRepeatedSigner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*NestedRepeatedSigner) ProtoMessage() {} + +// Deprecated: Use NestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*NestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{4} +} + +func (x *NestedRepeatedSigner) GetInner() *NestedRepeatedSigner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type RepeatedNestedRepeatedSigner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*RepeatedNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *RepeatedNestedRepeatedSigner) Reset() { + *x = RepeatedNestedRepeatedSigner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *RepeatedNestedRepeatedSigner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RepeatedNestedRepeatedSigner) ProtoMessage() {} + +// Deprecated: Use RepeatedNestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*RepeatedNestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{5} +} + +func (x *RepeatedNestedRepeatedSigner) GetInner() []*RepeatedNestedRepeatedSigner_Inner { if x != nil { return x.Inner } return nil } -type NestedRepeatedSigner struct { +type DeeplyNestedSigner struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inner *NestedRepeatedSigner_Inner `protobuf:"bytes,1,opt,name=inner,proto3" json:"inner,omitempty"` + InnerOne *DeeplyNestedSigner_InnerOne `protobuf:"bytes,1,opt,name=inner_one,json=innerOne,proto3" json:"inner_one,omitempty"` } -func (x *NestedRepeatedSigner) Reset() { - *x = NestedRepeatedSigner{} +func (x *DeeplyNestedSigner) Reset() { + *x = DeeplyNestedSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[4] + mi := &file_signers_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *NestedRepeatedSigner) String() string { +func (x *DeeplyNestedSigner) String() string { return protoimpl.X.MessageStringOf(x) } -func (*NestedRepeatedSigner) ProtoMessage() {} +func (*DeeplyNestedSigner) ProtoMessage() {} -// Deprecated: Use NestedRepeatedSigner.ProtoReflect.Descriptor instead. -func (*NestedRepeatedSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{4} +// Deprecated: Use DeeplyNestedSigner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6} } -func (x *NestedRepeatedSigner) GetInner() *NestedRepeatedSigner_Inner { +func (x *DeeplyNestedSigner) GetInnerOne() *DeeplyNestedSigner_InnerOne { if x != nil { - return x.Inner + return x.InnerOne } return nil } -type RepeatedNestedRepeatedSigner struct { +type DeeplyNestedRepeatedSigner struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Inner []*RepeatedNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` + Inner []*DeeplyNestedRepeatedSigner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` } -func (x *RepeatedNestedRepeatedSigner) Reset() { - *x = RepeatedNestedRepeatedSigner{} +func (x *DeeplyNestedRepeatedSigner) Reset() { + *x = DeeplyNestedRepeatedSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[5] + mi := &file_signers_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } } -func (x *RepeatedNestedRepeatedSigner) String() string { +func (x *DeeplyNestedRepeatedSigner) String() string { return protoimpl.X.MessageStringOf(x) } -func (*RepeatedNestedRepeatedSigner) ProtoMessage() {} +func (*DeeplyNestedRepeatedSigner) ProtoMessage() {} -// Deprecated: Use RepeatedNestedRepeatedSigner.ProtoReflect.Descriptor instead. -func (*RepeatedNestedRepeatedSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{5} +// Deprecated: Use DeeplyNestedRepeatedSigner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7} } -func (x *RepeatedNestedRepeatedSigner) GetInner() []*RepeatedNestedRepeatedSigner_Inner { +func (x *DeeplyNestedRepeatedSigner) GetInner() []*DeeplyNestedRepeatedSigner_Inner { if x != nil { return x.Inner } @@ -6070,7 +9392,7 @@ type BadSigner struct { func (x *BadSigner) Reset() { *x = BadSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[6] + mi := &file_signers_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6084,7 +9406,7 @@ func (*BadSigner) ProtoMessage() {} // Deprecated: Use BadSigner.ProtoReflect.Descriptor instead. func (*BadSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{6} + return file_signers_proto_rawDescGZIP(), []int{8} } func (x *BadSigner) GetSigner() []byte { @@ -6105,7 +9427,7 @@ type NoSignerOption struct { func (x *NoSignerOption) Reset() { *x = NoSignerOption{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[7] + mi := &file_signers_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6119,7 +9441,7 @@ func (*NoSignerOption) ProtoMessage() {} // Deprecated: Use NoSignerOption.ProtoReflect.Descriptor instead. func (*NoSignerOption) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{7} + return file_signers_proto_rawDescGZIP(), []int{9} } func (x *NoSignerOption) GetSigner() []byte { @@ -6140,7 +9462,7 @@ type ValidatorSigner struct { func (x *ValidatorSigner) Reset() { *x = ValidatorSigner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[8] + mi := &file_signers_proto_msgTypes[10] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6154,7 +9476,7 @@ func (*ValidatorSigner) ProtoMessage() {} // Deprecated: Use ValidatorSigner.ProtoReflect.Descriptor instead. func (*ValidatorSigner) Descriptor() ([]byte, []int) { - return file_signers_proto_rawDescGZIP(), []int{8} + return file_signers_proto_rawDescGZIP(), []int{10} } func (x *ValidatorSigner) GetSigner() string { @@ -6175,7 +9497,7 @@ type NestedSigner_Inner struct { func (x *NestedSigner_Inner) Reset() { *x = NestedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[9] + mi := &file_signers_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6210,7 +9532,7 @@ type RepeatedNestedSigner_Inner struct { func (x *RepeatedNestedSigner_Inner) Reset() { *x = RepeatedNestedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[10] + mi := &file_signers_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6245,7 +9567,7 @@ type NestedRepeatedSigner_Inner struct { func (x *NestedRepeatedSigner_Inner) Reset() { *x = NestedRepeatedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[11] + mi := &file_signers_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6280,7 +9602,7 @@ type RepeatedNestedRepeatedSigner_Inner struct { func (x *RepeatedNestedRepeatedSigner_Inner) Reset() { *x = RepeatedNestedRepeatedSigner_Inner{} if protoimpl.UnsafeEnabled { - mi := &file_signers_proto_msgTypes[12] + mi := &file_signers_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -6304,6 +9626,181 @@ func (x *RepeatedNestedRepeatedSigner_Inner) GetSigner() []string { return nil } +type DeeplyNestedSigner_InnerOne struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + InnerTwo *DeeplyNestedSigner_InnerOne_InnerTwo `protobuf:"bytes,1,opt,name=inner_two,json=innerTwo,proto3" json:"inner_two,omitempty"` +} + +func (x *DeeplyNestedSigner_InnerOne) Reset() { + *x = DeeplyNestedSigner_InnerOne{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedSigner_InnerOne) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedSigner_InnerOne) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedSigner_InnerOne.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner_InnerOne) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6, 0} +} + +func (x *DeeplyNestedSigner_InnerOne) GetInnerTwo() *DeeplyNestedSigner_InnerOne_InnerTwo { + if x != nil { + return x.InnerTwo + } + return nil +} + +type DeeplyNestedSigner_InnerOne_InnerTwo struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer string `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) Reset() { + *x = DeeplyNestedSigner_InnerOne_InnerTwo{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedSigner_InnerOne_InnerTwo) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedSigner_InnerOne_InnerTwo.ProtoReflect.Descriptor instead. +func (*DeeplyNestedSigner_InnerOne_InnerTwo) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{6, 0, 0} +} + +func (x *DeeplyNestedSigner_InnerOne_InnerTwo) GetSigner() string { + if x != nil { + return x.Signer + } + return "" +} + +type DeeplyNestedRepeatedSigner_Inner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*DeeplyNestedRepeatedSigner_Inner_Inner `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner) GetInner() []*DeeplyNestedRepeatedSigner_Inner_Inner { + if x != nil { + return x.Inner + } + return nil +} + +type DeeplyNestedRepeatedSigner_Inner_Inner struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Inner []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom `protobuf:"bytes,1,rep,name=inner,proto3" json:"inner,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner_Inner{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner_Inner) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner_Inner.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner_Inner) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner) GetInner() []*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom { + if x != nil { + return x.Inner + } + return nil +} + +type DeeplyNestedRepeatedSigner_Inner_Inner_Bottom struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Signer []string `protobuf:"bytes,1,rep,name=signer,proto3" json:"signer,omitempty"` +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Reset() { + *x = DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{} + if protoimpl.UnsafeEnabled { + mi := &file_signers_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) ProtoMessage() {} + +// Deprecated: Use DeeplyNestedRepeatedSigner_Inner_Inner_Bottom.ProtoReflect.Descriptor instead. +func (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) Descriptor() ([]byte, []int) { + return file_signers_proto_rawDescGZIP(), []int{7, 0, 0, 0} +} + +func (x *DeeplyNestedRepeatedSigner_Inner_Inner_Bottom) GetSigner() []string { + if x != nil { + return x.Signer + } + return nil +} + var File_signers_proto protoreflect.FileDescriptor var file_signers_proto_rawDesc = []byte{ @@ -6351,28 +9848,63 @@ var file_signers_proto_rawDesc = []byte{ 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, - 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, - 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0f, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, - 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x32, 0x4d, 0x0a, - 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, - 0x72, 0x12, 0x32, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, - 0x67, 0x6e, 0x65, 0x72, 0x1a, 0x0d, 0x2e, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, - 0x6e, 0x65, 0x72, 0x22, 0x00, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x3b, 0x42, 0x0c, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, - 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, - 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x33, + 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0xf1, 0x01, 0x0a, 0x12, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x52, 0x08, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x1a, 0x8f, 0x01, 0x0a, 0x08, 0x49, 0x6e, 0x6e, + 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x12, 0x42, 0x0a, 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, + 0x77, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, + 0x6e, 0x65, 0x72, 0x4f, 0x6e, 0x65, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x52, + 0x08, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x54, 0x77, 0x6f, 0x1a, 0x2f, 0x0a, 0x08, 0x49, 0x6e, 0x6e, + 0x65, 0x72, 0x54, 0x77, 0x6f, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x74, 0x77, 0x6f, 0x3a, 0x0e, 0x82, 0xe7, 0xb0, 0x2a, + 0x09, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x5f, 0x6f, 0x6e, 0x65, 0x22, 0xc1, 0x02, 0x0a, 0x1a, 0x44, + 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, + 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x37, 0x0a, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, + 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x1a, 0xdd, 0x01, 0x0a, 0x05, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x3d, 0x0a, 0x05, + 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x27, 0x2e, 0x44, 0x65, + 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, + 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x49, + 0x6e, 0x6e, 0x65, 0x72, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0x88, 0x01, 0x0a, 0x05, + 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x12, 0x44, 0x0a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x44, 0x65, 0x65, 0x70, 0x6c, 0x79, 0x4e, 0x65, 0x73, + 0x74, 0x65, 0x64, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, + 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x49, 0x6e, 0x6e, 0x65, 0x72, 0x2e, 0x42, 0x6f, + 0x74, 0x74, 0x6f, 0x6d, 0x52, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x1a, 0x2d, 0x0a, 0x06, 0x42, + 0x6f, 0x74, 0x74, 0x6f, 0x6d, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, + 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, + 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, + 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, + 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, + 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, + 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, + 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x59, 0x0a, 0x0f, 0x56, 0x61, + 0x6c, 0x69, 0x64, 0x61, 0x74, 0x6f, 0x72, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, + 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x21, 0xd2, + 0xb4, 0x2d, 0x1d, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, + 0x74, 0x6f, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x32, 0x4d, 0x0a, 0x10, 0x54, 0x65, 0x73, 0x74, 0x53, 0x69, 0x6d, + 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x10, 0x54, 0x65, 0x73, + 0x74, 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x0d, 0x2e, + 0x53, 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x1a, 0x0d, 0x2e, 0x53, + 0x69, 0x6d, 0x70, 0x6c, 0x65, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x00, 0x1a, 0x05, 0x80, + 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x3b, 0x42, 0x0c, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x73, 0x50, + 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x29, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, + 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x74, 0x65, 0x78, 0x74, 0x75, 0x61, + 0x6c, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, + 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -6387,34 +9919,46 @@ func file_signers_proto_rawDescGZIP() []byte { return file_signers_proto_rawDescData } -var file_signers_proto_msgTypes = make([]protoimpl.MessageInfo, 13) +var file_signers_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_signers_proto_goTypes = []interface{}{ - (*SimpleSigner)(nil), // 0: SimpleSigner - (*RepeatedSigner)(nil), // 1: RepeatedSigner - (*NestedSigner)(nil), // 2: NestedSigner - (*RepeatedNestedSigner)(nil), // 3: RepeatedNestedSigner - (*NestedRepeatedSigner)(nil), // 4: NestedRepeatedSigner - (*RepeatedNestedRepeatedSigner)(nil), // 5: RepeatedNestedRepeatedSigner - (*BadSigner)(nil), // 6: BadSigner - (*NoSignerOption)(nil), // 7: NoSignerOption - (*ValidatorSigner)(nil), // 8: ValidatorSigner - (*NestedSigner_Inner)(nil), // 9: NestedSigner.Inner - (*RepeatedNestedSigner_Inner)(nil), // 10: RepeatedNestedSigner.Inner - (*NestedRepeatedSigner_Inner)(nil), // 11: NestedRepeatedSigner.Inner - (*RepeatedNestedRepeatedSigner_Inner)(nil), // 12: RepeatedNestedRepeatedSigner.Inner + (*SimpleSigner)(nil), // 0: SimpleSigner + (*RepeatedSigner)(nil), // 1: RepeatedSigner + (*NestedSigner)(nil), // 2: NestedSigner + (*RepeatedNestedSigner)(nil), // 3: RepeatedNestedSigner + (*NestedRepeatedSigner)(nil), // 4: NestedRepeatedSigner + (*RepeatedNestedRepeatedSigner)(nil), // 5: RepeatedNestedRepeatedSigner + (*DeeplyNestedSigner)(nil), // 6: DeeplyNestedSigner + (*DeeplyNestedRepeatedSigner)(nil), // 7: DeeplyNestedRepeatedSigner + (*BadSigner)(nil), // 8: BadSigner + (*NoSignerOption)(nil), // 9: NoSignerOption + (*ValidatorSigner)(nil), // 10: ValidatorSigner + (*NestedSigner_Inner)(nil), // 11: NestedSigner.Inner + (*RepeatedNestedSigner_Inner)(nil), // 12: RepeatedNestedSigner.Inner + (*NestedRepeatedSigner_Inner)(nil), // 13: NestedRepeatedSigner.Inner + (*RepeatedNestedRepeatedSigner_Inner)(nil), // 14: RepeatedNestedRepeatedSigner.Inner + (*DeeplyNestedSigner_InnerOne)(nil), // 15: DeeplyNestedSigner.InnerOne + (*DeeplyNestedSigner_InnerOne_InnerTwo)(nil), // 16: DeeplyNestedSigner.InnerOne.InnerTwo + (*DeeplyNestedRepeatedSigner_Inner)(nil), // 17: DeeplyNestedRepeatedSigner.Inner + (*DeeplyNestedRepeatedSigner_Inner_Inner)(nil), // 18: DeeplyNestedRepeatedSigner.Inner.Inner + (*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom)(nil), // 19: DeeplyNestedRepeatedSigner.Inner.Inner.Bottom } var file_signers_proto_depIdxs = []int32{ - 9, // 0: NestedSigner.inner:type_name -> NestedSigner.Inner - 10, // 1: RepeatedNestedSigner.inner:type_name -> RepeatedNestedSigner.Inner - 11, // 2: NestedRepeatedSigner.inner:type_name -> NestedRepeatedSigner.Inner - 12, // 3: RepeatedNestedRepeatedSigner.inner:type_name -> RepeatedNestedRepeatedSigner.Inner - 0, // 4: TestSimpleSigner.TestSimpleSigner:input_type -> SimpleSigner - 0, // 5: TestSimpleSigner.TestSimpleSigner:output_type -> SimpleSigner - 5, // [5:6] is the sub-list for method output_type - 4, // [4:5] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 11, // 0: NestedSigner.inner:type_name -> NestedSigner.Inner + 12, // 1: RepeatedNestedSigner.inner:type_name -> RepeatedNestedSigner.Inner + 13, // 2: NestedRepeatedSigner.inner:type_name -> NestedRepeatedSigner.Inner + 14, // 3: RepeatedNestedRepeatedSigner.inner:type_name -> RepeatedNestedRepeatedSigner.Inner + 15, // 4: DeeplyNestedSigner.inner_one:type_name -> DeeplyNestedSigner.InnerOne + 17, // 5: DeeplyNestedRepeatedSigner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner + 16, // 6: DeeplyNestedSigner.InnerOne.inner_two:type_name -> DeeplyNestedSigner.InnerOne.InnerTwo + 18, // 7: DeeplyNestedRepeatedSigner.Inner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner.Inner + 19, // 8: DeeplyNestedRepeatedSigner.Inner.Inner.inner:type_name -> DeeplyNestedRepeatedSigner.Inner.Inner.Bottom + 0, // 9: TestSimpleSigner.TestSimpleSigner:input_type -> SimpleSigner + 0, // 10: TestSimpleSigner.TestSimpleSigner:output_type -> SimpleSigner + 10, // [10:11] is the sub-list for method output_type + 9, // [9:10] is the sub-list for method input_type + 9, // [9:9] is the sub-list for extension type_name + 9, // [9:9] is the sub-list for extension extendee + 0, // [0:9] is the sub-list for field type_name } func init() { file_signers_proto_init() } @@ -6496,7 +10040,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*BadSigner); i { + switch v := v.(*DeeplyNestedSigner); i { case 0: return &v.state case 1: @@ -6508,7 +10052,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NoSignerOption); i { + switch v := v.(*DeeplyNestedRepeatedSigner); i { case 0: return &v.state case 1: @@ -6520,7 +10064,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ValidatorSigner); i { + switch v := v.(*BadSigner); i { case 0: return &v.state case 1: @@ -6532,7 +10076,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NestedSigner_Inner); i { + switch v := v.(*NoSignerOption); i { case 0: return &v.state case 1: @@ -6544,7 +10088,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RepeatedNestedSigner_Inner); i { + switch v := v.(*ValidatorSigner); i { case 0: return &v.state case 1: @@ -6556,7 +10100,7 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*NestedRepeatedSigner_Inner); i { + switch v := v.(*NestedSigner_Inner); i { case 0: return &v.state case 1: @@ -6568,6 +10112,30 @@ func file_signers_proto_init() { } } file_signers_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RepeatedNestedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*NestedRepeatedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RepeatedNestedRepeatedSigner_Inner); i { case 0: return &v.state @@ -6579,6 +10147,66 @@ func file_signers_proto_init() { return nil } } + file_signers_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedSigner_InnerOne); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedSigner_InnerOne_InnerTwo); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner_Inner); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_signers_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*DeeplyNestedRepeatedSigner_Inner_Inner_Bottom); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -6586,7 +10214,7 @@ func file_signers_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_signers_proto_rawDesc, NumEnums: 0, - NumMessages: 13, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/x/tx/signing/aminojson/aminojson.go b/x/tx/signing/aminojson/aminojson.go index 6d4c264e5d90..5b0d9e4d0547 100644 --- a/x/tx/signing/aminojson/aminojson.go +++ b/x/tx/signing/aminojson/aminojson.go @@ -2,6 +2,7 @@ package aminojson import ( "context" + "errors" "fmt" "google.golang.org/protobuf/reflect/protoregistry" @@ -22,7 +23,7 @@ type SignModeHandler struct { // SignModeHandlerOptions are the options for the SignModeHandler. type SignModeHandlerOptions struct { FileResolver signing.ProtoFileResolver - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver Encoder *Encoder } @@ -43,6 +44,7 @@ func NewSignModeHandler(options SignModeHandlerOptions) *SignModeHandler { h.encoder = NewEncoder(EncoderOptions{ FileResolver: options.FileResolver, TypeResolver: options.TypeResolver, + EnumAsString: false, // ensure enum as string is disabled }) } else { h.encoder = *options.Encoder @@ -78,7 +80,7 @@ func (h SignModeHandler) GetSignBytes(_ context.Context, signerData signing.Sign f := txData.AuthInfo.Fee if f == nil { - return nil, fmt.Errorf("fee cannot be nil when tipper is not signer") + return nil, errors.New("fee cannot be nil when tipper is not signer") } fee = &aminojsonpb.AminoSignFee{ Amount: f.Amount, diff --git a/x/tx/signing/aminojson/any.go b/x/tx/signing/aminojson/any.go index 6898f50ce15f..c7e304a46977 100644 --- a/x/tx/signing/aminojson/any.go +++ b/x/tx/signing/aminojson/any.go @@ -11,12 +11,12 @@ import ( "google.golang.org/protobuf/types/known/anypb" ) -func (enc Encoder) marshalAny(message protoreflect.Message, writer io.Writer) error { +func marshalAny(enc *Encoder, message protoreflect.Message, writer io.Writer) error { // when a message contains a nested any field, and the top-level message has been unmarshalled into a dyanmicpb, // the nested any field will also be a dynamicpb. In this case, we must use the dynamicpb API. _, ok := message.Interface().(*dynamicpb.Message) if ok { - return enc.marshalDynamic(message, writer) + return marshalDynamic(enc, message, writer) } anyMsg, ok := message.Interface().(*anypb.Any) @@ -50,13 +50,7 @@ func (enc Encoder) marshalAny(message protoreflect.Message, writer io.Writer) er protoMessage = valueMsg.ProtoReflect() } - _, named := getMessageAminoName(protoMessage.Descriptor().Options()) - if !named { - return fmt.Errorf("message %s is packed into an any field, so requires an amino.name annotation", - anyMsg.TypeUrl) - } - - return enc.beginMarshal(protoMessage, writer) + return enc.beginMarshal(protoMessage, writer, true) } const ( @@ -64,7 +58,7 @@ const ( anyValueFieldName = "value" ) -func (enc Encoder) marshalDynamic(message protoreflect.Message, writer io.Writer) error { +func marshalDynamic(enc *Encoder, message protoreflect.Message, writer io.Writer) error { msgName := message.Get(message.Descriptor().Fields().ByName(anyTypeURLFieldName)).String()[1:] msgBytes := message.Get(message.Descriptor().Fields().ByName(anyValueFieldName)).Bytes() @@ -73,17 +67,11 @@ func (enc Encoder) marshalDynamic(message protoreflect.Message, writer io.Writer return errors.Wrapf(err, "can't resolve type URL %s", msgName) } - _, named := getMessageAminoName(desc.Options()) - if !named { - return fmt.Errorf("message %s is packed into an any field, so requires an amino.name annotation", - msgName) - } - valueMsg := dynamicpb.NewMessageType(desc.(protoreflect.MessageDescriptor)).New().Interface() err = proto.Unmarshal(msgBytes, valueMsg) if err != nil { return err } - return enc.beginMarshal(valueMsg.ProtoReflect(), writer) + return enc.beginMarshal(valueMsg.ProtoReflect(), writer, true) } diff --git a/x/tx/signing/aminojson/bench_test.go b/x/tx/signing/aminojson/bench_test.go index 9ccc11ddcf68..49f9302d4b7b 100644 --- a/x/tx/signing/aminojson/bench_test.go +++ b/x/tx/signing/aminojson/bench_test.go @@ -40,6 +40,7 @@ func BenchmarkAminoJSONDefaultSort(b *testing.B) { } func benchmarkAminoJSON(b *testing.B, addNaiveSort bool) { + b.Helper() enc := aminojson.NewEncoder(aminojson.EncoderOptions{DoNotSortFields: addNaiveSort}) b.ReportAllocs() b.ResetTimer() @@ -54,6 +55,7 @@ func benchmarkAminoJSON(b *testing.B, addNaiveSort bool) { } func runAminoJSON(b *testing.B, enc aminojson.Encoder, addNaiveSort bool) []byte { + b.Helper() bz, err := enc.Marshal(msg) if err != nil { b.Fatal(err) diff --git a/x/tx/signing/aminojson/encoder.go b/x/tx/signing/aminojson/encoder.go index acb899edbd61..07a7c8ea0792 100644 --- a/x/tx/signing/aminojson/encoder.go +++ b/x/tx/signing/aminojson/encoder.go @@ -72,10 +72,10 @@ func nullSliceAsEmptyEncoder(enc *Encoder, v protoreflect.Value, w io.Writer) er switch list := v.Interface().(type) { case protoreflect.List: if list.Len() == 0 { - _, err := w.Write([]byte("[]")) + _, err := io.WriteString(w, "[]") return err } - return enc.marshalList(list, w) + return enc.marshalList(list, nil /* no field descriptor available here */, w) default: return fmt.Errorf("unsupported type %T", list) } @@ -129,6 +129,7 @@ func moduleAccountEncoder(_ *Encoder, msg protoreflect.Message, w io.Writer) err pretty.Sequence = 0 } + // we do not want to use the json encoder here because it adds a newline bz, err := json.Marshal(pretty) if err != nil { return err @@ -146,13 +147,13 @@ func thresholdStringEncoder(enc *Encoder, msg protoreflect.Message, w io.Writer) if !ok { return errors.New("thresholdStringEncoder: msg not a multisig.LegacyAminoPubKey") } - _, err := w.Write([]byte(fmt.Sprintf(`{"threshold":"%d","pubkeys":`, pk.Threshold))) + _, err := fmt.Fprintf(w, `{"threshold":"%d","pubkeys":`, pk.Threshold) if err != nil { return err } if len(pk.PublicKeys) == 0 { - _, err = w.Write([]byte(`[]}`)) + _, err = io.WriteString(w, `[]}`) return err } @@ -160,10 +161,10 @@ func thresholdStringEncoder(enc *Encoder, msg protoreflect.Message, w io.Writer) pubkeysField := fields.ByName("public_keys") pubkeys := msg.Get(pubkeysField).List() - err = enc.marshalList(pubkeys, w) + err = enc.marshalList(pubkeys, pubkeysField, w) if err != nil { return err } - _, err = w.Write([]byte(`}`)) + _, err = io.WriteString(w, `}`) return err } diff --git a/x/tx/signing/aminojson/fuzz_test.go b/x/tx/signing/aminojson/fuzz_test.go new file mode 100644 index 000000000000..e5cbe7ccf3f1 --- /dev/null +++ b/x/tx/signing/aminojson/fuzz_test.go @@ -0,0 +1,75 @@ +package aminojson + +import ( + "context" + "encoding/json" + "testing" + + fuzz "github.com/google/gofuzz" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing/testutil" +) + +func FuzzSignModeGetSignBytes(f *testing.F) { + if testing.Short() { + f.Skip("not running in -short mode") + } + + // 1. Create seeds. + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + seed := &testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + } + + gf := fuzz.New() + for i := 0; i < 1e4; i++ { + blob, err := json.Marshal(seed) + if err != nil { + f.Fatal(err) + } + f.Add(blob) + + // 1.5. Mutate the seed for the next iteration. + // gofuzz cannot handle mutating "&bankv1beta1.MsgSend", + // hence why we are mutating fields individually. + gf.Fuzz(&seed.ChainID) + gf.Fuzz(&seed.Memo) + gf.Fuzz(&seed.AccNum) + gf.Fuzz(&seed.AccSeq) + gf.Fuzz(seed.Fee) + gf.Fuzz(&seed.SignerAddress) + } + + ctx := context.Background() + handler := NewSignModeHandler(SignModeHandlerOptions{}) + + // 2. Now run the fuzzers. + f.Fuzz(func(t *testing.T, in []byte) { + opts := new(testutil.HandlerArgumentOptions) + if err := json.Unmarshal(in, opts); err != nil { + return + } + + signerData, txData, err := testutil.MakeHandlerArguments(*opts) + if err != nil { + return + } + _, _ = handler.GetSignBytes(ctx, signerData, txData) + }) +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto index d28008c87dcf..8ab6373b864f 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto @@ -1,10 +1,8 @@ syntax = "proto3"; -import "cosmos_proto/cosmos.proto"; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/any.proto"; -import "cosmos/tx/v1beta1/tx.proto"; // AminoSignFee is the legacy amino json sign mode compatible version of txv1beta1.Fee, and differs from that message // by the name of the Gas field (GasLimit in txv1beta.Fee). @@ -27,5 +25,4 @@ message AminoSignDoc { string memo = 5 [(amino.dont_omitempty) = true]; AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; repeated google.protobuf.Any msgs = 7 [(amino.dont_omitempty) = true]; - cosmos.tx.v1beta1.Tip tip = 8; -} \ No newline at end of file +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go index d1f7f2540d35..e8ad14368fd9 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go @@ -4,9 +4,7 @@ package aminojsonpb import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - v1beta11 "cosmossdk.io/api/cosmos/tx/v1beta1" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -747,7 +745,6 @@ var ( fd_AminoSignDoc_memo protoreflect.FieldDescriptor fd_AminoSignDoc_fee protoreflect.FieldDescriptor fd_AminoSignDoc_msgs protoreflect.FieldDescriptor - fd_AminoSignDoc_tip protoreflect.FieldDescriptor ) func init() { @@ -760,7 +757,6 @@ func init() { fd_AminoSignDoc_memo = md_AminoSignDoc.Fields().ByName("memo") fd_AminoSignDoc_fee = md_AminoSignDoc.Fields().ByName("fee") fd_AminoSignDoc_msgs = md_AminoSignDoc.Fields().ByName("msgs") - fd_AminoSignDoc_tip = md_AminoSignDoc.Fields().ByName("tip") } var _ protoreflect.Message = (*fastReflection_AminoSignDoc)(nil) @@ -870,12 +866,6 @@ func (x *fastReflection_AminoSignDoc) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Tip != nil { - value := protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) - if !f(fd_AminoSignDoc_tip, value) { - return - } - } } // Has reports whether a field is populated. @@ -905,8 +895,6 @@ func (x *fastReflection_AminoSignDoc) Has(fd protoreflect.FieldDescriptor) bool return x.Fee != nil case "AminoSignDoc.msgs": return len(x.Msgs) != 0 - case "AminoSignDoc.tip": - return x.Tip != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -937,8 +925,6 @@ func (x *fastReflection_AminoSignDoc) Clear(fd protoreflect.FieldDescriptor) { x.Fee = nil case "AminoSignDoc.msgs": x.Msgs = nil - case "AminoSignDoc.tip": - x.Tip = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -979,9 +965,6 @@ func (x *fastReflection_AminoSignDoc) Get(descriptor protoreflect.FieldDescripto } listValue := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(listValue) - case "AminoSignDoc.tip": - value := x.Tip - return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1018,8 +1001,6 @@ func (x *fastReflection_AminoSignDoc) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_AminoSignDoc_7_list) x.Msgs = *clv.list - case "AminoSignDoc.tip": - x.Tip = value.Message().Interface().(*v1beta11.Tip) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1051,11 +1032,6 @@ func (x *fastReflection_AminoSignDoc) Mutable(fd protoreflect.FieldDescriptor) p } value := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(value) - case "AminoSignDoc.tip": - if x.Tip == nil { - x.Tip = new(v1beta11.Tip) - } - return protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) case "AminoSignDoc.account_number": panic(fmt.Errorf("field account_number of message AminoSignDoc is not mutable")) case "AminoSignDoc.sequence": @@ -1095,9 +1071,6 @@ func (x *fastReflection_AminoSignDoc) NewField(fd protoreflect.FieldDescriptor) case "AminoSignDoc.msgs": list := []*anypb.Any{} return protoreflect.ValueOfList(&_AminoSignDoc_7_list{list: &list}) - case "AminoSignDoc.tip": - m := new(v1beta11.Tip) - return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1194,10 +1167,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if x.Tip != nil { - l = options.Size(x.Tip) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1227,20 +1196,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Tip != nil { - encoded, err := options.Marshal(x.Tip) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x42 - } if len(x.Msgs) > 0 { for iNdEx := len(x.Msgs) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Msgs[iNdEx]) @@ -1540,42 +1495,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tip", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Tip == nil { - x.Tip = &v1beta11.Tip{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Tip); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1701,7 +1620,6 @@ type AminoSignDoc struct { Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` Fee *AminoSignFee `protobuf:"bytes,6,opt,name=fee,proto3" json:"fee,omitempty"` Msgs []*anypb.Any `protobuf:"bytes,7,rep,name=msgs,proto3" json:"msgs,omitempty"` - Tip *v1beta11.Tip `protobuf:"bytes,8,opt,name=tip,proto3" json:"tip,omitempty"` } func (x *AminoSignDoc) Reset() { @@ -1773,63 +1691,50 @@ func (x *AminoSignDoc) GetMsgs() []*anypb.Any { return nil } -func (x *AminoSignDoc) GetTip() *v1beta11.Tip { - if x != nil { - return x.Tip - } - return nil -} - var File_aminojsonpb_aminojson_proto protoreflect.FileDescriptor var file_aminojsonpb_aminojson_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, - 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, - 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, - 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, - 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xc6, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, - 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, - 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, - 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, - 0x42, 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, + 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, + 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, + 0x22, 0x9c, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, + 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, + 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, + 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, + 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x42, + 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1850,18 +1755,16 @@ var file_aminojsonpb_aminojson_proto_goTypes = []interface{}{ (*AminoSignDoc)(nil), // 1: AminoSignDoc (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin (*anypb.Any)(nil), // 3: google.protobuf.Any - (*v1beta11.Tip)(nil), // 4: cosmos.tx.v1beta1.Tip } var file_aminojsonpb_aminojson_proto_depIdxs = []int32{ 2, // 0: AminoSignFee.amount:type_name -> cosmos.base.v1beta1.Coin 0, // 1: AminoSignDoc.fee:type_name -> AminoSignFee 3, // 2: AminoSignDoc.msgs:type_name -> google.protobuf.Any - 4, // 3: AminoSignDoc.tip:type_name -> cosmos.tx.v1beta1.Tip - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_aminojsonpb_aminojson_proto_init() } diff --git a/x/tx/signing/aminojson/internal/buf.lock b/x/tx/signing/aminojson/internal/buf.lock index 0c2167d10c41..77b19169b1f7 100644 --- a/x/tx/signing/aminojson/internal/buf.lock +++ b/x/tx/signing/aminojson/internal/buf.lock @@ -9,8 +9,8 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: a0f17dcd1d6b4a03ab50d377b36da149 - digest: shake256:fc36c3c09df4a908270170125aeb559af8424df3efa1179f09b51738b0e95df5c5f31f590e2a6ab8c31af497a0e15056efeddde7ba1e3297383d01badc68d3b3 + commit: 1356e87e6d1d4076b8bfb735737a0b63 + digest: shake256:574a0e72da9b55e30257557503bd4203513e5ca06dd8bc19fb8bf375fc8525a6bab4d9995e1554db7e9c649bc3778578e0cb96182176206f0653f2a17c073c46 - remote: buf.build owner: cosmos repository: gogo-proto diff --git a/x/tx/signing/aminojson/internal/testpb/test.proto b/x/tx/signing/aminojson/internal/testpb/test.proto index 0b1b3644c843..8be5a3dc1362 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.proto +++ b/x/tx/signing/aminojson/internal/testpb/test.proto @@ -62,6 +62,11 @@ message ABitOfEverything { // google.protobuf.Duration duration = 24; } +message Duration { + google.protobuf.Duration duration = 1; + google.protobuf.Timestamp timestamp = 2; +} + message NestedMessage { option (amino.name) = "NestedMessage"; diff --git a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go index ae8a54ee2571..7cc06a47766e 100644 --- a/x/tx/signing/aminojson/internal/testpb/test.pulsar.go +++ b/x/tx/signing/aminojson/internal/testpb/test.pulsar.go @@ -10,11 +10,11 @@ import ( protoiface "google.golang.org/protobuf/runtime/protoiface" protoimpl "google.golang.org/protobuf/runtime/protoimpl" _ "google.golang.org/protobuf/types/known/anypb" - _ "google.golang.org/protobuf/types/known/durationpb" + durationpb "google.golang.org/protobuf/types/known/durationpb" _ "google.golang.org/protobuf/types/known/emptypb" _ "google.golang.org/protobuf/types/known/fieldmaskpb" _ "google.golang.org/protobuf/types/known/structpb" - _ "google.golang.org/protobuf/types/known/timestamppb" + timestamppb "google.golang.org/protobuf/types/known/timestamppb" _ "google.golang.org/protobuf/types/known/wrapperspb" io "io" reflect "reflect" @@ -2594,6 +2594,520 @@ func (x *fastReflection_ABitOfEverything) ProtoMethods() *protoiface.Methods { } } +var ( + md_Duration protoreflect.MessageDescriptor + fd_Duration_duration protoreflect.FieldDescriptor + fd_Duration_timestamp protoreflect.FieldDescriptor +) + +func init() { + file_testpb_test_proto_init() + md_Duration = File_testpb_test_proto.Messages().ByName("Duration") + fd_Duration_duration = md_Duration.Fields().ByName("duration") + fd_Duration_timestamp = md_Duration.Fields().ByName("timestamp") +} + +var _ protoreflect.Message = (*fastReflection_Duration)(nil) + +type fastReflection_Duration Duration + +func (x *Duration) ProtoReflect() protoreflect.Message { + return (*fastReflection_Duration)(x) +} + +func (x *Duration) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_test_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_Duration_messageType fastReflection_Duration_messageType +var _ protoreflect.MessageType = fastReflection_Duration_messageType{} + +type fastReflection_Duration_messageType struct{} + +func (x fastReflection_Duration_messageType) Zero() protoreflect.Message { + return (*fastReflection_Duration)(nil) +} +func (x fastReflection_Duration_messageType) New() protoreflect.Message { + return new(fastReflection_Duration) +} +func (x fastReflection_Duration_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_Duration +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_Duration) Descriptor() protoreflect.MessageDescriptor { + return md_Duration +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_Duration) Type() protoreflect.MessageType { + return _fastReflection_Duration_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_Duration) New() protoreflect.Message { + return new(fastReflection_Duration) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_Duration) Interface() protoreflect.ProtoMessage { + return (*Duration)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_Duration) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.Duration != nil { + value := protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + if !f(fd_Duration_duration, value) { + return + } + } + if x.Timestamp != nil { + value := protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + if !f(fd_Duration_timestamp, value) { + return + } + } +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_Duration) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "testpb.Duration.duration": + return x.Duration != nil + case "testpb.Duration.timestamp": + return x.Timestamp != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "testpb.Duration.duration": + x.Duration = nil + case "testpb.Duration.timestamp": + x.Timestamp = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_Duration) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "testpb.Duration.duration": + value := x.Duration + return protoreflect.ValueOfMessage(value.ProtoReflect()) + case "testpb.Duration.timestamp": + value := x.Timestamp + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "testpb.Duration.duration": + x.Duration = value.Message().Interface().(*durationpb.Duration) + case "testpb.Duration.timestamp": + x.Timestamp = value.Message().Interface().(*timestamppb.Timestamp) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.Duration.duration": + if x.Duration == nil { + x.Duration = new(durationpb.Duration) + } + return protoreflect.ValueOfMessage(x.Duration.ProtoReflect()) + case "testpb.Duration.timestamp": + if x.Timestamp == nil { + x.Timestamp = new(timestamppb.Timestamp) + } + return protoreflect.ValueOfMessage(x.Timestamp.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_Duration) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "testpb.Duration.duration": + m := new(durationpb.Duration) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + case "testpb.Duration.timestamp": + m := new(timestamppb.Timestamp) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.Duration")) + } + panic(fmt.Errorf("message testpb.Duration does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_Duration) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.Duration", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_Duration) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_Duration) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_Duration) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_Duration) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*Duration) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.Duration != nil { + l = options.Size(x.Duration) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.Timestamp != nil { + l = options.Size(x.Timestamp) + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*Duration) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if x.Timestamp != nil { + encoded, err := options.Marshal(x.Timestamp) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0x12 + } + if x.Duration != nil { + encoded, err := options.Marshal(x.Duration) + if err != nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, err + } + i -= len(encoded) + copy(dAtA[i:], encoded) + i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) + i-- + dAtA[i] = 0xa + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*Duration) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Duration: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: Duration: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Duration", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Duration == nil { + x.Duration = &durationpb.Duration{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Duration); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Timestamp", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if x.Timestamp == nil { + x.Timestamp = ×tamppb.Timestamp{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Timestamp); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + var ( md_NestedMessage protoreflect.MessageDescriptor fd_NestedMessage_foo protoreflect.FieldDescriptor @@ -2616,7 +3130,7 @@ func (x *NestedMessage) ProtoReflect() protoreflect.Message { } func (x *NestedMessage) slowProtoReflect() protoreflect.Message { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3357,6 +3871,49 @@ func (x *ABitOfEverything) GetSf64() int64 { return 0 } +type Duration struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + Duration *durationpb.Duration `protobuf:"bytes,1,opt,name=duration,proto3" json:"duration,omitempty"` + Timestamp *timestamppb.Timestamp `protobuf:"bytes,2,opt,name=timestamp,proto3" json:"timestamp,omitempty"` +} + +func (x *Duration) Reset() { + *x = Duration{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_test_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *Duration) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*Duration) ProtoMessage() {} + +// Deprecated: Use Duration.ProtoReflect.Descriptor instead. +func (*Duration) Descriptor() ([]byte, []int) { + return file_testpb_test_proto_rawDescGZIP(), []int{3} +} + +func (x *Duration) GetDuration() *durationpb.Duration { + if x != nil { + return x.Duration + } + return nil +} + +func (x *Duration) GetTimestamp() *timestamppb.Timestamp { + if x != nil { + return x.Timestamp + } + return nil +} + type NestedMessage struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3369,7 +3926,7 @@ type NestedMessage struct { func (x *NestedMessage) Reset() { *x = NestedMessage{} if protoimpl.UnsafeEnabled { - mi := &file_testpb_test_proto_msgTypes[3] + mi := &file_testpb_test_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3383,7 +3940,7 @@ func (*NestedMessage) ProtoMessage() {} // Deprecated: Use NestedMessage.ProtoReflect.Descriptor instead. func (*NestedMessage) Descriptor() ([]byte, []int) { - return file_testpb_test_proto_rawDescGZIP(), []int{3} + return file_testpb_test_proto_rawDescGZIP(), []int{4} } func (x *NestedMessage) GetFoo() string { @@ -3458,23 +4015,31 @@ var file_testpb_test_proto_rawDesc = []byte{ 0x12, 0x52, 0x04, 0x73, 0x69, 0x36, 0x34, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x66, 0x36, 0x34, 0x18, 0x13, 0x20, 0x01, 0x28, 0x10, 0x52, 0x04, 0x73, 0x66, 0x36, 0x34, 0x3a, 0x15, 0x8a, 0xe7, 0xb0, 0x2a, 0x10, 0x41, 0x42, 0x69, 0x74, 0x4f, 0x66, 0x45, 0x76, 0x65, 0x72, 0x79, 0x74, 0x68, 0x69, - 0x6e, 0x67, 0x22, 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x66, 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x05, 0x52, 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x4e, 0x65, - 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x29, 0x0a, 0x06, 0x41, - 0x6e, 0x45, 0x6e, 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, - 0x03, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, - 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, - 0x50, 0x01, 0x5a, 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, - 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, - 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, - 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, - 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, - 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, - 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x6e, 0x67, 0x22, 0x7b, 0x0a, 0x08, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x35, + 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x19, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x44, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x08, 0x64, 0x75, 0x72, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x38, 0x0a, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, + 0x6d, 0x70, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, + 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, + 0x74, 0x61, 0x6d, 0x70, 0x52, 0x09, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x22, + 0x47, 0x0a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, + 0x12, 0x10, 0x0a, 0x03, 0x66, 0x6f, 0x6f, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x66, + 0x6f, 0x6f, 0x12, 0x10, 0x0a, 0x03, 0x62, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, + 0x03, 0x62, 0x61, 0x72, 0x3a, 0x12, 0x8a, 0xe7, 0xb0, 0x2a, 0x0d, 0x4e, 0x65, 0x73, 0x74, 0x65, + 0x64, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x2a, 0x29, 0x0a, 0x06, 0x41, 0x6e, 0x45, 0x6e, + 0x75, 0x6d, 0x12, 0x0d, 0x0a, 0x09, 0x55, 0x4e, 0x44, 0x45, 0x46, 0x49, 0x4e, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x07, 0x0a, 0x03, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x57, + 0x4f, 0x10, 0x02, 0x42, 0x83, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x42, 0x09, 0x54, 0x65, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, + 0x32, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, + 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2f, 0x69, 0x6e, 0x74, + 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2f, 0x74, 0x65, 0x73, + 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, + 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, + 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x33, } var ( @@ -3490,24 +4055,29 @@ func file_testpb_test_proto_rawDescGZIP() []byte { } var file_testpb_test_proto_enumTypes = make([]protoimpl.EnumInfo, 1) -var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 5) +var file_testpb_test_proto_msgTypes = make([]protoimpl.MessageInfo, 6) var file_testpb_test_proto_goTypes = []interface{}{ - (AnEnum)(0), // 0: testpb.AnEnum - (*WithAMap)(nil), // 1: testpb.WithAMap - (*WithAList)(nil), // 2: testpb.WithAList - (*ABitOfEverything)(nil), // 3: testpb.ABitOfEverything - (*NestedMessage)(nil), // 4: testpb.NestedMessage - nil, // 5: testpb.WithAMap.StrMapEntry + (AnEnum)(0), // 0: testpb.AnEnum + (*WithAMap)(nil), // 1: testpb.WithAMap + (*WithAList)(nil), // 2: testpb.WithAList + (*ABitOfEverything)(nil), // 3: testpb.ABitOfEverything + (*Duration)(nil), // 4: testpb.Duration + (*NestedMessage)(nil), // 5: testpb.NestedMessage + nil, // 6: testpb.WithAMap.StrMapEntry + (*durationpb.Duration)(nil), // 7: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 8: google.protobuf.Timestamp } var file_testpb_test_proto_depIdxs = []int32{ - 5, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry - 4, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage + 6, // 0: testpb.WithAMap.str_map:type_name -> testpb.WithAMap.StrMapEntry + 5, // 1: testpb.ABitOfEverything.message:type_name -> testpb.NestedMessage 0, // 2: testpb.ABitOfEverything.enum:type_name -> testpb.AnEnum - 3, // [3:3] is the sub-list for method output_type - 3, // [3:3] is the sub-list for method input_type - 3, // [3:3] is the sub-list for extension type_name - 3, // [3:3] is the sub-list for extension extendee - 0, // [0:3] is the sub-list for field type_name + 7, // 3: testpb.Duration.duration:type_name -> google.protobuf.Duration + 8, // 4: testpb.Duration.timestamp:type_name -> google.protobuf.Timestamp + 5, // [5:5] is the sub-list for method output_type + 5, // [5:5] is the sub-list for method input_type + 5, // [5:5] is the sub-list for extension type_name + 5, // [5:5] is the sub-list for extension extendee + 0, // [0:5] is the sub-list for field type_name } func init() { file_testpb_test_proto_init() } @@ -3553,6 +4123,18 @@ func file_testpb_test_proto_init() { } } file_testpb_test_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*Duration); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_test_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*NestedMessage); i { case 0: return &v.state @@ -3571,7 +4153,7 @@ func file_testpb_test_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testpb_test_proto_rawDesc, NumEnums: 1, - NumMessages: 5, + NumMessages: 6, NumExtensions: 0, NumServices: 0, }, diff --git a/x/tx/signing/aminojson/json_marshal.go b/x/tx/signing/aminojson/json_marshal.go index 4afb432329d6..800dfc7fd320 100644 --- a/x/tx/signing/aminojson/json_marshal.go +++ b/x/tx/signing/aminojson/json_marshal.go @@ -23,10 +23,16 @@ type FieldEncoder func(*Encoder, protoreflect.Value, io.Writer) error // EncoderOptions are options for creating a new Encoder. type EncoderOptions struct { - // DonotSortFields when set turns off sorting of field names. + // Indent can only be composed of space or tab characters. + // It defines the indentation used for each level of indentation. + Indent string + // DoNotSortFields when set turns off sorting of field names. DoNotSortFields bool + // EnumAsString when set will encode enums as strings instead of integers. + // Caution: Enabling this option produce different sign bytes. + EnumAsString bool // TypeResolver is used to resolve protobuf message types by TypeURL when marshaling any packed messages. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver signing.TypeResolver // FileResolver is used to resolve protobuf file descriptors TypeURL when TypeResolver fails. FileResolver signing.ProtoFileResolver } @@ -34,12 +40,15 @@ type EncoderOptions struct { // Encoder is a JSON encoder that uses the Amino JSON encoding rules for protobuf messages. type Encoder struct { // maps cosmos_proto.scalar -> field encoder - scalarEncoders map[string]FieldEncoder - messageEncoders map[string]MessageEncoder - fieldEncoders map[string]FieldEncoder - fileResolver signing.ProtoFileResolver - typeResolver protoregistry.MessageTypeResolver - doNotSortFields bool + cosmosProtoScalarEncoders map[string]FieldEncoder + aminoMessageEncoders map[string]MessageEncoder + aminoFieldEncoders map[string]FieldEncoder + protoTypeEncoders map[string]MessageEncoder + fileResolver signing.ProtoFileResolver + typeResolver protoregistry.MessageTypeResolver + doNotSortFields bool + indent string + enumsAsString bool } // NewEncoder returns a new Encoder capable of serializing protobuf messages to JSON using the Amino JSON encoding @@ -52,21 +61,28 @@ func NewEncoder(options EncoderOptions) Encoder { options.TypeResolver = protoregistry.GlobalTypes } enc := Encoder{ - scalarEncoders: map[string]FieldEncoder{ + cosmosProtoScalarEncoders: map[string]FieldEncoder{ "cosmos.Dec": cosmosDecEncoder, "cosmos.Int": cosmosIntEncoder, }, - messageEncoders: map[string]MessageEncoder{ + aminoMessageEncoders: map[string]MessageEncoder{ "key_field": keyFieldEncoder, "module_account": moduleAccountEncoder, "threshold_string": thresholdStringEncoder, }, - fieldEncoders: map[string]FieldEncoder{ + aminoFieldEncoders: map[string]FieldEncoder{ "legacy_coins": nullSliceAsEmptyEncoder, }, + protoTypeEncoders: map[string]MessageEncoder{ + "google.protobuf.Timestamp": marshalTimestamp, + "google.protobuf.Duration": marshalDuration, + "google.protobuf.Any": marshalAny, + }, fileResolver: options.FileResolver, typeResolver: options.TypeResolver, doNotSortFields: options.DoNotSortFields, + indent: options.Indent, + enumsAsString: options.EnumAsString, } return enc } @@ -81,10 +97,10 @@ func NewEncoder(options EncoderOptions) Encoder { // ... // } func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) Encoder { - if enc.messageEncoders == nil { - enc.messageEncoders = map[string]MessageEncoder{} + if enc.aminoMessageEncoders == nil { + enc.aminoMessageEncoders = map[string]MessageEncoder{} } - enc.messageEncoders[name] = encoder + enc.aminoMessageEncoders[name] = encoder return enc } @@ -102,36 +118,89 @@ func (enc Encoder) DefineMessageEncoding(name string, encoder MessageEncoder) En // ... // } func (enc Encoder) DefineFieldEncoding(name string, encoder FieldEncoder) Encoder { - if enc.fieldEncoders == nil { - enc.fieldEncoders = map[string]FieldEncoder{} + if enc.aminoFieldEncoders == nil { + enc.aminoFieldEncoders = map[string]FieldEncoder{} + } + enc.aminoFieldEncoders[name] = encoder + return enc +} + +// DefineScalarEncoding defines a custom encoding for a protobuf scalar field. The `name` field must match a usage of +// an (cosmos_proto.scalar) option in the protobuf message as in the following example. This encoding will be used +// instead of the default encoding for all usages of the tagged field. +// +// message Balance { +// string address = 1 [(cosmos_proto.scalar) = "cosmos.AddressString"]; +// ... +// } +func (enc Encoder) DefineScalarEncoding(name string, encoder FieldEncoder) Encoder { + if enc.cosmosProtoScalarEncoders == nil { + enc.cosmosProtoScalarEncoders = map[string]FieldEncoder{} + } + enc.cosmosProtoScalarEncoders[name] = encoder + return enc +} + +// DefineTypeEncoding defines a custom encoding for a protobuf message type. The `typeURL` field must match the +// type of the protobuf message as in the following example. This encoding will be used instead of the default +// encoding for all usages of the tagged message. +// +// message Foo { +// google.protobuf.Duration type_url = 1; +// ... +// } + +func (enc Encoder) DefineTypeEncoding(typeURL string, encoder MessageEncoder) Encoder { + if enc.protoTypeEncoders == nil { + enc.protoTypeEncoders = map[string]MessageEncoder{} } - enc.fieldEncoders[name] = encoder + enc.protoTypeEncoders[typeURL] = encoder return enc } // Marshal serializes a protobuf message to JSON. func (enc Encoder) Marshal(message proto.Message) ([]byte, error) { buf := &bytes.Buffer{} - err := enc.beginMarshal(message.ProtoReflect(), buf) + err := enc.beginMarshal(message.ProtoReflect(), buf, false) + + if enc.indent != "" { + indentBuf := &bytes.Buffer{} + if err := json.Indent(indentBuf, buf.Bytes(), "", enc.indent); err != nil { + return nil, err + } + + return indentBuf.Bytes(), err + } + return buf.Bytes(), err } -func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer) error { - name, named := getMessageAminoName(msg.Descriptor().Options()) +func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer, isAny bool) error { + var ( + name string + named bool + ) + + if isAny { + name, named = getMessageAminoNameAny(msg), true + } else { + name, named = getMessageAminoName(msg) + } + if named { - _, err := writer.Write([]byte(fmt.Sprintf(`{"type":"%s","value":`, name))) + _, err := fmt.Fprintf(writer, `{"type":"%s","value":`, name) if err != nil { return err } } - err := enc.marshal(protoreflect.ValueOfMessage(msg), writer) + err := enc.marshal(protoreflect.ValueOfMessage(msg), nil /* no field descriptor needed here */, writer) if err != nil { return err } if named { - _, err = writer.Write([]byte("}")) + _, err = io.WriteString(writer, "}") if err != nil { return err } @@ -140,7 +209,7 @@ func (enc Encoder) beginMarshal(msg protoreflect.Message, writer io.Writer) erro return nil } -func (enc Encoder) marshal(value protoreflect.Value, writer io.Writer) error { +func (enc Encoder) marshal(value protoreflect.Value, fd protoreflect.FieldDescriptor, writer io.Writer) error { switch val := value.Interface().(type) { case protoreflect.Message: err := enc.marshalMessage(val, writer) @@ -151,12 +220,23 @@ func (enc Encoder) marshal(value protoreflect.Value, writer io.Writer) error { case protoreflect.List: if !val.IsValid() { - _, err := writer.Write([]byte("null")) + _, err := io.WriteString(writer, "null") return err } - return enc.marshalList(val, writer) + return enc.marshalList(val, fd, writer) + + case string, bool, int32, uint32, []byte: + return jsonMarshal(writer, val) + + case protoreflect.EnumNumber: + if enc.enumsAsString && fd != nil { + desc := fd.Enum().Values().ByNumber(val) + if desc != nil { + _, err := io.WriteString(writer, fmt.Sprintf(`"%s"`, desc.Name())) + return err + } + } - case string, bool, int32, uint32, []byte, protoreflect.EnumNumber: return jsonMarshal(writer, val) case uint64, int64: @@ -178,14 +258,9 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return errors.New("nil message") } - switch msg.Descriptor().FullName() { - case timestampFullName: - // replicate https://github.com/tendermint/go-amino/blob/8e779b71f40d175cd1302d3cd41a75b005225a7a/json-encode.go#L45-L51 - return marshalTimestamp(msg, writer) - case durationFullName: - return marshalDuration(msg, writer) - case anyFullName: - return enc.marshalAny(msg, writer) + // check if we have a custom type encoder for this type + if typeEnc, ok := enc.protoTypeEncoders[string(msg.Descriptor().FullName())]; ok { + return typeEnc(&enc, msg, writer) } if encoder := enc.getMessageEncoder(msg); encoder != nil { @@ -193,7 +268,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } - _, err := writer.Write([]byte("{")) + _, err := io.WriteString(writer, "{") if err != nil { return err } @@ -248,15 +323,14 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er } if !first { - _, err = writer.Write([]byte(",")) + _, err = io.WriteString(writer, ",") if err != nil { return err } } if isOneOf && !writeNil { - _, err = writer.Write([]byte(fmt.Sprintf(`"%s":{"type":"%s","value":{`, - oneofFieldName, oneofTypeName))) + _, err = fmt.Fprintf(writer, `"%s":{"type":"%s","value":{`, oneofFieldName, oneofTypeName) if err != nil { return err } @@ -267,7 +341,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } - _, err = writer.Write([]byte(":")) + _, err = io.WriteString(writer, ":") if err != nil { return err } @@ -279,19 +353,19 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er return err } } else if writeNil { - _, err = writer.Write([]byte("null")) + _, err = io.WriteString(writer, "null") if err != nil { return err } } else { - err = enc.marshal(v, writer) + err = enc.marshal(v, f, writer) if err != nil { return err } } if isOneOf && !writeNil { - _, err = writer.Write([]byte("}}")) + _, err = io.WriteString(writer, "}}") if err != nil { return err } @@ -300,7 +374,7 @@ func (enc Encoder) marshalMessage(msg protoreflect.Message, writer io.Writer) er first = false } - _, err = writer.Write([]byte("}")) + _, err = io.WriteString(writer, "}") return err } @@ -313,10 +387,10 @@ func jsonMarshal(w io.Writer, v interface{}) error { return err } -func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error { +func (enc Encoder) marshalList(list protoreflect.List, fd protoreflect.FieldDescriptor, writer io.Writer) error { n := list.Len() - _, err := writer.Write([]byte("[")) + _, err := io.WriteString(writer, "[") if err != nil { return err } @@ -324,25 +398,19 @@ func (enc Encoder) marshalList(list protoreflect.List, writer io.Writer) error { first := true for i := 0; i < n; i++ { if !first { - _, err := writer.Write([]byte(",")) + _, err := io.WriteString(writer, ",") if err != nil { return err } } first = false - err = enc.marshal(list.Get(i), writer) + err = enc.marshal(list.Get(i), fd, writer) if err != nil { return err } } - _, err = writer.Write([]byte("]")) + _, err = io.WriteString(writer, "]") return err } - -const ( - timestampFullName protoreflect.FullName = "google.protobuf.Timestamp" - durationFullName protoreflect.FullName = "google.protobuf.Duration" - anyFullName protoreflect.FullName = "google.protobuf.Any" -) diff --git a/x/tx/signing/aminojson/json_marshal_test.go b/x/tx/signing/aminojson/json_marshal_test.go index 08d4263cd29b..be8caf8c7364 100644 --- a/x/tx/signing/aminojson/json_marshal_test.go +++ b/x/tx/signing/aminojson/json_marshal_test.go @@ -2,9 +2,12 @@ package aminojson_test import ( "encoding/json" + "errors" "fmt" + "io" "reflect" "testing" + "time" "github.com/cosmos/cosmos-proto/rapidproto" "github.com/stretchr/testify/require" @@ -14,6 +17,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/dynamicpb" + "google.golang.org/protobuf/types/known/durationpb" "gotest.tools/v3/assert" "pgregory.net/rapid" @@ -117,12 +121,13 @@ func TestAminoJSON(t *testing.T) { require.Equal(t, string(sortedBz), string(encodedDefaultBz)) } -func naiveSortedJSON(t testing.TB, jsonToSort []byte) []byte { +func naiveSortedJSON(tb testing.TB, jsonToSort []byte) []byte { + tb.Helper() var c interface{} err := json.Unmarshal(jsonToSort, &c) - assert.NilError(t, err) + assert.NilError(tb, err) sortedBz, err := json.Marshal(c) - assert.NilError(t, err) + assert.NilError(tb, err) return sortedBz } @@ -173,6 +178,152 @@ func TestDynamicPb(t *testing.T) { require.NoError(t, err) dynamicBz, err := encoder.Marshal(dynamicMsg) require.NoError(t, err) - fmt.Printf("dynamicBz: %s\n", string(dynamicBz)) require.Equal(t, string(bz), string(dynamicBz)) } + +func TestMarshalDuration(t *testing.T) { + msg := &testpb.Duration{ + Duration: &durationpb.Duration{Seconds: 1}, + } + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{}) + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"duration":"1000000000"}`, string(bz)) + + // define a custom marshaler for duration + encoder.DefineTypeEncoding("google.protobuf.Duration", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var secondsName protoreflect.Name = "seconds" + + fields := msg.Descriptor().Fields() + secondsField := fields.ByName(secondsName) + if secondsField == nil { + return errors.New("expected seconds field") + } + seconds := msg.Get(secondsField).Int() + + _, err = fmt.Fprint(w, "\"", (time.Duration(seconds) * time.Second).String(), "\"") + return err + }) + bz, err = encoder.Marshal(msg) + require.NoError(t, err) + require.Equal(t, `{"duration":"1s"}`, string(bz)) +} + +func TestIndent(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " "}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + fmt.Println(string(bz)) + require.Equal(t, `{ + "type": "ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": 1, + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} + +func TestEnumAsString(t *testing.T) { + encoder := aminojson.NewEncoder(aminojson.EncoderOptions{Indent: " ", EnumAsString: true}) + + msg := &testpb.ABitOfEverything{ + Message: &testpb.NestedMessage{ + Foo: "test", + Bar: 0, // this is the default value and should be omitted from output + }, + Enum: testpb.AnEnum_ONE, + Repeated: []int32{3, -7, 2, 6, 4}, + Str: `abcxyz"foo"def`, + Bool: true, + Bytes: []byte{0, 1, 2, 3}, + I32: -15, + F32: 1001, + U32: 1200, + Si32: -376, + Sf32: -1000, + I64: 14578294827584932, + F64: 9572348124213523654, + U64: 4759492485, + Si64: -59268425823934, + Sf64: -659101379604211154, + } + + bz, err := encoder.Marshal(msg) + require.NoError(t, err) + fmt.Println(string(bz)) + require.Equal(t, `{ + "type": "ABitOfEverything", + "value": { + "bool": true, + "bytes": "AAECAw==", + "enum": "ONE", + "f32": 1001, + "f64": "9572348124213523654", + "i32": -15, + "i64": "14578294827584932", + "message": { + "foo": "test" + }, + "repeated": [ + 3, + -7, + 2, + 6, + 4 + ], + "sf32": -1000, + "sf64": "-659101379604211154", + "si32": -376, + "si64": "-59268425823934", + "str": "abcxyz\"foo\"def", + "u32": 1200, + "u64": "4759492485" + } +}`, string(bz)) +} diff --git a/x/tx/signing/aminojson/options.go b/x/tx/signing/aminojson/options.go index f8b8991d04db..0eecedb88731 100644 --- a/x/tx/signing/aminojson/options.go +++ b/x/tx/signing/aminojson/options.go @@ -2,6 +2,7 @@ package aminojson import ( cosmos_proto "github.com/cosmos/cosmos-proto" + gogoproto "github.com/cosmos/gogoproto/proto" "github.com/iancoleman/strcase" "github.com/pkg/errors" "google.golang.org/protobuf/proto" @@ -12,14 +13,38 @@ import ( // getMessageAminoName returns the amino name of a message if it has been set by the `amino.name` option. // If the message does not have an amino name, then the function returns false. -func getMessageAminoName(messageOptions proto.Message) (string, bool) { +func getMessageAminoName(msg protoreflect.Message) (string, bool) { + messageOptions := msg.Descriptor().Options() if proto.HasExtension(messageOptions, amino.E_Name) { name := proto.GetExtension(messageOptions, amino.E_Name) return name.(string), true } + return "", false } +// getMessageAminoName returns the amino name of a message if it has been set by the `amino.name` option. +// If the message does not have an amino name, then it returns the msg url. +// If it cannot get the msg url, then it returns false. +func getMessageAminoNameAny(msg protoreflect.Message) string { + messageOptions := msg.Descriptor().Options() + if proto.HasExtension(messageOptions, amino.E_Name) { + name := proto.GetExtension(messageOptions, amino.E_Name) + return name.(string) + } + + msgURL := "/" + string(msg.Descriptor().FullName()) + if msgURL != "/" { + return msgURL + } + + if m, ok := msg.(gogoproto.Message); ok { + return "/" + gogoproto.MessageName(m) + } + + return "" +} + // omitEmpty returns true if the field should be omitted if empty. Empty field omission is the default behavior. func omitEmpty(field protoreflect.FieldDescriptor) bool { opts := field.Options() @@ -64,7 +89,7 @@ func (enc Encoder) getMessageEncoder(message protoreflect.Message) MessageEncode opts := message.Descriptor().Options() if proto.HasExtension(opts, amino.E_MessageEncoding) { encoding := proto.GetExtension(opts, amino.E_MessageEncoding).(string) - if fn, ok := enc.messageEncoders[encoding]; ok { + if fn, ok := enc.aminoMessageEncoders[encoding]; ok { return fn } } @@ -75,13 +100,13 @@ func (enc Encoder) getFieldEncoding(field protoreflect.FieldDescriptor) FieldEnc opts := field.Options() if proto.HasExtension(opts, amino.E_Encoding) { encoding := proto.GetExtension(opts, amino.E_Encoding).(string) - if fn, ok := enc.fieldEncoders[encoding]; ok { + if fn, ok := enc.aminoFieldEncoders[encoding]; ok { return fn } } if proto.HasExtension(opts, cosmos_proto.E_Scalar) { scalar := proto.GetExtension(opts, cosmos_proto.E_Scalar).(string) - if fn, ok := enc.scalarEncoders[scalar]; ok { + if fn, ok := enc.cosmosProtoScalarEncoders[scalar]; ok { return fn } } diff --git a/x/tx/signing/aminojson/options_test.go b/x/tx/signing/aminojson/options_test.go new file mode 100644 index 000000000000..8038827f0f7f --- /dev/null +++ b/x/tx/signing/aminojson/options_test.go @@ -0,0 +1,30 @@ +package aminojson + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/x/tx/signing/aminojson/internal/testpb" +) + +func Test_getMessageAminoName(t *testing.T) { + msg := &testpb.ABitOfEverything{} + name, ok := getMessageAminoName(msg.ProtoReflect()) + require.True(t, ok) + require.Equal(t, "ABitOfEverything", name) + + secondMsg := &testpb.Duration{} + _, ok = getMessageAminoName(secondMsg.ProtoReflect()) + require.False(t, ok) +} + +func Test_getMessageAminoNameAny(t *testing.T) { + msg := &testpb.ABitOfEverything{} + name := getMessageAminoNameAny(msg.ProtoReflect()) + require.Equal(t, "ABitOfEverything", name) + + secondMsg := &testpb.Duration{} + name = getMessageAminoNameAny(secondMsg.ProtoReflect()) + require.Equal(t, "/testpb.Duration", name) +} diff --git a/x/tx/signing/aminojson/time.go b/x/tx/signing/aminojson/time.go index da02514c0255..9bfa035928e7 100644 --- a/x/tx/signing/aminojson/time.go +++ b/x/tx/signing/aminojson/time.go @@ -1,6 +1,7 @@ package aminojson import ( + "errors" "fmt" "io" "math" @@ -14,16 +15,17 @@ const ( nanosName protoreflect.Name = "nanos" ) -func marshalTimestamp(message protoreflect.Message, writer io.Writer) error { +// marshalTimestamp replicate https://github.com/tendermint/go-amino/blob/8e779b71f40d175cd1302d3cd41a75b005225a7a/json-encode.go#L45-L51 +func marshalTimestamp(_ *Encoder, message protoreflect.Message, writer io.Writer) error { fields := message.Descriptor().Fields() secondsField := fields.ByName(secondsName) if secondsField == nil { - return fmt.Errorf("expected seconds field") + return errors.New("expected seconds field") } nanosField := fields.ByName(nanosName) if nanosField == nil { - return fmt.Errorf("expected nanos field") + return errors.New("expected nanos field") } seconds := message.Get(secondsField).Int() @@ -48,11 +50,11 @@ func marshalTimestamp(message protoreflect.Message, writer io.Writer) error { // gogoproto encodes google.protobuf.Duration as a time.Duration, which is 64-bit signed integer. const MaxDurationSeconds = int64(math.MaxInt64)/1e9 - 1 -func marshalDuration(message protoreflect.Message, writer io.Writer) error { +func marshalDuration(_ *Encoder, message protoreflect.Message, writer io.Writer) error { fields := message.Descriptor().Fields() secondsField := fields.ByName(secondsName) if secondsField == nil { - return fmt.Errorf("expected seconds field") + return errors.New("expected seconds field") } // todo @@ -64,11 +66,11 @@ func marshalDuration(message protoreflect.Message, writer io.Writer) error { nanosField := fields.ByName(nanosName) if nanosField == nil { - return fmt.Errorf("expected nanos field") + return errors.New("expected nanos field") } nanos := message.Get(nanosField).Int() totalNanos := nanos + (seconds * 1e9) - _, err := writer.Write([]byte(fmt.Sprintf(`"%d"`, totalNanos))) + _, err := fmt.Fprintf(writer, `"%d"`, totalNanos) return err } diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index c4e99bdf2003..2d0a01be139d 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -14,6 +14,11 @@ import ( "cosmossdk.io/core/address" ) +type TypeResolver interface { + protoregistry.MessageTypeResolver + protoregistry.ExtensionTypeResolver +} + // Context is a context for retrieving the list of signers from a // message where signers are specified by the cosmos.msg.v1.signer protobuf // option. It also contains the ProtoFileResolver and address.Codec's used @@ -25,6 +30,7 @@ type Context struct { validatorAddressCodec address.Codec getSignersFuncs map[protoreflect.FullName]GetSignersFunc customGetSignerFuncs map[protoreflect.FullName]GetSignersFunc + maxRecursionDepth int } // Options are options for creating Context which will be used for signing operations. @@ -34,7 +40,7 @@ type Options struct { FileResolver ProtoFileResolver // TypeResolver is the protobuf type resolver to use for resolving message types. - TypeResolver protoregistry.MessageTypeResolver + TypeResolver TypeResolver // AddressCodec is the codec for converting addresses between strings and bytes. AddressCodec address.Codec @@ -42,7 +48,11 @@ type Options struct { // ValidatorAddressCodec is the codec for converting validator addresses between strings and bytes. ValidatorAddressCodec address.Codec + // CustomGetSigners is a map of message types to custom GetSignersFuncs. CustomGetSigners map[protoreflect.FullName]GetSignersFunc + + // MaxRecursionDepth is the maximum depth of nested messages that will be traversed + MaxRecursionDepth int } // DefineCustomGetSigners defines a custom GetSigners function for a given @@ -85,6 +95,10 @@ func NewContext(options Options) (*Context, error) { return nil, errors.New("validator address codec is required") } + if options.MaxRecursionDepth <= 0 { + options.MaxRecursionDepth = 32 + } + customGetSignerFuncs := map[protoreflect.FullName]GetSignersFunc{} for k := range options.CustomGetSigners { customGetSignerFuncs[k] = options.CustomGetSigners[k] @@ -97,6 +111,7 @@ func NewContext(options Options) (*Context, error) { validatorAddressCodec: options.ValidatorAddressCodec, getSignersFuncs: map[protoreflect.FullName]GetSignersFunc{}, customGetSignerFuncs: customGetSignerFuncs, + maxRecursionDepth: options.MaxRecursionDepth, } return c, nil @@ -203,92 +218,85 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor) } } case protoreflect.MessageKind: - isList := field.IsList() - nestedMessage := field.Message() - nestedSignersFields, err := getSignersFieldNames(nestedMessage) - if err != nil { - return nil, err - } - - if len(nestedSignersFields) != 1 { - return nil, fmt.Errorf("nested cosmos.msg.v1.signer option in message %s must contain only one value", nestedMessage.FullName()) - } - - nestedFieldName := nestedSignersFields[0] - nestedField := nestedMessage.Fields().ByName(protoreflect.Name(nestedFieldName)) - nestedIsList := nestedField.IsList() - if nestedField == nil { - return nil, fmt.Errorf("field %s not found in message %s", nestedFieldName, nestedMessage.FullName()) - } - - if nestedField.Kind() != protoreflect.StringKind || nestedField.IsMap() || nestedField.HasOptionalKeyword() { - return nil, fmt.Errorf("nested signer field %s in message %s must be a simple string", nestedFieldName, nestedMessage.FullName()) - } - - addrCdc := c.getAddressCodec(nestedField) - - if isList { - if nestedIsList { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - msgs := msg.ProtoReflect().Get(field).List() - m := msgs.Len() - for i := 0; i < m; i++ { - signers := msgs.Get(i).Message().Get(nestedField).List() - n := signers.Len() - for j := 0; j < n; j++ { - addrStr := signers.Get(j).String() - addrBz, err := addrCdc.StringToBytes(addrStr) - if err != nil { - return nil, err - } - arr = append(arr, addrBz) - } - } - return arr, nil - } - } else { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - msgs := msg.ProtoReflect().Get(field).List() - m := msgs.Len() - for i := 0; i < m; i++ { - addrStr := msgs.Get(i).Message().Get(nestedField).String() - addrBz, err := addrCdc.StringToBytes(addrStr) + var fieldGetter func(protoreflect.Message, int) ([][]byte, error) + fieldGetter = func(msg protoreflect.Message, depth int) ([][]byte, error) { + if depth > c.maxRecursionDepth { + return nil, errors.New("maximum recursion depth exceeded") + } + desc := msg.Descriptor() + signerFields, err := getSignersFieldNames(desc) + if err != nil { + return nil, err + } + if len(signerFields) != 1 { + return nil, fmt.Errorf("nested cosmos.msg.v1.signer option in message %s must contain only one value", desc.FullName()) + } + signerFieldName := signerFields[0] + childField := desc.Fields().ByName(protoreflect.Name(signerFieldName)) + switch { + case childField.Kind() == protoreflect.MessageKind: + if childField.IsList() { + childMsgs := msg.Get(childField).List() + var arr [][]byte + for i := 0; i < childMsgs.Len(); i++ { + res, err := fieldGetter(childMsgs.Get(i).Message(), depth+1) if err != nil { return nil, err } - arr = append(arr, addrBz) + arr = append(arr, res...) } return arr, nil } - } - } else { - if nestedIsList { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - nestedMsg := msg.ProtoReflect().Get(field).Message() - signers := nestedMsg.Get(nestedField).List() - n := signers.Len() - for j := 0; j < n; j++ { - addrStr := signers.Get(j).String() + return fieldGetter(msg.Get(childField).Message(), depth+1) + case childField.IsMap() || childField.HasOptionalKeyword(): + return nil, fmt.Errorf("cosmos.msg.v1.signer field %s in message %s must not be a map or optional", signerFieldName, desc.FullName()) + case childField.Kind() == protoreflect.StringKind: + addrCdc := c.getAddressCodec(childField) + if childField.IsList() { + childMsgs := msg.Get(childField).List() + n := childMsgs.Len() + var res [][]byte + for i := 0; i < n; i++ { + addrStr := childMsgs.Get(i).String() addrBz, err := addrCdc.StringToBytes(addrStr) if err != nil { return nil, err } - arr = append(arr, addrBz) + res = append(res, addrBz) } - return arr, nil + return res, nil } - } else { - fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { - addrStr := msg.ProtoReflect().Get(field).Message().Get(nestedField).String() - addrBz, err := addrCdc.StringToBytes(addrStr) + addrStr := msg.Get(childField).String() + addrBz, err := addrCdc.StringToBytes(addrStr) + if err != nil { + return nil, err + } + return [][]byte{addrBz}, nil + } + return nil, fmt.Errorf("unexpected field type %s for field %s in message %s, only string and message type are supported", + childField.Kind(), signerFieldName, desc.FullName()) + } + + fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { + if field.IsList() { + signers := msg.ProtoReflect().Get(field).List() + n := signers.Len() + for i := 0; i < n; i++ { + res, err := fieldGetter(signers.Get(i).Message(), 0) if err != nil { return nil, err } - return append(arr, addrBz), nil + arr = append(arr, res...) } + } else { + res, err := fieldGetter(msg.ProtoReflect().Get(field).Message(), 0) + if err != nil { + return nil, err + } + arr = append(arr, res...) } + return arr, nil } - default: return nil, fmt.Errorf("unexpected field type %s for field %s in message %s", field.Kind(), fieldName, descriptor.FullName()) } diff --git a/x/tx/signing/context_test.go b/x/tx/signing/context_test.go index 0be18c98914b..d8c2b370333a 100644 --- a/x/tx/signing/context_test.go +++ b/x/tx/signing/context_test.go @@ -14,6 +14,43 @@ import ( "cosmossdk.io/x/tx/internal/testpb" ) +var deeplyNestedRepeatedSigner = &testpb.DeeplyNestedRepeatedSigner{ + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("foo")), hex.EncodeToString([]byte("bar"))}, + }, + }, + }, + }, + }, + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner{ + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("baz"))}, + }, + }, + }, + { + Inner: []*testpb.DeeplyNestedRepeatedSigner_Inner_Inner_Bottom{ + { + Signer: []string{hex.EncodeToString([]byte("qux")), hex.EncodeToString([]byte("fuz"))}, + }, + { + Signer: []string{hex.EncodeToString([]byte("bing")), hex.EncodeToString([]byte("bap"))}, + }, + }, + }, + }, + }, + }, +} + func TestGetSigners(t *testing.T) { ctx, err := NewContext(Options{ AddressCodec: dummyAddressCodec{}, @@ -88,7 +125,18 @@ func TestGetSigners(t *testing.T) { want: [][]byte{[]byte("foo"), []byte("bar")}, }, { - name: "nested repeated", + name: "deeply nested", + msg: &testpb.DeeplyNestedSigner{ + InnerOne: &testpb.DeeplyNestedSigner_InnerOne{ + InnerTwo: &testpb.DeeplyNestedSigner_InnerOne_InnerTwo{ + Signer: hex.EncodeToString([]byte("foo")), + }, + }, + }, + want: [][]byte{[]byte("foo")}, + }, + { + name: "nested repeated #1", msg: &testpb.NestedRepeatedSigner{Inner: &testpb.NestedRepeatedSigner_Inner{ Signer: []string{ hex.EncodeToString([]byte("foo")), @@ -97,6 +145,11 @@ func TestGetSigners(t *testing.T) { }}, want: [][]byte{[]byte("foo"), []byte("bar")}, }, + { + name: "nested repeated #2", + msg: deeplyNestedRepeatedSigner, + want: [][]byte{[]byte("foo"), []byte("bar"), []byte("baz"), []byte("qux"), []byte("fuz"), []byte("bing"), []byte("bap")}, + }, { name: "repeated nested repeated", msg: &testpb.RepeatedNestedRepeatedSigner{Inner: []*testpb.RepeatedNestedRepeatedSigner_Inner{ @@ -145,6 +198,27 @@ func TestGetSigners(t *testing.T) { } } +func TestMaxRecursionDepth(t *testing.T) { + ctx, err := NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + MaxRecursionDepth: 1, + }) + require.NoError(t, err) + + _, err = ctx.GetSigners(deeplyNestedRepeatedSigner) + require.ErrorContains(t, err, "maximum recursion depth exceeded") + + ctx, err = NewContext(Options{ + AddressCodec: dummyAddressCodec{}, + ValidatorAddressCodec: dummyValidatorAddressCodec{}, + MaxRecursionDepth: 5, + }) + require.NoError(t, err) + _, err = ctx.GetSigners(deeplyNestedRepeatedSigner) + require.NoError(t, err) +} + func TestDefineCustomGetSigners(t *testing.T) { customMsg := &testpb.Ballot{} signers := [][]byte{[]byte("foo")} diff --git a/x/tx/signing/direct/direct.go b/x/tx/signing/direct/direct.go index 420daf6012ef..57e005981010 100644 --- a/x/tx/signing/direct/direct.go +++ b/x/tx/signing/direct/direct.go @@ -10,6 +10,11 @@ import ( "cosmossdk.io/x/tx/signing" ) +var ( + _ signing.SignModeHandler = SignModeHandler{} + protov2MarshalOpts = proto.MarshalOptions{Deterministic: true} +) + // SignModeHandler is the SIGN_MODE_DIRECT implementation of signing.SignModeHandler. type SignModeHandler struct{} @@ -20,12 +25,10 @@ func (h SignModeHandler) Mode() signingv1beta1.SignMode { // GetSignBytes implements signing.SignModeHandler.GetSignBytes. func (SignModeHandler) GetSignBytes(_ context.Context, signerData signing.SignerData, txData signing.TxData) ([]byte, error) { - return proto.Marshal(&txv1beta1.SignDoc{ + return protov2MarshalOpts.Marshal(&txv1beta1.SignDoc{ BodyBytes: txData.BodyBytes, AuthInfoBytes: txData.AuthInfoBytes, ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, }) } - -var _ signing.SignModeHandler = SignModeHandler{} diff --git a/x/tx/signing/directaux/direct_aux.go b/x/tx/signing/directaux/direct_aux.go index 2ed0f149e353..fbc56b670888 100644 --- a/x/tx/signing/directaux/direct_aux.go +++ b/x/tx/signing/directaux/direct_aux.go @@ -2,6 +2,7 @@ package directaux import ( "context" + "errors" "fmt" "github.com/cosmos/cosmos-proto/anyutil" @@ -34,7 +35,7 @@ func NewSignModeHandler(options SignModeHandlerOptions) (SignModeHandler, error) h := SignModeHandler{} if options.SignersContext == nil { - return h, fmt.Errorf("signers context is required") + return h, errors.New("signers context is required") } h.signersContext = options.SignersContext @@ -60,7 +61,7 @@ func (h SignModeHandler) Mode() signingv1beta1.SignMode { // https://github.com/cosmos/cosmos-sdk/blob/4a6a1e3cb8de459891cb0495052589673d14ef51/x/auth/tx/builder.go#L142 func (h SignModeHandler) getFirstSigner(txData signing.TxData) ([]byte, error) { if len(txData.Body.Messages) == 0 { - return nil, fmt.Errorf("no signer found") + return nil, errors.New("no signer found") } msg, err := anyutil.Unpack(txData.Body.Messages[0], h.fileResolver, h.typeResolver) @@ -100,7 +101,8 @@ func (h SignModeHandler) GetSignBytes( ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, Sequence: signerData.Sequence, - Tip: txData.AuthInfo.Tip, //nolint:staticcheck // keep it for compatibility } - return proto.Marshal(signDocDirectAux) + + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + return protov2MarshalOpts.Marshal(signDocDirectAux) } diff --git a/x/tx/signing/directaux/direct_aux_test.go b/x/tx/signing/directaux/direct_aux_test.go index 7a1d8a9df7ef..00c48222aa89 100644 --- a/x/tx/signing/directaux/direct_aux_test.go +++ b/x/tx/signing/directaux/direct_aux_test.go @@ -54,7 +54,6 @@ func TestDirectAuxHandler(t *testing.T) { GasLimit: 20000, Payer: feePayerAddr, } - tip := &txv1beta1.Tip{Amount: []*basev1beta1.Coin{{Denom: "tip-token", Amount: "10"}}} //nolint:staticcheck // we still need this deprecated struct txBody := &txv1beta1.TxBody{ Messages: []*anypb.Any{msg}, @@ -63,7 +62,6 @@ func TestDirectAuxHandler(t *testing.T) { authInfo := &txv1beta1.AuthInfo{ Fee: fee, - Tip: tip, SignerInfos: signerInfo, } @@ -113,7 +111,6 @@ func TestDirectAuxHandler(t *testing.T) { } authInfoWithNoFeePayer := &txv1beta1.AuthInfo{ Fee: feeWithNoPayer, - Tip: tip, SignerInfos: signerInfo, } authInfoWithNoFeePayerBz, err := proto.Marshal(authInfoWithNoFeePayer) @@ -139,7 +136,6 @@ func TestDirectAuxHandler(t *testing.T) { ChainId: chainID, AccountNumber: accNum, Sequence: accSeq, - Tip: tip, } expectedSignBytes, err := proto.Marshal(signDocDirectAux) require.NoError(t, err) diff --git a/x/tx/signing/testutil/util.go b/x/tx/signing/testutil/util.go index 17a79cda3295..dfa265992a35 100644 --- a/x/tx/signing/testutil/util.go +++ b/x/tx/signing/testutil/util.go @@ -17,7 +17,6 @@ type HandlerArgumentOptions struct { Msg proto.Message AccNum uint64 AccSeq uint64 - Tip *txv1beta1.Tip //nolint:staticcheck // we still need this deprecated struct Fee *txv1beta1.Fee SignerAddress string } @@ -57,15 +56,16 @@ func MakeHandlerArguments(options HandlerArgumentOptions) (signing.SignerData, s authInfo := &txv1beta1.AuthInfo{ Fee: options.Fee, - Tip: options.Tip, SignerInfos: signerInfo, } - bodyBz, err := proto.Marshal(txBody) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + bodyBz, err := protov2MarshalOpts.Marshal(txBody) if err != nil { return signing.SignerData{}, signing.TxData{}, err } - authInfoBz, err := proto.Marshal(authInfo) + + authInfoBz, err := protov2MarshalOpts.Marshal(authInfo) if err != nil { return signing.SignerData{}, signing.TxData{}, err } diff --git a/x/tx/signing/textual/any.go b/x/tx/signing/textual/any.go index 7818fb27e4d1..3770969dc580 100644 --- a/x/tx/signing/textual/any.go +++ b/x/tx/signing/textual/any.go @@ -2,6 +2,7 @@ package textual import ( "context" + "errors" "fmt" "strings" @@ -74,7 +75,7 @@ func (ar anyValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([] // Parse implements the ValueRenderer interface. func (ar anyValueRenderer) Parse(ctx context.Context, screens []Screen) (protoreflect.Value, error) { if len(screens) == 0 { - return nilValue, fmt.Errorf("expect at least one screen") + return nilValue, errors.New("expect at least one screen") } if screens[0].Indent != 0 { return nilValue, fmt.Errorf("bad indentation: want 0, got %d", screens[0].Indent) @@ -82,7 +83,7 @@ func (ar anyValueRenderer) Parse(ctx context.Context, screens []Screen) (protore typeURL := screens[0].Content msgType, err := ar.tr.typeResolver.FindMessageByURL(typeURL) - if err == protoregistry.NotFound { + if errors.Is(err, protoregistry.NotFound) { // If the proto v2 registry doesn't have this message, then we use // protoFiles (which can e.g. be initialized to gogo's MergedRegistry) // to retrieve the message descriptor, and then use dynamicpb on that diff --git a/x/tx/signing/textual/coin_test.go b/x/tx/signing/textual/coin_test.go index 8ebdad6c85f9..07af1841f9b4 100644 --- a/x/tx/signing/textual/coin_test.go +++ b/x/tx/signing/textual/coin_test.go @@ -3,6 +3,7 @@ package textual_test import ( "context" "encoding/json" + "errors" "fmt" "os" "testing" @@ -55,7 +56,7 @@ func TestMetadataQuerier(t *testing.T) { require.Error(t, err) // Errors if metadata querier returns an error - expErr := fmt.Errorf("mock error") + expErr := errors.New("mock error") txt, err := textual.NewSignModeHandler(textual.SignModeOptions{ CoinMetadataQuerier: func(_ context.Context, _ string) (*bankv1beta1.Metadata, error) { return nil, expErr diff --git a/x/tx/signing/textual/coins.go b/x/tx/signing/textual/coins.go index 049b13421429..2bcd8230905d 100644 --- a/x/tx/signing/textual/coins.go +++ b/x/tx/signing/textual/coins.go @@ -2,14 +2,15 @@ package textual import ( "context" + "errors" "fmt" + "sort" "strings" "google.golang.org/protobuf/reflect/protoreflect" bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - corecoins "cosmossdk.io/core/coins" "cosmossdk.io/math" ) @@ -32,7 +33,7 @@ var _ RepeatedValueRenderer = coinsValueRenderer{} func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]Screen, error) { if vr.coinMetadataQuerier == nil { - return nil, fmt.Errorf("expected non-nil coin metadata querier") + return nil, errors.New("expected non-nil coin metadata querier") } // Since this value renderer has a FormatRepeated method, the Format one @@ -48,7 +49,7 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ( return nil, err } - formatted, err := corecoins.FormatCoins([]*basev1beta1.Coin{coin}, []*bankv1beta1.Metadata{metadata}) + formatted, err := FormatCoins([]*basev1beta1.Coin{coin}, []*bankv1beta1.Metadata{metadata}) if err != nil { return nil, err } @@ -58,7 +59,7 @@ func (vr coinsValueRenderer) Format(ctx context.Context, v protoreflect.Value) ( func (vr coinsValueRenderer) FormatRepeated(ctx context.Context, v protoreflect.Value) ([]Screen, error) { if vr.coinMetadataQuerier == nil { - return nil, fmt.Errorf("expected non-nil coin metadata querier") + return nil, errors.New("expected non-nil coin metadata querier") } protoCoins := v.List() @@ -76,7 +77,7 @@ func (vr coinsValueRenderer) FormatRepeated(ctx context.Context, v protoreflect. } } - formatted, err := corecoins.FormatCoins(coins, metadatas) + formatted, err := FormatCoins(coins, metadatas) if err != nil { return nil, err } @@ -217,3 +218,92 @@ func parseCoin(coinStr string, metadata *bankv1beta1.Metadata) (*basev1beta1.Coi Denom: baseDenom, }, nil } + +// formatCoin formats a sdk.Coin into a value-rendered string, using the +// given metadata about the denom. It returns the formatted coin string, the +// display denom, and an optional error. +func formatCoin(coin *basev1beta1.Coin, metadata *bankv1beta1.Metadata) (string, error) { + coinDenom := coin.Denom + + // Return early if no display denom or display denom is the current coin denom. + if metadata == nil || metadata.Display == "" || coinDenom == metadata.Display { + vr, err := math.FormatDec(coin.Amount) + return vr + " " + coin.Denom, err + } + + dispDenom := metadata.Display + + // Find exponents of both denoms. + var coinExp, dispExp uint32 + foundCoinExp, foundDispExp := false, false + for _, unit := range metadata.DenomUnits { + if coinDenom == unit.Denom { + coinExp = unit.Exponent + foundCoinExp = true + } + if dispDenom == unit.Denom { + dispExp = unit.Exponent + foundDispExp = true + } + } + + // If we didn't find either exponent, then we return early. + if !foundCoinExp || !foundDispExp { + vr, err := math.FormatInt(coin.Amount) + return vr + " " + coin.Denom, err + } + + dispAmount, err := math.LegacyNewDecFromStr(coin.Amount) + if err != nil { + return "", err + } + + if coinExp > dispExp { + dispAmount = dispAmount.Mul(math.LegacyNewDec(10).Power(uint64(coinExp - dispExp))) + } else { + dispAmount = dispAmount.Quo(math.LegacyNewDec(10).Power(uint64(dispExp - coinExp))) + } + + vr, err := math.FormatDec(dispAmount.String()) + return vr + " " + dispDenom, err +} + +// FormatCoins formats Coins into a value-rendered string, which uses +// `formatCoin` separated by ", " (a comma and a space), and sorted +// alphabetically by value-rendered denoms. It expects an array of metadata +// (optionally nil), where each metadata at index `i` MUST match the coin denom +// at the same index. +func FormatCoins(coins []*basev1beta1.Coin, metadata []*bankv1beta1.Metadata) (string, error) { + if len(coins) != len(metadata) { + return "", fmt.Errorf("formatCoins expect one metadata for each coin; expected %d, got %d", len(coins), len(metadata)) + } + + formatted := make([]string, len(coins)) + for i, coin := range coins { + var err error + formatted[i], err = formatCoin(coin, metadata[i]) + if err != nil { + return "", err + } + + // If a coin contains a comma, return an error given that the output + // could be misinterpreted by the user as 2 different coins. + if strings.Contains(formatted[i], ",") { + return "", fmt.Errorf("coin %s contains a comma", formatted[i]) + } + } + + if len(coins) == 0 { + return emptyCoins, nil + } + + // Sort the formatted coins by display denom. + sort.SliceStable(formatted, func(i, j int) bool { + denomI := strings.Split(formatted[i], " ")[1] + denomJ := strings.Split(formatted[j], " ")[1] + + return denomI < denomJ + }) + + return strings.Join(formatted, ", "), nil +} diff --git a/x/tx/signing/textual/coins_test.go b/x/tx/signing/textual/coins_test.go index 35c7c4c27ad3..c9e1bbf6dd7a 100644 --- a/x/tx/signing/textual/coins_test.go +++ b/x/tx/signing/textual/coins_test.go @@ -66,12 +66,13 @@ func TestCoinsJSONTestcases(t *testing.T) { // rendering, so we lose initial Coins ordering. Instead, we just check // set equality using a map. func checkCoinsEqual(t *testing.T, l1, l2 protoreflect.List) { + t.Helper() require.Equal(t, l1.Len(), l2.Len()) coinsMap := make(map[string]*basev1beta1.Coin, l1.Len()) for i := 0; i < l1.Len(); i++ { coin, ok := l1.Get(i).Message().Interface().(*basev1beta1.Coin) - require.True(t, ok) + require.True(t, ok, "not a *basev1beta1.Coin: %#v", l1.Get(i).Message().Interface()) coinsMap[coin.Denom] = coin } @@ -85,12 +86,13 @@ func checkCoinsEqual(t *testing.T, l1, l2 protoreflect.List) { } func checkCoinEqual(t *testing.T, coin, coin1 *basev1beta1.Coin) { + t.Helper() require.Equal(t, coin1.Denom, coin.Denom) v, ok := math.NewIntFromString(coin.Amount) require.True(t, ok) v1, ok := math.NewIntFromString(coin1.Amount) require.True(t, ok) - require.True(t, v.Equal(v1)) + require.True(t, v.Equal(v1), "Mismatch\n\tv: %+v\n\tv1: %+v", v, v1) } // coinsJSONTest is the type of test cases in the testdata file. @@ -104,3 +106,64 @@ type coinsJSONTest struct { Text string Error bool } + +// formatCoinJSONTest is the type of test cases in the coin.json file. +type formatCoinJSONTest struct { + Proto *basev1beta1.Coin + Metadata *bankv1beta1.Metadata + Text string + Error bool +} + +func TestFormatCoin(t *testing.T) { + var testcases []formatCoinJSONTest + raw, err := os.ReadFile("./internal/testdata/coin.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc.Text, func(t *testing.T) { + if tc.Proto != nil { + out, err := textual.FormatCoins([]*basev1beta1.Coin{tc.Proto}, []*bankv1beta1.Metadata{tc.Metadata}) + + if tc.Error { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.Text, out) + } + }) + } +} + +func TestFormatCoins(t *testing.T) { + var testcases []coinsJSONTest + raw, err := os.ReadFile("./internal/testdata/coins.json") + require.NoError(t, err) + err = json.Unmarshal(raw, &testcases) + require.NoError(t, err) + + for _, tc := range testcases { + t.Run(tc.Text, func(t *testing.T) { + if tc.Proto != nil { + metadata := make([]*bankv1beta1.Metadata, len(tc.Proto)) + for i, coin := range tc.Proto { + metadata[i] = tc.Metadata[coin.Denom] + } + + out, err := textual.FormatCoins(tc.Proto, metadata) + + if tc.Error { + require.Error(t, err) + return + } + + require.NoError(t, err) + require.Equal(t, tc.Text, out) + } + }) + } +} diff --git a/x/tx/signing/textual/dec_test.go b/x/tx/signing/textual/dec_test.go index defb6d9cc509..f8c7b3ebe2f4 100644 --- a/x/tx/signing/textual/dec_test.go +++ b/x/tx/signing/textual/dec_test.go @@ -38,6 +38,7 @@ func TestDecJSONTestcases(t *testing.T) { } func checkDecTest(t *testing.T, r textual.ValueRenderer, pv protoreflect.Value, expected string) { + t.Helper() screens, err := r.Format(context.Background(), pv) require.NoError(t, err) require.Len(t, screens, 1) diff --git a/x/tx/signing/textual/e2e_test.go b/x/tx/signing/textual/e2e_test.go index 1f6dc09b66a5..e759d403f446 100644 --- a/x/tx/signing/textual/e2e_test.go +++ b/x/tx/signing/textual/e2e_test.go @@ -71,6 +71,10 @@ func TestE2EJSONTestcases(t *testing.T) { AuthInfoBytes: authInfoBz, }) require.NoError(t, err) + decodeWant, err := hex.DecodeString(tc.Cbor) + require.NoError(t, err) + t.Log("got: " + string(signDoc)) + t.Log("want " + string(decodeWant)) require.Equal(t, tc.Cbor, hex.EncodeToString(signDoc)) }) } diff --git a/x/tx/signing/textual/fuzz_test.go b/x/tx/signing/textual/fuzz_test.go index 81e2fbb867b4..bdbf1be24397 100644 --- a/x/tx/signing/textual/fuzz_test.go +++ b/x/tx/signing/textual/fuzz_test.go @@ -1,14 +1,20 @@ package textual_test import ( + "bytes" "context" "encoding/json" "os" + "regexp" "testing" + "github.com/google/go-cmp/cmp" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/testing/protocmp" tspb "google.golang.org/protobuf/types/known/timestamppb" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/x/tx/internal/testpb" "cosmossdk.io/x/tx/signing/textual" ) @@ -101,3 +107,195 @@ func FuzzTimestampJSONParseToParseRoundTrip(f *testing.F) { } }) } + +func FuzzBytesValueRendererParse(f *testing.F) { + // 1. Generate some seeds from testdata. + seed, err := os.ReadFile("./internal/testdata/bytes.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + tr, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) + if err != nil { + f.Fatal(err) + } + + ctx := context.Background() + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []bytesTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + rend, err := tr.GetFieldValueRenderer(fieldDescriptorFromName("BYTES")) + if err != nil { + t.Fatal(err) + } + + screens, err := rend.Format(ctx, protoreflect.ValueOfBytes(tc.base64)) + if err != nil { + t.Fatal(err) + } + if g, w := len(screens), 1; g != w { + t.Fatalf("Mismatch screen count: got=%d, want=%d", g, w) + } + + // Round trip and test. + val, err := rend.Parse(ctx, screens) + if err != nil { + t.Fatal(err) + } + if g, w := len(tc.base64), 35; g > w { + if len(val.Bytes()) != 0 { + t.Fatalf("val.Bytes() != 0:\n\tGot: % x", val.Bytes()) + } + } else if !bytes.Equal(tc.base64, val.Bytes()) { + t.Fatalf("val.Bytes() mismatch:\n\tGot: % x\n\tWant: % x", val.Bytes(), tc.base64) + } + } + }) +} + +func FuzzMessageValueRendererParse(f *testing.F) { + if testing.Short() { + f.Skip() + } + + // 1. Use the seeds from testdata and mutate them. + seed, err := os.ReadFile("./internal/testdata/message.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + ctx := context.Background() + tr, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: EmptyCoinMetadataQuerier}) + if err != nil { + f.Fatalf("Failed to create SignModeHandler: %v", err) + } + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []messageJSONTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + rend := textual.NewMessageValueRenderer(tr, (&testpb.Foo{}).ProtoReflect().Descriptor()) + + var screens []textual.Screen + var err error + + if tc.Proto != nil { + screens, err = rend.Format(ctx, protoreflect.ValueOf(tc.Proto.ProtoReflect())) + if err != nil { + continue + } + } + + val, err := rend.Parse(ctx, screens) + if err != nil { + continue + } + + msg := val.Message().Interface() + gotMsg, ok := msg.(*testpb.Foo) + if !ok { + t.Fatalf("Wrong type for Foo: %T", msg) + } + diff := cmp.Diff(gotMsg, tc.Proto, protocmp.Transform()) + if diff != "" { + t.Fatalf("Roundtrip mismatch\n\tGot: %#v\n\tWant: %#v", gotMsg, tc.Proto) + } + } + }) +} + +// Copied from types/coin.go but pasted in here so as to avoid any imports +// of that package as has been mandated by team decisions. +var ( + reCoinDenom = regexp.MustCompile(`[a-zA-Z][a-zA-Z0-9/:._-]{2,127}`) + reCoinAmount = regexp.MustCompile(`[[:digit:]]+(?:\.[[:digit:]]+)?|\.[[:digit:]]+`) +) + +func FuzzCoinsJSONTestcases(f *testing.F) { + f.Skip() // https://github.com/cosmos/cosmos-sdk/pull/16521#issuecomment-1614507574 + + // Generate some seeds. + seed, err := os.ReadFile("./internal/testdata/coins.json") + if err != nil { + f.Fatal(err) + } + f.Add(seed) + + txt, err := textual.NewSignModeHandler(textual.SignModeOptions{CoinMetadataQuerier: mockCoinMetadataQuerier}) + if err != nil { + f.Fatal(err) + } + rend, err := txt.GetFieldValueRenderer(fieldDescriptorFromName("COINS")) + if err != nil { + f.Fatal(err) + } + vrr := rend.(textual.RepeatedValueRenderer) + + f.Fuzz(func(t *testing.T, input []byte) { + var testCases []coinsJSONTest + if err := json.Unmarshal(input, &testCases); err != nil { + return + } + + for _, tc := range testCases { + if tc.Proto == nil { + continue + } + + // Create a context.Context containing all coins metadata, to simulate + // that they are in state. + ctx := context.Background() + for _, v := range tc.Metadata { + ctx = addMetadataToContext(ctx, v) + } + + listValue := NewGenericList(tc.Proto) + screens, err := vrr.FormatRepeated(ctx, protoreflect.ValueOf(listValue)) + if err != nil { + cpt := tc.Proto[0] + likeEmpty := err.Error() == "cannot format empty string" || err.Error() == "decimal string cannot be empty" + if likeEmpty && (!reCoinDenom.MatchString(cpt.Denom) || cpt.Amount == "") { + return + } + if !reCoinDenom.MatchString(cpt.Denom) { + return + } + if !reCoinAmount.MatchString(cpt.Amount) { + return + } + t.Fatalf("%v\n%q\n%#v => %t", err, tc.Text, cpt, cpt.Amount == "") + } + + if g, w := len(screens), 1; g != w { + t.Fatalf("Screens mismatch: got=%d want=%d", g, w) + } + + wantContent := tc.Text + if wantContent == "" { + wantContent = "zero" + } + if false { + if g, w := screens[0].Content, wantContent; g != w { + t.Fatalf("Content mismatch:\n\tGot: %s\n\tWant: %s", g, w) + } + } + + // Round trip. + parsedValue := NewGenericList([]*basev1beta1.Coin{}) + if err := vrr.ParseRepeated(ctx, screens, parsedValue); err != nil { + return + } + checkCoinsEqual(t, listValue, parsedValue) + } + }) +} diff --git a/x/tx/signing/textual/handler.go b/x/tx/signing/textual/handler.go index 5d7768227a28..67ab53a5c095 100644 --- a/x/tx/signing/textual/handler.go +++ b/x/tx/signing/textual/handler.go @@ -3,6 +3,7 @@ package textual import ( "bytes" "context" + "errors" "fmt" "reflect" @@ -67,7 +68,7 @@ type SignModeHandler struct { // NewSignModeHandler returns a new SignModeHandler which generates sign bytes and provides value renderers. func NewSignModeHandler(o SignModeOptions) (*SignModeHandler, error) { if o.CoinMetadataQuerier == nil { - return nil, fmt.Errorf("coinMetadataQuerier must be non-empty") + return nil, errors.New("coinMetadataQuerier must be non-empty") } if o.FileResolver == nil { o.FileResolver = protoregistry.GlobalFiles @@ -134,7 +135,7 @@ func (r *SignModeHandler) GetFieldValueRenderer(fd protoreflect.FieldDescriptor) } if fd.IsMap() { - return nil, fmt.Errorf("value renderers cannot format value of type map") + return nil, errors.New("value renderers cannot format value of type map") } return NewMessageValueRenderer(r, md), nil case fd.Kind() == protoreflect.BoolKind: diff --git a/x/tx/signing/textual/int_test.go b/x/tx/signing/textual/int_test.go index 2767a2430c06..100ec3097157 100644 --- a/x/tx/signing/textual/int_test.go +++ b/x/tx/signing/textual/int_test.go @@ -78,6 +78,7 @@ func TestIntJSONTestcases(t *testing.T) { // checkNumberTest checks that the output of a number value renderer // matches the expected string. Only use it to test numbers. func checkNumberTest(t *testing.T, r textual.ValueRenderer, pv protoreflect.Value, expected string) { + t.Helper() screens, err := r.Format(context.Background(), pv) require.NoError(t, err) require.Len(t, screens, 1) diff --git a/x/tx/signing/textual/internal/testdata/coin.json b/x/tx/signing/textual/internal/testdata/coin.json index 1a1ac79b9306..02231d2d712e 100644 --- a/x/tx/signing/textual/internal/testdata/coin.json +++ b/x/tx/signing/textual/internal/testdata/coin.json @@ -327,5 +327,10 @@ {"text":"", "error": true}, {"text":"1COSM", "error": true}, {"text":"1 COSM", "error": true}, - {"text":" 1 COSM", "error": true} + {"text":" 1 COSM", "error": true}, + { + "proto": {"amount": "10000000", "denom": "point, 222222 point"}, + "metadata": {"display": "POINT", "base": "point", "denom_units": [{"denom": "point", "exponent": 0}, {"denom": "POINT", "exponent": 0}]}, + "error": true + } ] diff --git a/x/tx/signing/textual/internal/testdata/e2e.json b/x/tx/signing/textual/internal/testdata/e2e.json index 49f5c6effdb3..2ab0e30f5b96 100644 --- a/x/tx/signing/textual/internal/testdata/e2e.json +++ b/x/tx/signing/textual/internal/testdata/e2e.json @@ -286,13 +286,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -344,8 +337,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -381,8 +372,8 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ], - "cbor": "a101983fa20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a201635469700277302e30322041544f4d2c2033302730303020756f736d6fa2016654697070657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b683574a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278403765613032653866306261656432646239363965326439616534646335316661333131313632353962643432383937353838303732666166306562623464326504f5" + "cbor": "a101983da20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278406537626537383038646534393835626436303938313164326133323830356362323333633136386337643234376436316433376634613664643463663361326104f5" } ] diff --git a/x/tx/signing/textual/internal/testdata/tx.json b/x/tx/signing/textual/internal/testdata/tx.json index c071d08eec28..bbafe3b14120 100644 --- a/x/tx/signing/textual/internal/testdata/tx.json +++ b/x/tx/signing/textual/internal/testdata/tx.json @@ -299,13 +299,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -357,8 +350,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -394,7 +385,7 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ] } ] diff --git a/x/tx/signing/textual/internal/textualpb/textual.proto b/x/tx/signing/textual/internal/textualpb/textual.proto index efd8d35275bd..cddfc99d6e6b 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.proto +++ b/x/tx/signing/textual/internal/textualpb/textual.proto @@ -77,8 +77,6 @@ message Envelope { repeated cosmos.base.v1beta1.Coin fees = 8; string fee_payer = 9; string fee_granter = 10; - repeated cosmos.base.v1beta1.Coin tip = 11; - string tipper = 12; uint64 gas_limit = 13; uint64 timeout_height = 14; repeated cosmos.tx.v1beta1.SignerInfo other_signer = 15; diff --git a/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf b/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf new file mode 100644 index 000000000000..f16030abe365 --- /dev/null +++ b/x/tx/signing/textual/testdata/fuzz/FuzzCoinsJSONTestcases/4d81af7cc74558bf @@ -0,0 +1,2 @@ +go test fuzz v1 +[]byte("[{\"proto\":[{\"Amount\":\"0\"},{\"Amount\":\"1\"}]}]") diff --git a/x/tx/signing/textual/timestamp_test.go b/x/tx/signing/textual/timestamp_test.go index c3f047401ec5..65d2a99a9323 100644 --- a/x/tx/signing/textual/timestamp_test.go +++ b/x/tx/signing/textual/timestamp_test.go @@ -43,6 +43,7 @@ func TestTimestampJsonTestcasesExtraneousNanos(t *testing.T) { } func testTimestampJSONTestcases(t *testing.T, raw []byte) { + t.Helper() var testcases []timestampJSONTest err := json.Unmarshal(raw, &testcases) require.NoError(t, err) diff --git a/x/tx/signing/textual/tx.go b/x/tx/signing/textual/tx.go index 0b2c64d84aec..501189e3e5d6 100644 --- a/x/tx/signing/textual/tx.go +++ b/x/tx/signing/textual/tx.go @@ -83,10 +83,7 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S NonCriticalExtensionOptions: txBody.NonCriticalExtensionOptions, HashOfRawBytes: getHash(textualData.BodyBytes, textualData.AuthInfoBytes), } - if txAuthInfo.Tip != nil { //nolint:staticcheck // we still need this deprecated struct - envelope.Tip = txAuthInfo.Tip.Amount //nolint:staticcheck // we still need this deprecated struct - envelope.Tipper = txAuthInfo.Tip.Tipper //nolint:staticcheck // we still need this deprecated struct - } + // Find all other tx signers than the current signer. In the case where our // Textual signer is one key of a multisig, then otherSigners will include // the multisig pubkey. @@ -243,12 +240,6 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref Granter: envelope.FeeGranter, }, } - if envelope.Tip != nil { - authInfo.Tip = &txv1beta1.Tip{ //nolint:staticcheck // we still need this deprecated struct - Amount: envelope.Tip, - Tipper: envelope.Tipper, - } - } // Figure out the signers in the correct order. signers, err := getSigners(txBody, authInfo) @@ -281,11 +272,12 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref // Note that we might not always get back the exact bodyBz and authInfoBz // that was passed into, because protobuf is not deterministic. // In tests, we don't check bytes equality, but protobuf object equality. - bodyBz, err := proto.Marshal(txBody) + protov2MarshalOpts := proto.MarshalOptions{Deterministic: true} + bodyBz, err := protov2MarshalOpts.Marshal(txBody) if err != nil { return nilValue, err } - authInfoBz, err := proto.Marshal(authInfo) + authInfoBz, err := protov2MarshalOpts.Marshal(authInfo) if err != nil { return nilValue, err } diff --git a/x/tx/signing/textual/tx_test.go b/x/tx/signing/textual/tx_test.go index f12b0d01384f..47acb0a8bec8 100644 --- a/x/tx/signing/textual/tx_test.go +++ b/x/tx/signing/textual/tx_test.go @@ -117,6 +117,7 @@ func TestTxJSONTestcases(t *testing.T) { // createTextualData creates a Textual data give then JSON // test case. func createTextualData(t *testing.T, jsonTx txJSONTestTx, jsonSignerData json.RawMessage) (*txv1beta1.TxBody, []byte, *txv1beta1.AuthInfo, []byte, signing.SignerData) { + t.Helper() body := &txv1beta1.TxBody{} authInfo := &txv1beta1.AuthInfo{} protoSignerData := &textualpb.SignerData{} From e8854d5aada636deebb4274f692ce9bb6bc21919 Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 10 Apr 2024 11:50:34 +0800 Subject: [PATCH 22/37] Problem: automatic signer getter don't support bytes field (#276) Solution: - support bytes fields to support MsgEthereumTx Update CHANGELOG.md Signed-off-by: yihuang fix test move changelog --- x/tx/CHANGELOG.md | 4 ++ x/tx/internal/testpb/signers.proto | 4 +- x/tx/internal/testpb/signers.pulsar.go | 56 +++++++++----------------- x/tx/signing/context.go | 6 +++ 4 files changed, 31 insertions(+), 39 deletions(-) diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index 4d475d2c64d0..1ddbcc1631b1 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -31,6 +31,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* [#276](https://github.com/crypto-org-chain/cosmos-sdk/pull/276) Support bytes in automatic signer getters. + ## v0.13.1 ### Features diff --git a/x/tx/internal/testpb/signers.proto b/x/tx/internal/testpb/signers.proto index 63eb38cba43b..7244a3657400 100644 --- a/x/tx/internal/testpb/signers.proto +++ b/x/tx/internal/testpb/signers.proto @@ -92,7 +92,7 @@ message DeeplyNestedRepeatedSigner { message BadSigner { option (cosmos.msg.v1.signer) = "signer"; - bytes signer = 1; + int32 signer = 1; } message NoSignerOption { @@ -107,4 +107,4 @@ message ValidatorSigner { service TestSimpleSigner { option (cosmos.msg.v1.service) = true; rpc TestSimpleSigner(SimpleSigner) returns (SimpleSigner) {} -} \ No newline at end of file +} diff --git a/x/tx/internal/testpb/signers.pulsar.go b/x/tx/internal/testpb/signers.pulsar.go index f6e3a3d081c1..91de409223b3 100644 --- a/x/tx/internal/testpb/signers.pulsar.go +++ b/x/tx/internal/testpb/signers.pulsar.go @@ -7900,8 +7900,8 @@ func (x *fastReflection_BadSigner) Interface() protoreflect.ProtoMessage { // While iterating, mutating operations may only be performed // on the current field descriptor. func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { - if len(x.Signer) != 0 { - value := protoreflect.ValueOfBytes(x.Signer) + if x.Signer != int32(0) { + value := protoreflect.ValueOfInt32(x.Signer) if !f(fd_BadSigner_signer, value) { return } @@ -7922,7 +7922,7 @@ func (x *fastReflection_BadSigner) Range(f func(protoreflect.FieldDescriptor, pr func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { switch fd.FullName() { case "BadSigner.signer": - return len(x.Signer) != 0 + return x.Signer != int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) @@ -7940,7 +7940,7 @@ func (x *fastReflection_BadSigner) Has(fd protoreflect.FieldDescriptor) bool { func (x *fastReflection_BadSigner) Clear(fd protoreflect.FieldDescriptor) { switch fd.FullName() { case "BadSigner.signer": - x.Signer = nil + x.Signer = int32(0) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) @@ -7959,7 +7959,7 @@ func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) switch descriptor.FullName() { case "BadSigner.signer": value := x.Signer - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfInt32(value) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) @@ -7981,7 +7981,7 @@ func (x *fastReflection_BadSigner) Get(descriptor protoreflect.FieldDescriptor) func (x *fastReflection_BadSigner) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { switch fd.FullName() { case "BadSigner.signer": - x.Signer = value.Bytes() + x.Signer = int32(value.Int()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) @@ -8018,7 +8018,7 @@ func (x *fastReflection_BadSigner) Mutable(fd protoreflect.FieldDescriptor) prot func (x *fastReflection_BadSigner) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { case "BadSigner.signer": - return protoreflect.ValueOfBytes(nil) + return protoreflect.ValueOfInt32(int32(0)) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: BadSigner")) @@ -8088,9 +8088,8 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { var n int var l int _ = l - l = len(x.Signer) - if l > 0 { - n += 1 + l + runtime.Sov(uint64(l)) + if x.Signer != 0 { + n += 1 + runtime.Sov(uint64(x.Signer)) } if x.unknownFields != nil { n += len(x.unknownFields) @@ -8121,12 +8120,10 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if len(x.Signer) > 0 { - i -= len(x.Signer) - copy(dAtA[i:], x.Signer) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Signer))) + if x.Signer != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.Signer)) i-- - dAtA[i] = 0xa + dAtA[i] = 0x8 } if input.Buf != nil { input.Buf = append(input.Buf, dAtA...) @@ -8178,10 +8175,10 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } switch fieldNum { case 1: - if wireType != 2 { + if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Signer", wireType) } - var byteLen int + x.Signer = 0 for shift := uint(0); ; shift += 7 { if shift >= 64 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow @@ -8191,26 +8188,11 @@ func (x *fastReflection_BadSigner) ProtoMethods() *protoiface.Methods { } b := dAtA[iNdEx] iNdEx++ - byteLen |= int(b&0x7F) << shift + x.Signer |= int32(b&0x7F) << shift if b < 0x80 { break } } - if byteLen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + byteLen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - x.Signer = append(x.Signer[:0], dAtA[iNdEx:postIndex]...) - if x.Signer == nil { - x.Signer = []byte{} - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -9386,7 +9368,7 @@ type BadSigner struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Signer []byte `protobuf:"bytes,1,opt,name=signer,proto3" json:"signer,omitempty"` + Signer int32 `protobuf:"varint,1,opt,name=signer,proto3" json:"signer,omitempty"` } func (x *BadSigner) Reset() { @@ -9409,11 +9391,11 @@ func (*BadSigner) Descriptor() ([]byte, []int) { return file_signers_proto_rawDescGZIP(), []int{8} } -func (x *BadSigner) GetSigner() []byte { +func (x *BadSigner) GetSigner() int32 { if x != nil { return x.Signer } - return nil + return 0 } type NoSignerOption struct { @@ -9885,7 +9867,7 @@ var file_signers_proto_rawDesc = []byte{ 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x3a, 0x0a, 0x82, 0xe7, 0xb0, 0x2a, 0x05, 0x69, 0x6e, 0x6e, 0x65, 0x72, 0x22, 0x30, 0x0a, 0x09, 0x42, 0x61, 0x64, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x73, - 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x06, 0x73, 0x69, 0x67, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x3a, 0x0b, 0x82, 0xe7, 0xb0, 0x2a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x22, 0x28, 0x0a, 0x0e, 0x4e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, diff --git a/x/tx/signing/context.go b/x/tx/signing/context.go index 2d0a01be139d..259ee81a399d 100644 --- a/x/tx/signing/context.go +++ b/x/tx/signing/context.go @@ -297,6 +297,12 @@ func (c *Context) makeGetSignersFunc(descriptor protoreflect.MessageDescriptor) } return arr, nil } + case protoreflect.BytesKind: + fieldGetters[i] = func(msg proto.Message, arr [][]byte) ([][]byte, error) { + addrBz := msg.ProtoReflect().Get(field).Bytes() + return append(arr, addrBz), nil + } + default: return nil, fmt.Errorf("unexpected field type %s for field %s in message %s", field.Kind(), fieldName, descriptor.FullName()) } From ab87a3a1f8eac1205205a72ea6621f4c231f3304 Mon Sep 17 00:00:00 2001 From: yihuang Date: Mon, 15 Apr 2024 17:30:38 +0800 Subject: [PATCH 23/37] fix: bootstrap-state command can't parse latest genesis format (#289) Update CHANGELOG.md cleanup upstream merged --- CHANGELOG.md | 1 + go.mod | 10 +++++----- go.sum | 20 ++++++++++---------- server/cmt_cmds.go | 2 +- 4 files changed, 17 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 021533364551..c58b5416df74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (crypto) [#19691](https://github.com/cosmos/cosmos-sdk/pull/19745) Fix tx sign doesn't throw an error when incorrect Ledger is used. +* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. ### Features diff --git a/go.mod b/go.mod index cf4eb93e189a..6fab0108b7fc 100644 --- a/go.mod +++ b/go.mod @@ -18,7 +18,7 @@ require ( github.com/chzyer/readline v1.5.1 github.com/cockroachdb/apd/v2 v2.0.2 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.4 @@ -53,7 +53,7 @@ require ( github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 - golang.org/x/crypto v0.19.0 + golang.org/x/crypto v0.21.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 golang.org/x/sync v0.6.0 google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 @@ -150,9 +150,9 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.18.0 // indirect + golang.org/x/term v0.18.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect diff --git a/go.sum b/go.sum index 2dcc7475ba29..d8eb94d4d496 100644 --- a/go.sum +++ b/go.sum @@ -131,8 +131,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= +github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -765,8 +765,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= +golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -821,8 +821,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -897,15 +897,15 @@ 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= +golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= 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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= +golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= diff --git a/server/cmt_cmds.go b/server/cmt_cmds.go index 71563ee674c3..359a1554bccc 100644 --- a/server/cmt_cmds.go +++ b/server/cmt_cmds.go @@ -381,7 +381,7 @@ func BootstrapStateCmd(appCreator types.AppCreator) *cobra.Command { height = app.CommitMultiStore().LastCommitID().Version } - return node.BootstrapState(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, uint64(height), nil) + return node.BootstrapStateWithGenProvider(cmd.Context(), cfg, cmtcfg.DefaultDBProvider, getGenDocProvider(cfg), uint64(height), nil) }, } From 0108877a3201281be96ea501d7872c64f923a330 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Mon, 15 Apr 2024 18:51:51 +0800 Subject: [PATCH 24/37] Release/v0.50.x backport (#298) * fix(x/bank): align query with multi denoms for send-enabled (#20028) * fix(client/v2): respect output format from client ctx (#20033) --- CHANGELOG.md | 4 ++++ client/v2/CHANGELOG.md | 1 + client/v2/autocli/common.go | 16 ++++++++++++++-- x/bank/autocli.go | 2 +- 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c58b5416df74..bb86c24d7c1a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#261](https://github.com/crypto-org-chain/cosmos-sdk/pull/261) `ctx.BlockHeader` don't do protobuf deep copy, shallow copy seems enough, reduce scope of mutex in `PriorityNonceMempool.Remove`. +### Bug Fixes + +* (x/bank) [#20028](https://github.com/cosmos/cosmos-sdk/pull/20028) Align query with multi denoms for send-enabled. + ## [Unreleased-Upstream] ### Bug Fixes diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 4aac3deaf2c1..555a5bbfa6bf 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -49,6 +49,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19377](https://github.com/cosmos/cosmos-sdk/pull/19377) Partly fix comment parsing in autocli. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Simplify key flag parsing logic in flag handler. +* [#20033](https://github.com/cosmos/cosmos-sdk/pull/20033) Respect output format from client ctx. ## [v2.0.0-beta.1] - 2023-11-07 diff --git a/client/v2/autocli/common.go b/client/v2/autocli/common.go index 4c9a8f07dc2b..de5cc523434a 100644 --- a/client/v2/autocli/common.go +++ b/client/v2/autocli/common.go @@ -10,6 +10,8 @@ import ( autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" "cosmossdk.io/client/v2/internal/flags" "cosmossdk.io/client/v2/internal/util" + + "github.com/cosmos/cosmos-sdk/client" ) type cmdType int @@ -225,11 +227,21 @@ func enhanceCustomCmd(builder *Builder, cmd *cobra.Command, cmdType cmdType, mod // outOrStdoutFormat formats the output based on the output flag and writes it to the command's output stream. func (b *Builder) outOrStdoutFormat(cmd *cobra.Command, out []byte) error { + clientCtx := client.Context{} + if v := cmd.Context().Value(client.ClientContextKey); v != nil { + clientCtx = *(v.(*client.Context)) + } + flagSet := cmd.Flags() + if clientCtx.OutputFormat == "" || flagSet.Changed(flags.FlagOutput) { + output, _ := flagSet.GetString(flags.FlagOutput) + clientCtx = clientCtx.WithOutputFormat(output) + } + var err error - outputType := cmd.Flag(flags.FlagOutput) + outputType := clientCtx.OutputFormat // if the output type is text, convert the json to yaml // if output type is json or nil, default to json - if outputType != nil && outputType.Value.String() == flags.OutputFormatText { + if outputType == flags.OutputFormatText { out, err = yaml.JSONToYAML(out) if err != nil { return err diff --git a/x/bank/autocli.go b/x/bank/autocli.go index 4224dbafacd1..6c421ab0aa42 100644 --- a/x/bank/autocli.go +++ b/x/bank/autocli.go @@ -82,7 +82,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { To look up one or more specific denoms, supply them as arguments to this command. To look up all denoms, do not provide any arguments.`, ), - PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms"}}, + PositionalArgs: []*autocliv1.PositionalArgDescriptor{{ProtoField: "denoms", Varargs: true}}, }, }, }, From 8d30134159e069cc6a487677df639273c797ecbf Mon Sep 17 00:00:00 2001 From: mmsqe Date: Mon, 3 Jun 2024 11:55:22 +0800 Subject: [PATCH 25/37] feat: expose db keyring used in the keystore (#384) --- CHANGELOG.md | 1 + crypto/keyring/keyring.go | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bb86c24d7c1a..fe5c8be2ea67 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,6 +47,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#248](https://github.com/crypto-org-chain/cosmos-sdk/pull/248) Init btree store lazily to save allocations when no content insert into it. * [#252](https://github.com/crypto-org-chain/cosmos-sdk/pull/252) Add `BlockGasWanted` to `Context` to support feemarket module. * [#269](https://github.com/crypto-org-chain/cosmos-sdk/pull/269) Add `StreamingManager` to baseapp to extend the abci listeners. +* (crypto/keyring) [#20212](https://github.com/cosmos/cosmos-sdk/pull/20212) Expose the db keyring used in the keystore. ### Improvements diff --git a/crypto/keyring/keyring.go b/crypto/keyring/keyring.go index 554ff61e43a7..beab8f874532 100644 --- a/crypto/keyring/keyring.go +++ b/crypto/keyring/keyring.go @@ -58,6 +58,10 @@ var ( type Keyring interface { // Get the backend type used in the keyring config: "file", "os", "kwallet", "pass", "test", "memory". Backend() string + + // Get the db keyring used in the keystore. + DB() keyring.Keyring + // List all keys. List() ([]*Record, error) @@ -256,6 +260,11 @@ func (ks keystore) Backend() string { return ks.backend } +// DB returns the db keyring used in the keystore +func (ks keystore) DB() keyring.Keyring { + return ks.db +} + func (ks keystore) ExportPubKeyArmor(uid string) (string, error) { k, err := ks.Key(uid) if err != nil { From cf12e5ad62e46bb73edf24d4a572d36b033dcc56 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 4 Jun 2024 18:03:18 +0800 Subject: [PATCH 26/37] Problem: v0.50.x is outdated (#392) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * build(deps): Bump github.com/cosmos/gogoproto from 1.4.11 to 1.4.12 (#19811) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * feat(x/gov): emit proposer address in submit proposal event (backport #19842) (#19844) Co-authored-by: Aryan Tikarya Co-authored-by: marbar3778 Co-authored-by: Julien Robert * feat(x/gov): emit depositor in `proposal_deposit` event (backport #19853) (#19859) Co-authored-by: Kien Co-authored-by: Julien Robert * reuse fromAddrString (minor cleanup) (#19881) * feat(client): replace `event-query-tx-for` with `wait-tx` (backport #19870) (#19887) * feat(server): add custom start handler (backport #19854) (#19884) Co-authored-by: Julien Robert * build(deps): Bump cosmossdk.io/store from 1.0.2 to 1.1.0 (#19810) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: marbar3778 Co-authored-by: Julien Robert * docs(x/mint): Fix inconsistency in mint docs (backport #19915) (#19925) * build(deps): Bump github.com/cosmos/iavl from 1.1.1 to 1.1.2 (#19985) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julien Robert * fix(client/v2): add encoder for `cosmos.base.v1beta1.DecCoin` (backport #19976) (#20001) Co-authored-by: Julien Robert * fix(mempool): use no-op mempool as default (backport #19970) (#20008) Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com> Co-authored-by: marbar3778 Co-authored-by: Julien Robert * feat: Conditionally emit metrics based on enablement (backport #19903) (#20017) Co-authored-by: Lucas Francisco López Co-authored-by: Julien Robert * fix(x/bank): align query with multi denoms for send-enabled (backport #20028) (#20029) Co-authored-by: mmsqe * fix: Implement gogoproto customtype to secp256r1 keys (backport #20027) (#20031) Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> * fix(client/v2): respect output format from client ctx (backport #20033) (#20046) Co-authored-by: mmsqe * build(deps): Bump cosmossdk.io/x/tx from 0.13.1 to 0.13.2 (#20042) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Julien Robert * feat(x/bank): support depinject for send restrictions (backport #20014) (#20024) * fix(baseapp): don't share global gas meter in tx execution (backport #19616) (#20050) * fix: secp256r1 json missing quotes (backport #20060) (#20069) Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> * build(deps): Bump github.com/cosmos/cosmos-proto from 1.0.0-beta.4 to 1.0.0-beta.5 (#20095) * feat(client/v2): implement version filtering using annotation (backport #20083) (#20099) Co-authored-by: Julien Robert * chore: prepare v0.50.6 (#19998) * fix: use timestamp for sim log file name (backport #20108) (#20111) Co-authored-by: mmsqe * fix(x/authz,x/feegrant): check blocked address (#20102) * chore: update v0.50.6 release notes (#20124) * build(deps): bump sdk in modules (#20126) * docs(gas/fees): Update block gas documentation (backport #20128) (#20131) Co-authored-by: samricotta <37125168+samricotta@users.noreply.github.com> * fix(baseapp): avoid header height overwrite block height (backport #20107) (#20129) Co-authored-by: mmsqe Co-authored-by: Julien Robert * docs: fix broken link (backport #20133) (#20138) * build(deps): bump modules in simapp (#20137) * build(deps): Bump cosmossdk.io/x/tx from 0.13.2 to 0.13.3 (#20152) * docs: add authz reference info in the circuit antehandler (backport #20146) (#20155) Co-authored-by: Reece Williams <31943163+Reecepbcups@users.noreply.github.com> * fix(testsuite/sims): set all signatures (backport #20151) (#20185) Co-authored-by: Leon <156270887+leonz789@users.noreply.github.com> * build(deps): Bump github.com/cometbft/cometbft from 0.38.6 to 0.38.7 (#20206) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> * fix(server): bootstrap-state command can't parse latest genesis format (backport #20020) (#20045) Co-authored-by: yihuang Co-authored-by: Julien Robert Co-authored-by: sontrinh16 Co-authored-by: marbar3778 * fix: remove txs from mempool when antehandler fails in recheck (backport #20144) (#20251) Co-authored-by: Marko * fix resolve * align dependencies --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> Co-authored-by: Aryan Tikarya Co-authored-by: marbar3778 Co-authored-by: Julien Robert Co-authored-by: Kien Co-authored-by: yihuang Co-authored-by: Tom <54514587+GAtom22@users.noreply.github.com> Co-authored-by: Lucas Francisco López Co-authored-by: Facundo Medica <14063057+facundomedica@users.noreply.github.com> Co-authored-by: samricotta <37125168+samricotta@users.noreply.github.com> Co-authored-by: Reece Williams <31943163+Reecepbcups@users.noreply.github.com> Co-authored-by: Leon <156270887+leonz789@users.noreply.github.com> Co-authored-by: sontrinh16 Co-authored-by: Marko --- CHANGELOG.md | 35 +- RELEASE_NOTES.md | 15 +- api/cosmos/bank/module/v1/module.pulsar.go | 177 ++- api/go.mod | 20 +- api/go.sum | 40 +- baseapp/abci.go | 7 +- baseapp/abci_test.go | 113 +- baseapp/abci_utils.go | 4 +- baseapp/baseapp.go | 18 +- baseapp/baseapp_test.go | 27 +- baseapp/grpcserver.go | 3 - baseapp/options.go | 10 + client/cmd.go | 13 +- client/cmd_test.go | 26 +- client/debug/main.go | 41 +- client/rpc/tx.go | 98 +- client/v2/CHANGELOG.md | 5 + client/v2/README.md | 15 +- client/v2/autocli/common.go | 19 +- client/v2/autocli/flag/builder.go | 4 - client/v2/autocli/msg.go | 8 +- client/v2/autocli/query.go | 48 +- client/v2/go.mod | 57 +- client/v2/go.sum | 117 +- client/v2/internal/buf.lock | 22 +- client/v2/internal/testpb/msg.proto | 13 +- client/v2/internal/testpb/msg.pulsar.go | 1000 ++++++++++++++--- client/v2/internal/testpb/msg_grpc.pb.go | 39 +- client/v2/internal/testpb/query.pulsar.go | 170 +-- client/v2/internal/util/util.go | 27 +- client/v2/internal/util/util_test.go | 135 +-- collections/go.mod | 6 +- collections/go.sum | 12 +- core/go.mod | 16 +- core/go.sum | 34 +- crypto/keys/secp256r1/privkey.go | 25 + .../keys/secp256r1/privkey_internal_test.go | 11 + crypto/keys/secp256r1/pubkey.go | 38 + crypto/keys/secp256r1/pubkey_internal_test.go | 11 + .../build/building-apps/03-app-upgrade.md | 4 +- docs/docs/build/building-modules/00-intro.md | 9 + .../05-protobuf-annotations.md | 16 +- docs/docs/learn/advanced/01-transactions.md | 6 +- docs/docs/learn/advanced/05-encoding.md | 8 +- docs/docs/learn/beginner/00-app-anatomy.md | 2 +- docs/docs/learn/beginner/01-tx-lifecycle.md | 78 +- docs/docs/learn/beginner/04-gas-fees.md | 20 +- go.mod | 50 +- go.sum | 104 +- orm/go.mod | 16 +- orm/go.sum | 34 +- proto/cosmos/bank/module/v1/module.proto | 8 +- runtime/app.go | 1 + runtime/builder.go | 1 + runtime/module.go | 5 +- runtime/store.go | 4 + server/config/config.go | 2 +- server/config/toml.go | 2 +- server/start.go | 43 +- server/util.go | 29 + simapp/go.mod | 64 +- simapp/go.sum | 128 +-- simapp/simd/cmd/commands.go | 16 +- simapp/simd/cmd/root.go | 2 +- simapp/simd/cmd/root_v2.go | 2 +- store/CHANGELOG.md | 4 + store/cache/cache_test.go | 11 +- store/go.mod | 32 +- store/go.sum | 70 +- store/iavl/store.go | 3 +- store/iavl/store_test.go | 21 +- store/iavl/tree.go | 4 +- store/iavl/tree_test.go | 3 +- store/prefix/store_test.go | 3 +- store/wrapper/wrapper.go | 34 + telemetry/metrics.go | 15 +- telemetry/metrics_test.go | 3 +- telemetry/wrapper.go | 37 + telemetry/wrapper_test.go | 51 + tests/go.mod | 64 +- tests/go.sum | 128 +-- testutil/sims/tx_helpers.go | 8 +- tools/confix/data/v0.50-app.toml | 4 +- tools/confix/go.mod | 55 +- tools/confix/go.sum | 117 +- tools/cosmovisor/go.mod | 28 +- tools/cosmovisor/go.sum | 56 +- tools/hubl/go.mod | 26 +- tools/hubl/go.sum | 52 +- types/mempool/mempool_test.go | 2 +- types/mempool/sender_nonce.go | 2 +- types/mempool/sender_nonce_test.go | 4 +- x/auth/tx/service.go | 4 +- x/authz/expected_keepers.go | 1 + x/authz/keeper/keeper.go | 8 + x/authz/keeper/keeper_test.go | 4 +- x/authz/keeper/msg_server.go | 4 + x/authz/module/module.go | 2 +- x/authz/testutil/expected_keepers_mocks.go | 14 + x/bank/README.md | 5 + x/bank/module.go | 46 +- x/bank/types/restrictions.go | 3 + x/circuit/CHANGELOG.md | 9 + x/circuit/ante/circuit.go | 4 + x/circuit/go.mod | 53 +- x/circuit/go.sum | 113 +- x/circuit/module.go | 4 - x/consensus/keeper/keeper.go | 20 +- x/consensus/keeper/keeper_test.go | 125 ++- x/crisis/abci.go | 3 +- x/crisis/module.go | 4 - x/distribution/abci.go | 4 +- x/evidence/CHANGELOG.md | 9 +- x/evidence/go.mod | 53 +- x/evidence/go.sum | 113 +- x/evidence/keeper/abci.go | 3 +- x/feegrant/CHANGELOG.md | 11 + x/feegrant/expected_keepers.go | 1 + x/feegrant/go.mod | 53 +- x/feegrant/go.sum | 113 +- x/feegrant/keeper/keeper.go | 12 + x/feegrant/keeper/keeper_test.go | 6 +- x/feegrant/module/module.go | 2 +- x/feegrant/testutil/expected_keepers_mocks.go | 14 + x/gov/abci.go | 2 +- x/gov/autocli.go | 2 +- x/gov/keeper/deposit.go | 1 + x/gov/keeper/proposal.go | 1 + x/gov/types/events.go | 2 + x/mint/README.md | 22 +- x/mint/abci.go | 3 +- x/nft/CHANGELOG.md | 9 + x/nft/go.mod | 53 +- x/nft/go.sum | 113 +- x/simulation/log.go | 2 +- x/slashing/abci.go | 3 +- x/staking/keeper/abci.go | 5 +- x/tx/go.mod | 8 +- x/tx/go.sum | 16 +- x/upgrade/CHANGELOG.md | 7 + x/upgrade/abci.go | 3 +- x/upgrade/go.mod | 57 +- x/upgrade/go.sum | 121 +- 143 files changed, 3363 insertions(+), 1857 deletions(-) create mode 100644 store/wrapper/wrapper.go create mode 100644 telemetry/wrapper_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index fe5c8be2ea67..deb213d41b9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -52,6 +52,14 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements * [#261](https://github.com/crypto-org-chain/cosmos-sdk/pull/261) `ctx.BlockHeader` don't do protobuf deep copy, shallow copy seems enough, reduce scope of mutex in `PriorityNonceMempool.Remove`. +* (debug) [#20328](https://github.com/cosmos/cosmos-sdk/pull/20328) Add consensus address for debug cmd. +* (runtime) [#20264](https://github.com/cosmos/cosmos-sdk/pull/20264) Expose grpc query router via depinject. +* (x/consensus) [#20381](https://github.com/cosmos/cosmos-sdk/pull/20381) Use Comet utility for consensus module consensus param updates. +* (client) [#20356](https://github.com/cosmos/cosmos-sdk/pull/20356) Overwrite client context when available in `SetCmdClientContext`. +* (baseapp) [#20346](https://github.com/cosmos/cosmos-sdk/pull/20346) Correctly assign `execModeSimulate` to context for `simulateTx`. +* (baseapp) [#20144](https://github.com/cosmos/cosmos-sdk/pull/20144) Remove txs from mempool when antehandler fails in recheck. +* (baseapp) [#20107](https://github.com/cosmos/cosmos-sdk/pull/20107) Avoid header height overwrite block height. +* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. ### Bug Fixes @@ -59,14 +67,31 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased-Upstream] -### Bug Fixes - -* (crypto) [#19691](https://github.com/cosmos/cosmos-sdk/pull/19745) Fix tx sign doesn't throw an error when incorrect Ledger is used. -* (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. - ### Features * (types) [#19759](https://github.com/cosmos/cosmos-sdk/pull/19759) Align SignerExtractionAdapter in PriorityNonceMempool Remove. +* (client) [#19870](https://github.com/cosmos/cosmos-sdk/pull/19870) Add new query command `wait-tx`. Alias `event-query-tx-for` to `wait-tx` for backward compatibility. + +### Improvements + +* (telemetry) [#19903](https://github.com/cosmos/cosmos-sdk/pull/19903) Conditionally emit metrics based on enablement. + * **Introduction of `Now` Function**: Added a new function called `Now` to the telemetry package. It returns the current system time if telemetry is enabled, or a zero time if telemetry is not enabled. + * **Atomic Global Variable**: Implemented an atomic global variable to manage the state of telemetry's enablement. This ensures thread safety for the telemetry state. + * **Conditional Telemetry Emission**: All telemetry functions have been updated to emit metrics only when telemetry is enabled. They perform a check with `isTelemetryEnabled()` and return early if telemetry is disabled, minimizing unnecessary operations and overhead. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade prometheus version and fix API breaking change due to prometheus bump. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. +* (server) [#19884](https://github.com/cosmos/cosmos-sdk/pull/19884) Add start customizability to start command options. +* (x/gov) [#19853](https://github.com/cosmos/cosmos-sdk/pull/19853) Emit `depositor` in `EventTypeProposalDeposit`. +* (x/gov) [#19844](https://github.com/cosmos/cosmos-sdk/pull/19844) Emit the proposer of governance proposals. +* (baseapp) [#19616](https://github.com/cosmos/cosmos-sdk/pull/19616) Don't share gas meter in tx execution. + +## Bug Fixes + +* (x/authz) [#20114](https://github.com/cosmos/cosmos-sdk/pull/20114) Follow up of [GHSA-4j93-fm92-rp4m](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-4j93-fm92-rp4m) for `x/authz`. +* (crypto) [#19691](https://github.com/cosmos/cosmos-sdk/pull/19745) Fix tx sign doesn't throw an error when incorrect Ledger is used. +* (baseapp) [#19970](https://github.com/cosmos/cosmos-sdk/pull/19970) Fix default config values to use no-op mempool as default. +* (crypto) [#20027](https://github.com/cosmos/cosmos-sdk/pull/20027) secp256r1 keys now implement gogoproto's customtype interface. +* (x/bank) [#20028](https://github.com/cosmos/cosmos-sdk/pull/20028) Align query with multi denoms for send-enabled. ## [v0.50.5](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.5) - 2024-03-12 diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 0b0d46e5874a..bdb1c0d02ae9 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,22 +1,19 @@ -# Cosmos SDK v0.50.5 Release Notes +# Cosmos SDK v0.50.6 Release Notes 💬 [**Release Discussion**](https://github.com/orgs/cosmos/discussions/58) ## 🚀 Highlights -This is time for another patch release of Cosmos SDK Eden. -This release includes a few notable fixes: +For this month patch release of the v0.50.x line, a few features and improvements were added to the SDK. -* Fix a bypass delegator slashing: [GHSA-86h5-xcpx-cfqc](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-86h5-xcpx-cfqc) -* Fix an issue in `baseapp.ValidateVoteExtensions` helper: [GHSA-95rx-m9m5-m94v](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-95rx-m9m5-m94v) -* Allow to provide custom signers for `x/auth/tx` using depinject +Notably, we added and fixed the following: -We recommended to upgrade to this patch release as soon as possible. -When upgrading from <= v0.50.4, please ensure that 2/3 of the validator power upgrade to v0.50.5. +* Add start customizability to start command options. Customize how an application starts with the new `StartCommandHandler` field in `server.StartCmdOptions` struct. +* Fixing [GHSA-4j93-fm92-rp4m](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-4j93-fm92-rp4m) in `x/feegrant` and `x/authz` modules. The upgrade instuctions were provided in the [v0.50.4 release notes](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.4). ## 📝 Changelog -Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.50.5/CHANGELOG.md) for an exhaustive list of changes, or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/release/v0.50.4...v0.50.5) from the last release. +Check out the [changelog](https://github.com/cosmos/cosmos-sdk/blob/v0.50.6/CHANGELOG.md) for an exhaustive list of changes, or [compare changes](https://github.com/cosmos/cosmos-sdk/compare/release/v0.50.5...v0.50.6) from the last release. Refer to the [upgrading guide](https://github.com/cosmos/cosmos-sdk/blob/release/v0.50.x/UPGRADING.md) when migrating from `v0.47.x` to `v0.50.1`. Note, that the next SDK release, v0.51, will not include `x/params` migration, when migrating from < v0.47, v0.50.x **or** v0.47.x, is a mandatory migration. diff --git a/api/cosmos/bank/module/v1/module.pulsar.go b/api/cosmos/bank/module/v1/module.pulsar.go index 11bf65722555..89966594fde7 100644 --- a/api/cosmos/bank/module/v1/module.pulsar.go +++ b/api/cosmos/bank/module/v1/module.pulsar.go @@ -59,10 +59,57 @@ func (x *_Module_1_list) IsValid() bool { return x.list != nil } +var _ protoreflect.List = (*_Module_3_list)(nil) + +type _Module_3_list struct { + list *[]string +} + +func (x *_Module_3_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_Module_3_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfString((*x.list)[i]) +} + +func (x *_Module_3_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + (*x.list)[i] = concreteValue +} + +func (x *_Module_3_list) Append(value protoreflect.Value) { + valueUnwrapped := value.String() + concreteValue := valueUnwrapped + *x.list = append(*x.list, concreteValue) +} + +func (x *_Module_3_list) AppendMutable() protoreflect.Value { + panic(fmt.Errorf("AppendMutable can not be called on message Module at list field RestrictionsOrder as it is not of Message kind")) +} + +func (x *_Module_3_list) Truncate(n int) { + *x.list = (*x.list)[:n] +} + +func (x *_Module_3_list) NewElement() protoreflect.Value { + v := "" + return protoreflect.ValueOfString(v) +} + +func (x *_Module_3_list) IsValid() bool { + return x.list != nil +} + var ( md_Module protoreflect.MessageDescriptor fd_Module_blocked_module_accounts_override protoreflect.FieldDescriptor fd_Module_authority protoreflect.FieldDescriptor + fd_Module_restrictions_order protoreflect.FieldDescriptor ) func init() { @@ -70,6 +117,7 @@ func init() { md_Module = File_cosmos_bank_module_v1_module_proto.Messages().ByName("Module") fd_Module_blocked_module_accounts_override = md_Module.Fields().ByName("blocked_module_accounts_override") fd_Module_authority = md_Module.Fields().ByName("authority") + fd_Module_restrictions_order = md_Module.Fields().ByName("restrictions_order") } var _ protoreflect.Message = (*fastReflection_Module)(nil) @@ -149,6 +197,12 @@ func (x *fastReflection_Module) Range(f func(protoreflect.FieldDescriptor, proto return } } + if len(x.RestrictionsOrder) != 0 { + value := protoreflect.ValueOfList(&_Module_3_list{list: &x.RestrictionsOrder}) + if !f(fd_Module_restrictions_order, value) { + return + } + } } // Has reports whether a field is populated. @@ -168,6 +222,8 @@ func (x *fastReflection_Module) Has(fd protoreflect.FieldDescriptor) bool { return len(x.BlockedModuleAccountsOverride) != 0 case "cosmos.bank.module.v1.Module.authority": return x.Authority != "" + case "cosmos.bank.module.v1.Module.restrictions_order": + return len(x.RestrictionsOrder) != 0 default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -188,6 +244,8 @@ func (x *fastReflection_Module) Clear(fd protoreflect.FieldDescriptor) { x.BlockedModuleAccountsOverride = nil case "cosmos.bank.module.v1.Module.authority": x.Authority = "" + case "cosmos.bank.module.v1.Module.restrictions_order": + x.RestrictionsOrder = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -213,6 +271,12 @@ func (x *fastReflection_Module) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.bank.module.v1.Module.authority": value := x.Authority return protoreflect.ValueOfString(value) + case "cosmos.bank.module.v1.Module.restrictions_order": + if len(x.RestrictionsOrder) == 0 { + return protoreflect.ValueOfList(&_Module_3_list{}) + } + listValue := &_Module_3_list{list: &x.RestrictionsOrder} + return protoreflect.ValueOfList(listValue) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -239,6 +303,10 @@ func (x *fastReflection_Module) Set(fd protoreflect.FieldDescriptor, value proto x.BlockedModuleAccountsOverride = *clv.list case "cosmos.bank.module.v1.Module.authority": x.Authority = value.Interface().(string) + case "cosmos.bank.module.v1.Module.restrictions_order": + lv := value.List() + clv := lv.(*_Module_3_list) + x.RestrictionsOrder = *clv.list default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -265,6 +333,12 @@ func (x *fastReflection_Module) Mutable(fd protoreflect.FieldDescriptor) protore } value := &_Module_1_list{list: &x.BlockedModuleAccountsOverride} return protoreflect.ValueOfList(value) + case "cosmos.bank.module.v1.Module.restrictions_order": + if x.RestrictionsOrder == nil { + x.RestrictionsOrder = []string{} + } + value := &_Module_3_list{list: &x.RestrictionsOrder} + return protoreflect.ValueOfList(value) case "cosmos.bank.module.v1.Module.authority": panic(fmt.Errorf("field authority of message cosmos.bank.module.v1.Module is not mutable")) default: @@ -285,6 +359,9 @@ func (x *fastReflection_Module) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfList(&_Module_1_list{list: &list}) case "cosmos.bank.module.v1.Module.authority": return protoreflect.ValueOfString("") + case "cosmos.bank.module.v1.Module.restrictions_order": + list := []string{} + return protoreflect.ValueOfList(&_Module_3_list{list: &list}) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.bank.module.v1.Module")) @@ -364,6 +441,12 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } + if len(x.RestrictionsOrder) > 0 { + for _, s := range x.RestrictionsOrder { + l = len(s) + n += 1 + l + runtime.Sov(uint64(l)) + } + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -393,6 +476,15 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if len(x.RestrictionsOrder) > 0 { + for iNdEx := len(x.RestrictionsOrder) - 1; iNdEx >= 0; iNdEx-- { + i -= len(x.RestrictionsOrder[iNdEx]) + copy(dAtA[i:], x.RestrictionsOrder[iNdEx]) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.RestrictionsOrder[iNdEx]))) + i-- + dAtA[i] = 0x1a + } + } if len(x.Authority) > 0 { i -= len(x.Authority) copy(dAtA[i:], x.Authority) @@ -522,6 +614,38 @@ func (x *fastReflection_Module) ProtoMethods() *protoiface.Methods { } x.Authority = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 3: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field RestrictionsOrder", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if postIndex > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + x.RestrictionsOrder = append(x.RestrictionsOrder, string(dAtA[iNdEx:postIndex])) + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -582,6 +706,11 @@ type Module struct { BlockedModuleAccountsOverride []string `protobuf:"bytes,1,rep,name=blocked_module_accounts_override,json=blockedModuleAccountsOverride,proto3" json:"blocked_module_accounts_override,omitempty"` // authority defines the custom module authority. If not set, defaults to the governance module. Authority string `protobuf:"bytes,2,opt,name=authority,proto3" json:"authority,omitempty"` + // restrictions_order specifies the order of send restrictions and should be + // a list of module names which provide a send restriction instance. If no + // order is provided, then restrictions will be applied in alphabetical order + // of module names. + RestrictionsOrder []string `protobuf:"bytes,3,rep,name=restrictions_order,json=restrictionsOrder,proto3" json:"restrictions_order,omitempty"` } func (x *Module) Reset() { @@ -618,6 +747,13 @@ func (x *Module) GetAuthority() string { return "" } +func (x *Module) GetRestrictionsOrder() []string { + if x != nil { + return x.RestrictionsOrder + } + return nil +} + var File_cosmos_bank_module_v1_module_proto protoreflect.FileDescriptor var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ @@ -626,31 +762,34 @@ var file_cosmos_bank_module_v1_module_proto_rawDesc = []byte{ 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x20, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x70, 0x70, 0x2f, 0x76, 0x31, 0x61, 0x6c, 0x70, 0x68, 0x61, 0x31, - 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x9c, 0x01, + 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xcb, 0x01, 0x0a, 0x06, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x12, 0x47, 0x0a, 0x20, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x5f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5f, 0x6f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x18, 0x01, 0x20, 0x03, 0x28, 0x09, 0x52, 0x1d, 0x62, 0x6c, 0x6f, 0x63, 0x6b, 0x65, 0x64, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x4f, 0x76, 0x65, 0x72, 0x72, 0x69, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x02, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x3a, - 0x2b, 0xba, 0xc0, 0x96, 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, - 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0xd0, 0x01, 0x0a, - 0x19, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, - 0x2e, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, - 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, - 0x31, 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, - 0xaa, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, - 0xe2, 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, - 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, - 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, - 0x61, 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, + 0x2d, 0x0a, 0x12, 0x72, 0x65, 0x73, 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x5f, + 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x72, 0x65, 0x73, + 0x74, 0x72, 0x69, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x3a, 0x2b, + 0xba, 0xc0, 0x96, 0xda, 0x01, 0x25, 0x0a, 0x23, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, + 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x78, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x42, 0xd0, 0x01, 0x0a, 0x19, + 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x6e, 0x6b, 0x2e, + 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x76, 0x31, 0x42, 0x0b, 0x4d, 0x6f, 0x64, 0x75, 0x6c, + 0x65, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x62, 0x61, 0x6e, 0x6b, 0x2f, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x2f, 0x76, 0x31, + 0x3b, 0x6d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x42, 0x4d, 0xaa, + 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x42, 0x61, 0x6e, 0x6b, 0x2e, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x15, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0xe2, + 0x02, 0x21, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x42, 0x61, 0x6e, 0x6b, 0x5c, 0x4d, 0x6f, + 0x64, 0x75, 0x6c, 0x65, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x18, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x42, 0x61, + 0x6e, 0x6b, 0x3a, 0x3a, 0x4d, 0x6f, 0x64, 0x75, 0x6c, 0x65, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, + 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/go.mod b/api/go.mod index 1162d209b87b..acfb2b18b58d 100644 --- a/api/go.mod +++ b/api/go.mod @@ -3,20 +3,20 @@ module cosmossdk.io/api go 1.20 require ( - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/gogoproto v1.4.11 - google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e - google.golang.org/grpc v1.57.0 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/gogoproto v1.4.12 + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f + google.golang.org/grpc v1.61.1 google.golang.org/protobuf v1.33.0 ) require ( github.com/golang/protobuf v1.5.4 // indirect github.com/google/go-cmp v0.6.0 // indirect - golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb // indirect - golang.org/x/net v0.14.0 // indirect - golang.org/x/sys v0.11.0 // indirect - golang.org/x/text v0.12.0 // indirect - google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 // indirect + golang.org/x/exp v0.0.0-20231006140011-7918f672742d // indirect + golang.org/x/net v0.20.0 // indirect + golang.org/x/sys v0.16.0 // indirect + golang.org/x/text v0.14.0 // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect ) diff --git a/api/go.sum b/api/go.sum index c35fa62f71f8..7db12cc22430 100644 --- a/api/go.sum +++ b/api/go.sum @@ -1,26 +1,26 @@ -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -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/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb h1:mIKbk8weKhSeLH2GmUTrvx8CjkyJmnU1wFmg59CUjFA= -golang.org/x/exp v0.0.0-20230811145659-89c5cff77bcb/go.mod h1:FXUEEKJgO7OQYeo8N01OfiKP8RXMtf6e8aTskBGqWdc= -golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14= -golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI= -golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= -golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/text v0.12.0 h1:k+n5B8goJNdU7hSvEtMUz3d1Q6D/XW4COJSJR6fN0mc= -golang.org/x/text v0.12.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5 h1:L6iMMGrtzgHsWofoFcihmDEMYeDR9KN/ThbPWGrh++g= -google.golang.org/genproto v0.0.0-20230803162519-f966b187b2e5/go.mod h1:oH/ZOT02u4kWEp7oYBGYFFkCdKS/uYR9Z7+0/xuuFp8= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e h1:z3vDksarJxsAKM5dmEGv0GHwE2hKJ096wZra71Vs4sw= -google.golang.org/genproto/googleapis/api v0.0.0-20230726155614-23370e0ffb3e/go.mod h1:rsr7RhLuwsDKL7RmgDDCUc6yaGr1iqceVb5Wv6f6YvQ= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878 h1:lv6/DhyiFFGsmzxbsUUTOkN29II+zeWHxvT8Lpdxsv0= -google.golang.org/genproto/googleapis/rpc v0.0.0-20230815205213-6bfd019c3878/go.mod h1:+Bk1OCOj40wS2hwAMA+aCW9ypzm63QTBBHp6lQ3p+9M= -google.golang.org/grpc v1.57.0 h1:kfzNeI/klCGD2YPMUlaGNT3pxvYfga7smW3Vth8Zsiw= -google.golang.org/grpc v1.57.0/go.mod h1:Sd+9RMTACXwmub0zcNY2c4arhtrbBYD1AUHI/dt16Mo= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d h1:jtJma62tbqLibJ5sFQz8bKtEM8rJBtfilJ2qTU199MI= +golang.org/x/exp v0.0.0-20231006140011-7918f672742d/go.mod h1:ldy0pHrwJyGW56pPQzzkH36rKxoZW1tw7ZJpeKx+hdo= +golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= +golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU= +golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= +golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/baseapp/abci.go b/baseapp/abci.go index 027f94763944..45adf0327a69 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -165,7 +165,7 @@ func (app *BaseApp) Query(_ context.Context, req *abci.RequestQuery) (resp *abci telemetry.IncrCounter(1, "query", "count") telemetry.IncrCounter(1, "query", req.Path) - defer telemetry.MeasureSince(time.Now(), req.Path) + defer telemetry.MeasureSince(telemetry.Now(), req.Path) if req.Path == QueryPathBroadcastTx { return sdkerrors.QueryResult(errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "can't route a broadcast tx message"), app.trace), nil @@ -1269,8 +1269,9 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e header := app.checkState.Context().BlockHeader() ctx := sdk.NewContext(cacheMS, header, true, app.logger). WithMinGasPrices(app.minGasPrices). - WithBlockHeight(height). - WithGasMeter(storetypes.NewGasMeter(app.queryGasLimit)).WithBlockHeader(header) + WithGasMeter(storetypes.NewGasMeter(app.queryGasLimit)). + WithBlockHeader(header). + WithBlockHeight(height) if height != lastBlockHeight { rms, ok := app.cms.(*rootmulti.Store) diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 858c3ce976ae..2c250b03ddf9 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -1391,7 +1391,7 @@ func TestPrecommiterCalledWithDeliverState(t *testing.T) { func TestABCI_Proposal_HappyPath(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1569,7 +1569,7 @@ func TestABCI_Proposals_WithVE(t *testing.T) { func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1599,7 +1599,7 @@ func TestABCI_PrepareProposal_ReachedMaxBytes(t *testing.T) { func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -1626,7 +1626,7 @@ func TestABCI_PrepareProposal_BadEncoding(t *testing.T) { } func TestABCI_PrepareProposal_OverGasUnderBytes(t *testing.T) { - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) suite := NewBaseAppSuite(t, baseapp.SetMempool(pool)) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) @@ -1667,7 +1667,7 @@ func TestABCI_PrepareProposal_OverGasUnderBytes(t *testing.T) { } func TestABCI_PrepareProposal_MaxGas(t *testing.T) { - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) suite := NewBaseAppSuite(t, baseapp.SetMempool(pool)) baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) @@ -1705,7 +1705,7 @@ func TestABCI_PrepareProposal_MaxGas(t *testing.T) { func TestABCI_PrepareProposal_Failures(t *testing.T) { anteKey := []byte("ante-key") - pool := mempool.NewSenderNonceMempool() + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) anteOpt := func(bapp *baseapp.BaseApp) { bapp.SetAnteHandler(anteHandlerTxTest(t, capKey1, anteKey)) } @@ -2388,3 +2388,104 @@ func TestOptimisticExecution(t *testing.T) { require.Equal(t, int64(50), suite.baseApp.LastBlockHeight()) } + +func TestABCI_Proposal_FailReCheckTx(t *testing.T) { + pool := mempool.NewPriorityMempool[int64](mempool.PriorityNonceMempoolConfig[int64]{ + TxPriority: mempool.NewDefaultTxPriority(), + MaxTx: 0, + SignerExtractor: mempool.NewDefaultSignerExtractionAdapter(), + }) + + anteOpt := func(bapp *baseapp.BaseApp) { + bapp.SetAnteHandler(func(ctx sdk.Context, tx sdk.Tx, simulate bool) (sdk.Context, error) { + // always fail on recheck, just to test the recheck logic + if ctx.IsReCheckTx() { + return ctx, errors.New("recheck failed in ante handler") + } + + return ctx, nil + }) + } + + suite := NewBaseAppSuite(t, anteOpt, baseapp.SetMempool(pool)) + baseapptestutil.RegisterKeyValueServer(suite.baseApp.MsgServiceRouter(), MsgKeyValueImpl{}) + baseapptestutil.RegisterCounterServer(suite.baseApp.MsgServiceRouter(), NoopCounterServerImpl{}) + + _, err := suite.baseApp.InitChain(&abci.RequestInitChain{ + ConsensusParams: &cmtproto.ConsensusParams{}, + }) + require.NoError(t, err) + + tx := newTxCounter(t, suite.txConfig, 0, 1) + txBytes, err := suite.txConfig.TxEncoder()(tx) + require.NoError(t, err) + + reqCheckTx := abci.RequestCheckTx{ + Tx: txBytes, + Type: abci.CheckTxType_New, + } + _, err = suite.baseApp.CheckTx(&reqCheckTx) + require.NoError(t, err) + + tx2 := newTxCounter(t, suite.txConfig, 1, 1) + + tx2Bytes, err := suite.txConfig.TxEncoder()(tx2) + require.NoError(t, err) + + err = pool.Insert(sdk.Context{}, tx2) + require.NoError(t, err) + + require.Equal(t, 2, pool.CountTx()) + + // call prepareProposal before calling recheck tx, just as a sanity check + reqPrepareProposal := abci.RequestPrepareProposal{ + MaxTxBytes: 1000, + Height: 1, + } + resPrepareProposal, err := suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 2, len(resPrepareProposal.Txs)) + + // call recheck on the first tx, it MUST return an error + reqReCheckTx := abci.RequestCheckTx{ + Tx: txBytes, + Type: abci.CheckTxType_Recheck, + } + resp, err := suite.baseApp.CheckTx(&reqReCheckTx) + require.NoError(t, err) + require.True(t, resp.IsErr()) + require.Equal(t, "recheck failed in ante handler", resp.Log) + + // call prepareProposal again, should return only the second tx + resPrepareProposal, err = suite.baseApp.PrepareProposal(&reqPrepareProposal) + require.NoError(t, err) + require.Equal(t, 1, len(resPrepareProposal.Txs)) + require.Equal(t, tx2Bytes, resPrepareProposal.Txs[0]) + + // check the mempool, it should have only the second tx + require.Equal(t, 1, pool.CountTx()) + + reqProposalTxBytes := [][]byte{ + tx2Bytes, + } + reqProcessProposal := abci.RequestProcessProposal{ + Txs: reqProposalTxBytes, + Height: reqPrepareProposal.Height, + } + + resProcessProposal, err := suite.baseApp.ProcessProposal(&reqProcessProposal) + require.NoError(t, err) + require.Equal(t, abci.ResponseProcessProposal_ACCEPT, resProcessProposal.Status) + + // the same txs as in PrepareProposal + res, err := suite.baseApp.FinalizeBlock(&abci.RequestFinalizeBlock{ + Height: suite.baseApp.LastBlockHeight() + 1, + Txs: reqProposalTxBytes, + }) + require.NoError(t, err) + + require.Equal(t, 0, pool.CountTx()) + + require.NotEmpty(t, res.TxResults[0].Events) + require.True(t, res.TxResults[0].IsOK(), fmt.Sprintf("%v", res)) +} diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 4cfadbbdca5a..38672821dfcc 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -4,7 +4,7 @@ import ( "bytes" "context" "fmt" - "slices" + "slices" //nolint: gci // ignore this line for this linter "github.com/cockroachdb/errors" abci "github.com/cometbft/cometbft/abci/types" @@ -12,7 +12,7 @@ import ( cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" cmtproto "github.com/cometbft/cometbft/proto/tendermint/types" protoio "github.com/cosmos/gogoproto/io" - "github.com/cosmos/gogoproto/proto" + "github.com/cosmos/gogoproto/proto" //nolint: gci // ignore this line for this linter "cosmossdk.io/core/comet" diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index a084367dba4a..09a9f5827d04 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -280,10 +280,8 @@ func (app *BaseApp) Trace() bool { // MsgServiceRouter returns the MsgServiceRouter of a BaseApp. func (app *BaseApp) MsgServiceRouter() *MsgServiceRouter { return app.msgServiceRouter } -// SetMsgServiceRouter sets the MsgServiceRouter of a BaseApp. -func (app *BaseApp) SetMsgServiceRouter(msgServiceRouter *MsgServiceRouter) { - app.msgServiceRouter = msgServiceRouter -} +// GRPCQueryRouter returns the GRPCQueryRouter of a BaseApp. +func (app *BaseApp) GRPCQueryRouter() *GRPCQueryRouter { return app.grpcQueryRouter } // MountStores mounts all IAVL or DB stores to the provided keys in the BaseApp // multistore. @@ -683,7 +681,8 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte, txIndex int) } ctx := modeState.Context(). WithTxBytes(txBytes). - WithTxIndex(txIndex) + WithTxIndex(txIndex). + WithGasMeter(storetypes.NewInfiniteGasMeter()) // WithVoteInfos(app.voteInfos) // TODO: identify if this is needed ctx = ctx.WithConsensusParams(app.GetConsensusParams(ctx)) @@ -694,6 +693,7 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte, txIndex int) if mode == execModeSimulate { ctx, _ = ctx.CacheContext() + ctx = ctx.WithExecMode(sdk.ExecMode(execModeSimulate)) } return ctx @@ -738,7 +738,7 @@ func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) error { return nil } -func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) (sdk.BeginBlock, error) { +func (app *BaseApp) beginBlock(_ *abci.RequestFinalizeBlock) (sdk.BeginBlock, error) { var ( resp sdk.BeginBlock err error @@ -943,6 +943,12 @@ func (app *BaseApp) runTxWithMultiStore(mode execMode, txBytes []byte, txIndex i gasWanted = ctx.GasMeter().Limit() if err != nil { + if mode == execModeReCheck { + // if the ante handler fails on recheck, we want to remove the tx from the mempool + if mempoolErr := app.mempool.Remove(tx); mempoolErr != nil { + return gInfo, nil, anteEvents, errors.Join(err, mempoolErr) + } + } return gInfo, nil, nil, err } diff --git a/baseapp/baseapp_test.go b/baseapp/baseapp_test.go index 1ba3fb82d4d8..f847009e8e49 100644 --- a/baseapp/baseapp_test.go +++ b/baseapp/baseapp_test.go @@ -702,24 +702,33 @@ func TestABCI_CreateQueryContext(t *testing.T) { require.NoError(t, err) testCases := []struct { - name string - height int64 - prove bool - expErr bool + name string + height int64 + headerHeight int64 + prove bool + expErr bool }{ - {"valid height", 2, true, false}, - {"future height", 10, true, true}, - {"negative height, prove=true", -1, true, true}, - {"negative height, prove=false", -1, false, true}, + {"valid height", 2, 2, true, false}, + {"valid height with different initial height", 2, 1, true, false}, + {"future height", 10, 10, true, true}, + {"negative height, prove=true", -1, -1, true, true}, + {"negative height, prove=false", -1, -1, false, true}, } for _, tc := range testCases { t.Run(tc.name, func(t *testing.T) { - _, err := app.CreateQueryContext(tc.height, tc.prove) + if tc.headerHeight != tc.height { + _, err := app.InitChain(&abci.RequestInitChain{ + InitialHeight: tc.headerHeight, + }) + require.NoError(t, err) + } + ctx, err := app.CreateQueryContext(tc.height, tc.prove) if tc.expErr { require.Error(t, err) } else { require.NoError(t, err) + require.Equal(t, tc.height, ctx.BlockHeight()) } }) } diff --git a/baseapp/grpcserver.go b/baseapp/grpcserver.go index 20ea6ecac1de..1e8f3a91d748 100644 --- a/baseapp/grpcserver.go +++ b/baseapp/grpcserver.go @@ -19,9 +19,6 @@ import ( grpctypes "github.com/cosmos/cosmos-sdk/types/grpc" ) -// GRPCQueryRouter returns the GRPCQueryRouter of a BaseApp. -func (app *BaseApp) GRPCQueryRouter() *GRPCQueryRouter { return app.grpcQueryRouter } - // RegisterGRPCServer registers gRPC services directly with the gRPC server. func (app *BaseApp) RegisterGRPCServer(server gogogrpc.Server) { // Define an interceptor for all gRPC queries: this interceptor will create diff --git a/baseapp/options.go b/baseapp/options.go index 0c28e3755c12..d8615bea6aa4 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -382,3 +382,13 @@ func (app *BaseApp) SetDisableBlockGasMeter(disableBlockGasMeter bool) { func (app *BaseApp) SetTxExecutor(executor TxExecutor) { app.txExecutor = executor } + +// SetMsgServiceRouter sets the MsgServiceRouter of a BaseApp. +func (app *BaseApp) SetMsgServiceRouter(msgServiceRouter *MsgServiceRouter) { + app.msgServiceRouter = msgServiceRouter +} + +// SetGRPCQueryRouter sets the GRPCQueryRouter of the BaseApp. +func (app *BaseApp) SetGRPCQueryRouter(grpcQueryRouter *GRPCQueryRouter) { + app.grpcQueryRouter = grpcQueryRouter +} diff --git a/client/cmd.go b/client/cmd.go index 947df1ceaac1..34b433ec5f3a 100644 --- a/client/cmd.go +++ b/client/cmd.go @@ -359,14 +359,17 @@ func GetClientContextFromCmd(cmd *cobra.Command) Context { // SetCmdClientContext sets a command's Context value to the provided argument. // If the context has not been set, set the given context as the default. func SetCmdClientContext(cmd *cobra.Command, clientCtx Context) error { - var cmdCtx context.Context - - if cmd.Context() == nil { + cmdCtx := cmd.Context() + if cmdCtx == nil { cmdCtx = context.Background() + } + + v := cmd.Context().Value(ClientContextKey) + if clientCtxPtr, ok := v.(*Context); ok { + *clientCtxPtr = clientCtx } else { - cmdCtx = cmd.Context() + cmd.SetContext(context.WithValue(cmdCtx, ClientContextKey, &clientCtx)) } - cmd.SetContext(context.WithValue(cmdCtx, ClientContextKey, &clientCtx)) return nil } diff --git a/client/cmd_test.go b/client/cmd_test.go index 81d5719ccfb6..559d31d39f40 100644 --- a/client/cmd_test.go +++ b/client/cmd_test.go @@ -79,11 +79,13 @@ func TestSetCmdClientContextHandler(t *testing.T) { name string expectedContext client.Context args []string + ctx context.Context }{ { "no flags set", initClientCtx, []string{}, + context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}), }, { "flags set", @@ -91,6 +93,7 @@ func TestSetCmdClientContextHandler(t *testing.T) { []string{ fmt.Sprintf("--%s=new-chain-id", flags.FlagChainID), }, + context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}), }, { "flags set with space", @@ -99,6 +102,25 @@ func TestSetCmdClientContextHandler(t *testing.T) { fmt.Sprintf("--%s", flags.FlagHome), "/tmp/dir", }, + context.Background(), + }, + { + "no context provided", + initClientCtx.WithHomeDir("/tmp/noctx"), + []string{ + fmt.Sprintf("--%s", flags.FlagHome), + "/tmp/noctx", + }, + nil, + }, + { + "with invalid client value in the context", + initClientCtx.WithHomeDir("/tmp/invalid"), + []string{ + fmt.Sprintf("--%s", flags.FlagHome), + "/tmp/invalid", + }, + context.WithValue(context.Background(), client.ClientContextKey, "invalid"), }, } @@ -106,13 +128,11 @@ func TestSetCmdClientContextHandler(t *testing.T) { tc := tc t.Run(tc.name, func(t *testing.T) { - ctx := context.WithValue(context.Background(), client.ClientContextKey, &client.Context{}) - cmd := newCmd() _ = testutil.ApplyMockIODiscardOutErr(cmd) cmd.SetArgs(tc.args) - require.NoError(t, cmd.ExecuteContext(ctx)) + require.NoError(t, cmd.ExecuteContext(tc.ctx)) clientCtx := client.GetClientContextFromCmd(cmd) require.Equal(t, tc.expectedContext, clientCtx) diff --git a/client/debug/main.go b/client/debug/main.go index e1048a427524..90eaa991422d 100644 --- a/client/debug/main.go +++ b/client/debug/main.go @@ -253,28 +253,43 @@ $ %s debug addr cosmos1e0jnq2sun3dzjh8p2xq95kk0expwmd7shwjpfg Args: cobra.ExactArgs(1), RunE: func(cmd *cobra.Command, args []string) error { addrString := args[0] - var addr []byte - // try hex, then bech32 - var err error - addr, err = hex.DecodeString(addrString) - if err != nil { - var err2 error - addr, err2 = sdk.AccAddressFromBech32(addrString) - if err2 != nil { - var err3 error - addr, err3 = sdk.ValAddressFromBech32(addrString) - - if err3 != nil { - return fmt.Errorf("expected hex or bech32. Got errors: hex: %v, bech32 acc: %v, bech32 val: %v", err, err2, err3) + var ( + addr []byte + err error + ) + decodeFns := []func(text string) ([]byte, error){ + hex.DecodeString, + func(text string) ([]byte, error) { return sdk.AccAddressFromBech32(text) }, + func(text string) ([]byte, error) { return sdk.ValAddressFromBech32(text) }, + func(text string) ([]byte, error) { return sdk.ConsAddressFromBech32(text) }, + } + errs := make([]any, 0, len(decodeFns)) + for _, fn := range decodeFns { + if addr, err = fn(addrString); err == nil { + break + } + errs = append(errs, err) + } + if len(errs) == len(decodeFns) { + errTags := []string{ + "hex", "bech32 acc", "bech32 val", "bech32 con", + } + format := "" + for i := range errs { + if format != "" { + format += ", " } + format += errTags[i] + ": %w" } + return fmt.Errorf("expected hex or bech32. Got errors: "+format, errs...) } cmd.Println("Address:", addr) cmd.Printf("Address (hex): %X\n", addr) cmd.Printf("Bech32 Acc: %s\n", sdk.AccAddress(addr)) cmd.Printf("Bech32 Val: %s\n", sdk.ValAddress(addr)) + cmd.Printf("Bech32 Con: %s\n", sdk.ConsAddress(addr)) return nil }, } diff --git a/client/rpc/tx.go b/client/rpc/tx.go index 02b9852b8601..c22af90a8d8f 100644 --- a/client/rpc/tx.go +++ b/client/rpc/tx.go @@ -3,7 +3,9 @@ package rpc import ( "context" "encoding/hex" + "encoding/json" "fmt" + "io" "strings" "time" @@ -16,8 +18,11 @@ import ( "github.com/cosmos/cosmos-sdk/client/flags" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/errors" + "github.com/cosmos/cosmos-sdk/version" ) +const TimeoutFlag = "timeout" + func newTxResponseCheckTx(res *coretypes.ResultBroadcastTxCommit) *sdk.TxResponse { if res == nil { return nil @@ -84,18 +89,36 @@ func newResponseFormatBroadcastTxCommit(res *coretypes.ResultBroadcastTxCommit) return newTxResponseDeliverTx(res) } -// QueryEventForTxCmd returns a CLI command that subscribes to a WebSocket connection and waits for a transaction event with the given hash. +// QueryEventForTxCmd is an alias for WaitTxCmd, kept for backwards compatibility. func QueryEventForTxCmd() *cobra.Command { + return WaitTxCmd() +} + +// WaitTx returns a CLI command that waits for a transaction with the given hash to be included in a block. +func WaitTxCmd() *cobra.Command { cmd := &cobra.Command{ - Use: "event-query-tx-for [hash]", - Short: "Query for a transaction by hash", - Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`, - Args: cobra.ExactArgs(1), + Use: "wait-tx [hash]", + Aliases: []string{"event-query-tx-for"}, + Short: "Wait for a transaction to be included in a block", + Long: `Subscribes to a CometBFT WebSocket connection and waits for a transaction event with the given hash.`, + Example: fmt.Sprintf(`By providing the transaction hash: +$ %[1]sd q wait-tx [hash] + +Or, by piping a "tx" command: +$ %[1]sd tx [flags] | %[1]sd q wait-tx +`, version.AppName), + Args: cobra.MaximumNArgs(1), RunE: func(cmd *cobra.Command, args []string) error { clientCtx, err := client.GetClientTxContext(cmd) if err != nil { return err } + + timeout, err := cmd.Flags().GetDuration(TimeoutFlag) + if err != nil { + return err + } + c, err := rpchttp.New(clientCtx.NodeURI, "/websocket") if err != nil { return err @@ -105,11 +128,34 @@ func QueryEventForTxCmd() *cobra.Command { } defer c.Stop() //nolint:errcheck // ignore stop error - ctx, cancel := context.WithTimeout(context.Background(), time.Second*15) + ctx, cancel := context.WithTimeout(context.Background(), timeout) defer cancel() - hash := args[0] - query := fmt.Sprintf("%s='%s' AND %s='%s'", tmtypes.EventTypeKey, tmtypes.EventTx, tmtypes.TxHashKey, hash) + var hash []byte + if len(args) == 0 { + // read hash from stdin + in, err := io.ReadAll(cmd.InOrStdin()) + if err != nil { + return err + } + hashByt, err := parseHashFromInput(in) + if err != nil { + return err + } + + hash = hashByt + } else { + // read hash from args + hashByt, err := hex.DecodeString(args[0]) + if err != nil { + return err + } + + hash = hashByt + } + + // subscribe to websocket events + query := fmt.Sprintf("%s='%s' AND %s='%X'", tmtypes.EventTypeKey, tmtypes.EventTx, tmtypes.TxHashKey, hash) const subscriber = "subscriber" eventCh, err := c.Subscribe(ctx, subscriber, query) if err != nil { @@ -117,6 +163,19 @@ func QueryEventForTxCmd() *cobra.Command { } defer c.UnsubscribeAll(context.Background(), subscriber) //nolint:errcheck // ignore unsubscribe error + // return immediately if tx is already included in a block + res, err := c.Tx(ctx, hash, false) + if err == nil { + // tx already included in a block + res := &coretypes.ResultBroadcastTxCommit{ + TxResult: res.TxResult, + Hash: res.Hash, + Height: res.Height, + } + return clientCtx.PrintProto(newResponseFormatBroadcastTxCommit(res)) + } + + // tx not yet included in a block, wait for event on websocket select { case evt := <-eventCh: if txe, ok := evt.Data.(tmtypes.EventDataTx); ok { @@ -128,13 +187,32 @@ func QueryEventForTxCmd() *cobra.Command { return clientCtx.PrintProto(newResponseFormatBroadcastTxCommit(res)) } case <-ctx.Done(): - return errors.ErrLogic.Wrapf("timed out waiting for event, the transaction could have already been included or wasn't yet included") + return errors.ErrLogic.Wrapf("timed out waiting for transaction %X to be included in a block", hash) } return nil }, } - flags.AddTxFlagsToCmd(cmd) + cmd.Flags().Duration(TimeoutFlag, 15*time.Second, "The maximum time to wait for the transaction to be included in a block") + flags.AddQueryFlagsToCmd(cmd) return cmd } + +func parseHashFromInput(in []byte) ([]byte, error) { + var resultTx coretypes.ResultTx + if err := json.Unmarshal(in, &resultTx); err == nil { + // input was JSON, return the hash + return resultTx.Hash, nil + } + + // try to parse the hash from the output of a tx command + lines := strings.Split(string(in), "\n") + for _, line := range lines { + if strings.HasPrefix(line, "txhash:") { + hash := strings.TrimSpace(line[len("txhash:"):]) + return hex.DecodeString(hash) + } + } + return nil, fmt.Errorf("txhash not found") +} diff --git a/client/v2/CHANGELOG.md b/client/v2/CHANGELOG.md index 555a5bbfa6bf..c86146bcb545 100644 --- a/client/v2/CHANGELOG.md +++ b/client/v2/CHANGELOG.md @@ -40,13 +40,18 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. +* [#20083](https://github.com/cosmos/cosmos-sdk/pull/20083) Integrate latest version of cosmos-proto and improve version filtering. * [#19618](https://github.com/cosmos/cosmos-sdk/pull/19618) Marshal enum as string in queries. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Use client context from root (or enhanced) command in autocli commands. * Note, the given command must have a `client.Context` in its context. * [#19216](https://github.com/cosmos/cosmos-sdk/pull/19216) Do not overwrite TxConfig, use directly the one provided in context. TxConfig should always be set in the `client.Context` in `root.go` of an app. +* [#20266](https://github.com/cosmos/cosmos-sdk/pull/20266) Add ability to override the short description in AutoCLI-generated top-level commands. ### Bug Fixes +* [#19976](https://github.com/cosmos/cosmos-sdk/pull/19976) Add encoder for `cosmos.base.v1beta1.DecCoin`. * [#19377](https://github.com/cosmos/cosmos-sdk/pull/19377) Partly fix comment parsing in autocli. * [#19060](https://github.com/cosmos/cosmos-sdk/pull/19060) Simplify key flag parsing logic in flag handler. * [#20033](https://github.com/cosmos/cosmos-sdk/pull/20033) Respect output format from client ctx. diff --git a/client/v2/README.md b/client/v2/README.md index b61c6b2de064..ea917ce20a7a 100644 --- a/client/v2/README.md +++ b/client/v2/README.md @@ -114,7 +114,7 @@ err := autoCliOpts.EnhanceRootCommand(rootCmd) ## Signing `autocli` supports signing transactions with the keyring. -The [`cosmos.msg.v1.signer` protobuf annotation](https://github.com/cosmos/cosmos-sdk/blob/9dd34510e27376005e7e7ff3628eab9dbc8ad6dc/docs/build/building-modules/05-protobuf-annotations.md#L9) defines the signer field of the message. +The [`cosmos.msg.v1.signer` protobuf annotation](https://docs.cosmos.network/main/build/building-modules/protobuf-annotations) defines the signer field of the message. This field is automatically filled when using the `--from` flag or defining the signer as a positional argument. :::warning @@ -194,6 +194,19 @@ https://github.com/cosmos/cosmos-sdk/blob/fa4d87ef7e6d87aaccc94c337ffd2fe90fcb7a If not set to true, `AutoCLI` will not generate commands for the module if there are already commands registered for the module (when `GetTxCmd()` or `GetTxCmd()` are defined). +### Skip a command + +AutoCLI automatically skips unsupported commands when [`cosmos_proto.method_added_in` protobuf annotation](https://docs.cosmos.network/main/build/building-modules/protobuf-annotations) is present. + +Additionally, a command can be manually skipped using the `autocliv1.RpcCommandOptions`: + +```go +*autocliv1.RpcCommandOptions{ + RpcMethod: "Params", // The name of the gRPC service + Skip: true, +} +``` + ### Use AutoCLI for non module commands It is possible to use `AutoCLI` for non module commands. The trick is still to implement the `appmodule.Module` interface and append it to the `appOptions.ModuleOptions` map. diff --git a/client/v2/autocli/common.go b/client/v2/autocli/common.go index de5cc523434a..de6b06d677a2 100644 --- a/client/v2/autocli/common.go +++ b/client/v2/autocli/common.go @@ -32,11 +32,6 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip short = fmt.Sprintf("Execute the %s RPC method", descriptor.Name()) } - long := options.Long - if long == "" { - long = util.DescriptorDocs(descriptor) - } - inputDesc := descriptor.Input() inputType := util.ResolveMessageType(b.TypeResolver, inputDesc) @@ -48,7 +43,7 @@ func (b *Builder) buildMethodCommandCommon(descriptor protoreflect.MethodDescrip cmd := &cobra.Command{ SilenceUsage: false, Use: use, - Long: long, + Long: options.Long, Short: short, Example: options.Example, Aliases: options.Alias, @@ -180,7 +175,11 @@ func (b *Builder) enhanceCommandCommon( // enhanceQuery enhances the provided query command with the autocli commands for a module. func enhanceQuery(builder *Builder, moduleName string, cmd *cobra.Command, modOpts *autocliv1.ModuleOptions) error { if queryCmdDesc := modOpts.Query; queryCmdDesc != nil { - subCmd := topLevelCmd(cmd.Context(), moduleName, fmt.Sprintf("Querying commands for the %s module", moduleName)) + short := queryCmdDesc.Short + if short == "" { + short = fmt.Sprintf("Querying commands for the %s module", moduleName) + } + subCmd := topLevelCmd(cmd.Context(), moduleName, short) if err := builder.AddQueryServiceCommands(subCmd, queryCmdDesc); err != nil { return err } @@ -194,7 +193,11 @@ func enhanceQuery(builder *Builder, moduleName string, cmd *cobra.Command, modOp // enhanceMsg enhances the provided msg command with the autocli commands for a module. func enhanceMsg(builder *Builder, moduleName string, cmd *cobra.Command, modOpts *autocliv1.ModuleOptions) error { if txCmdDesc := modOpts.Tx; txCmdDesc != nil { - subCmd := topLevelCmd(cmd.Context(), moduleName, fmt.Sprintf("Transactions commands for the %s module", moduleName)) + short := txCmdDesc.Short + if short == "" { + short = fmt.Sprintf("Transactions commands for the %s module", moduleName) + } + subCmd := topLevelCmd(cmd.Context(), moduleName, short) if err := builder.AddMsgServiceCommands(subCmd, txCmdDesc); err != nil { return err } diff --git a/client/v2/autocli/flag/builder.go b/client/v2/autocli/flag/builder.go index 2fa1c81507a9..d797029fa2b9 100644 --- a/client/v2/autocli/flag/builder.go +++ b/client/v2/autocli/flag/builder.go @@ -307,10 +307,6 @@ func (b *Builder) addFieldFlag(ctx context.Context, flagSet *pflag.FlagSet, fiel } usage := opts.Usage - if usage == "" { - usage = util.DescriptorDocs(field) - } - shorthand := opts.Shorthand defaultValue := opts.DefaultValue diff --git a/client/v2/autocli/msg.go b/client/v2/autocli/msg.go index 903d313f9763..5bcbd9baa33a 100644 --- a/client/v2/autocli/msg.go +++ b/client/v2/autocli/msg.go @@ -38,7 +38,11 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc for cmdName, subCmdDescriptor := range cmdDescriptor.SubCommands { subCmd := findSubCommand(cmd, cmdName) if subCmd == nil { - subCmd = topLevelCmd(cmd.Context(), cmdName, fmt.Sprintf("Tx commands for the %s service", subCmdDescriptor.Service)) + short := subCmdDescriptor.Short + if short == "" { + short = fmt.Sprintf("Tx commands for the %s service", subCmdDescriptor.Service) + } + subCmd = topLevelCmd(cmd.Context(), cmdName, short) } // Add recursive sub-commands if there are any. This is used for nested services. @@ -83,7 +87,7 @@ func (b *Builder) AddMsgServiceCommands(cmd *cobra.Command, cmdDescriptor *autoc continue } - if !util.IsSupportedVersion(util.DescriptorDocs(methodDescriptor)) { + if !util.IsSupportedVersion(methodDescriptor) { continue } diff --git a/client/v2/autocli/query.go b/client/v2/autocli/query.go index 92a04d732afe..95bfbca78bca 100644 --- a/client/v2/autocli/query.go +++ b/client/v2/autocli/query.go @@ -4,9 +4,11 @@ import ( "context" "fmt" "io" + "strings" "time" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" + "cosmossdk.io/math" "cosmossdk.io/x/tx/signing/aminojson" "github.com/cockroachdb/errors" "github.com/spf13/cobra" @@ -14,6 +16,8 @@ import ( "cosmossdk.io/client/v2/internal/flags" "cosmossdk.io/client/v2/internal/util" + + sdk "github.com/cosmos/cosmos-sdk/types" ) // BuildQueryCommand builds the query commands for all the provided modules. If a custom command is provided for a @@ -37,7 +41,11 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut for cmdName, subCmdDesc := range cmdDescriptor.SubCommands { subCmd := findSubCommand(cmd, cmdName) if subCmd == nil { - subCmd = topLevelCmd(cmd.Context(), cmdName, fmt.Sprintf("Querying commands for the %s service", subCmdDesc.Service)) + short := subCmdDesc.Short + if short == "" { + short = fmt.Sprintf("Querying commands for the %s service", subCmdDesc.Service) + } + subCmd = topLevelCmd(cmd.Context(), cmdName, short) } if err := b.AddQueryServiceCommands(subCmd, subCmdDesc); err != nil { @@ -81,7 +89,7 @@ func (b *Builder) AddQueryServiceCommands(cmd *cobra.Command, cmdDescriptor *aut continue } - if !util.IsSupportedVersion(util.DescriptorDocs(methodDescriptor)) { + if !util.IsSupportedVersion(methodDescriptor) { continue } @@ -183,5 +191,41 @@ func encoder(encoder aminojson.Encoder) aminojson.Encoder { _, err := fmt.Fprintf(w, `"%s"`, (time.Duration(seconds)*time.Second + (time.Duration(nanos) * time.Nanosecond)).String()) return err + }).DefineTypeEncoding("cosmos.base.v1beta1.DecCoin", func(_ *aminojson.Encoder, msg protoreflect.Message, w io.Writer) error { + var ( + denomName protoreflect.Name = "denom" + amountName protoreflect.Name = "amount" + ) + + fields := msg.Descriptor().Fields() + denomField := fields.ByName(denomName) + if denomField == nil { + return fmt.Errorf("expected denom field") + } + + denom := msg.Get(denomField).String() + + amountField := fields.ByName(amountName) + if amountField == nil { + return fmt.Errorf("expected amount field") + } + + amount := msg.Get(amountField).String() + decimalPlace := len(amount) - math.LegacyPrecision + if decimalPlace > 0 { + amount = amount[:decimalPlace] + "." + amount[decimalPlace:] + } else if decimalPlace == 0 { + amount = "0." + amount + } else { + amount = "0." + strings.Repeat("0", -decimalPlace) + amount + } + + amountDec, err := math.LegacyNewDecFromStr(amount) + if err != nil { + return fmt.Errorf("invalid amount: %s: %w", amount, err) + } + + _, err = fmt.Fprintf(w, `"%s"`, sdk.NewDecCoinFromDec(denom, amountDec)) // TODO(@julienrbrt): Eventually remove this SDK dependency + return err }) } diff --git a/client/v2/go.mod b/client/v2/go.mod index f4fca1883e3f..113837041719 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -3,16 +3,17 @@ module cosmossdk.io/client/v2 go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/math v1.3.0 + cosmossdk.io/x/tx v0.13.3 github.com/cockroachdb/errors v1.11.1 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/cosmos-sdk v0.50.1 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.6 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 - google.golang.org/grpc v1.62.0 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 @@ -22,30 +23,30 @@ require ( cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.3.1 // indirect - cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/store v1.0.0 // indirect + cosmossdk.io/store v1.1.0 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -56,7 +57,7 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect @@ -83,7 +84,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -99,7 +100,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -110,13 +111,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -137,16 +138,16 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index f2794c6bb843..3567a0e69d81 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,10 +14,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -29,6 +29,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -90,8 +91,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= @@ -124,8 +125,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -140,19 +141,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -191,8 +192,8 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= 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/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -369,8 +370,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -458,8 +459,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -568,8 +569,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -590,32 +591,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -756,13 +757,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -777,8 +778,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -806,8 +807,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -819,8 +820,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -876,12 +877,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -913,8 +914,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -935,12 +936,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -958,8 +959,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/client/v2/internal/buf.lock b/client/v2/internal/buf.lock index 696956596bf8..ca09fbb4fad6 100644 --- a/client/v2/internal/buf.lock +++ b/client/v2/internal/buf.lock @@ -4,16 +4,30 @@ deps: - remote: buf.build owner: cosmos repository: cosmos-proto - commit: 1935555c206d4afb9e94615dfd0fad31 + commit: 04467658e59e44bbb22fe568206e1f70 + digest: shake256:73a640bd60e0c523b0f8237ff34eab67c45a38b64bbbde1d80224819d272dbf316ac183526bd245f994af6608b025f5130483d0133c5edd385531326b5990466 - remote: buf.build owner: cosmos repository: cosmos-sdk - commit: b7797ff7f3814399b0c5d52e1b8227ed + commit: 05419252bcc241ea8023acf1ed4cadc5 + digest: shake256:1e54a48c19a8b59d35e0a7efa76402939f515f2d8005df099856f24c37c20a52800308f025abb8cffcd014d437b49707388aaca4865d9d063d8f25d5d4eb77d5 - remote: buf.build owner: cosmos repository: gogo-proto - commit: 6652e3443c3b4504bb3bf82e73a7e409 + commit: 88ef6483f90f478fb938c37dde52ece3 + digest: shake256:89c45df2aa11e0cff97b0d695436713db3d993d76792e9f8dc1ae90e6ab9a9bec55503d48ceedd6b86069ab07d3041b32001b2bfe0227fa725dd515ff381e5ba - remote: buf.build owner: googleapis repository: googleapis - commit: 62f35d8aed1149c291d606d958a7ce32 + commit: 7e6f6e774e29406da95bd61cdcdbc8bc + digest: shake256:fe43dd2265ea0c07d76bd925eeba612667cf4c948d2ce53d6e367e1b4b3cb5fa69a51e6acb1a6a50d32f894f054a35e6c0406f6808a483f2752e10c866ffbf73 + - remote: buf.build + owner: protocolbuffers + repository: wellknowntypes + commit: 657250e6a39648cbb169d079a60bd9ba + digest: shake256:00de25001b8dd2e29d85fc4bcc3ede7aed886d76d67f5e0f7a9b320b90f871d3eb73507d50818d823a0512f3f8db77a11c043685528403e31ff3fef18323a9fb + - remote: buf.build + owner: tendermint + repository: tendermint + commit: 33ed361a90514289beabf3189e1d7665 + digest: shake256:038267e06294714fd883610626554b04a127b576b4e253befb4206cb72d5d3c1eeccacd4b9ec8e3fb891f7c14e1cb0f770c077d2989638995b0a61c85afedb1d diff --git a/client/v2/internal/testpb/msg.proto b/client/v2/internal/testpb/msg.proto index 11605759f41a..a1360175d0a1 100644 --- a/client/v2/internal/testpb/msg.proto +++ b/client/v2/internal/testpb/msg.proto @@ -11,10 +11,15 @@ import "testpb/query.proto"; service Msg { // Send a request and returns the request as a response. - rpc Send(MsgRequest) returns (MsgResponse); + rpc Send(MsgRequest) returns (MsgResponse) { + option (cosmos_proto.method_added_in) = "cosmos-sdk v0.50.0"; + }; + + rpc Clawback(MsgClawbackRequest) returns (MsgClawbackResponse) { + option (cosmos_proto.method_added_in) = "cosmos-sdk v0.51.0"; + } } -// MsgRequest is a sample request message message MsgRequest { // u32 is an uint32 uint32 u32 = 1; @@ -51,3 +56,7 @@ message MsgRequest { message MsgResponse { MsgRequest request = 1; } + +message MsgClawbackRequest {} + +message MsgClawbackResponse {} \ No newline at end of file diff --git a/client/v2/internal/testpb/msg.pulsar.go b/client/v2/internal/testpb/msg.pulsar.go index e1cc871ae2bc..29fd89007a3d 100644 --- a/client/v2/internal/testpb/msg.pulsar.go +++ b/client/v2/internal/testpb/msg.pulsar.go @@ -3140,6 +3140,718 @@ func (x *fastReflection_MsgResponse) ProtoMethods() *protoiface.Methods { } } +var ( + md_MsgClawbackRequest protoreflect.MessageDescriptor +) + +func init() { + file_testpb_msg_proto_init() + md_MsgClawbackRequest = File_testpb_msg_proto.Messages().ByName("MsgClawbackRequest") +} + +var _ protoreflect.Message = (*fastReflection_MsgClawbackRequest)(nil) + +type fastReflection_MsgClawbackRequest MsgClawbackRequest + +func (x *MsgClawbackRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClawbackRequest)(x) +} + +func (x *MsgClawbackRequest) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_msg_proto_msgTypes[2] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgClawbackRequest_messageType fastReflection_MsgClawbackRequest_messageType +var _ protoreflect.MessageType = fastReflection_MsgClawbackRequest_messageType{} + +type fastReflection_MsgClawbackRequest_messageType struct{} + +func (x fastReflection_MsgClawbackRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClawbackRequest)(nil) +} +func (x fastReflection_MsgClawbackRequest_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClawbackRequest) +} +func (x fastReflection_MsgClawbackRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClawbackRequest) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackRequest +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgClawbackRequest) Type() protoreflect.MessageType { + return _fastReflection_MsgClawbackRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClawbackRequest) New() protoreflect.Message { + return new(fastReflection_MsgClawbackRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClawbackRequest) Interface() protoreflect.ProtoMessage { + return (*MsgClawbackRequest)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgClawbackRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgClawbackRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgClawbackRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgClawbackRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackRequest")) + } + panic(fmt.Errorf("message testpb.MsgClawbackRequest does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgClawbackRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.MsgClawbackRequest", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgClawbackRequest) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackRequest) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgClawbackRequest) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgClawbackRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClawbackRequest) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgClawbackRequest) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgClawbackRequest) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + +var ( + md_MsgClawbackResponse protoreflect.MessageDescriptor +) + +func init() { + file_testpb_msg_proto_init() + md_MsgClawbackResponse = File_testpb_msg_proto.Messages().ByName("MsgClawbackResponse") +} + +var _ protoreflect.Message = (*fastReflection_MsgClawbackResponse)(nil) + +type fastReflection_MsgClawbackResponse MsgClawbackResponse + +func (x *MsgClawbackResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgClawbackResponse)(x) +} + +func (x *MsgClawbackResponse) slowProtoReflect() protoreflect.Message { + mi := &file_testpb_msg_proto_msgTypes[3] + if protoimpl.UnsafeEnabled && x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +var _fastReflection_MsgClawbackResponse_messageType fastReflection_MsgClawbackResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgClawbackResponse_messageType{} + +type fastReflection_MsgClawbackResponse_messageType struct{} + +func (x fastReflection_MsgClawbackResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgClawbackResponse)(nil) +} +func (x fastReflection_MsgClawbackResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgClawbackResponse) +} +func (x fastReflection_MsgClawbackResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgClawbackResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgClawbackResponse +} + +// Type returns the message type, which encapsulates both Go and protobuf +// type information. If the Go type information is not needed, +// it is recommended that the message descriptor be used instead. +func (x *fastReflection_MsgClawbackResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgClawbackResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgClawbackResponse) New() protoreflect.Message { + return new(fastReflection_MsgClawbackResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgClawbackResponse) Interface() protoreflect.ProtoMessage { + return (*MsgClawbackResponse)(x) +} + +// Range iterates over every populated field in an undefined order, +// calling f for each field descriptor and value encountered. +// Range returns immediately if f returns false. +// While iterating, mutating operations may only be performed +// on the current field descriptor. +func (x *fastReflection_MsgClawbackResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { +} + +// Has reports whether a field is populated. +// +// Some fields have the property of nullability where it is possible to +// distinguish between the default value of a field and whether the field +// was explicitly populated with the default value. Singular message fields, +// member fields of a oneof, and proto2 scalar fields are nullable. Such +// fields are populated only if explicitly set. +// +// In other cases (aside from the nullable cases above), +// a proto3 scalar field is populated if it contains a non-zero value, and +// a repeated field is populated if it is non-empty. +func (x *fastReflection_MsgClawbackResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse does not contain field %s", fd.FullName())) + } +} + +// Clear clears the field such that a subsequent Has call reports false. +// +// Clearing an extension field clears both the extension type and value +// associated with the given field number. +// +// Clear is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse does not contain field %s", fd.FullName())) + } +} + +// Get retrieves the value for a field. +// +// For unpopulated scalars, it returns the default value, where +// the default value of a bytes scalar is guaranteed to be a copy. +// For unpopulated composite types, it returns an empty, read-only view +// of the value; to obtain a mutable reference, use Mutable. +func (x *fastReflection_MsgClawbackResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse does not contain field %s", descriptor.FullName())) + } +} + +// Set stores the value for a field. +// +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType. +// When setting a composite type, it is unspecified whether the stored value +// aliases the source's memory in any way. If the composite value is an +// empty, read-only value, then it panics. +// +// Set is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse does not contain field %s", fd.FullName())) + } +} + +// Mutable returns a mutable reference to a composite type. +// +// If the field is unpopulated, it may allocate a composite value. +// For a field belonging to a oneof, it implicitly clears any other field +// that may be currently set within the same oneof. +// For extension fields, it implicitly stores the provided ExtensionType +// if not already stored. +// It panics if the field does not contain a composite type. +// +// Mutable is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse does not contain field %s", fd.FullName())) + } +} + +// NewField returns a new value that is assignable to the field +// for the given descriptor. For scalars, this returns the default value. +// For lists, maps, and messages, this returns a new, empty, mutable value. +func (x *fastReflection_MsgClawbackResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: testpb.MsgClawbackResponse")) + } + panic(fmt.Errorf("message testpb.MsgClawbackResponse does not contain field %s", fd.FullName())) + } +} + +// WhichOneof reports which field within the oneof is populated, +// returning nil if none are populated. +// It panics if the oneof descriptor does not belong to this message. +func (x *fastReflection_MsgClawbackResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in testpb.MsgClawbackResponse", d.FullName())) + } + panic("unreachable") +} + +// GetUnknown retrieves the entire list of unknown fields. +// The caller may only mutate the contents of the RawFields +// if the mutated bytes are stored back into the message with SetUnknown. +func (x *fastReflection_MsgClawbackResponse) GetUnknown() protoreflect.RawFields { + return x.unknownFields +} + +// SetUnknown stores an entire list of unknown fields. +// The raw fields must be syntactically valid according to the wire format. +// An implementation may panic if this is not the case. +// Once stored, the caller must not mutate the content of the RawFields. +// An empty RawFields may be passed to clear the fields. +// +// SetUnknown is a mutating operation and unsafe for concurrent use. +func (x *fastReflection_MsgClawbackResponse) SetUnknown(fields protoreflect.RawFields) { + x.unknownFields = fields +} + +// IsValid reports whether the message is valid. +// +// An invalid message is an empty, read-only value. +// +// An invalid message often corresponds to a nil pointer of the concrete +// message type, but the details are implementation dependent. +// Validity is not part of the protobuf data model, and may not +// be preserved in marshaling or other operations. +func (x *fastReflection_MsgClawbackResponse) IsValid() bool { + return x != nil +} + +// ProtoMethods returns optional fastReflectionFeature-path implementations of various operations. +// This method may return nil. +// +// The returned methods type is identical to +// "google.golang.org/protobuf/runtime/protoiface".Methods. +// Consult the protoiface package documentation for details. +func (x *fastReflection_MsgClawbackResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgClawbackResponse) + if x == nil { + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: 0, + } + } + options := runtime.SizeInputToOptions(input) + _ = options + var n int + var l int + _ = l + if x.unknownFields != nil { + n += len(x.unknownFields) + } + return protoiface.SizeOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Size: n, + } + } + + marshal := func(input protoiface.MarshalInput) (protoiface.MarshalOutput, error) { + x := input.Message.Interface().(*MsgClawbackResponse) + if x == nil { + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + options := runtime.MarshalInputToOptions(input) + _ = options + size := options.Size(x) + dAtA := make([]byte, size) + i := len(dAtA) + _ = i + var l int + _ = l + if x.unknownFields != nil { + i -= len(x.unknownFields) + copy(dAtA[i:], x.unknownFields) + } + if input.Buf != nil { + input.Buf = append(input.Buf, dAtA...) + } else { + input.Buf = dAtA + } + return protoiface.MarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Buf: input.Buf, + }, nil + } + unmarshal := func(input protoiface.UnmarshalInput) (protoiface.UnmarshalOutput, error) { + x := input.Message.Interface().(*MsgClawbackResponse) + if x == nil { + return protoiface.UnmarshalOutput{ + NoUnkeyedLiterals: input.NoUnkeyedLiterals, + Flags: input.Flags, + }, nil + } + options := runtime.UnmarshalInputToOptions(input) + _ = options + dAtA := input.Buf + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow + } + if iNdEx >= l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, 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 protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgClawbackResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + default: + iNdEx = preIndex + skippy, err := runtime.Skip(dAtA[iNdEx:]) + if err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength + } + if (iNdEx + skippy) > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + if !options.DiscardUnknown { + x.unknownFields = append(x.unknownFields, dAtA[iNdEx:iNdEx+skippy]...) + } + iNdEx += skippy + } + } + + if iNdEx > l { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF + } + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, nil + } + return &protoiface.Methods{ + NoUnkeyedLiterals: struct{}{}, + Flags: protoiface.SupportMarshalDeterministic | protoiface.SupportUnmarshalDiscardUnknown, + Size: size, + Marshal: marshal, + Unmarshal: unmarshal, + Merge: nil, + CheckInitialized: nil, + } +} + // Code generated by protoc-gen-go. DO NOT EDIT. // versions: // protoc-gen-go v1.27.0 @@ -3153,7 +3865,6 @@ const ( _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20) ) -// MsgRequest is a sample request message type MsgRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -3433,6 +4144,58 @@ func (x *MsgResponse) GetRequest() *MsgRequest { return nil } +type MsgClawbackRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClawbackRequest) Reset() { + *x = MsgClawbackRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClawbackRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClawbackRequest) ProtoMessage() {} + +// Deprecated: Use MsgClawbackRequest.ProtoReflect.Descriptor instead. +func (*MsgClawbackRequest) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{2} +} + +type MsgClawbackResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields +} + +func (x *MsgClawbackResponse) Reset() { + *x = MsgClawbackResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_testpb_msg_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgClawbackResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgClawbackResponse) ProtoMessage() {} + +// Deprecated: Use MsgClawbackResponse.ProtoReflect.Descriptor instead. +func (*MsgClawbackResponse) Descriptor() ([]byte, []int) { + return file_testpb_msg_proto_rawDescGZIP(), []int{3} +} + var File_testpb_msg_proto protoreflect.FileDescriptor var file_testpb_msg_proto_rawDesc = []byte{ @@ -3521,147 +4284,30 @@ var file_testpb_msg_proto_rawDesc = []byte{ 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2c, 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, - 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x32, 0x36, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, - 0x2f, 0x0a, 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, - 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x42, - 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, 0x67, 0x69, 0x74, - 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, - 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, - 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, - 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, - 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, - 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x4a, 0xf8, 0x0f, 0x0a, 0x06, 0x12, 0x04, - 0x00, 0x00, 0x34, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, 0x00, 0x12, 0x0a, 0x08, - 0x0a, 0x01, 0x02, 0x12, 0x03, 0x02, 0x00, 0x0f, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x00, 0x12, 0x03, - 0x04, 0x00, 0x29, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x01, 0x12, 0x03, 0x05, 0x00, 0x28, 0x0a, 0x09, - 0x0a, 0x02, 0x03, 0x02, 0x12, 0x03, 0x06, 0x00, 0x23, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x03, 0x12, - 0x03, 0x07, 0x00, 0x34, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x04, 0x12, 0x03, 0x08, 0x00, 0x28, 0x0a, - 0x09, 0x0a, 0x02, 0x03, 0x05, 0x12, 0x03, 0x09, 0x00, 0x1c, 0x0a, 0x0a, 0x0a, 0x02, 0x06, 0x00, - 0x12, 0x04, 0x0b, 0x00, 0x0e, 0x01, 0x0a, 0x0a, 0x0a, 0x03, 0x06, 0x00, 0x01, 0x12, 0x03, 0x0b, - 0x08, 0x0b, 0x0a, 0x44, 0x0a, 0x04, 0x06, 0x00, 0x02, 0x00, 0x12, 0x03, 0x0d, 0x02, 0x2d, 0x1a, - 0x37, 0x20, 0x53, 0x65, 0x6e, 0x64, 0x20, 0x61, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x20, 0x61, 0x6e, 0x64, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, - 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x61, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x06, 0x00, 0x02, 0x00, - 0x01, 0x12, 0x03, 0x0d, 0x06, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x06, 0x00, 0x02, 0x00, 0x02, 0x12, - 0x03, 0x0d, 0x0b, 0x15, 0x0a, 0x0c, 0x0a, 0x05, 0x06, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0d, - 0x20, 0x2b, 0x0a, 0x34, 0x0a, 0x02, 0x04, 0x00, 0x12, 0x04, 0x11, 0x00, 0x30, 0x01, 0x1a, 0x28, - 0x20, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, 0x69, 0x73, 0x20, 0x61, - 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x20, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x0a, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x00, 0x01, 0x12, - 0x03, 0x11, 0x08, 0x12, 0x0a, 0x1f, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x00, 0x12, 0x03, 0x13, 0x02, - 0x37, 0x1a, 0x12, 0x20, 0x75, 0x33, 0x32, 0x20, 0x69, 0x73, 0x20, 0x61, 0x6e, 0x20, 0x75, 0x69, - 0x6e, 0x74, 0x33, 0x32, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x05, 0x12, 0x03, - 0x13, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x13, 0x28, - 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x13, 0x35, 0x36, 0x0a, - 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x01, 0x12, 0x03, 0x14, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x00, 0x02, 0x01, 0x05, 0x12, 0x03, 0x14, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, - 0x02, 0x01, 0x01, 0x12, 0x03, 0x14, 0x28, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, - 0x03, 0x12, 0x03, 0x14, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x02, 0x12, 0x03, - 0x15, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x02, 0x05, 0x12, 0x03, 0x15, 0x02, - 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x02, 0x01, 0x12, 0x03, 0x15, 0x28, 0x2b, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x02, 0x03, 0x12, 0x03, 0x15, 0x35, 0x36, 0x0a, 0x0b, 0x0a, - 0x04, 0x04, 0x00, 0x02, 0x03, 0x12, 0x03, 0x16, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, - 0x02, 0x03, 0x05, 0x12, 0x03, 0x16, 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x03, - 0x01, 0x12, 0x03, 0x16, 0x28, 0x2a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x03, 0x03, 0x12, - 0x03, 0x16, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x04, 0x12, 0x03, 0x17, 0x02, - 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x06, 0x12, 0x03, 0x17, 0x02, 0x1b, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x04, 0x01, 0x12, 0x03, 0x17, 0x28, 0x31, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x00, 0x02, 0x04, 0x03, 0x12, 0x03, 0x17, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, - 0x00, 0x02, 0x05, 0x12, 0x03, 0x18, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x05, - 0x06, 0x12, 0x03, 0x18, 0x02, 0x1a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x05, 0x01, 0x12, - 0x03, 0x18, 0x28, 0x30, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x05, 0x03, 0x12, 0x03, 0x18, - 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x06, 0x12, 0x03, 0x19, 0x02, 0x37, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x06, 0x05, 0x12, 0x03, 0x19, 0x02, 0x07, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x00, 0x02, 0x06, 0x01, 0x12, 0x03, 0x19, 0x28, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x06, 0x03, 0x12, 0x03, 0x19, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, - 0x07, 0x12, 0x03, 0x1a, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x07, 0x05, 0x12, - 0x03, 0x1a, 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x07, 0x01, 0x12, 0x03, 0x1a, - 0x28, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x07, 0x03, 0x12, 0x03, 0x1a, 0x35, 0x37, - 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x08, 0x12, 0x03, 0x1b, 0x02, 0x38, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x00, 0x02, 0x08, 0x05, 0x12, 0x03, 0x1b, 0x02, 0x06, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x08, 0x01, 0x12, 0x03, 0x1b, 0x28, 0x2e, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, - 0x08, 0x03, 0x12, 0x03, 0x1b, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x09, 0x12, - 0x03, 0x1c, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x09, 0x06, 0x12, 0x03, 0x1c, - 0x02, 0x0d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x09, 0x01, 0x12, 0x03, 0x1c, 0x28, 0x2f, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x09, 0x03, 0x12, 0x03, 0x1c, 0x35, 0x37, 0x0a, 0x0b, - 0x0a, 0x04, 0x04, 0x00, 0x02, 0x0a, 0x12, 0x03, 0x1d, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x0a, 0x06, 0x12, 0x03, 0x1d, 0x02, 0x11, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, - 0x0a, 0x01, 0x12, 0x03, 0x1d, 0x28, 0x31, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0a, 0x03, - 0x12, 0x03, 0x1d, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x0b, 0x12, 0x03, 0x1e, - 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0b, 0x06, 0x12, 0x03, 0x1e, 0x02, 0x1a, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0b, 0x01, 0x12, 0x03, 0x1e, 0x28, 0x2e, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0b, 0x03, 0x12, 0x03, 0x1e, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, - 0x04, 0x00, 0x02, 0x0c, 0x12, 0x03, 0x1f, 0x02, 0x69, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, - 0x0c, 0x05, 0x12, 0x03, 0x1f, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0c, 0x01, - 0x12, 0x03, 0x1f, 0x28, 0x32, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0c, 0x03, 0x12, 0x03, - 0x1f, 0x35, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0c, 0x08, 0x12, 0x03, 0x1f, 0x38, - 0x68, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x02, 0x0c, 0x08, 0xca, 0xd6, 0x05, 0x12, 0x03, 0x1f, - 0x39, 0x67, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x0d, 0x12, 0x03, 0x20, 0x02, 0x38, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0d, 0x06, 0x12, 0x03, 0x20, 0x02, 0x27, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x00, 0x02, 0x0d, 0x01, 0x12, 0x03, 0x20, 0x28, 0x2c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x0d, 0x03, 0x12, 0x03, 0x20, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, - 0x0e, 0x12, 0x03, 0x21, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0e, 0x04, 0x12, - 0x03, 0x21, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0e, 0x05, 0x12, 0x03, 0x21, - 0x0b, 0x0f, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0e, 0x01, 0x12, 0x03, 0x21, 0x28, 0x2d, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0e, 0x03, 0x12, 0x03, 0x21, 0x35, 0x37, 0x0a, 0x0b, - 0x0a, 0x04, 0x04, 0x00, 0x02, 0x0f, 0x12, 0x03, 0x22, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x0f, 0x04, 0x12, 0x03, 0x22, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, - 0x0f, 0x05, 0x12, 0x03, 0x22, 0x0b, 0x11, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0f, 0x01, - 0x12, 0x03, 0x22, 0x28, 0x2d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x0f, 0x03, 0x12, 0x03, - 0x22, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x10, 0x12, 0x03, 0x23, 0x02, 0x38, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x10, 0x04, 0x12, 0x03, 0x23, 0x02, 0x0a, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x00, 0x02, 0x10, 0x05, 0x12, 0x03, 0x23, 0x0b, 0x11, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x00, 0x02, 0x10, 0x01, 0x12, 0x03, 0x23, 0x28, 0x2f, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, - 0x02, 0x10, 0x03, 0x12, 0x03, 0x23, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x11, - 0x12, 0x03, 0x24, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x11, 0x04, 0x12, 0x03, - 0x24, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x11, 0x06, 0x12, 0x03, 0x24, 0x0b, - 0x16, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x11, 0x01, 0x12, 0x03, 0x24, 0x17, 0x1c, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x11, 0x03, 0x12, 0x03, 0x24, 0x35, 0x37, 0x0a, 0x0b, 0x0a, - 0x04, 0x04, 0x00, 0x02, 0x12, 0x12, 0x03, 0x25, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, - 0x02, 0x12, 0x04, 0x12, 0x03, 0x25, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x12, - 0x06, 0x12, 0x03, 0x25, 0x0b, 0x23, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x12, 0x01, 0x12, - 0x03, 0x25, 0x24, 0x2d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x12, 0x03, 0x12, 0x03, 0x25, - 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x13, 0x12, 0x03, 0x26, 0x02, 0x38, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x13, 0x04, 0x12, 0x03, 0x26, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x00, 0x02, 0x13, 0x06, 0x12, 0x03, 0x26, 0x0b, 0x1a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x13, 0x01, 0x12, 0x03, 0x26, 0x1b, 0x28, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, - 0x13, 0x03, 0x12, 0x03, 0x26, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x14, 0x12, - 0x03, 0x28, 0x02, 0x3d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x14, 0x05, 0x12, 0x03, 0x28, - 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x14, 0x01, 0x12, 0x03, 0x28, 0x0b, 0x16, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x14, 0x03, 0x12, 0x03, 0x28, 0x3a, 0x3c, 0x0a, 0x0b, - 0x0a, 0x04, 0x04, 0x00, 0x02, 0x15, 0x12, 0x03, 0x29, 0x02, 0x3d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x00, 0x02, 0x15, 0x05, 0x12, 0x03, 0x29, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, - 0x15, 0x01, 0x12, 0x03, 0x29, 0x0b, 0x16, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x15, 0x03, - 0x12, 0x03, 0x29, 0x3a, 0x3c, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x16, 0x12, 0x03, 0x2a, - 0x02, 0x3d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x16, 0x04, 0x12, 0x03, 0x2a, 0x02, 0x0a, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x16, 0x06, 0x12, 0x03, 0x2a, 0x0b, 0x23, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x00, 0x02, 0x16, 0x01, 0x12, 0x03, 0x2a, 0x24, 0x37, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x00, 0x02, 0x16, 0x03, 0x12, 0x03, 0x2a, 0x3a, 0x3c, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, - 0x02, 0x17, 0x12, 0x03, 0x2c, 0x02, 0x29, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x17, 0x05, - 0x12, 0x03, 0x2c, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x17, 0x01, 0x12, 0x03, - 0x2c, 0x09, 0x19, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x17, 0x03, 0x12, 0x03, 0x2c, 0x26, - 0x28, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x18, 0x12, 0x03, 0x2d, 0x02, 0x29, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x00, 0x02, 0x18, 0x05, 0x12, 0x03, 0x2d, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x00, 0x02, 0x18, 0x01, 0x12, 0x03, 0x2d, 0x09, 0x23, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, - 0x02, 0x18, 0x03, 0x12, 0x03, 0x2d, 0x26, 0x28, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x19, - 0x12, 0x03, 0x2e, 0x02, 0x29, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x19, 0x05, 0x12, 0x03, - 0x2e, 0x02, 0x06, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x19, 0x01, 0x12, 0x03, 0x2e, 0x09, - 0x14, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x19, 0x03, 0x12, 0x03, 0x2e, 0x26, 0x28, 0x0a, - 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x1a, 0x12, 0x03, 0x2f, 0x02, 0x63, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x00, 0x02, 0x1a, 0x05, 0x12, 0x03, 0x2f, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, - 0x02, 0x1a, 0x01, 0x12, 0x03, 0x2f, 0x09, 0x1c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x1a, - 0x03, 0x12, 0x03, 0x2f, 0x26, 0x28, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x1a, 0x08, 0x12, - 0x03, 0x2f, 0x29, 0x62, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x00, 0x02, 0x1a, 0x08, 0xca, 0xd6, 0x05, - 0x12, 0x03, 0x2f, 0x2a, 0x61, 0x0a, 0x0a, 0x0a, 0x02, 0x04, 0x01, 0x12, 0x04, 0x32, 0x00, 0x34, - 0x01, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12, 0x03, 0x32, 0x08, 0x13, 0x0a, 0x0b, 0x0a, - 0x04, 0x04, 0x01, 0x02, 0x00, 0x12, 0x03, 0x33, 0x02, 0x19, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x00, 0x06, 0x12, 0x03, 0x33, 0x02, 0x0c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, - 0x01, 0x12, 0x03, 0x33, 0x0d, 0x14, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, 0x12, - 0x03, 0x33, 0x17, 0x18, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x14, 0x0a, 0x12, 0x4d, 0x73, 0x67, 0x43, + 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x15, + 0x0a, 0x13, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0xab, 0x01, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x47, 0x0a, + 0x04, 0x53, 0x65, 0x6e, 0x64, 0x12, 0x12, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, + 0x73, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, + 0xca, 0xb4, 0x2d, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, + 0x30, 0x2e, 0x35, 0x30, 0x2e, 0x30, 0x12, 0x5b, 0x0a, 0x08, 0x43, 0x6c, 0x61, 0x77, 0x62, 0x61, + 0x63, 0x6b, 0x12, 0x1a, 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, + 0x6c, 0x61, 0x77, 0x62, 0x61, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1b, + 0x2e, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x6c, 0x61, 0x77, 0x62, + 0x61, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0xca, 0xb4, 0x2d, + 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x20, 0x76, 0x30, 0x2e, 0x35, + 0x31, 0x2e, 0x30, 0x42, 0x86, 0x01, 0x0a, 0x0a, 0x63, 0x6f, 0x6d, 0x2e, 0x74, 0x65, 0x73, 0x74, + 0x70, 0x62, 0x42, 0x08, 0x4d, 0x73, 0x67, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x36, + 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2d, 0x73, 0x64, 0x6b, 0x2f, 0x63, 0x6c, 0x69, + 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x32, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, + 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, + 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, + 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, + 0x61, 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -3676,33 +4322,37 @@ func file_testpb_msg_proto_rawDescGZIP() []byte { return file_testpb_msg_proto_rawDescData } -var file_testpb_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_testpb_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 4) var file_testpb_msg_proto_goTypes = []interface{}{ (*MsgRequest)(nil), // 0: testpb.MsgRequest (*MsgResponse)(nil), // 1: testpb.MsgResponse - (*timestamppb.Timestamp)(nil), // 2: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 3: google.protobuf.Duration - (Enum)(0), // 4: testpb.Enum - (*AMessage)(nil), // 5: testpb.AMessage - (*v1beta1.Coin)(nil), // 6: cosmos.base.v1beta1.Coin - (*v1beta11.PageRequest)(nil), // 7: cosmos.base.query.v1beta1.PageRequest + (*MsgClawbackRequest)(nil), // 2: testpb.MsgClawbackRequest + (*MsgClawbackResponse)(nil), // 3: testpb.MsgClawbackResponse + (*timestamppb.Timestamp)(nil), // 4: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 5: google.protobuf.Duration + (Enum)(0), // 6: testpb.Enum + (*AMessage)(nil), // 7: testpb.AMessage + (*v1beta1.Coin)(nil), // 8: cosmos.base.v1beta1.Coin + (*v1beta11.PageRequest)(nil), // 9: cosmos.base.query.v1beta1.PageRequest } var file_testpb_msg_proto_depIdxs = []int32{ - 2, // 0: testpb.MsgRequest.timestamp:type_name -> google.protobuf.Timestamp - 3, // 1: testpb.MsgRequest.duration:type_name -> google.protobuf.Duration - 4, // 2: testpb.MsgRequest.an_enum:type_name -> testpb.Enum - 5, // 3: testpb.MsgRequest.a_message:type_name -> testpb.AMessage - 6, // 4: testpb.MsgRequest.a_coin:type_name -> cosmos.base.v1beta1.Coin - 7, // 5: testpb.MsgRequest.page:type_name -> cosmos.base.query.v1beta1.PageRequest - 4, // 6: testpb.MsgRequest.enums:type_name -> testpb.Enum - 3, // 7: testpb.MsgRequest.durations:type_name -> google.protobuf.Duration - 5, // 8: testpb.MsgRequest.some_messages:type_name -> testpb.AMessage - 6, // 9: testpb.MsgRequest.positional3_varargs:type_name -> cosmos.base.v1beta1.Coin + 4, // 0: testpb.MsgRequest.timestamp:type_name -> google.protobuf.Timestamp + 5, // 1: testpb.MsgRequest.duration:type_name -> google.protobuf.Duration + 6, // 2: testpb.MsgRequest.an_enum:type_name -> testpb.Enum + 7, // 3: testpb.MsgRequest.a_message:type_name -> testpb.AMessage + 8, // 4: testpb.MsgRequest.a_coin:type_name -> cosmos.base.v1beta1.Coin + 9, // 5: testpb.MsgRequest.page:type_name -> cosmos.base.query.v1beta1.PageRequest + 6, // 6: testpb.MsgRequest.enums:type_name -> testpb.Enum + 5, // 7: testpb.MsgRequest.durations:type_name -> google.protobuf.Duration + 7, // 8: testpb.MsgRequest.some_messages:type_name -> testpb.AMessage + 8, // 9: testpb.MsgRequest.positional3_varargs:type_name -> cosmos.base.v1beta1.Coin 0, // 10: testpb.MsgResponse.request:type_name -> testpb.MsgRequest 0, // 11: testpb.Msg.Send:input_type -> testpb.MsgRequest - 1, // 12: testpb.Msg.Send:output_type -> testpb.MsgResponse - 12, // [12:13] is the sub-list for method output_type - 11, // [11:12] is the sub-list for method input_type + 2, // 12: testpb.Msg.Clawback:input_type -> testpb.MsgClawbackRequest + 1, // 13: testpb.Msg.Send:output_type -> testpb.MsgResponse + 3, // 14: testpb.Msg.Clawback:output_type -> testpb.MsgClawbackResponse + 13, // [13:15] is the sub-list for method output_type + 11, // [11:13] is the sub-list for method input_type 11, // [11:11] is the sub-list for extension type_name 11, // [11:11] is the sub-list for extension extendee 0, // [0:11] is the sub-list for field type_name @@ -3739,6 +4389,30 @@ func file_testpb_msg_proto_init() { return nil } } + file_testpb_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClawbackRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_testpb_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgClawbackResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } } type x struct{} out := protoimpl.TypeBuilder{ @@ -3746,7 +4420,7 @@ func file_testpb_msg_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_testpb_msg_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 4, NumExtensions: 0, NumServices: 1, }, diff --git a/client/v2/internal/testpb/msg_grpc.pb.go b/client/v2/internal/testpb/msg_grpc.pb.go index 663941ff9a95..ebcfba150bb9 100644 --- a/client/v2/internal/testpb/msg_grpc.pb.go +++ b/client/v2/internal/testpb/msg_grpc.pb.go @@ -19,7 +19,8 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_Send_FullMethodName = "/testpb.Msg/Send" + Msg_Send_FullMethodName = "/testpb.Msg/Send" + Msg_Clawback_FullMethodName = "/testpb.Msg/Clawback" ) // MsgClient is the client API for Msg service. @@ -28,6 +29,7 @@ const ( type MsgClient interface { // Send a request and returns the request as a response. Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallOption) (*MsgResponse, error) + Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) } type msgClient struct { @@ -47,12 +49,22 @@ func (c *msgClient) Send(ctx context.Context, in *MsgRequest, opts ...grpc.CallO return out, nil } +func (c *msgClient) Clawback(ctx context.Context, in *MsgClawbackRequest, opts ...grpc.CallOption) (*MsgClawbackResponse, error) { + out := new(MsgClawbackResponse) + err := c.cc.Invoke(ctx, Msg_Clawback_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. // All implementations must embed UnimplementedMsgServer // for forward compatibility type MsgServer interface { // Send a request and returns the request as a response. Send(context.Context, *MsgRequest) (*MsgResponse, error) + Clawback(context.Context, *MsgClawbackRequest) (*MsgClawbackResponse, error) mustEmbedUnimplementedMsgServer() } @@ -63,6 +75,9 @@ type UnimplementedMsgServer struct { func (UnimplementedMsgServer) Send(context.Context, *MsgRequest) (*MsgResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method Send not implemented") } +func (UnimplementedMsgServer) Clawback(context.Context, *MsgClawbackRequest) (*MsgClawbackResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method Clawback not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -94,6 +109,24 @@ func _Msg_Send_Handler(srv interface{}, ctx context.Context, dec func(interface{ return interceptor(ctx, in, info, handler) } +func _Msg_Clawback_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgClawbackRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).Clawback(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_Clawback_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).Clawback(ctx, req.(*MsgClawbackRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Msg_ServiceDesc is the grpc.ServiceDesc for Msg service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -105,6 +138,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "Send", Handler: _Msg_Send_Handler, }, + { + MethodName: "Clawback", + Handler: _Msg_Clawback_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "testpb/msg.proto", diff --git a/client/v2/internal/testpb/query.pulsar.go b/client/v2/internal/testpb/query.pulsar.go index 4ed2eab54659..53f899b395ca 100644 --- a/client/v2/internal/testpb/query.pulsar.go +++ b/client/v2/internal/testpb/query.pulsar.go @@ -5316,174 +5316,8 @@ var file_testpb_query_proto_rawDesc = []byte{ 0x65, 0x73, 0x74, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x54, 0x58, 0x58, 0xaa, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xca, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0xe2, 0x02, 0x12, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x4a, 0xe1, 0x14, 0x0a, 0x06, - 0x12, 0x04, 0x00, 0x00, 0x45, 0x01, 0x0a, 0x08, 0x0a, 0x01, 0x0c, 0x12, 0x03, 0x00, 0x00, 0x12, - 0x0a, 0x08, 0x0a, 0x01, 0x02, 0x12, 0x03, 0x02, 0x00, 0x0f, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x00, - 0x12, 0x03, 0x04, 0x00, 0x29, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x01, 0x12, 0x03, 0x05, 0x00, 0x28, - 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x02, 0x12, 0x03, 0x06, 0x00, 0x23, 0x0a, 0x09, 0x0a, 0x02, 0x03, - 0x03, 0x12, 0x03, 0x07, 0x00, 0x34, 0x0a, 0x09, 0x0a, 0x02, 0x03, 0x04, 0x12, 0x03, 0x08, 0x00, - 0x28, 0x0a, 0x0a, 0x0a, 0x02, 0x06, 0x00, 0x12, 0x04, 0x0a, 0x00, 0x0d, 0x01, 0x0a, 0x0a, 0x0a, - 0x03, 0x06, 0x00, 0x01, 0x12, 0x03, 0x0a, 0x08, 0x0d, 0x0a, 0x37, 0x0a, 0x04, 0x06, 0x00, 0x02, - 0x00, 0x12, 0x03, 0x0c, 0x02, 0x2f, 0x1a, 0x2a, 0x20, 0x45, 0x63, 0x68, 0x6f, 0x20, 0x72, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x06, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x0c, 0x06, 0x0a, - 0x0a, 0x0c, 0x0a, 0x05, 0x06, 0x00, 0x02, 0x00, 0x02, 0x12, 0x03, 0x0c, 0x0b, 0x16, 0x0a, 0x0c, - 0x0a, 0x05, 0x06, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x0c, 0x21, 0x2d, 0x0a, 0x0a, 0x0a, 0x02, - 0x04, 0x00, 0x12, 0x04, 0x0f, 0x00, 0x12, 0x01, 0x0a, 0x0a, 0x0a, 0x03, 0x04, 0x00, 0x01, 0x12, - 0x03, 0x0f, 0x08, 0x10, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x00, 0x02, 0x00, 0x12, 0x03, 0x10, 0x02, - 0x11, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x05, 0x12, 0x03, 0x10, 0x02, 0x08, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x10, 0x09, 0x0c, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x00, 0x02, 0x00, 0x03, 0x12, 0x03, 0x10, 0x0f, 0x10, 0x0a, 0x0b, 0x0a, 0x04, 0x04, - 0x00, 0x02, 0x01, 0x12, 0x03, 0x11, 0x02, 0x11, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, - 0x05, 0x12, 0x03, 0x11, 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x01, 0x12, - 0x03, 0x11, 0x09, 0x0c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x00, 0x02, 0x01, 0x03, 0x12, 0x03, 0x11, - 0x0f, 0x10, 0x0a, 0x0a, 0x0a, 0x02, 0x04, 0x01, 0x12, 0x04, 0x14, 0x00, 0x39, 0x01, 0x0a, 0x0a, - 0x0a, 0x03, 0x04, 0x01, 0x01, 0x12, 0x03, 0x14, 0x08, 0x13, 0x0a, 0x1f, 0x0a, 0x04, 0x04, 0x01, - 0x02, 0x00, 0x12, 0x03, 0x16, 0x02, 0x37, 0x1a, 0x12, 0x20, 0x75, 0x33, 0x32, 0x20, 0x69, 0x73, - 0x20, 0x61, 0x6e, 0x20, 0x75, 0x69, 0x6e, 0x74, 0x33, 0x32, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x00, 0x05, 0x12, 0x03, 0x16, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x00, 0x01, 0x12, 0x03, 0x16, 0x28, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x00, 0x03, - 0x12, 0x03, 0x16, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x01, 0x12, 0x03, 0x17, - 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x01, 0x05, 0x12, 0x03, 0x17, 0x02, 0x08, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x01, 0x01, 0x12, 0x03, 0x17, 0x28, 0x2b, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x01, 0x02, 0x01, 0x03, 0x12, 0x03, 0x17, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, - 0x04, 0x01, 0x02, 0x02, 0x12, 0x03, 0x18, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x02, 0x05, 0x12, 0x03, 0x18, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x02, 0x01, - 0x12, 0x03, 0x18, 0x28, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x02, 0x03, 0x12, 0x03, - 0x18, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x03, 0x12, 0x03, 0x19, 0x02, 0x37, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x03, 0x05, 0x12, 0x03, 0x19, 0x02, 0x07, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x01, 0x02, 0x03, 0x01, 0x12, 0x03, 0x19, 0x28, 0x2a, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x01, 0x02, 0x03, 0x03, 0x12, 0x03, 0x19, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, - 0x02, 0x04, 0x12, 0x03, 0x1a, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x04, 0x06, - 0x12, 0x03, 0x1a, 0x02, 0x1b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x04, 0x01, 0x12, 0x03, - 0x1a, 0x28, 0x31, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x04, 0x03, 0x12, 0x03, 0x1a, 0x35, - 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x05, 0x12, 0x03, 0x1b, 0x02, 0x37, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x01, 0x02, 0x05, 0x06, 0x12, 0x03, 0x1b, 0x02, 0x1a, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x01, 0x02, 0x05, 0x01, 0x12, 0x03, 0x1b, 0x28, 0x30, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x05, 0x03, 0x12, 0x03, 0x1b, 0x35, 0x36, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x06, - 0x12, 0x03, 0x1c, 0x02, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x06, 0x05, 0x12, 0x03, - 0x1c, 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x06, 0x01, 0x12, 0x03, 0x1c, 0x28, - 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x06, 0x03, 0x12, 0x03, 0x1c, 0x35, 0x36, 0x0a, - 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x07, 0x12, 0x03, 0x1d, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x01, 0x02, 0x07, 0x05, 0x12, 0x03, 0x1d, 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x07, 0x01, 0x12, 0x03, 0x1d, 0x28, 0x2b, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x07, - 0x03, 0x12, 0x03, 0x1d, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x08, 0x12, 0x03, - 0x1e, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x08, 0x05, 0x12, 0x03, 0x1e, 0x02, - 0x06, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x08, 0x01, 0x12, 0x03, 0x1e, 0x28, 0x2e, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x08, 0x03, 0x12, 0x03, 0x1e, 0x35, 0x37, 0x0a, 0x0b, 0x0a, - 0x04, 0x04, 0x01, 0x02, 0x09, 0x12, 0x03, 0x1f, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x09, 0x06, 0x12, 0x03, 0x1f, 0x02, 0x06, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x09, - 0x01, 0x12, 0x03, 0x1f, 0x28, 0x2f, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x09, 0x03, 0x12, - 0x03, 0x1f, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x0a, 0x12, 0x03, 0x20, 0x02, - 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0a, 0x06, 0x12, 0x03, 0x20, 0x02, 0x0a, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0a, 0x01, 0x12, 0x03, 0x20, 0x28, 0x31, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x0a, 0x03, 0x12, 0x03, 0x20, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, - 0x01, 0x02, 0x0b, 0x12, 0x03, 0x21, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0b, - 0x06, 0x12, 0x03, 0x21, 0x02, 0x1a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0b, 0x01, 0x12, - 0x03, 0x21, 0x28, 0x2e, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0b, 0x03, 0x12, 0x03, 0x21, - 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x0c, 0x12, 0x03, 0x22, 0x02, 0x69, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0c, 0x05, 0x12, 0x03, 0x22, 0x02, 0x08, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x0c, 0x01, 0x12, 0x03, 0x22, 0x28, 0x32, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x0c, 0x03, 0x12, 0x03, 0x22, 0x35, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x0c, 0x08, 0x12, 0x03, 0x22, 0x38, 0x68, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x01, 0x02, 0x0c, 0x08, - 0xca, 0xd6, 0x05, 0x12, 0x03, 0x22, 0x39, 0x67, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x0d, - 0x12, 0x03, 0x23, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0d, 0x06, 0x12, 0x03, - 0x23, 0x02, 0x27, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0d, 0x01, 0x12, 0x03, 0x23, 0x28, - 0x2c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0d, 0x03, 0x12, 0x03, 0x23, 0x35, 0x37, 0x0a, - 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x0e, 0x12, 0x03, 0x24, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x01, 0x02, 0x0e, 0x04, 0x12, 0x03, 0x24, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x0e, 0x05, 0x12, 0x03, 0x24, 0x0b, 0x0f, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0e, - 0x01, 0x12, 0x03, 0x24, 0x28, 0x2d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0e, 0x03, 0x12, - 0x03, 0x24, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x0f, 0x12, 0x03, 0x25, 0x02, - 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0f, 0x04, 0x12, 0x03, 0x25, 0x02, 0x0a, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x0f, 0x05, 0x12, 0x03, 0x25, 0x0b, 0x11, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x0f, 0x01, 0x12, 0x03, 0x25, 0x28, 0x2d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x0f, 0x03, 0x12, 0x03, 0x25, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, - 0x10, 0x12, 0x03, 0x26, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x10, 0x04, 0x12, - 0x03, 0x26, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x10, 0x05, 0x12, 0x03, 0x26, - 0x0b, 0x11, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x10, 0x01, 0x12, 0x03, 0x26, 0x28, 0x2f, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x10, 0x03, 0x12, 0x03, 0x26, 0x35, 0x37, 0x0a, 0x0b, - 0x0a, 0x04, 0x04, 0x01, 0x02, 0x11, 0x12, 0x03, 0x27, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x11, 0x04, 0x12, 0x03, 0x27, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x11, 0x06, 0x12, 0x03, 0x27, 0x0b, 0x0f, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x11, 0x01, - 0x12, 0x03, 0x27, 0x28, 0x2d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x11, 0x03, 0x12, 0x03, - 0x27, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x12, 0x12, 0x03, 0x28, 0x02, 0x38, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x12, 0x04, 0x12, 0x03, 0x28, 0x02, 0x0a, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x01, 0x02, 0x12, 0x06, 0x12, 0x03, 0x28, 0x0b, 0x23, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x01, 0x02, 0x12, 0x01, 0x12, 0x03, 0x28, 0x24, 0x2d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x12, 0x03, 0x12, 0x03, 0x28, 0x35, 0x37, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x13, - 0x12, 0x03, 0x29, 0x02, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x13, 0x04, 0x12, 0x03, - 0x29, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x13, 0x06, 0x12, 0x03, 0x29, 0x0b, - 0x13, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x13, 0x01, 0x12, 0x03, 0x29, 0x24, 0x31, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x13, 0x03, 0x12, 0x03, 0x29, 0x35, 0x37, 0x0a, 0x0b, 0x0a, - 0x04, 0x04, 0x01, 0x02, 0x14, 0x12, 0x03, 0x2b, 0x02, 0x3d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, - 0x02, 0x14, 0x05, 0x12, 0x03, 0x2b, 0x02, 0x07, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x14, - 0x01, 0x12, 0x03, 0x2b, 0x0b, 0x16, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x14, 0x03, 0x12, - 0x03, 0x2b, 0x3a, 0x3c, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x15, 0x12, 0x03, 0x2c, 0x02, - 0x3d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x15, 0x05, 0x12, 0x03, 0x2c, 0x02, 0x08, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x15, 0x01, 0x12, 0x03, 0x2c, 0x0b, 0x16, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x15, 0x03, 0x12, 0x03, 0x2c, 0x3a, 0x3c, 0x0a, 0x0b, 0x0a, 0x04, 0x04, - 0x01, 0x02, 0x16, 0x12, 0x03, 0x2d, 0x02, 0x3d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x16, - 0x04, 0x12, 0x03, 0x2d, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x16, 0x06, 0x12, - 0x03, 0x2d, 0x0b, 0x23, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x16, 0x01, 0x12, 0x03, 0x2d, - 0x24, 0x37, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x16, 0x03, 0x12, 0x03, 0x2d, 0x3a, 0x3c, - 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x17, 0x12, 0x03, 0x2f, 0x02, 0x48, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x17, 0x05, 0x12, 0x03, 0x2f, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x17, 0x01, 0x12, 0x03, 0x2f, 0x28, 0x38, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x17, 0x03, 0x12, 0x03, 0x2f, 0x45, 0x47, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x18, 0x12, - 0x03, 0x30, 0x02, 0x48, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x18, 0x05, 0x12, 0x03, 0x30, - 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x18, 0x01, 0x12, 0x03, 0x30, 0x28, 0x42, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x18, 0x03, 0x12, 0x03, 0x30, 0x45, 0x47, 0x0a, 0x0b, - 0x0a, 0x04, 0x04, 0x01, 0x02, 0x19, 0x12, 0x03, 0x31, 0x02, 0x48, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x19, 0x05, 0x12, 0x03, 0x31, 0x02, 0x06, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x19, 0x01, 0x12, 0x03, 0x31, 0x28, 0x33, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x19, 0x03, - 0x12, 0x03, 0x31, 0x45, 0x47, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x1a, 0x12, 0x03, 0x32, - 0x02, 0x48, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1a, 0x06, 0x12, 0x03, 0x32, 0x02, 0x15, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1a, 0x01, 0x12, 0x03, 0x32, 0x28, 0x39, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1a, 0x03, 0x12, 0x03, 0x32, 0x45, 0x47, 0x0a, 0x0b, 0x0a, 0x04, - 0x04, 0x01, 0x02, 0x1b, 0x12, 0x03, 0x33, 0x02, 0x48, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x1b, 0x06, 0x12, 0x03, 0x33, 0x02, 0x15, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1b, 0x01, - 0x12, 0x03, 0x33, 0x28, 0x39, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1b, 0x03, 0x12, 0x03, - 0x33, 0x45, 0x47, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x1c, 0x12, 0x03, 0x34, 0x02, 0x48, - 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1c, 0x06, 0x12, 0x03, 0x34, 0x02, 0x27, 0x0a, 0x0c, - 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1c, 0x01, 0x12, 0x03, 0x34, 0x28, 0x37, 0x0a, 0x0c, 0x0a, 0x05, - 0x04, 0x01, 0x02, 0x1c, 0x03, 0x12, 0x03, 0x34, 0x45, 0x47, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, - 0x02, 0x1d, 0x12, 0x03, 0x35, 0x02, 0x5c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1d, 0x05, - 0x12, 0x03, 0x35, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1d, 0x01, 0x12, 0x03, - 0x35, 0x09, 0x1c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1d, 0x03, 0x12, 0x03, 0x35, 0x1f, - 0x21, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1d, 0x08, 0x12, 0x03, 0x35, 0x22, 0x5b, 0x0a, - 0x0f, 0x0a, 0x08, 0x04, 0x01, 0x02, 0x1d, 0x08, 0xca, 0xd6, 0x05, 0x12, 0x03, 0x35, 0x23, 0x5a, - 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x1e, 0x12, 0x03, 0x36, 0x02, 0x5c, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x1e, 0x05, 0x12, 0x03, 0x36, 0x02, 0x08, 0x0a, 0x0c, 0x0a, 0x05, 0x04, - 0x01, 0x02, 0x1e, 0x01, 0x12, 0x03, 0x36, 0x09, 0x1c, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, - 0x1e, 0x03, 0x12, 0x03, 0x36, 0x1f, 0x21, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1e, 0x08, - 0x12, 0x03, 0x36, 0x22, 0x5b, 0x0a, 0x0f, 0x0a, 0x08, 0x04, 0x01, 0x02, 0x1e, 0x08, 0xca, 0xd6, - 0x05, 0x12, 0x03, 0x36, 0x23, 0x5a, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x01, 0x02, 0x1f, 0x12, 0x03, - 0x38, 0x02, 0x2f, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1f, 0x04, 0x12, 0x03, 0x38, 0x02, - 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1f, 0x06, 0x12, 0x03, 0x38, 0x0b, 0x23, 0x0a, - 0x0c, 0x0a, 0x05, 0x04, 0x01, 0x02, 0x1f, 0x01, 0x12, 0x03, 0x38, 0x24, 0x29, 0x0a, 0x0c, 0x0a, - 0x05, 0x04, 0x01, 0x02, 0x1f, 0x03, 0x12, 0x03, 0x38, 0x2c, 0x2e, 0x0a, 0x0a, 0x0a, 0x02, 0x05, - 0x00, 0x12, 0x04, 0x3b, 0x00, 0x41, 0x01, 0x0a, 0x0a, 0x0a, 0x03, 0x05, 0x00, 0x01, 0x12, 0x03, - 0x3b, 0x05, 0x09, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x00, 0x02, 0x00, 0x12, 0x03, 0x3c, 0x02, 0x17, - 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x00, 0x01, 0x12, 0x03, 0x3c, 0x02, 0x12, 0x0a, 0x0c, - 0x0a, 0x05, 0x05, 0x00, 0x02, 0x00, 0x02, 0x12, 0x03, 0x3c, 0x15, 0x16, 0x0a, 0x0b, 0x0a, 0x04, - 0x05, 0x00, 0x02, 0x01, 0x12, 0x03, 0x3d, 0x02, 0x17, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, - 0x01, 0x01, 0x12, 0x03, 0x3d, 0x02, 0x0a, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x01, 0x02, - 0x12, 0x03, 0x3d, 0x15, 0x16, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x00, 0x02, 0x02, 0x12, 0x03, 0x3e, - 0x02, 0x17, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x02, 0x01, 0x12, 0x03, 0x3e, 0x02, 0x0a, - 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x02, 0x02, 0x12, 0x03, 0x3e, 0x15, 0x16, 0x0a, 0x0b, - 0x0a, 0x04, 0x05, 0x00, 0x02, 0x03, 0x12, 0x03, 0x3f, 0x02, 0x17, 0x0a, 0x0c, 0x0a, 0x05, 0x05, - 0x00, 0x02, 0x03, 0x01, 0x12, 0x03, 0x3f, 0x02, 0x0b, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, - 0x03, 0x02, 0x12, 0x03, 0x3f, 0x15, 0x16, 0x0a, 0x0b, 0x0a, 0x04, 0x05, 0x00, 0x02, 0x04, 0x12, - 0x03, 0x40, 0x02, 0x18, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x04, 0x01, 0x12, 0x03, 0x40, - 0x02, 0x10, 0x0a, 0x0c, 0x0a, 0x05, 0x05, 0x00, 0x02, 0x04, 0x02, 0x12, 0x03, 0x40, 0x15, 0x17, - 0x0a, 0x0a, 0x0a, 0x02, 0x04, 0x02, 0x12, 0x04, 0x43, 0x00, 0x45, 0x01, 0x0a, 0x0a, 0x0a, 0x03, - 0x04, 0x02, 0x01, 0x12, 0x03, 0x43, 0x08, 0x14, 0x0a, 0x0b, 0x0a, 0x04, 0x04, 0x02, 0x02, 0x00, - 0x12, 0x03, 0x44, 0x02, 0x1a, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x02, 0x02, 0x00, 0x06, 0x12, 0x03, - 0x44, 0x02, 0x0d, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x02, 0x02, 0x00, 0x01, 0x12, 0x03, 0x44, 0x0e, - 0x15, 0x0a, 0x0c, 0x0a, 0x05, 0x04, 0x02, 0x02, 0x00, 0x03, 0x12, 0x03, 0x44, 0x18, 0x19, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x61, 0xea, 0x02, 0x06, 0x54, 0x65, 0x73, 0x74, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, + 0x74, 0x6f, 0x33, } var ( diff --git a/client/v2/internal/util/util.go b/client/v2/internal/util/util.go index e5327a8e50ab..ed82d3973c30 100644 --- a/client/v2/internal/util/util.go +++ b/client/v2/internal/util/util.go @@ -5,6 +5,8 @@ import ( "runtime/debug" "strings" + cosmos_proto "github.com/cosmos/cosmos-proto" + "google.golang.org/protobuf/proto" "google.golang.org/protobuf/reflect/protoreflect" "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/dynamicpb" @@ -22,11 +24,6 @@ func DescriptorKebabName(descriptor protoreflect.Descriptor) string { return strcase.ToKebab(string(descriptor.Name())) } -// DescriptorDocs returns the leading comments of the descriptor. -func DescriptorDocs(descriptor protoreflect.Descriptor) string { - return descriptor.ParentFile().SourceLocations().ByDescriptor(descriptor).LeadingComments -} - func ResolveMessageType(resolver protoregistry.MessageTypeResolver, descriptor protoreflect.MessageDescriptor) protoreflect.MessageType { typ, err := resolver.FindMessageByName(descriptor.FullName()) if err == nil { @@ -38,19 +35,23 @@ func ResolveMessageType(resolver protoregistry.MessageTypeResolver, descriptor p // IsSupportedVersion is used to determine in which version of a module / sdk a rpc was introduced. // It returns false if the rpc has comment for an higher version than the current one. -func IsSupportedVersion(input string) bool { - return isSupportedVersion(input, buildInfo) +// It returns true if the method descriptor contains no annotation. +func IsSupportedVersion(methodDesc protoreflect.MethodDescriptor) bool { + return isSupportedVersion(methodDesc, buildInfo) } // isSupportedVersion is used to determine in which version of a module / sdk a rpc was introduced. // It returns false if the rpc has comment for an higher version than the current one. +// It returns true if the method descriptor contains no annotation. // It takes a buildInfo as argument to be able to test it. -func isSupportedVersion(input string, buildInfo *debug.BuildInfo) bool { - if input == "" || buildInfo == nil { +func isSupportedVersion(methodDesc protoreflect.MethodDescriptor, buildInfo *debug.BuildInfo) bool { + hasVersion := proto.HasExtension(methodDesc.Options(), cosmos_proto.E_MethodAddedIn) + if !hasVersion || buildInfo == nil || len(buildInfo.Deps) == 0 { return true } - moduleName, version := parseSinceComment(input) + version := proto.GetExtension(methodDesc.Options(), cosmos_proto.E_MethodAddedIn).(string) + moduleName, version := parseVersion(version) if moduleName == "" || version == "" { return true // if no comment consider it's supported } @@ -70,10 +71,10 @@ func isSupportedVersion(input string, buildInfo *debug.BuildInfo) bool { return false } -var sinceCommentRegex = regexp.MustCompile(`\/\/\s*since: (\S+) (\S+)`) +var sinceCommentRegex = regexp.MustCompile(`(\S+) (\S+)`) -// parseSinceComment parses the `// Since: cosmos-sdk v0.xx` comment on rpc. -func parseSinceComment(input string) (string, string) { +// parseVersion parses the `cosmos-sdk v0.xx` comment on rpc. +func parseVersion(input string) (string, string) { var ( moduleName string version string diff --git a/client/v2/internal/util/util_test.go b/client/v2/internal/util/util_test.go index a4a58f52b01c..60a713ed2143 100644 --- a/client/v2/internal/util/util_test.go +++ b/client/v2/internal/util/util_test.go @@ -5,8 +5,9 @@ import ( "testing" "google.golang.org/protobuf/reflect/protoreflect" + "google.golang.org/protobuf/reflect/protoregistry" - "cosmossdk.io/client/v2/internal/testpb" + _ "cosmossdk.io/client/v2/internal/testpb" ) func TestIsSupportedVersion(t *testing.T) { @@ -24,70 +25,40 @@ func TestIsSupportedVersion(t *testing.T) { } cases := []struct { - input string - expected bool + messageName string + expected bool }{ { - input: "", - expected: true, + messageName: "testpb.Msg.Send", + expected: true, }, { - input: "not a since comment", - expected: true, + messageName: "testpb.Query.Echo", + expected: true, }, { - input: "// Since: cosmos-sdk v0.47", - expected: true, - }, - { - input: "// since: Cosmos-SDK 0.50", - expected: true, - }, - { - input: "// Since: cosmos-sdk v0.51", - expected: false, - }, - { - input: "// Since: cosmos-sdk v1.0.0", - expected: false, - }, - { - input: "// since: x/feegrant v0.1.0", - expected: true, - }, - { - input: "// since: feegrant v0.0.1", - expected: true, - }, - { - input: "// since: feegrant v0.1.0", - expected: true, - }, - { - input: "// since: feegrant v0.1", - expected: true, - }, - { - input: "// since: feegrant v0.1.1", - expected: false, - }, - { - input: "// since: feegrant v0.2.0", - expected: false, + messageName: "testpb.Msg.Clawback", + expected: false, }, } for _, tc := range cases { - t.Run(tc.input, func(t *testing.T) { - resp := isSupportedVersion(tc.input, mockBuildInfo) - if resp != tc.expected { - t.Errorf("expected %v, got %v", tc.expected, resp) + t.Run(tc.messageName, func(t *testing.T) { + desc, err := protoregistry.GlobalFiles.FindDescriptorByName(protoreflect.FullName(tc.messageName)) + if err != nil { + t.Fatal(err) + } + + methodDesc := desc.(protoreflect.MethodDescriptor) + isSupported := isSupportedVersion(methodDesc, mockBuildInfo) + if isSupported != tc.expected { + t.Errorf("expected %v, got %v for %s", tc.expected, isSupported, methodDesc.FullName()) } }) } } -func TestParseSinceComment(t *testing.T) { +func TestParseVersion(t *testing.T) { cases := []struct { input string expectedModuleName string @@ -99,52 +70,42 @@ func TestParseSinceComment(t *testing.T) { expectedVersion: "", }, { - input: "not a since comment", - expectedModuleName: "", - expectedVersion: "", - }, - { - input: "// Since: Cosmos SDK 0.50", - expectedModuleName: "cosmos-sdk", - expectedVersion: "v0.50", - }, - { - input: "// since: Cosmos SDK 0.50", + input: "Cosmos SDK 0.50", expectedModuleName: "cosmos-sdk", expectedVersion: "v0.50", }, { - input: "// since: cosmos sdk 0.50", + input: "cosmos sdk 0.50", expectedModuleName: "cosmos-sdk", expectedVersion: "v0.50", }, { - input: "// since: Cosmos-SDK 0.50", + input: "Cosmos-SDK 0.50", expectedModuleName: "cosmos-sdk", expectedVersion: "v0.50", }, { - input: "// Since: cosmos-sdk v0.50", + input: "cosmos-sdk v0.50", expectedModuleName: "cosmos-sdk", expectedVersion: "v0.50", }, { - input: "//since: cosmos-sdk v0.50.1", + input: "cosmos-sdk v0.50.1", expectedModuleName: "cosmos-sdk", expectedVersion: "v0.50.1", }, { - input: "// since: cosmos-sdk 0.47.0-veronica", + input: "cosmos-sdk 0.47.0-veronica", expectedModuleName: "cosmos-sdk", expectedVersion: "v0.47.0-veronica", }, { - input: "// Since: x/feegrant v0.1.0", + input: "x/feegrant v0.1.0", expectedModuleName: "feegrant", expectedVersion: "v0.1.0", }, { - input: "// since: x/feegrant 0.1", + input: "x/feegrant 0.1", expectedModuleName: "feegrant", expectedVersion: "v0.1", }, @@ -152,7 +113,7 @@ func TestParseSinceComment(t *testing.T) { for _, tc := range cases { t.Run(tc.input, func(t *testing.T) { - moduleName, version := parseSinceComment(tc.input) + moduleName, version := parseVersion(tc.input) if moduleName != tc.expectedModuleName { t.Errorf("expected module name %s, got %s", tc.expectedModuleName, moduleName) } @@ -162,39 +123,3 @@ func TestParseSinceComment(t *testing.T) { }) } } - -func TestDescriptorDocs(t *testing.T) { - t.Skip() // TODO(@julienrbrt): Unskip when https://github.com/cosmos/cosmos-proto/pull/131 is finalized. - - msg1 := &testpb.MsgRequest{} - descriptor1 := msg1.ProtoReflect().Descriptor() - - msg2 := testpb.MsgResponse{} - descriptor2 := msg2.ProtoReflect().Descriptor() - - cases := []struct { - name string - input protoreflect.Descriptor - expected string - }{ - { - name: "Test with leading comments", - input: descriptor1, - expected: "MsgRequest is a sample request message", - }, - { - name: "Test with no leading comments", - input: descriptor2, - expected: "", - }, - } - - for _, tc := range cases { - t.Run(tc.name, func(t *testing.T) { - output := DescriptorDocs(tc.input) - if output != tc.expected { - t.Errorf("expected %s, got %s", tc.expected, output) - } - }) - } -} diff --git a/collections/go.mod b/collections/go.mod index 9d4822402ee6..18118e1500f4 100644 --- a/collections/go.mod +++ b/collections/go.mod @@ -5,12 +5,12 @@ go 1.21 require ( cosmossdk.io/core v0.11.0 github.com/cosmos/cosmos-db v1.0.2 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 pgregory.net/rapid v1.1.0 ) require ( - cosmossdk.io/api v0.7.2 // indirect + cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -20,7 +20,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect diff --git a/collections/go.sum b/collections/go.sum index 47995228ebc2..8932e2415bc5 100644 --- a/collections/go.sum +++ b/collections/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= -cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= @@ -27,8 +27,8 @@ 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/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -119,8 +119,8 @@ github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= diff --git a/core/go.mod b/core/go.mod index 46e979f99ba8..350dbad672e2 100644 --- a/core/go.mod +++ b/core/go.mod @@ -3,13 +3,13 @@ module cosmossdk.io/core go 1.20 require ( - cosmossdk.io/api v0.7.2 + cosmossdk.io/api v0.7.5 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/math v1.3.0 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/stretchr/testify v1.8.4 - google.golang.org/grpc v1.58.3 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/stretchr/testify v1.9.0 + google.golang.org/grpc v1.61.1 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 @@ -24,7 +24,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/getsentry/sentry-go v0.27.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -49,8 +49,8 @@ require ( golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/core/go.sum b/core/go.sum index 238a6eeb220c..80faea6e362c 100644 --- a/core/go.sum +++ b/core/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= -cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= @@ -26,10 +26,10 @@ 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/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -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/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -116,8 +116,8 @@ github.com/spf13/cast v1.6.0/go.mod h1:ancEpBxwJDODSW/UG4rDrAqiKolqNNh2DX3mk86cA github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -144,7 +144,7 @@ golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -181,14 +181,14 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/crypto/keys/secp256r1/privkey.go b/crypto/keys/secp256r1/privkey.go index c6702111c738..3080dec21785 100644 --- a/crypto/keys/secp256r1/privkey.go +++ b/crypto/keys/secp256r1/privkey.go @@ -1,10 +1,14 @@ package secp256r1 import ( + "encoding/base64" + "github.com/cosmos/cosmos-sdk/crypto/keys/internal/ecdsa" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) +var _ customProtobufType = (*ecdsaSK)(nil) + // GenPrivKey generates a new secp256r1 private key. It uses operating system randomness. func GenPrivKey() (*PrivKey, error) { key, err := ecdsa.GenPrivKey(secp256r1) @@ -52,6 +56,27 @@ type ecdsaSK struct { ecdsa.PrivKey } +// Marshal implements customProtobufType. +func (sk ecdsaSK) Marshal() ([]byte, error) { + return sk.PrivKey.Bytes(), nil +} + +// MarshalJSON implements customProtobufType. +func (sk ecdsaSK) MarshalJSON() ([]byte, error) { + b64 := base64.StdEncoding.EncodeToString(sk.PrivKey.Bytes()) + return []byte("\"" + b64 + "\""), nil +} + +// UnmarshalJSON implements customProtobufType. +func (sk *ecdsaSK) UnmarshalJSON(data []byte) error { + bz, err := base64.StdEncoding.DecodeString(string(data[1 : len(data)-1])) + if err != nil { + return err + } + + return sk.PrivKey.Unmarshal(bz, secp256r1, fieldSize) +} + // Size implements proto.Marshaler interface func (sk *ecdsaSK) Size() int { if sk == nil { diff --git a/crypto/keys/secp256r1/privkey_internal_test.go b/crypto/keys/secp256r1/privkey_internal_test.go index 902ee6dafbf8..52ea3239dac6 100644 --- a/crypto/keys/secp256r1/privkey_internal_test.go +++ b/crypto/keys/secp256r1/privkey_internal_test.go @@ -113,3 +113,14 @@ func (suite *SKSuite) TestSize() { var nilPk *ecdsaSK require.Equal(0, nilPk.Size(), "nil value must have zero size") } + +func (suite *SKSuite) TestJson() { + require := suite.Require() + asd := suite.sk.(*PrivKey) + bz, err := asd.Secret.MarshalJSON() + require.NoError(err) + + sk := &ecdsaSK{} + require.NoError(sk.UnmarshalJSON(bz)) + require.Equal(suite.sk.(*PrivKey).Secret, sk) +} diff --git a/crypto/keys/secp256r1/pubkey.go b/crypto/keys/secp256r1/pubkey.go index cacec514c3d7..fea06f73f201 100644 --- a/crypto/keys/secp256r1/pubkey.go +++ b/crypto/keys/secp256r1/pubkey.go @@ -1,6 +1,8 @@ package secp256r1 import ( + "encoding/base64" + cmtcrypto "github.com/cometbft/cometbft/crypto" "github.com/cosmos/gogoproto/proto" @@ -8,6 +10,20 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" ) +// customProtobufType is here to make sure that ecdsaPK and ecdsaSK implement the +// gogoproto customtype interface. +type customProtobufType interface { + Marshal() ([]byte, error) + MarshalTo(data []byte) (n int, err error) + Unmarshal(data []byte) error + Size() int + + MarshalJSON() ([]byte, error) + UnmarshalJSON(data []byte) error +} + +var _ customProtobufType = (*ecdsaPK)(nil) + // String implements proto.Message interface. func (m *PubKey) String() string { return m.Key.String(name) @@ -49,6 +65,28 @@ type ecdsaPK struct { ecdsa.PubKey } +// Marshal implements customProtobufType. +func (pk ecdsaPK) Marshal() ([]byte, error) { + return pk.PubKey.Bytes(), nil +} + +// MarshalJSON implements customProtobufType. +func (pk ecdsaPK) MarshalJSON() ([]byte, error) { + b64 := base64.StdEncoding.EncodeToString(pk.PubKey.Bytes()) + return []byte("\"" + b64 + "\""), nil +} + +// UnmarshalJSON implements customProtobufType. +func (pk *ecdsaPK) UnmarshalJSON(data []byte) error { + // the string is quoted so we need to remove them + bz, err := base64.StdEncoding.DecodeString(string(data[1 : len(data)-1])) + if err != nil { + return err + } + + return pk.PubKey.Unmarshal(bz, secp256r1, pubKeySize) +} + // Size implements proto.Marshaler interface func (pk *ecdsaPK) Size() int { if pk == nil { diff --git a/crypto/keys/secp256r1/pubkey_internal_test.go b/crypto/keys/secp256r1/pubkey_internal_test.go index d3d2ed3823eb..77f4a66e5114 100644 --- a/crypto/keys/secp256r1/pubkey_internal_test.go +++ b/crypto/keys/secp256r1/pubkey_internal_test.go @@ -126,3 +126,14 @@ func (suite *PKSuite) TestSize() { var nilPk *ecdsaPK require.Equal(0, nilPk.Size(), "nil value must have zero size") } + +func (suite *PKSuite) TestJson() { + require := suite.Require() + + bz, err := suite.pk.Key.MarshalJSON() + require.NoError(err) + + pk := &ecdsaPK{} + require.NoError(pk.UnmarshalJSON(bz)) + require.Equal(suite.pk.Key, pk) +} diff --git a/docs/docs/build/building-apps/03-app-upgrade.md b/docs/docs/build/building-apps/03-app-upgrade.md index d5a88c5d7cc4..ebaddb3f75ea 100644 --- a/docs/docs/build/building-apps/03-app-upgrade.md +++ b/docs/docs/build/building-apps/03-app-upgrade.md @@ -52,9 +52,9 @@ be a matter of minutes and not even require them to be awake at that time. ## Integrating With An App -::tip +:::tip The following is not required for users using `depinject` / app v2, this is abstracted for them. -:: +::: In addition to basic module wiring, setup the upgrade Keeper for the app and then define a `PreBlocker` that calls the upgrade keeper's PreBlocker method: diff --git a/docs/docs/build/building-modules/00-intro.md b/docs/docs/build/building-modules/00-intro.md index 6850f0b6740e..4ac5462f376c 100644 --- a/docs/docs/build/building-modules/00-intro.md +++ b/docs/docs/build/building-modules/00-intro.md @@ -70,6 +70,15 @@ Cosmos SDK modules can be seen as little state-machines within the state-machine As a result of this architecture, building a Cosmos SDK application usually revolves around writing modules to implement the specialized logic of the application and composing them with existing modules to complete the application. Developers will generally work on modules that implement logic needed for their specific use case that do not exist yet, and will use existing modules for more generic functionalities like staking, accounts, or token management. + +### Modules as Sudo + +Modules have the ability to perform actions that are not available to regular users. This is because modules are given sudo permissions by the state machine. Modules can reject another modules desire to execute a function but this logic must be explicit. Examples of this can be seen when modules create functions to modify parameters: + +```go reference +https://github.com/cosmos/cosmos-sdk/blob/61da5d1c29c16a1eb5bb5488719fde604ec07b10/x/bank/keeper/msg_server.go#L147-L149 +``` + ## How to Approach Building Modules as a Developer While there are no definitive guidelines for writing modules, here are some important design principles developers should keep in mind when building them: diff --git a/docs/docs/build/building-modules/05-protobuf-annotations.md b/docs/docs/build/building-modules/05-protobuf-annotations.md index 3621e10485df..5240112e9054 100644 --- a/docs/docs/build/building-modules/05-protobuf-annotations.md +++ b/docs/docs/build/building-modules/05-protobuf-annotations.md @@ -52,7 +52,7 @@ Example of Int scalar: https://github.com/cosmos/cosmos-sdk/blob/e8f28bf5db18b8d6b7e0d94b542ce4cf48fed9d6/proto/cosmos/gov/v1/gov.proto#L137 ``` -There are a few options for what can be provided as a scalar: cosmos.AddressString, cosmos.ValidatorAddressString, cosmos.ConsensusAddressString, cosmos.Int, cosmos.Dec. +There are a few options for what can be provided as a scalar: `cosmos.AddressString`, `cosmos.ValidatorAddressString`, `cosmos.ConsensusAddressString`, `cosmos.Int`, `cosmos.Dec`. ## Implements_Interface @@ -62,9 +62,21 @@ Implement interface is used to provide information to client tooling like [teles option (cosmos_proto.implements_interface) = "cosmos.auth.v1beta1.AccountI"; ``` +## Method,Field,Message Added In + +`method_added_in`, `field_added_in` and `message_added_in` are annotations to denotate to clients that a field has been supported in a later version. This is useful when new methods or fields are added in later versions and that the client needs to be aware of what it can call. + +The annotation should be worded as follow: + +```proto +option (cosmos_proto.method_added_in) = "cosmos-sdk v0.50.1"; +option (cosmos_proto.method_added_in) = "x/epochs v1.0.0"; +option (cosmos_proto.method_added_in) = "simapp v24.0.0"; +``` + ## Amino -The amino codec was removed in 0.50.0, this means there is not a need register `legacyAminoCodec`. To replace the amino codec, Amino protobuf annotations are used to provide information to the amino codec on how to encode and decode protobuf messages. +The amino codec was removed in `v0.50+`, this means there is not a need register `legacyAminoCodec`. To replace the amino codec, Amino protobuf annotations are used to provide information to the amino codec on how to encode and decode protobuf messages. :::note Amino annotations are only used for backwards compatibility with amino. New modules are not required use amino annotations. diff --git a/docs/docs/learn/advanced/01-transactions.md b/docs/docs/learn/advanced/01-transactions.md index c2d779a8306b..900d8b3fe182 100644 --- a/docs/docs/learn/advanced/01-transactions.md +++ b/docs/docs/learn/advanced/01-transactions.md @@ -33,9 +33,9 @@ It contains the following methods: * **GetMsgs:** unwraps the transaction and returns a list of contained `sdk.Msg`s - one transaction may have one or multiple messages, which are defined by module developers. * **ValidateBasic:** lightweight, [_stateless_](../beginner/01-tx-lifecycle.md#types-of-checks) checks used by ABCI messages [`CheckTx`](./00-baseapp.md#checktx) and [`DeliverTx`](./00-baseapp.md#delivertx) to make sure transactions are not invalid. For example, the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth) module's `ValidateBasic` function checks that its transactions are signed by the correct number of signers and that the fees do not exceed what the user's maximum. When [`runTx`](./00-baseapp.md#runtx) is checking a transaction created from the [`auth`](https://github.com/cosmos/cosmos-sdk/tree/main/x/auth/spec) module, it first runs `ValidateBasic` on each message, then runs the `auth` module AnteHandler which calls `ValidateBasic` for the transaction itself. - :::note - This function is different from the deprecated `sdk.Msg` [`ValidateBasic`](../beginner/01-tx-lifecycle.md#ValidateBasic) methods, which was performing basic validity checks on messages only. - ::: +:::note +This function is different from the deprecated `sdk.Msg` [`ValidateBasic`](../beginner/01-tx-lifecycle.md#ValidateBasic) methods, which was performing basic validity checks on messages only. +::: As a developer, you should rarely manipulate `Tx` directly, as `Tx` is really an intermediate type used for transaction generation. Instead, developers should prefer the `TxBuilder` interface, which you can learn more about [below](#transaction-generation). diff --git a/docs/docs/learn/advanced/05-encoding.md b/docs/docs/learn/advanced/05-encoding.md index 0178884b2bd8..c7da94bf952d 100644 --- a/docs/docs/learn/advanced/05-encoding.md +++ b/docs/docs/learn/advanced/05-encoding.md @@ -93,7 +93,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/decoder.go https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/x/auth/tx/encoder.go ``` -See [ADR-020](../../build/architecture/adr-020-protobuf-transaction-encoding.md) for details of how a transaction is encoded. +See [ADR-020](../../architecture/adr-020-protobuf-transaction-encoding.md) for details of how a transaction is encoded. ### Interface Encoding and Usage of `Any` @@ -114,7 +114,7 @@ In this `Profile` example, we hardcoded `account` as a `BaseAccount`. However, t https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/types/account.go#L15-L32 ``` -In [ADR-019](../../build/architecture/adr-019-protobuf-state-encoding.md), it has been decided to use [`Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto)s to encode interfaces in protobuf. An `Any` contains an arbitrary serialized message as bytes, along with a URL that acts as a globally unique identifier for and resolves to that message's type. This strategy allows us to pack arbitrary Go types inside protobuf messages. Our new `Profile` then looks like: +In [ADR-019](../../architecture/adr-019-protobuf-state-encoding.md), it has been decided to use [`Any`](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/any.proto)s to encode interfaces in protobuf. An `Any` contains an arbitrary serialized message as bytes, along with a URL that acts as a globally unique identifier for and resolves to that message's type. This strategy allows us to pack arbitrary Go types inside protobuf messages. Our new `Profile` then looks like: ```protobuf message Profile { @@ -183,7 +183,7 @@ func (p *Profile) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { The `UnpackInterfaces` gets called recursively on all structs implementing this method, to allow all `Any`s to have their `GetCachedValue()` correctly populated. -For more information about interface encoding, and especially on `UnpackInterfaces` and how the `Any`'s `type_url` gets resolved using the `InterfaceRegistry`, please refer to [ADR-019](../../build/architecture/adr-019-protobuf-state-encoding.md). +For more information about interface encoding, and especially on `UnpackInterfaces` and how the `Any`'s `type_url` gets resolved using the `InterfaceRegistry`, please refer to [ADR-019](../../architecture/adr-019-protobuf-state-encoding.md). #### `Any` Encoding in the Cosmos SDK @@ -248,7 +248,7 @@ Protobuf types can be defined to encode: #### Naming and conventions We encourage developers to follow industry guidelines: [Protocol Buffers style guide](https://developers.google.com/protocol-buffers/docs/style) -and [Buf](https://buf.build/docs/style-guide), see more details in [ADR 023](../../build/architecture/adr-023-protobuf-naming.md) +and [Buf](https://buf.build/docs/style-guide), see more details in [ADR 023](../../architecture/adr-023-protobuf-naming.md) ### How to update modules to protobuf encoding diff --git a/docs/docs/learn/beginner/00-app-anatomy.md b/docs/docs/learn/beginner/00-app-anatomy.md index 0d9ae4036be8..07f656db2417 100644 --- a/docs/docs/learn/beginner/00-app-anatomy.md +++ b/docs/docs/learn/beginner/00-app-anatomy.md @@ -274,6 +274,6 @@ The following is the `go.mod` of the [Cosmos Hub](https://github.com/cosmos/gaia https://github.com/cosmos/gaia/blob/26ae7c2/go.mod#L1-L28 ``` -For building the application, a [Makefile](https://en.wikipedia.org/wiki/Makefile) is generally used. The Makefile primarily ensures that the `go.mod` is run before building the two entrypoints to the application, [`appd`](#node-client) and [`appd`](#application-interface). +For building the application, a [Makefile](https://en.wikipedia.org/wiki/Makefile) is generally used. The Makefile primarily ensures that the `go.mod` is run before building the two entrypoints to the application, [`Node Client`](#node-client) and [`Application Interface`](#application-interface). Here is an example of the [Cosmos Hub Makefile](https://github.com/cosmos/gaia/blob/main/Makefile). diff --git a/docs/docs/learn/beginner/01-tx-lifecycle.md b/docs/docs/learn/beginner/01-tx-lifecycle.md index 1fddabddad48..2f86f168a1d7 100644 --- a/docs/docs/learn/beginner/01-tx-lifecycle.md +++ b/docs/docs/learn/beginner/01-tx-lifecycle.md @@ -164,45 +164,45 @@ As mentioned throughout the documentation `BeginBlock`, `ExecuteTx` and `EndBloc Although every full-node operates individually and locally, the outcome is always consistent and unequivocal. This is because the state changes brought about by the messages are predictable, and the transactions are specifically sequenced in the proposed block. ```text - ----------------------- - |Receive Block Proposal| - ----------------------- - | - v - ------------------------- - | FinalizeBlock | - | - v - ------------------- - | BeginBlock | - ------------------- - | - v - -------------------- - | ExecuteTx(tx0) | - | ExecuteTx(tx1) | - | ExecuteTx(tx2) | - | ExecuteTx(tx3) | - | . | - | . | - | . | - ------------------- - | - v - -------------------- - | EndBlock | - -------------------- - ------------------------- - | - v - ----------------------- - | Consensus | - ----------------------- - | - v - ----------------------- - | Commit | - ----------------------- + -------------------------- + | Receive Block Proposal | + -------------------------- + | + v + ------------------------- + | FinalizeBlock | + ------------------------- + | + v + ------------------- + | BeginBlock | + ------------------- + | + v + -------------------- + | ExecuteTx(tx0) | + | ExecuteTx(tx1) | + | ExecuteTx(tx2) | + | ExecuteTx(tx3) | + | . | + | . | + | . | + ------------------- + | + v + -------------------- + | EndBlock | + -------------------- + | + v + ------------------------- + | Consensus | + ------------------------- + | + v + ------------------------- + | Commit | + ------------------------- ``` ### Transaction Execution diff --git a/docs/docs/learn/beginner/04-gas-fees.md b/docs/docs/learn/beginner/04-gas-fees.md index 2e04af462e89..4def021ea7bc 100644 --- a/docs/docs/learn/beginner/04-gas-fees.md +++ b/docs/docs/learn/beginner/04-gas-fees.md @@ -56,21 +56,25 @@ Gas consumption can be done manually, generally by the module developer in the [ ### Block Gas Meter -`ctx.BlockGasMeter()` is the gas meter used to track gas consumption per block and make sure it does not go above a certain limit. A new instance of the `BlockGasMeter` is created each time [`FinalizeBlock`](../advanced/00-baseapp.md#finalizeblock) is called. The `BlockGasMeter` is finite, and the limit of gas per block is defined in the application's consensus parameters. By default, Cosmos SDK applications use the default consensus parameters provided by CometBFT: +`ctx.BlockGasMeter()` is the gas meter used to track gas consumption per block and make sure it does not go above a certain limit. -```go reference -https://github.com/cometbft/cometbft/blob/v0.37.0/types/params.go#L66-L105 +During the genesis phase, gas consumption is unlimited to accommodate initialisation transactions. + +```go +app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(storetypes.NewInfiniteGasMeter())) ``` -When a new [transaction](../advanced/01-transactions.md) is being processed via `FinalizeBlock`, the current value of `BlockGasMeter` is checked to see if it is above the limit. If it is, the transaction fails and returned to the consensus engine as a failed transaction. This can happen even with the first transaction in a block, as `FinalizeBlock` itself can consume gas. If not, the transaction is processed normally. At the end of `FinalizeBlock`, the gas tracked by `ctx.BlockGasMeter()` is increased by the amount consumed to process the transaction: +Following the genesis block, the block gas meter is set to a finite value by the SDK. This transition is facilitated by the consensus engine (e.g., CometBFT) calling the `RequestFinalizeBlock` function, which in turn triggers the SDK's `FinalizeBlock` method. Within `FinalizeBlock`, `internalFinalizeBlock` is executed, performing necessary state updates and function executions. The block gas meter, initialised each with a finite limit, is then incorporated into the context for transaction execution, ensuring gas consumption does not exceed the block's gas limit and is reset at the end of each block. + +Modules within the Cosmos SDK can consume block gas at any point during their execution by utilising the `ctx`. This gas consumption primarily occurs during state read/write operations and transaction processing. The block gas meter, accessible via `ctx.BlockGasMeter()`, monitors the total gas usage within a block, enforcing the gas limit to prevent excessive computation. This ensures that gas limits are adhered to on a per-block basis, starting from the first block post-genesis. ```go -ctx.BlockGasMeter().ConsumeGas( - ctx.GasMeter().GasConsumedToLimit(), - "block gas meter", -) +gasMeter := app.getBlockGasMeter(app.finalizeBlockState.Context()) +app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) ``` +This above shows the general mechanism for setting the block gas meter with a finite limit based on the block's consensus parameters. + ## AnteHandler The `AnteHandler` is run for every transaction during `CheckTx` and `FinalizeBlock`, before a Protobuf `Msg` service method for each `sdk.Msg` in the transaction. diff --git a/go.mod b/go.mod index 6fab0108b7fc..dd90a12566c9 100644 --- a/go.mod +++ b/go.mod @@ -3,28 +3,28 @@ go 1.21 module github.com/cosmos/cosmos-sdk require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.2 - cosmossdk.io/x/tx v0.13.1 + cosmossdk.io/store v1.1.0 + cosmossdk.io/x/tx v0.13.3 github.com/99designs/keyring v1.2.1 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 github.com/bits-and-blooms/bitset v1.8.0 github.com/chzyer/readline v1.5.1 github.com/cockroachdb/apd/v2 v2.0.2 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 + github.com/cometbft/cometbft v0.38.7 github.com/cosmos/btcutil v1.0.5 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/cosmos/go-bip39 v1.0.0 github.com/cosmos/gogogateway v1.2.0 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/gogoproto v1.4.12 github.com/cosmos/ledger-cosmos-go v0.13.3 github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 github.com/golang/mock v1.6.0 @@ -35,7 +35,7 @@ require ( github.com/gorilla/mux v1.8.0 github.com/grpc-ecosystem/go-grpc-middleware v1.4.0 github.com/grpc-ecosystem/grpc-gateway v1.16.0 - github.com/hashicorp/go-metrics v0.5.1 + github.com/hashicorp/go-metrics v0.5.3 github.com/hashicorp/golang-lru v1.0.2 github.com/hdevalence/ed25519consensus v0.1.0 github.com/huandu/skiplist v1.2.0 @@ -44,8 +44,8 @@ require ( github.com/magiconair/properties v1.8.7 github.com/manifoldco/promptui v0.9.0 github.com/mattn/go-isatty v0.0.20 - github.com/prometheus/client_golang v1.18.0 - github.com/prometheus/common v0.47.0 + github.com/prometheus/client_golang v1.19.0 + github.com/prometheus/common v0.52.2 github.com/rs/zerolog v1.32.0 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 @@ -53,11 +53,11 @@ require ( github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 - golang.org/x/crypto v0.21.0 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - golang.org/x/sync v0.6.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.0 + golang.org/x/crypto v0.22.0 + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 + golang.org/x/sync v0.7.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -74,13 +74,13 @@ require ( github.com/bufbuild/protocompile v0.6.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/danieljoos/wincred v1.1.2 // indirect github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect @@ -120,7 +120,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/minio/highwayhash v1.0.2 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -130,11 +130,11 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -150,12 +150,12 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/net v0.23.0 // indirect - golang.org/x/sys v0.18.0 // indirect - golang.org/x/term v0.18.0 // indirect + golang.org/x/net v0.24.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/go.sum b/go.sum index d8eb94d4d496..69bb3cd915a0 100644 --- a/go.sum +++ b/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,8 +14,8 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -90,8 +90,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk= @@ -131,8 +131,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45 h1:gZEONnQVW32QEemrDEDCkse4kzd43/HyBmQqZUkjcnU= -github.com/cometbft/cometbft v0.38.7-0.20240412124004-1f67e396cf45/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -147,17 +147,17 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -371,8 +371,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -461,8 +461,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -568,8 +568,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -590,32 +590,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -765,13 +765,13 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.21.0 h1:X31++rzVUdKhX5sWmSOFZxx8UW/ldWx55cbf08iNAMA= -golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -788,8 +788,8 @@ golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -821,8 +821,8 @@ golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= -golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -836,8 +836,8 @@ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.1.0/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -897,15 +897,15 @@ 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.18.0 h1:DBdB3niSjOA/O0blCZBqDefyWNYveAYMNF1Wum0DYQ4= -golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.18.0 h1:FcHjZXDMxI8mM3nwhX9HlKop4C0YQvCVCdwYl2wOtE8= -golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -942,8 +942,8 @@ golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4f golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -963,12 +963,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -986,8 +986,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/orm/go.mod b/orm/go.mod index 5b8040a78f84..d6a89325bcfb 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -3,19 +3,19 @@ module cosmossdk.io/orm go 1.20 require ( - cosmossdk.io/api v0.7.2 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.0-beta.7 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 github.com/golang/mock v1.6.0 github.com/google/go-cmp v0.6.0 github.com/iancoleman/strcase v0.2.0 github.com/regen-network/gocuke v0.6.2 - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/grpc v1.58.3 + google.golang.org/grpc v1.61.1 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -32,7 +32,7 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect github.com/cucumber/common/gherkin/go/v22 v22.0.0 // indirect github.com/cucumber/common/messages/go/v17 v17.1.1 // indirect github.com/davecgh/go-spew v1.1.1 // indirect @@ -61,9 +61,9 @@ require ( golang.org/x/net v0.20.0 // indirect golang.org/x/sys v0.17.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c // indirect + google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect sigs.k8s.io/yaml v1.3.0 // indirect diff --git a/orm/go.sum b/orm/go.sum index babdefa849e0..6415ce0f9f42 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -1,5 +1,5 @@ -cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= -cosmossdk.io/api v0.7.2/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= @@ -34,10 +34,10 @@ 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/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -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/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/cucumber/common/gherkin/go/v22 v22.0.0 h1:4K8NqptbvdOrjL9DEea6HFjSpbdT9+Q5kgLpmmsHYl0= github.com/cucumber/common/gherkin/go/v22 v22.0.0/go.mod h1:3mJT10B2GGn3MvVPd3FwR7m2u4tLhSRhWUqJU4KN4Fg= @@ -143,8 +143,8 @@ github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81P github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= @@ -175,7 +175,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -216,14 +216,14 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 h1:SeZZZx0cP0fqUyA+oRzP9k7cSwJlvDFiROO72uwD6i0= -google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97/go.mod h1:t1VqOqqvce95G3hIDCT5FeO3YUc6Q4Oe24L/+rNMxRk= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13 h1:U7+wNaVuSTaUqNvK2+osJ9ejEZxbjHHk8F2b6Hpx0AE= -google.golang.org/genproto/googleapis/api v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:RdyHbowztCGQySiCvQPgWQWgWhGnouTdCflKoDBt32U= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c h1:jHkCUWkseRf+W+edG5hMzr/Uh1xkDREY4caybAq4dpY= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231009173412-8bfb1ae86b6c/go.mod h1:4cYg8o5yUbm77w8ZX00LhMVNl/YVBFJRYWDc0uYWMs0= -google.golang.org/grpc v1.58.3 h1:BjnpXut1btbtgN/6sp+brB2Kbm2LjNXnidYujAVbSoQ= -google.golang.org/grpc v1.58.3/go.mod h1:tgX3ZQDlNJGU96V6yHh1T/JeoBQ2TXdr43YbYSsCJk0= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 h1:1hfbdAfFbkmpg41000wDVqr7jUpK/Yo+LPnIxxGzmkg= +google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3/go.mod h1:5RBcpGRxr25RbDzY5w+dmaqpSEvl8Gwl1x2CICf60ic= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f h1:2yNACc1O40tTnrsbk9Cv6oxiW8pxI/pXj0wRtdlYmgY= +google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f/go.mod h1:Uy9bTZJqmfrw2rIBxgGLnamc78euZULUBrLZ9XTITKI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/proto/cosmos/bank/module/v1/module.proto b/proto/cosmos/bank/module/v1/module.proto index 2849dbf08972..d7d4a7fafdf7 100644 --- a/proto/cosmos/bank/module/v1/module.proto +++ b/proto/cosmos/bank/module/v1/module.proto @@ -17,4 +17,10 @@ message Module { // authority defines the custom module authority. If not set, defaults to the governance module. string authority = 2; -} \ No newline at end of file + + // restrictions_order specifies the order of send restrictions and should be + // a list of module names which provide a send restriction instance. If no + // order is provided, then restrictions will be applied in alphabetical order + // of module names. + repeated string restrictions_order = 3; +} diff --git a/runtime/app.go b/runtime/app.go index 734a13006eb1..55b44aaa0d34 100644 --- a/runtime/app.go +++ b/runtime/app.go @@ -50,6 +50,7 @@ type App struct { basicManager module.BasicManager baseAppOptions []BaseAppOption msgServiceRouter *baseapp.MsgServiceRouter + grpcQueryRouter *baseapp.GRPCQueryRouter appConfig *appv1alpha1.Config logger log.Logger // initChainer is the init chainer function defined by the app config. diff --git a/runtime/builder.go b/runtime/builder.go index 72bf965f7082..bf645ae7a5d1 100644 --- a/runtime/builder.go +++ b/runtime/builder.go @@ -31,6 +31,7 @@ func (a *AppBuilder) Build(db dbm.DB, traceStore io.Writer, baseAppOptions ...fu bApp := baseapp.NewBaseApp(a.app.config.AppName, a.app.logger, db, nil, baseAppOptions...) bApp.SetMsgServiceRouter(a.app.msgServiceRouter) + bApp.SetGRPCQueryRouter(a.app.grpcQueryRouter) bApp.SetCommitMultiStoreTracer(traceStore) bApp.SetVersion(version.Version) bApp.SetInterfaceRegistry(a.app.interfaceRegistry) diff --git a/runtime/module.go b/runtime/module.go index 148efb40fa8d..6d5a7874a18e 100644 --- a/runtime/module.go +++ b/runtime/module.go @@ -87,6 +87,7 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( *codec.LegacyAmino, *AppBuilder, *baseapp.MsgServiceRouter, + *baseapp.GRPCQueryRouter, appmodule.AppModule, protodesc.Resolver, protoregistry.MessageTypeResolver, @@ -109,6 +110,7 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( cdc := codec.NewProtoCodec(interfaceRegistry) msgServiceRouter := baseapp.NewMsgServiceRouter() + grpcQueryRouter := baseapp.NewGRPCQueryRouter() app := &App{ storeKeys: nil, interfaceRegistry: interfaceRegistry, @@ -116,10 +118,11 @@ func ProvideApp(interfaceRegistry codectypes.InterfaceRegistry) ( amino: amino, basicManager: module.BasicManager{}, msgServiceRouter: msgServiceRouter, + grpcQueryRouter: grpcQueryRouter, } appBuilder := &AppBuilder{app} - return cdc, amino, appBuilder, msgServiceRouter, appModule{app}, protoFiles, protoTypes, nil + return cdc, amino, appBuilder, msgServiceRouter, grpcQueryRouter, appModule{app}, protoFiles, protoTypes, nil } type AppInputs struct { diff --git a/runtime/store.go b/runtime/store.go index aee2487b5c9d..fdd2b1f8ede8 100644 --- a/runtime/store.go +++ b/runtime/store.go @@ -29,6 +29,10 @@ func (m memStoreService) OpenMemoryStore(ctx context.Context) store.KVStore { return newKVStore(sdk.UnwrapSDKContext(ctx).KVStore(m.key)) } +func NewTransientStoreService(storeKey *storetypes.TransientStoreKey) store.TransientStoreService { + return &transientStoreService{key: storeKey} +} + type transientStoreService struct { key *storetypes.TransientStoreKey } diff --git a/server/config/config.go b/server/config/config.go index bad21f6df3bb..d97dedc5f54e 100644 --- a/server/config/config.go +++ b/server/config/config.go @@ -263,7 +263,7 @@ func DefaultConfig() *Config { }, }, Mempool: MempoolConfig{ - MaxTxs: 5_000, + MaxTxs: -1, }, } } diff --git a/server/config/toml.go b/server/config/toml.go index 85ac3743737e..b3c20c69a024 100644 --- a/server/config/toml.go +++ b/server/config/toml.go @@ -240,7 +240,7 @@ stop-node-on-err = {{ .Streaming.ABCI.StopNodeOnErr }} [mempool] # Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). # Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. # # Note, this configuration only applies to SDK built-in app-side mempool diff --git a/server/start.go b/server/start.go index 71874cd4269f..c2a812a7b5f8 100644 --- a/server/start.go +++ b/server/start.go @@ -115,8 +115,12 @@ type StartCmdOptions struct { // PostSetup can be used to setup extra services under the same cancellable context, // it's not called in stand-alone mode, only for in-process mode. PostSetup func(svrCtx *Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error + // PostSetupStandalone can be used to setup extra services under the same cancellable context, + PostSetupStandalone func(svrCtx *Context, clientCtx client.Context, ctx context.Context, g *errgroup.Group) error // AddFlags add custom flags to start cmd AddFlags func(cmd *cobra.Command) + // StartCommandHanlder can be used to customize the start command handler + StartCommandHandler func(svrCtx *Context, clientCtx client.Context, appCreator types.AppCreator, inProcessConsensus bool, opts StartCmdOptions) error } // StartCmd runs the service passed in, either stand-alone or in-process with @@ -132,6 +136,10 @@ func StartCmdWithOptions(appCreator types.AppCreator, defaultNodeHome string, op opts.DBOpener = openDB } + if opts.StartCommandHandler == nil { + opts.StartCommandHandler = start + } + cmd := &cobra.Command{ Use: "start", Short: "Run the full node", @@ -187,7 +195,7 @@ is performed. Note, when enabled, gRPC will also be automatically enabled. } err = wrapCPUProfile(serverCtx, func() error { - return start(serverCtx, clientCtx, appCreator, withCMT, opts) + return opts.StartCommandHandler(serverCtx, clientCtx, appCreator, withCMT, opts) }) serverCtx.Logger.Debug("received quit signal") @@ -271,14 +279,17 @@ func startStandAlone(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clie return err } - cmtCfg := svrCtx.Config - home := cmtCfg.RootDir - - err = startAPIServer(ctx, g, cmtCfg, svrCfg, clientCtx, svrCtx, app, home, grpcSrv, metrics) + err = startAPIServer(ctx, g, svrCfg, clientCtx, svrCtx, app, svrCtx.Config.RootDir, grpcSrv, metrics) if err != nil { return err } + if opts.PostSetupStandalone != nil { + if err := opts.PostSetupStandalone(svrCtx, clientCtx, ctx, g); err != nil { + return err + } + } + g.Go(func() error { if err := svr.Start(); err != nil { svrCtx.Logger.Error("failed to start out-of-process ABCI server", "err", err) @@ -299,8 +310,6 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien metrics *telemetry.Metrics, opts StartCmdOptions, ) error { cmtCfg := svrCtx.Config - home := cmtCfg.RootDir - gRPCOnly := svrCtx.Viper.GetBool(flagGRPCOnly) g, ctx := getCtx(svrCtx, true) @@ -336,7 +345,7 @@ func startInProcess(svrCtx *Context, svrCfg serverconfig.Config, clientCtx clien return err } - err = startAPIServer(ctx, g, cmtCfg, svrCfg, clientCtx, svrCtx, app, home, grpcSrv, metrics) + err = startAPIServer(ctx, g, svrCfg, clientCtx, svrCtx, app, cmtCfg.RootDir, grpcSrv, metrics) if err != nil { return err } @@ -499,7 +508,6 @@ func startGrpcServer( func startAPIServer( ctx context.Context, g *errgroup.Group, - cmtCfg *cmtcfg.Config, svrCfg serverconfig.Config, clientCtx client.Context, svrCtx *Context, @@ -528,10 +536,6 @@ func startAPIServer( } func startTelemetry(cfg serverconfig.Config) (*telemetry.Metrics, error) { - if !cfg.Telemetry.Enabled { - return nil, nil - } - return telemetry.New(cfg.Telemetry) } @@ -606,7 +610,7 @@ func startApp(svrCtx *Context, appCreator types.AppCreator, opts StartCmdOptions } if isTestnet, ok := svrCtx.Viper.Get(KeyIsTestnet).(bool); ok && isTestnet { - app, err = testnetify(svrCtx, home, appCreator, db, traceWriter) + app, err = testnetify(svrCtx, appCreator, db, traceWriter) if err != nil { return app, traceCleanupFn, err } @@ -632,6 +636,10 @@ func InPlaceTestnetCreator(testnetAppCreator types.AppCreator) *cobra.Command { opts.DBOpener = openDB } + if opts.StartCommandHandler == nil { + opts.StartCommandHandler = start + } + cmd := &cobra.Command{ Use: "in-place-testnet [newChainID] [newOperatorAddress]", Short: "Create and start a testnet from current local state", @@ -696,7 +704,7 @@ you want to test the upgrade handler itself. serverCtx.Viper.Set(KeyNewOpAddr, newOperatorAddress) err = wrapCPUProfile(serverCtx, func() error { - return start(serverCtx, clientCtx, testnetAppCreator, withCMT, opts) + return opts.StartCommandHandler(serverCtx, clientCtx, testnetAppCreator, withCMT, opts) }) serverCtx.Logger.Debug("received quit signal") @@ -719,7 +727,7 @@ you want to test the upgrade handler itself. // testnetify modifies both state and blockStore, allowing the provided operator address and local validator key to control the network // that the state in the data folder represents. The chainID of the local genesis file is modified to match the provided chainID. -func testnetify(ctx *Context, home string, testnetAppCreator types.AppCreator, db dbm.DB, traceWriter io.WriteCloser) (types.Application, error) { +func testnetify(ctx *Context, testnetAppCreator types.AppCreator, db dbm.DB, traceWriter io.WriteCloser) (types.Application, error) { config := ctx.Config newChainID, ok := ctx.Viper.Get(KeyNewChainID).(string) @@ -765,9 +773,6 @@ func testnetify(ctx *Context, home string, testnetAppCreator types.AppCreator, d return nil, err } validatorAddress := userPubKey.Address() - if err != nil { - return nil, err - } stateStore := sm.NewStore(stateDB, sm.StoreOptions{ DiscardABCIResponses: config.Storage.DiscardABCIResponses, diff --git a/server/util.go b/server/util.go index b1cbec13f751..de656d949001 100644 --- a/server/util.go +++ b/server/util.go @@ -341,6 +341,35 @@ func AddCommands(rootCmd *cobra.Command, defaultNodeHome string, appCreator type ) } +// AddCommandsWithStartCmdOptions adds server commands with the provided StartCmdOptions. +func AddCommandsWithStartCmdOptions(rootCmd *cobra.Command, defaultNodeHome string, appCreator types.AppCreator, appExport types.AppExporter, opts StartCmdOptions) { + cometCmd := &cobra.Command{ + Use: "comet", + Aliases: []string{"cometbft", "tendermint"}, + Short: "CometBFT subcommands", + } + + cometCmd.AddCommand( + ShowNodeIDCmd(), + ShowValidatorCmd(), + ShowAddressCmd(), + VersionCmd(), + cmtcmd.ResetAllCmd, + cmtcmd.ResetStateCmd, + BootstrapStateCmd(appCreator), + ) + + startCmd := StartCmdWithOptions(appCreator, defaultNodeHome, opts) + + rootCmd.AddCommand( + startCmd, + cometCmd, + ExportCmd(appExport, defaultNodeHome), + version.NewVersionCommand(), + NewRollbackCmd(appCreator, defaultNodeHome), + ) +} + // AddTestnetCreatorCommand allows chains to create a testnet from the state existing in their node's data directory. func AddTestnetCreatorCommand(rootCmd *cobra.Command, appCreator types.AppCreator, addStartFlags types.ModuleInitFlags) { testnetCreateCmd := InPlaceTestnetCreator(appCreator) diff --git a/simapp/go.mod b/simapp/go.mod index 19c716a5db9c..acb5e47f7f19 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -3,26 +3,26 @@ module cosmossdk.io/simapp go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.2 + cosmossdk.io/store v1.1.0 cosmossdk.io/tools/confix v0.1.1 - cosmossdk.io/x/circuit v0.1.0 - cosmossdk.io/x/evidence v0.1.0 - cosmossdk.io/x/feegrant v0.1.0 - cosmossdk.io/x/nft v0.1.0 - cosmossdk.io/x/tx v0.13.1 - cosmossdk.io/x/upgrade v0.1.1 - github.com/cometbft/cometbft v0.38.6 + cosmossdk.io/x/circuit v0.1.1 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/nft v0.1.1 + cosmossdk.io/x/tx v0.13.3 + cosmossdk.io/x/upgrade v0.1.2 + github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 // this version is not used as it is always replaced by the latest Cosmos SDK version - github.com/cosmos/cosmos-sdk v0.50.3 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 @@ -52,7 +52,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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 @@ -62,10 +62,10 @@ require ( github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/creachadair/atomicfile v0.3.1 // indirect @@ -113,7 +113,7 @@ require ( github.com/hashicorp/go-getter v1.7.3 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.2 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect @@ -132,7 +132,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -145,13 +145,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -176,21 +176,21 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.7.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/time v0.5.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 304effe160a3..eeb7d4370eb8 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -184,8 +184,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 h1:Hr1t0fCq1nbFC7hLs0Xvy9WAiH7Iti5iVLXMM5C37F0= cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79/go.mod h1:8pN6LSVReNnIxrC2QGcvuIJ/m1pJN6FNYn2kAYtYftI= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= @@ -202,18 +202,18 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/tools/confix v0.1.1 h1:aexyRv9+y15veH3Qw16lxQwo+ki7r2I+g0yNTEFEQM8= cosmossdk.io/tools/confix v0.1.1/go.mod h1:nQVvP1tHsGXS83PonPVWJtSbddIqyjEw99L4M3rPJyQ= -cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= -cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= -cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= -cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= -cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= -cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= -cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= -cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= -cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= -cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= +cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +cosmossdk.io/x/upgrade v0.1.2 h1:O2FGb0mVSXl7P6BQm9uV3hRVKom1zBLDGhd4G8jysJg= +cosmossdk.io/x/upgrade v0.1.2/go.mod h1:P+e4/ZNd8km7lTAX5hC2pXz/042YDcB7gzKTHuY53nc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -293,8 +293,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= @@ -339,8 +339,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -355,17 +355,17 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -662,8 +662,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.2 h1:ErEYO2f//CjKsUDw4SmLzelsK6L3ZmOAR/4P9iS7ruY= -github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -765,8 +765,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -874,8 +874,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -896,32 +896,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1097,8 +1097,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1110,8 +1110,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 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-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1139,8 +1139,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1203,8 +1203,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1230,8 +1230,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1247,8 +1247,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ 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.1.0/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1349,16 +1349,16 @@ 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/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= @@ -1444,8 +1444,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.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -1622,12 +1622,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1669,8 +1669,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/simapp/simd/cmd/commands.go b/simapp/simd/cmd/commands.go index e8f59e5bc123..2b6c2be24901 100644 --- a/simapp/simd/cmd/commands.go +++ b/simapp/simd/cmd/commands.go @@ -21,8 +21,6 @@ import ( "github.com/cosmos/cosmos-sdk/client/pruning" "github.com/cosmos/cosmos-sdk/client/rpc" "github.com/cosmos/cosmos-sdk/client/snapshot" - "github.com/cosmos/cosmos-sdk/codec" - codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" serverconfig "github.com/cosmos/cosmos-sdk/server/config" servertypes "github.com/cosmos/cosmos-sdk/server/types" @@ -106,8 +104,6 @@ custom-field = "{{ .Custom.CustomField }}"` func initRootCmd( rootCmd *cobra.Command, txConfig client.TxConfig, - interfaceRegistry codectypes.InterfaceRegistry, - appCodec codec.Codec, basicManager module.BasicManager, ) { cfg := sdk.GetConfig() @@ -122,7 +118,11 @@ func initRootCmd( snapshot.Cmd(newApp), ) - server.AddCommands(rootCmd, simapp.DefaultNodeHome, newApp, appExport, addModuleInitFlags) + server.AddCommandsWithStartCmdOptions(rootCmd, simapp.DefaultNodeHome, newApp, appExport, server.StartCmdOptions{ + AddFlags: func(startCmd *cobra.Command) { + crisis.AddModuleInitFlags(startCmd) + }, + }) // add keybase, auxiliary RPC, query, genesis, and tx child commands rootCmd.AddCommand( @@ -134,10 +134,6 @@ func initRootCmd( ) } -func addModuleInitFlags(startCmd *cobra.Command) { - crisis.AddModuleInitFlags(startCmd) -} - // genesisCommand builds genesis-related `simd genesis` command. Users may provide application specific commands as a parameter func genesisCommand(txConfig client.TxConfig, basicManager module.BasicManager, cmds ...*cobra.Command) *cobra.Command { cmd := genutilcli.Commands(txConfig, basicManager, simapp.DefaultNodeHome) @@ -159,7 +155,7 @@ func queryCommand() *cobra.Command { } cmd.AddCommand( - rpc.QueryEventForTxCmd(), + rpc.WaitTxCmd(), server.QueryBlockCmd(), authcmd.QueryTxsByEventsCmd(), server.QueryBlocksCmd(), diff --git a/simapp/simd/cmd/root.go b/simapp/simd/cmd/root.go index ee8d7e089892..f56b849a9c56 100644 --- a/simapp/simd/cmd/root.go +++ b/simapp/simd/cmd/root.go @@ -96,7 +96,7 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, encodingConfig.TxConfig, encodingConfig.InterfaceRegistry, encodingConfig.Codec, tempApp.BasicModuleManager) + initRootCmd(rootCmd, encodingConfig.TxConfig, tempApp.BasicModuleManager) // add keyring to autocli opts autoCliOpts := tempApp.AutoCliOpts() diff --git a/simapp/simd/cmd/root_v2.go b/simapp/simd/cmd/root_v2.go index 934ee3584925..94ef4cd9d17b 100644 --- a/simapp/simd/cmd/root_v2.go +++ b/simapp/simd/cmd/root_v2.go @@ -84,7 +84,7 @@ func NewRootCmd() *cobra.Command { }, } - initRootCmd(rootCmd, clientCtx.TxConfig, clientCtx.InterfaceRegistry, clientCtx.Codec, moduleBasicManager) + initRootCmd(rootCmd, clientCtx.TxConfig, moduleBasicManager) if err := autoCliOpts.EnhanceRootCommand(rootCmd); err != nil { panic(err) diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index b5e06dc3f03a..fcb57d1b8f32 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -38,6 +38,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## v1.1.0 (March 20, 2024) +### Improvements + +* [#19770](https://github.com/cosmos/cosmos-sdk/pull/19770) Upgrade IAVL to IAVL v1.1.1. + ## v1.0.2 (January 10, 2024) ### Bug Fixes diff --git a/store/cache/cache_test.go b/store/cache/cache_test.go index 0340f7ecbd8d..efbf22c8e18e 100644 --- a/store/cache/cache_test.go +++ b/store/cache/cache_test.go @@ -13,10 +13,11 @@ import ( "cosmossdk.io/store/cachekv" iavlstore "cosmossdk.io/store/iavl" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) func TestGetOrSetStoreCache(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -29,7 +30,7 @@ func TestGetOrSetStoreCache(t *testing.T) { } func TestUnwrap(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -42,7 +43,7 @@ func TestUnwrap(t *testing.T) { } func TestStoreCache(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -68,7 +69,7 @@ func TestStoreCache(t *testing.T) { } func TestReset(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") @@ -88,7 +89,7 @@ func TestReset(t *testing.T) { } func TestCacheWrap(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) mngr := cache.NewCommitKVStoreCacheManager(cache.DefaultCommitKVStoreCacheSize) sKey := types.NewKVStoreKey("test") diff --git a/store/go.mod b/store/go.mod index c9950b02ce56..dc8b475c3ee9 100644 --- a/store/go.mod +++ b/store/go.mod @@ -6,10 +6,10 @@ require ( cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - github.com/cometbft/cometbft v0.38.6 + github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/gogoproto v1.4.11 - github.com/cosmos/iavl v1.0.1 + github.com/cosmos/gogoproto v1.4.12 + github.com/cosmos/iavl v1.1.2 github.com/cosmos/ics23/go v0.10.0 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 // indirect @@ -18,10 +18,10 @@ require ( github.com/hashicorp/go-plugin v1.5.2 github.com/hashicorp/golang-lru v1.0.2 github.com/spf13/cast v1.6.0 // indirect - github.com/stretchr/testify v1.8.4 + github.com/stretchr/testify v1.9.0 github.com/tidwall/btree v1.7.0 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 - google.golang.org/grpc v1.60.0 + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 + google.golang.org/grpc v1.61.1 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) @@ -30,7 +30,7 @@ require ( github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect - github.com/cespare/xxhash/v2 v2.2.0 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect @@ -52,7 +52,7 @@ require ( github.com/klauspost/compress v1.17.7 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect github.com/mitchellh/go-testing-interface v1.14.1 // indirect @@ -61,18 +61,18 @@ require ( github.com/petermattis/goid v0.0.0-20221215004737-a150e88a970d // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/zerolog v1.32.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.20.0 // indirect - golang.org/x/sys v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/net v0.23.0 // indirect + golang.org/x/sys v0.19.0 // indirect golang.org/x/text v0.14.0 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/store/go.sum b/store/go.sum index 5b83ff072607..961dfe435593 100644 --- a/store/go.sum +++ b/store/go.sum @@ -24,8 +24,8 @@ github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1/go.mod h1:7SFka0XMvUgj3hfZtyd github.com/bufbuild/protocompile v0.6.0 h1:Uu7WiSQ6Yj9DbkdnOe7U4mNKp58y9WDMKDn28/ZlunY= github.com/bufbuild/protocompile v0.6.0/go.mod h1:YNP35qEYoYGme7QMtz5SBCoN4kL4g12jTtjuzRNdjpE= 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= @@ -43,15 +43,15 @@ github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwP github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= @@ -154,8 +154,8 @@ github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= @@ -211,22 +211,22 @@ github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5FsnadC4Ky3P0J6CfImo= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.12.0 h1:exVL4IDcn6na9z1rAb56Vxr+CgyK3nn3O+epU5NdKM8= github.com/rogpeppe/go-internal v1.12.0/go.mod h1:E+RYuTGaKKdloAfM02xzb0FW3Paa99yedzYV+kq4uf4= @@ -246,8 +246,8 @@ github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UV github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= github.com/stretchr/testify v1.7.2/go.mod h1:R6va5+xMeoiuVRoj+gSkQ7d3FALtqAAGI1FQKckRals= -github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk= -github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo= +github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= +github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d h1:vfofYNRScrDdvS342BElfbETmL1Aiz3i2t0zfRj16Hs= github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d/go.mod h1:RRCYJbIwD5jmqPI9XoAFR0OcDxqUctll6zUj/+B4S48= github.com/tidwall/btree v1.7.0 h1:L1fkJH/AuEh5zBnnBbmTwQ5Lt+bRJ5A8EWecslvo9iI= @@ -260,10 +260,10 @@ golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnf golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +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/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= @@ -279,8 +279,8 @@ golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96b golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.20.0 h1:aCL9BSgETF1k+blQaYUBx9hJ9LOGP3gAVemcZlf1Kpo= -golang.org/x/net v0.20.0/go.mod h1:z8BVo6PvndSri0LbOE3hAn0apkU+1YvI6E70E9jsnvY= +golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= +golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -288,8 +288,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -320,8 +320,8 @@ golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= @@ -341,10 +341,10 @@ golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220517211312-f3a8303e98df/go.mod h1:K8+ghG5WaK9qNqU5K3HdILfMLy1f3aNYFI/wnl100a8= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f h1:ultW7fxlIvee4HYrtnaRPon9HpEgFk5zYpmfMgtKB5I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20231120223509-83a465c0220f/go.mod h1:L9KNLi232K1/xB6f7AlSX692koaRnKaWSR0stBki0Yc= -google.golang.org/grpc v1.60.0 h1:6FQAR0kM31P6MRdeluor2w2gPaS4SVNrD/DNTxrQ15k= -google.golang.org/grpc v1.60.0/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 h1:/jFB8jK5R3Sq3i/lmeZO0cATSzFfZaJq1J2Euan3XKU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0/go.mod h1:FUoWkonphQm3RhTS+kOEhF8h0iDpm4tdXolVCeZ9KKA= +google.golang.org/grpc v1.61.1 h1:kLAiWrZs7YeDM6MumDe7m3y4aM6wacLzM1Y/wiLP9XY= +google.golang.org/grpc v1.61.1/go.mod h1:VUbo7IFqmF1QtCAstipjG0GIoq49KvMe9+h1jFLBNJs= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= @@ -373,5 +373,3 @@ gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= gotest.tools/v3 v3.5.1 h1:EENdUnS3pdur5nybKYIh2Vfgc8IUNBjxDPSjtiJcOzU= gotest.tools/v3 v3.5.1/go.mod h1:isy3WKz7GK6uNw/sbHzfKBLvlvXwUyV06n6brMxxopU= -sigs.k8s.io/yaml v1.4.0 h1:Mk1wCc2gy/F0THH0TAp1QYyJNzRm2KCLy3o5ASXVI5E= -sigs.k8s.io/yaml v1.4.0/go.mod h1:Ejl7/uTz7PSA4eKMyQCUTnhZYNmLIl+5c2lQPGR2BPY= diff --git a/store/iavl/store.go b/store/iavl/store.go index c52feb89544d..e73dcd6c1fdd 100644 --- a/store/iavl/store.go +++ b/store/iavl/store.go @@ -16,6 +16,7 @@ import ( "cosmossdk.io/store/metrics" pruningtypes "cosmossdk.io/store/pruning/types" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) const ( @@ -49,7 +50,7 @@ func LoadStore(db dbm.DB, logger log.Logger, key types.StoreKey, id types.Commit // provided DB. An error is returned if the version fails to load, or if called with a positive // version on an empty tree. func LoadStoreWithInitialVersion(db dbm.DB, logger log.Logger, key types.StoreKey, id types.CommitID, initialVersion uint64, cacheSize int, disableFastNode bool, metrics metrics.StoreMetrics) (types.CommitKVStore, error) { - tree := iavl.NewMutableTree(db, cacheSize, disableFastNode, logger, iavl.InitialVersionOption(initialVersion)) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, disableFastNode, logger, iavl.InitialVersionOption(initialVersion)) isUpgradeable, err := tree.IsUpgradeable() if err != nil { diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index d9a47b21fb7b..46d9fa62371c 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -17,6 +17,7 @@ import ( "cosmossdk.io/store/internal/kv" "cosmossdk.io/store/metrics" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) var ( @@ -37,7 +38,7 @@ func randBytes(numBytes int) []byte { // make a tree with data from above and save it func newAlohaTree(t *testing.T, db dbm.DB) (*iavl.MutableTree, types.CommitID) { t.Helper() - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) for k, v := range treeData { _, err := tree.Set([]byte(k), []byte(v)) @@ -285,7 +286,7 @@ func TestIAVLIterator(t *testing.T) { } func TestIAVLReverseIterator(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) @@ -319,7 +320,7 @@ func TestIAVLReverseIterator(t *testing.T) { } func TestIAVLPrefixIterator(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -382,7 +383,7 @@ func TestIAVLPrefixIterator(t *testing.T) { } func TestIAVLReversePrefixIterator(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -449,7 +450,7 @@ func nextVersion(iavl *Store) { } func TestIAVLNoPrune(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -467,7 +468,7 @@ func TestIAVLNoPrune(t *testing.T) { } func TestIAVLStoreQuery(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := UnsafeNewStore(tree) @@ -579,7 +580,7 @@ func TestIAVLStoreQuery(t *testing.T) { func BenchmarkIAVLIteratorNext(b *testing.B) { b.ReportAllocs() - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) treeSize := 1000 tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) @@ -615,7 +616,7 @@ func TestSetInitialVersion(t *testing.T) { { "works with a mutable tree", func(db *dbm.MemDB) *Store { - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) store := UnsafeNewStore(tree) return store @@ -624,7 +625,7 @@ func TestSetInitialVersion(t *testing.T) { { "throws error on immutable tree", func(db *dbm.MemDB) *Store { - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger()) store := UnsafeNewStore(tree) _, version, err := store.tree.SaveVersion() require.NoError(t, err) @@ -669,7 +670,7 @@ func TestChangeSets(t *testing.T) { treeSize := 1000 treeVersion := int64(10) targetVersion := int64(6) - tree := iavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger(), iavl.FlushThresholdOption(math.MaxInt)) + tree := iavl.NewMutableTree(wrapper.NewDBWrapper(db), cacheSize, false, log.NewNopLogger(), iavl.FlushThresholdOption(math.MaxInt)) for j := int64(0); j < treeVersion; j++ { keys := [][]byte{} diff --git a/store/iavl/tree.go b/store/iavl/tree.go index 6819029f2642..889fc1d5a07f 100644 --- a/store/iavl/tree.go +++ b/store/iavl/tree.go @@ -3,8 +3,8 @@ package iavl import ( "fmt" - dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/iavl" + idb "github.com/cosmos/iavl/db" ) var ( @@ -31,7 +31,7 @@ type ( GetVersioned(key []byte, version int64) ([]byte, error) GetImmutable(version int64) (*iavl.ImmutableTree, error) SetInitialVersion(version uint64) - Iterator(start, end []byte, ascending bool) (dbm.Iterator, error) + Iterator(start, end []byte, ascending bool) (idb.Iterator, error) AvailableVersions() []int LoadVersionForOverwriting(targetVersion int64) error TraverseStateChanges(startVersion, endVersion int64, fn func(version int64, changeSet *iavl.ChangeSet) error) error diff --git a/store/iavl/tree_test.go b/store/iavl/tree_test.go index 63a12a2e5d28..243355e42e08 100644 --- a/store/iavl/tree_test.go +++ b/store/iavl/tree_test.go @@ -8,11 +8,12 @@ import ( "github.com/stretchr/testify/require" "cosmossdk.io/log" + "cosmossdk.io/store/wrapper" ) func TestImmutableTreePanics(t *testing.T) { t.Parallel() - immTree := iavl.NewImmutableTree(dbm.NewMemDB(), 100, false, log.NewNopLogger()) + immTree := iavl.NewImmutableTree(wrapper.NewDBWrapper(dbm.NewMemDB()), 100, false, log.NewNopLogger()) it := &immutableTree{immTree} require.Panics(t, func() { _, err := it.Set([]byte{}, []byte{}) diff --git a/store/prefix/store_test.go b/store/prefix/store_test.go index af2605818c52..818733033e09 100644 --- a/store/prefix/store_test.go +++ b/store/prefix/store_test.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/store/gaskv" "cosmossdk.io/store/iavl" "cosmossdk.io/store/types" + "cosmossdk.io/store/wrapper" ) // copied from iavl/store_test.go @@ -90,7 +91,7 @@ func testPrefixStore(t *testing.T, baseStore types.KVStore, prefix []byte) { } func TestIAVLStorePrefix(t *testing.T) { - db := dbm.NewMemDB() + db := wrapper.NewDBWrapper(dbm.NewMemDB()) tree := tiavl.NewMutableTree(db, cacheSize, false, log.NewNopLogger()) iavlStore := iavl.UnsafeNewStore(tree) diff --git a/store/wrapper/wrapper.go b/store/wrapper/wrapper.go new file mode 100644 index 000000000000..5ccb4aef4698 --- /dev/null +++ b/store/wrapper/wrapper.go @@ -0,0 +1,34 @@ +package wrapper + +import ( + dbm "github.com/cosmos/cosmos-db" + idb "github.com/cosmos/iavl/db" +) + +var _ idb.DB = &DBWrapper{} + +// DBwrapper is a simple wrapper of dbm.DB that implements the iavl.DB interface. +type DBWrapper struct { + dbm.DB +} + +// NewDBWrapper creates a new DBWrapper instance. +func NewDBWrapper(db dbm.DB) *DBWrapper { + return &DBWrapper{db} +} + +func (dbw *DBWrapper) NewBatch() idb.Batch { + return dbw.DB.NewBatch() +} + +func (dbw *DBWrapper) NewBatchWithSize(size int) idb.Batch { + return dbw.DB.NewBatchWithSize(size) +} + +func (dbw *DBWrapper) Iterator(start, end []byte) (idb.Iterator, error) { + return dbw.DB.Iterator(start, end) +} + +func (dbw *DBWrapper) ReverseIterator(start, end []byte) (idb.Iterator, error) { + return dbw.DB.ReverseIterator(start, end) +} diff --git a/telemetry/metrics.go b/telemetry/metrics.go index c15720897972..07d1020eb892 100644 --- a/telemetry/metrics.go +++ b/telemetry/metrics.go @@ -14,6 +14,15 @@ import ( "github.com/prometheus/common/expfmt" ) +// globalTelemetryEnabled is a private variable that stores the telemetry enabled state. +// It is set on initialization and does not change for the lifetime of the program. +var globalTelemetryEnabled bool + +// IsTelemetryEnabled provides controlled access to check if telemetry is enabled. +func IsTelemetryEnabled() bool { + return globalTelemetryEnabled +} + // globalLabels defines the set of global labels that will be applied to all // metrics emitted using the telemetry package function wrappers. var globalLabels = []metrics.Label{} @@ -23,6 +32,7 @@ const ( FormatDefault = "" FormatPrometheus = "prometheus" FormatText = "text" + ContentTypeText = `text/plain; version=` + expfmt.TextVersion + `; charset=utf-8` MetricSinkInMem = "mem" MetricSinkStatsd = "statsd" @@ -94,6 +104,7 @@ type GatherResponse struct { // New creates a new instance of Metrics func New(cfg Config) (_ *Metrics, rerr error) { + globalTelemetryEnabled = cfg.Enabled if !cfg.Enabled { return nil, nil } @@ -192,7 +203,7 @@ func (m *Metrics) gatherPrometheus() (GatherResponse, error) { buf := &bytes.Buffer{} defer buf.Reset() - e := expfmt.NewEncoder(buf, expfmt.FmtText) + e := expfmt.NewEncoder(buf, expfmt.NewFormat(expfmt.TypeTextPlain)) for _, mf := range metricsFamilies { if err := e.Encode(mf); err != nil { @@ -200,7 +211,7 @@ func (m *Metrics) gatherPrometheus() (GatherResponse, error) { } } - return GatherResponse{ContentType: string(expfmt.FmtText), Metrics: buf.Bytes()}, nil + return GatherResponse{ContentType: ContentTypeText, Metrics: buf.Bytes()}, nil } // gatherGeneric collects generic metrics and returns a GatherResponse. diff --git a/telemetry/metrics_test.go b/telemetry/metrics_test.go index 1ce1103529c8..e7b8895dfdcf 100644 --- a/telemetry/metrics_test.go +++ b/telemetry/metrics_test.go @@ -7,7 +7,6 @@ import ( "time" "github.com/hashicorp/go-metrics" - "github.com/prometheus/common/expfmt" "github.com/stretchr/testify/require" ) @@ -58,7 +57,7 @@ func TestMetrics_Prom(t *testing.T) { gr, err := m.Gather(FormatPrometheus) require.NoError(t, err) - require.Equal(t, gr.ContentType, string(expfmt.FmtText)) + require.Equal(t, gr.ContentType, ContentTypeText) require.True(t, strings.Contains(string(gr.Metrics), "test_dummy_counter 30")) } diff --git a/telemetry/wrapper.go b/telemetry/wrapper.go index 4cd96b78f715..da11f1fa0450 100644 --- a/telemetry/wrapper.go +++ b/telemetry/wrapper.go @@ -24,6 +24,10 @@ func NewLabel(name, value string) metrics.Label { // metric for a module with a given set of keys. If any global labels are defined, // they will be added to the module label. func ModuleMeasureSince(module string, start time.Time, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.MeasureSinceWithLabels( keys, start.UTC(), @@ -35,6 +39,10 @@ func ModuleMeasureSince(module string, start time.Time, keys ...string) { // module with a given set of keys. If any global labels are defined, they will // be added to the module label. func ModuleSetGauge(module string, val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels( keys, val, @@ -45,29 +53,58 @@ func ModuleSetGauge(module string, val float32, keys ...string) { // IncrCounter provides a wrapper functionality for emitting a counter metric with // global labels (if any). func IncrCounter(val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.IncrCounterWithLabels(keys, val, globalLabels) } // IncrCounterWithLabels provides a wrapper functionality for emitting a counter // metric with global labels (if any) along with the provided labels. func IncrCounterWithLabels(keys []string, val float32, labels []metrics.Label) { + if !IsTelemetryEnabled() { + return + } + metrics.IncrCounterWithLabels(keys, val, append(labels, globalLabels...)) } // SetGauge provides a wrapper functionality for emitting a gauge metric with // global labels (if any). func SetGauge(val float32, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels(keys, val, globalLabels) } // SetGaugeWithLabels provides a wrapper functionality for emitting a gauge // metric with global labels (if any) along with the provided labels. func SetGaugeWithLabels(keys []string, val float32, labels []metrics.Label) { + if !IsTelemetryEnabled() { + return + } + metrics.SetGaugeWithLabels(keys, val, append(labels, globalLabels...)) } // MeasureSince provides a wrapper functionality for emitting a a time measure // metric with global labels (if any). func MeasureSince(start time.Time, keys ...string) { + if !IsTelemetryEnabled() { + return + } + metrics.MeasureSinceWithLabels(keys, start.UTC(), globalLabels) } + +// Now return the current time if telemetry is enabled or a zero time if it's not +func Now() time.Time { + if !IsTelemetryEnabled() { + return time.Time{} + } + + return time.Now() +} diff --git a/telemetry/wrapper_test.go b/telemetry/wrapper_test.go new file mode 100644 index 000000000000..5388839874bc --- /dev/null +++ b/telemetry/wrapper_test.go @@ -0,0 +1,51 @@ +package telemetry + +import ( + "sync" + "testing" + "time" + + "github.com/stretchr/testify/assert" +) + +var mu sync.Mutex + +func initTelemetry(v bool) { + globalTelemetryEnabled = v +} + +// Reset the global state to a known disabled state before each test. +func setupTest(t *testing.T) { + t.Helper() + mu.Lock() // Ensure no other test can modify global state at the same time. + defer mu.Unlock() + initTelemetry(false) +} + +// TestNow tests the Now function when telemetry is enabled and disabled. +func TestNow(t *testing.T) { + setupTest(t) // Locks the mutex to avoid race condition. + + initTelemetry(true) + telemetryTime := Now() + assert.NotEqual(t, time.Time{}, telemetryTime, "Now() should not return zero time when telemetry is enabled") + + setupTest(t) // Reset the global state and lock the mutex again. + + initTelemetry(false) + telemetryTime = Now() + assert.Equal(t, time.Time{}, telemetryTime, "Now() should return zero time when telemetry is disabled") +} + +// TestIsTelemetryEnabled tests the IsTelemetryEnabled function. +func TestIsTelemetryEnabled(t *testing.T) { + setupTest(t) // Locks the mutex to avoid race condition. + + initTelemetry(true) + assert.True(t, IsTelemetryEnabled(), "IsTelemetryEnabled() should return true when globalTelemetryEnabled is set to true") + + setupTest(t) // Reset the global state and lock the mutex again. + + initTelemetry(false) + assert.False(t, IsTelemetryEnabled(), "IsTelemetryEnabled() should return false when globalTelemetryEnabled is set to false") +} diff --git a/tests/go.mod b/tests/go.mod index 4dd82ea6c82e..23df40dfe2ee 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -3,29 +3,29 @@ module github.com/cosmos/cosmos-sdk/tests go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 cosmossdk.io/simapp v0.0.0-20230620040119-e078f1a49e8b - cosmossdk.io/store v1.0.2 - cosmossdk.io/x/evidence v0.1.0 - cosmossdk.io/x/feegrant v0.1.0 - cosmossdk.io/x/nft v0.1.0 // indirect - cosmossdk.io/x/tx v0.13.1 - cosmossdk.io/x/upgrade v0.1.1 - github.com/cometbft/cometbft v0.38.6 + cosmossdk.io/store v1.1.0 + cosmossdk.io/x/evidence v0.1.1 + cosmossdk.io/x/feegrant v0.1.1 + cosmossdk.io/x/nft v0.1.1 // indirect + cosmossdk.io/x/tx v0.13.3 + cosmossdk.io/x/upgrade v0.1.2 + github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // this version is not used as it is always replaced by the latest Cosmos SDK version - github.com/cosmos/cosmos-sdk v0.50.3 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/grpc v1.62.0 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 @@ -39,7 +39,7 @@ require ( cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/circuit v0.1.0 // indirect + cosmossdk.io/x/circuit v0.1.1 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -53,7 +53,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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 @@ -65,7 +65,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -111,7 +111,7 @@ require ( github.com/hashicorp/go-getter v1.7.3 // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.2 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect @@ -130,7 +130,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -143,13 +143,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -177,20 +177,20 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.7.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/time v0.5.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/tests/go.sum b/tests/go.sum index 9853a5bdfd93..12b2a1097c1d 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -184,8 +184,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79 h1:Hr1t0fCq1nbFC7hLs0Xvy9WAiH7Iti5iVLXMM5C37F0= cosmossdk.io/client/v2 v2.0.0-beta.1.0.20240124105859-5ad1805d0e79/go.mod h1:8pN6LSVReNnIxrC2QGcvuIJ/m1pJN6FNYn2kAYtYftI= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= @@ -200,18 +200,18 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/x/circuit v0.1.0 h1:IAej8aRYeuOMritczqTlljbUVHq1E85CpBqaCTwYgXs= -cosmossdk.io/x/circuit v0.1.0/go.mod h1:YDzblVE8+E+urPYQq5kq5foRY/IzhXovSYXb4nwd39w= -cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= -cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= -cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= -cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= -cosmossdk.io/x/nft v0.1.0 h1:VhcsFiEK33ODN27kxKLa0r/CeFd8laBfbDBwYqCyYCM= -cosmossdk.io/x/nft v0.1.0/go.mod h1:ec4j4QAO4mJZ+45jeYRnW7awLHby1JZANqe1hNZ4S3g= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= -cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= -cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= +cosmossdk.io/x/circuit v0.1.1 h1:KPJCnLChWrxD4jLwUiuQaf5mFD/1m7Omyo7oooefBVQ= +cosmossdk.io/x/circuit v0.1.1/go.mod h1:B6f/urRuQH8gjt4eLIXfZJucrbreuYrKh5CSjaOxr+Q= +cosmossdk.io/x/evidence v0.1.1 h1:Ks+BLTa3uftFpElLTDp9L76t2b58htjVbSZ86aoK/E4= +cosmossdk.io/x/evidence v0.1.1/go.mod h1:OoDsWlbtuyqS70LY51aX8FBTvguQqvFrt78qL7UzeNc= +cosmossdk.io/x/feegrant v0.1.1 h1:EKFWOeo/pup0yF0svDisWWKAA9Zags6Zd0P3nRvVvw8= +cosmossdk.io/x/feegrant v0.1.1/go.mod h1:2GjVVxX6G2fta8LWj7pC/ytHjryA6MHAJroBWHFNiEQ= +cosmossdk.io/x/nft v0.1.1 h1:pslAVS8P5NkW080+LWOamInjDcq+v2GSCo+BjN9sxZ8= +cosmossdk.io/x/nft v0.1.1/go.mod h1:Kac6F6y2gsKvoxU+fy8uvxRTi4BIhLOor2zgCNQwVgY= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +cosmossdk.io/x/upgrade v0.1.2 h1:O2FGb0mVSXl7P6BQm9uV3hRVKom1zBLDGhd4G8jysJg= +cosmossdk.io/x/upgrade v0.1.2/go.mod h1:P+e4/ZNd8km7lTAX5hC2pXz/042YDcB7gzKTHuY53nc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -291,8 +291,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= @@ -337,8 +337,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -353,17 +353,17 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/keyring v1.2.0 h1:8C1lBP9xhImmIabyXW4c3vFjjLiBdGCmfLUfeZlV1Yo= @@ -659,8 +659,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.2 h1:ErEYO2f//CjKsUDw4SmLzelsK6L3ZmOAR/4P9iS7ruY= -github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -762,8 +762,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -875,8 +875,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -897,32 +897,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1098,8 +1098,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1111,8 +1111,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 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-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1140,8 +1140,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1204,8 +1204,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1231,8 +1231,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1248,8 +1248,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ 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.1.0/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1349,16 +1349,16 @@ 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/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= @@ -1445,8 +1445,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.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -1623,12 +1623,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1670,8 +1670,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/testutil/sims/tx_helpers.go b/testutil/sims/tx_helpers.go index 55ac8a79a42d..0557e6b647b1 100644 --- a/testutil/sims/tx_helpers.go +++ b/testutil/sims/tx_helpers.go @@ -79,10 +79,10 @@ func GenSignedMockTx(r *rand.Rand, txConfig client.TxConfig, msgs []sdk.Msg, fee panic(err) } sigs[i].Data.(*signing.SingleSignatureData).Signature = sig - err = tx.SetSignatures(sigs...) - if err != nil { - panic(err) - } + } + err = tx.SetSignatures(sigs...) + if err != nil { + panic(err) } return tx.GetTx(), nil diff --git a/tools/confix/data/v0.50-app.toml b/tools/confix/data/v0.50-app.toml index 75f587576ea5..32d9af06b90e 100644 --- a/tools/confix/data/v0.50-app.toml +++ b/tools/confix/data/v0.50-app.toml @@ -227,9 +227,9 @@ stop-node-on-err = true [mempool] # Setting max-txs to 0 will allow for a unbounded amount of transactions in the mempool. -# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool. +# Setting max_txs to negative 1 (-1) will disable transactions from being inserted into the mempool (no-op mempool). # Setting max_txs to a positive number (> 0) will limit the number of transactions in the mempool, by the specified amount. # # Note, this configuration only applies to SDK built-in app-side mempool # implementations. -max-txs = 5000 +max-txs = -1 diff --git a/tools/confix/go.mod b/tools/confix/go.mod index 9e79a758a6d3..db5af213b341 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -3,50 +3,51 @@ module cosmossdk.io/tools/confix go 1.21 require ( - github.com/cosmos/cosmos-sdk v0.50.1 + github.com/cosmos/cosmos-sdk v0.50.6 github.com/creachadair/atomicfile v0.3.1 github.com/creachadair/tomledit v0.0.24 github.com/pelletier/go-toml/v2 v2.1.0 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 gotest.tools/v3 v3.5.1 ) require ( - cosmossdk.io/api v0.7.3 // indirect + cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.11.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/store v1.0.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/store v1.1.0 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -57,7 +58,7 @@ require ( github.com/dgraph-io/ristretto v0.1.1 // indirect github.com/dgryski/go-farm v0.0.0-20200201041132-a6ae2369ad13 // indirect github.com/dustin/go-humanize v1.0.1 // indirect - github.com/dvsekhvalnov/jose2go v1.5.0 // indirect + github.com/dvsekhvalnov/jose2go v1.6.0 // indirect github.com/emicklei/dot v1.6.1 // indirect github.com/fatih/color v1.15.0 // indirect github.com/felixge/httpsnoop v1.0.2 // indirect @@ -84,7 +85,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -100,7 +101,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -110,13 +111,13 @@ require ( github.com/mtibben/percent v0.2.1 // indirect github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -137,16 +138,16 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/tools/confix/go.sum b/tools/confix/go.sum index 57dd5c98baf3..2646c47b3d19 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,10 +14,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -29,6 +29,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -90,8 +91,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= @@ -124,8 +125,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -140,19 +141,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -195,8 +196,8 @@ github.com/dustin/go-humanize v0.0.0-20171111073723-bb3d318650d4/go.mod h1:Htrtb github.com/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/dustin/go-humanize v1.0.1 h1:GzkhY7T5VNhEkwH0PVJgjz+fX1rhBrR7pRT3mDkpeCY= 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/dvsekhvalnov/jose2go v1.6.0 h1:Y9gnSnP4qEI0+/uQkHvFXeD2PLPJeXEL+ySMEA2EjTY= +github.com/dvsekhvalnov/jose2go v1.6.0/go.mod h1:QsHjhyTlD/lAVqn/NSbVZmSCGeDehTB/mPZadG+mhXU= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I= @@ -373,8 +374,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -462,8 +463,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -572,8 +573,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -594,32 +595,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -760,13 +761,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -781,8 +782,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -810,8 +811,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -823,8 +824,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -880,12 +881,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -917,8 +918,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -939,12 +940,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -962,8 +963,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 4d5728f01da1..3ccf1a31e0b8 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -17,14 +17,14 @@ require ( cloud.google.com/go/compute/metadata v0.2.3 // indirect cloud.google.com/go/iam v1.1.6 // indirect cloud.google.com/go/storage v1.36.0 // indirect - cosmossdk.io/api v0.7.3 // indirect + cosmossdk.io/api v0.7.5 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/core v0.11.0 // indirect cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.1 // indirect cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.0.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -43,15 +43,15 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect github.com/cosmos/iavl v1.0.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect @@ -159,21 +159,21 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/oauth2 v0.17.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.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/time v0.5.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect - google.golang.org/grpc v1.62.0 // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect + google.golang.org/grpc v1.63.2 // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/tools/cosmovisor/go.sum b/tools/cosmovisor/go.sum index fd0bb23ea007..aeff17bfb251 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -184,8 +184,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -200,8 +200,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= cosmossdk.io/x/upgrade v0.0.0-20230614103911-b3da8bb4e801 h1:U0jO59nMqMh3/19ktMy0gCd050k7svcrGJG9Vdrri20= cosmossdk.io/x/upgrade v0.0.0-20230614103911-b3da8bb4e801/go.mod h1:Nqm1dOl9yTTtG+uibprZTQp50rW+pd+XjAYGVQ5+Ojc= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -311,8 +311,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -325,8 +325,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801 h1:Qg0EgcEYtN0RWmxaFWTTCeMDfnbHB6UEzHucafy14i8= github.com/cosmos/cosmos-sdk v0.46.0-beta2.0.20230614103911-b3da8bb4e801/go.mod h1:VwFzgpv4z/Mrx+0sQpWwURCHx4h/iAalMdKIe3VEyBw= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -334,8 +334,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -1053,8 +1053,8 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1153,8 +1153,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.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1180,8 +1180,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.17.0 h1:6m3ZPmLEFdVxKKWnKq4VqZ60gutO35zm+zrAHVmHyDQ= +golang.org/x/oauth2 v0.17.0/go.mod h1:OzPDGQiuQMguemayvdylqddI7qcD9lnSDb+1FiwQ5HA= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1292,13 +1292,13 @@ golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/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= @@ -1557,12 +1557,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1604,8 +1604,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 4430fdf77543..82759b22eda0 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -3,7 +3,7 @@ module cosmossdk.io/tools/hubl go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/client/v2 v2.0.0-20230719143845-dff6b0e26aa4 cosmossdk.io/errors v1.0.1 github.com/cockroachdb/errors v1.11.1 @@ -11,7 +11,7 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/pelletier/go-toml/v2 v2.1.0 github.com/spf13/cobra v1.8.0 - google.golang.org/grpc v1.62.0 + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -22,7 +22,7 @@ require ( cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect cosmossdk.io/store v1.0.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -38,14 +38,14 @@ require ( github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect - github.com/cometbft/cometbft v0.38.6 // indirect + github.com/cometbft/cometbft v0.38.7 // indirect github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect + github.com/cosmos/gogoproto v1.4.12 // indirect github.com/cosmos/iavl v1.0.1 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect @@ -137,16 +137,16 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect + golang.org/x/crypto v0.22.0 // indirect golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect + golang.org/x/net v0.24.0 // indirect golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index 6d0fa9d6001f..23e9cccea538 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/client/v2 v2.0.0-20230719143845-dff6b0e26aa4 h1:rXCotxNnD0DUpcVBYojEZWUTEIJ9p+sgkpEtZlV4+pE= cosmossdk.io/client/v2 v2.0.0-20230719143845-dff6b0e26aa4/go.mod h1:mrwVTC+6n90zDpvn4N12YJVl67QUCDQ3yEqIR4Ovp14= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= @@ -18,8 +18,8 @@ cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -130,8 +130,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -146,8 +146,8 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= github.com/cosmos/cosmos-sdk v0.50.0-rc.1 h1:1Z+SgLg8S2+DoiePz9aO5dSjJUgag8VFhFUSD/HGvOU= github.com/cosmos/cosmos-sdk v0.50.0-rc.1/go.mod h1:JbgPLZrh+yX+4+n1CPJ/uL9HrhZw6QVg0q7cTq2Iwq0= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= @@ -155,8 +155,8 @@ github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4x github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/cosmos/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= @@ -761,8 +761,8 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= @@ -810,8 +810,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -880,12 +880,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -938,12 +938,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -961,8 +961,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/types/mempool/mempool_test.go b/types/mempool/mempool_test.go index 9ed3b4d596a9..05f61e46decd 100644 --- a/types/mempool/mempool_test.go +++ b/types/mempool/mempool_test.go @@ -210,7 +210,7 @@ type MempoolTestSuite struct { func (s *MempoolTestSuite) resetMempool() { s.iterations = 0 - s.mempool = mempool.NewSenderNonceMempool() + s.mempool = mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) } func (s *MempoolTestSuite) SetupTest() { diff --git a/types/mempool/sender_nonce.go b/types/mempool/sender_nonce.go index 7645bda33993..57cdb4dd4f95 100644 --- a/types/mempool/sender_nonce.go +++ b/types/mempool/sender_nonce.go @@ -19,7 +19,7 @@ var ( _ Iterator = (*senderNonceMempoolIterator)(nil) ) -var DefaultMaxTx = 0 +var DefaultMaxTx = -1 // SenderNonceMempool is a mempool that prioritizes transactions within a sender // by nonce, the lowest first, but selects a random sender on each iteration. diff --git a/types/mempool/sender_nonce_test.go b/types/mempool/sender_nonce_test.go index 4d2762bfb2eb..4e6b10cd7e80 100644 --- a/types/mempool/sender_nonce_test.go +++ b/types/mempool/sender_nonce_test.go @@ -115,7 +115,7 @@ func (s *MempoolTestSuite) TestTxOrder() { } for i, tt := range tests { t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { - pool := mempool.NewSenderNonceMempool(mempool.SenderNonceSeedOpt(tt.seed)) + pool := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000), mempool.SenderNonceSeedOpt(tt.seed)) // create test txs and insert into mempool for i, ts := range tt.txs { tx := testTx{id: i, priority: int64(ts.p), nonce: uint64(ts.n), address: ts.a} @@ -173,7 +173,7 @@ func (s *MempoolTestSuite) TestTxNotFoundOnSender() { t := s.T() ctx := sdk.NewContext(nil, cmtproto.Header{}, false, log.NewNopLogger()) accounts := simtypes.RandomAccounts(rand.New(rand.NewSource(0)), 1) - mp := mempool.NewSenderNonceMempool() + mp := mempool.NewSenderNonceMempool(mempool.SenderNonceMaxTxOpt(5000)) txSender := testTx{ nonce: 0, diff --git a/x/auth/tx/service.go b/x/auth/tx/service.go index dd66777095dc..a96ac8cae0b4 100644 --- a/x/auth/tx/service.go +++ b/x/auth/tx/service.go @@ -195,13 +195,13 @@ func (s txServer) GetBlockWithTxs(ctx context.Context, req *txtypes.GetBlockWith if req.Pagination != nil && req.Pagination.Reverse { for i, count := offset, uint64(0); i > 0 && count != limit; i, count = i-1, count+1 { if err = decodeTxAt(i); err != nil { - return nil, err + sdkCtx.Logger().Error("failed to decode tx", "error", err) } } } else { for i, count := offset, uint64(0); i < blockTxsLn && count != limit; i, count = i+1, count+1 { if err = decodeTxAt(i); err != nil { - return nil, err + sdkCtx.Logger().Error("failed to decode tx", "error", err) } } } diff --git a/x/authz/expected_keepers.go b/x/authz/expected_keepers.go index 2db295aa7e52..c59837d2fc56 100644 --- a/x/authz/expected_keepers.go +++ b/x/authz/expected_keepers.go @@ -20,4 +20,5 @@ type AccountKeeper interface { type BankKeeper interface { SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins IsSendEnabledCoins(ctx context.Context, coins ...sdk.Coin) error + BlockedAddr(addr sdk.AccAddress) bool } diff --git a/x/authz/keeper/keeper.go b/x/authz/keeper/keeper.go index c7dc7dec5421..974c18000e42 100644 --- a/x/authz/keeper/keeper.go +++ b/x/authz/keeper/keeper.go @@ -34,6 +34,7 @@ type Keeper struct { cdc codec.Codec router baseapp.MessageRouter authKeeper authz.AccountKeeper + bankKeeper authz.BankKeeper } // NewKeeper constructs a message authorization Keeper @@ -46,6 +47,13 @@ func NewKeeper(storeService corestoretypes.KVStoreService, cdc codec.Codec, rout } } +// Super ugly hack to not be breaking in v0.50 and v0.47 +// DO NOT USE. +func (k Keeper) SetBankKeeper(bk authz.BankKeeper) Keeper { + k.bankKeeper = bk + return k +} + // Logger returns a module-specific logger. func (k Keeper) Logger(ctx context.Context) log.Logger { sdkCtx := sdk.UnwrapSDKContext(ctx) diff --git a/x/authz/keeper/keeper_test.go b/x/authz/keeper/keeper_test.go index 066e7d70750a..94f3f50fa3c0 100644 --- a/x/authz/keeper/keeper_test.go +++ b/x/authz/keeper/keeper_test.go @@ -68,14 +68,14 @@ func (s *TestSuite) SetupTest() { // gomock initializations ctrl := gomock.NewController(s.T()) s.accountKeeper = authztestutil.NewMockAccountKeeper(ctrl) - s.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() s.bankKeeper = authztestutil.NewMockBankKeeper(ctrl) banktypes.RegisterInterfaces(s.encCfg.InterfaceRegistry) banktypes.RegisterMsgServer(s.baseApp.MsgServiceRouter(), s.bankKeeper) + s.bankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false).AnyTimes() - s.authzKeeper = authzkeeper.NewKeeper(storeService, s.encCfg.Codec, s.baseApp.MsgServiceRouter(), s.accountKeeper) + s.authzKeeper = authzkeeper.NewKeeper(storeService, s.encCfg.Codec, s.baseApp.MsgServiceRouter(), s.accountKeeper).SetBankKeeper(s.bankKeeper) queryHelper := baseapp.NewQueryServerTestHelper(s.ctx, s.encCfg.InterfaceRegistry) authz.RegisterQueryServer(queryHelper, s.authzKeeper) diff --git a/x/authz/keeper/msg_server.go b/x/authz/keeper/msg_server.go index b6755a9f8436..98e24a44f2a2 100644 --- a/x/authz/keeper/msg_server.go +++ b/x/authz/keeper/msg_server.go @@ -38,6 +38,10 @@ func (k Keeper) Grant(goCtx context.Context, msg *authz.MsgGrant) (*authz.MsgGra ctx := sdk.UnwrapSDKContext(goCtx) granteeAcc := k.authKeeper.GetAccount(ctx, grantee) if granteeAcc == nil { + if k.bankKeeper.BlockedAddr(grantee) { + return nil, sdkerrors.ErrUnauthorized.Wrapf("%s is not allowed to receive funds", grantee) + } + granteeAcc = k.authKeeper.NewAccountWithAddress(ctx, grantee) k.authKeeper.SetAccount(ctx, granteeAcc) } diff --git a/x/authz/module/module.go b/x/authz/module/module.go index 248a75b8584b..3546f70e9d8e 100644 --- a/x/authz/module/module.go +++ b/x/authz/module/module.go @@ -113,7 +113,7 @@ type AppModule struct { func NewAppModule(cdc codec.Codec, keeper keeper.Keeper, ak authz.AccountKeeper, bk authz.BankKeeper, registry cdctypes.InterfaceRegistry) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc, ac: ak.AddressCodec()}, - keeper: keeper, + keeper: keeper.SetBankKeeper(bk), // Super ugly hack to not be api breaking in v0.50 and v0.47 accountKeeper: ak, bankKeeper: bk, registry: registry, diff --git a/x/authz/testutil/expected_keepers_mocks.go b/x/authz/testutil/expected_keepers_mocks.go index b9e8f521c327..d751684835dd 100644 --- a/x/authz/testutil/expected_keepers_mocks.go +++ b/x/authz/testutil/expected_keepers_mocks.go @@ -113,6 +113,20 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { return m.recorder } +// BlockedAddr mocks base method. +func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockedAddr", addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// BlockedAddr indicates an expected call of BlockedAddr. +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) +} + // IsSendEnabledCoins mocks base method. func (m *MockBankKeeper) IsSendEnabledCoins(ctx context.Context, coins ...types.Coin) error { m.ctrl.T.Helper() diff --git a/x/bank/README.md b/x/bank/README.md index 990634b8b3b3..885a9f1f6f1f 100644 --- a/x/bank/README.md +++ b/x/bank/README.md @@ -280,6 +280,11 @@ During `InputOutputCoins`, the send restriction is applied after the input coins A send restriction function should make use of a custom value in the context to allow bypassing that specific restriction. +Send Restrictions are not placed on `ModuleToAccount` or `ModuleToModule` transfers. This is done due to modules needing to move funds to user accounts and other module accounts. This is a design decision to allow for more flexibility in the state machine. The state machine should be able to move funds between module accounts and user accounts without restrictions. + +Secondly this limitation would limit the usage of the state machine even for itself. users would not be able to receive rewards, not be able to move funds between module accounts. In the case that a user sends funds from a user account to the community pool and then a governance proposal is used to get those tokens into the users account this would fall under the discretion of the app chain developer to what they would like to do here. We can not make strong assumptions here. +Thirdly, this issue could lead into a chain halt if a token is disabled and the token is moved in the begin/endblock. This is the last reason we see the current change and more damaging then beneficial for users. + For example, in your module's keeper package, you'd define the send restriction function: ```golang diff --git a/x/bank/module.go b/x/bank/module.go index ff5e21331f93..091729a88b7e 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -4,10 +4,11 @@ import ( "context" "encoding/json" "fmt" - "time" + "sort" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cobra" + "golang.org/x/exp/maps" modulev1 "cosmossdk.io/api/cosmos/bank/module/v1" "cosmossdk.io/core/address" @@ -20,7 +21,6 @@ import ( "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" simtypes "github.com/cosmos/cosmos-sdk/types/simulation" @@ -155,10 +155,8 @@ func (AppModule) QuerierRoute() string { return types.RouterKey } // InitGenesis performs genesis initialization for the bank module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { - start := time.Now() var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) } @@ -204,8 +202,10 @@ func (am AppModule) EndBlock(ctx context.Context) error { // App Wiring Setup func init() { - appmodule.Register(&modulev1.Module{}, + appmodule.Register( + &modulev1.Module{}, appmodule.Provide(ProvideModule), + appmodule.Invoke(InvokeSetSendRestrictions), ) } @@ -266,3 +266,39 @@ func ProvideModule(in ModuleInputs) ModuleOutputs { return ModuleOutputs{BankKeeper: bankKeeper, Module: m} } + +func InvokeSetSendRestrictions( + config *modulev1.Module, + keeper keeper.BaseKeeper, + restrictions map[string]types.SendRestrictionFn, +) error { + if config == nil { + return nil + } + + modules := maps.Keys(restrictions) + order := config.RestrictionsOrder + if len(order) == 0 { + order = modules + sort.Strings(order) + } + + if len(order) != len(modules) { + return fmt.Errorf("len(restrictions order: %v) != len(restriction modules: %v)", order, modules) + } + + if len(modules) == 0 { + return nil + } + + for _, module := range order { + restriction, ok := restrictions[module] + if !ok { + return fmt.Errorf("can't find send restriction for module %s", module) + } + + keeper.AppendSendRestriction(restriction) + } + + return nil +} diff --git a/x/bank/types/restrictions.go b/x/bank/types/restrictions.go index 6d7d6fe6bc86..2ec4489a0978 100644 --- a/x/bank/types/restrictions.go +++ b/x/bank/types/restrictions.go @@ -54,6 +54,9 @@ func ComposeMintingRestrictions(restrictions ...MintingRestrictionFn) MintingRes // A SendRestrictionFn can restrict sends and/or provide a new receiver address. type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) +// IsOnePerModuleType implements the depinject.OnePerModuleType interface. +func (SendRestrictionFn) IsOnePerModuleType() {} + var _ SendRestrictionFn = NoOpSendRestrictionFn // NoOpSendRestrictionFn is a no-op SendRestrictionFn. diff --git a/x/circuit/CHANGELOG.md b/x/circuit/CHANGELOG.md index d5ecd5a9dfa4..f9c54ddab57d 100644 --- a/x/circuit/CHANGELOG.md +++ b/x/circuit/CHANGELOG.md @@ -29,4 +29,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/circuit/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + ## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/circuit/v0.1.0) - 2023-11-07 + +* Initial release of the standalone NFT module. diff --git a/x/circuit/ante/circuit.go b/x/circuit/ante/circuit.go index 80ed8ce5f231..ab1876242b28 100644 --- a/x/circuit/ante/circuit.go +++ b/x/circuit/ante/circuit.go @@ -24,6 +24,10 @@ func NewCircuitBreakerDecorator(ck CircuitBreaker) CircuitBreakerDecorator { } } +// If you copy this as reference and your app has the authz module enabled, you must either: +// - recursively check for nested authz.Exec messages in this function. +// - or error early if a nested authz grant is found. +// The circuit AnteHandler handles this with baseapp's service router: https://github.com/cosmos/cosmos-sdk/issues/18632. func (cbd CircuitBreakerDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { // loop through all the messages and check if the message type is allowed for _, msg := range tx.GetMsgs() { diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 56c6924f2b35..dc85eabb1fd7 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -3,37 +3,38 @@ module cosmossdk.io/x/circuit go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 - cosmossdk.io/store v1.0.0 + cosmossdk.io/store v1.1.0 github.com/cockroachdb/errors v1.11.1 - github.com/cometbft/cometbft v0.38.6 - github.com/cosmos/cosmos-sdk v0.50.1 - github.com/cosmos/gogoproto v1.4.11 + github.com/cometbft/cometbft v0.38.7 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 ) require ( cosmossdk.io/log v1.3.1 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect @@ -41,10 +42,10 @@ require ( github.com/cometbft/cometbft-db v0.9.1 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.2 // indirect - github.com/cosmos/cosmos-proto v1.0.0-beta.4 // indirect + github.com/cosmos/cosmos-proto v1.0.0-beta.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -80,7 +81,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -96,7 +97,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -107,13 +108,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -135,15 +136,15 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/circuit/go.sum b/x/circuit/go.sum index 704c54fd704f..3567a0e69d81 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,10 +14,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -29,6 +29,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -90,8 +91,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= @@ -124,8 +125,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -140,19 +141,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -369,8 +370,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -458,8 +459,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -568,8 +569,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -590,32 +591,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -756,13 +757,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -777,8 +778,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -806,8 +807,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -819,8 +820,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -876,12 +877,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -913,8 +914,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -935,12 +936,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -958,8 +959,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/circuit/module.go b/x/circuit/module.go index 496643fdafe4..33b8b54db3e4 100644 --- a/x/circuit/module.go +++ b/x/circuit/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "time" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" @@ -21,7 +20,6 @@ import ( "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -111,10 +109,8 @@ func (AppModule) ConsensusVersion() uint64 { return ConsensusVersion } // InitGenesis performs genesis initialization for the circuit module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { - start := time.Now() var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) } diff --git a/x/consensus/keeper/keeper.go b/x/consensus/keeper/keeper.go index 52dfd6740f6c..50b5b2d93f6c 100644 --- a/x/consensus/keeper/keeper.go +++ b/x/consensus/keeper/keeper.go @@ -14,6 +14,7 @@ import ( "cosmossdk.io/errors" "github.com/cosmos/cosmos-sdk/codec" + sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/consensus/exported" "github.com/cosmos/cosmos-sdk/x/consensus/types" govtypes "github.com/cosmos/cosmos-sdk/x/gov/types" @@ -72,11 +73,26 @@ func (k Keeper) UpdateParams(ctx context.Context, msg *types.MsgUpdateParams) (* if err != nil { return nil, err } - if err := cmttypes.ConsensusParamsFromProto(consensusParams).ValidateBasic(); err != nil { + + paramsProto, err := k.ParamsStore.Get(ctx) + if err != nil { + return nil, err + } + params := cmttypes.ConsensusParamsFromProto(paramsProto) + + nextParams := params.Update(&consensusParams) + + if err := nextParams.ValidateBasic(); err != nil { + return nil, err + } + + sdkCtx := sdk.UnwrapSDKContext(ctx) + + if err := params.ValidateUpdate(&consensusParams, sdkCtx.BlockHeader().Height); err != nil { return nil, err } - if err := k.ParamsStore.Set(ctx, consensusParams); err != nil { + if err := k.ParamsStore.Set(ctx, nextParams.ToProto()); err != nil { return nil, err } diff --git a/x/consensus/keeper/keeper_test.go b/x/consensus/keeper/keeper_test.go index ce95158652bd..c349c8dbaffe 100644 --- a/x/consensus/keeper/keeper_test.go +++ b/x/consensus/keeper/keeper_test.go @@ -30,7 +30,8 @@ type KeeperTestSuite struct { func (s *KeeperTestSuite) SetupTest() { key := storetypes.NewKVStoreKey(consensusparamkeeper.StoreKey) testCtx := testutil.DefaultContextWithDB(s.T(), key, storetypes.NewTransientStoreKey("transient_test")) - ctx := testCtx.Ctx.WithBlockHeader(cmtproto.Header{}) + header := cmtproto.Header{Height: 5} + ctx := testCtx.Ctx.WithBlockHeader(header) encCfg := moduletestutil.MakeTestEncodingConfig() storeService := runtime.NewKVStoreService(key) @@ -43,6 +44,8 @@ func (s *KeeperTestSuite) SetupTest() { queryHelper := baseapp.NewQueryServerTestHelper(ctx, encCfg.InterfaceRegistry) types.RegisterQueryServer(queryHelper, keeper) s.queryClient = types.NewQueryClient(queryHelper) + err := s.consensusParamsKeeper.ParamsStore.Set(ctx, cmttypes.DefaultConsensusParams().ToProto()) + s.Require().NoError(err) } func TestKeeperTestSuite(t *testing.T) { @@ -50,7 +53,14 @@ func TestKeeperTestSuite(t *testing.T) { } func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { - defaultConsensusParams := cmttypes.DefaultConsensusParams().ToProto() + // Create ConsensusParams with modified fields + modifiedConsensusParams := cmttypes.DefaultConsensusParams().ToProto() + modifiedConsensusParams.Block.MaxBytes++ + modifiedConsensusParams.Block.MaxGas = 100 + modifiedConsensusParams.Evidence.MaxAgeDuration++ + modifiedConsensusParams.Evidence.MaxAgeNumBlocks++ + modifiedConsensusParams.Evidence.MaxBytes++ + modifiedConsensusParams.Validator.PubKeyTypes = []string{cmttypes.ABCIPubKeyTypeSecp256k1} testCases := []struct { msg string @@ -65,18 +75,22 @@ func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { func() { input := &types.MsgUpdateParams{ Authority: s.consensusParamsKeeper.GetAuthority(), - Block: defaultConsensusParams.Block, - Validator: defaultConsensusParams.Validator, - Evidence: defaultConsensusParams.Evidence, + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, } - s.consensusParamsKeeper.UpdateParams(s.ctx, input) + _, err := s.consensusParamsKeeper.UpdateParams(s.ctx, input) + s.Require().NoError(err) }, types.QueryParamsResponse{ Params: &cmtproto.ConsensusParams{ - Block: defaultConsensusParams.Block, - Validator: defaultConsensusParams.Validator, - Evidence: defaultConsensusParams.Evidence, - Version: defaultConsensusParams.Version, + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, + Version: modifiedConsensusParams.Version, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 0, + }, }, }, true, @@ -87,21 +101,22 @@ func (s *KeeperTestSuite) TestGRPCQueryConsensusParams() { func() { input := &types.MsgUpdateParams{ Authority: s.consensusParamsKeeper.GetAuthority(), - Block: defaultConsensusParams.Block, - Validator: defaultConsensusParams.Validator, - Evidence: defaultConsensusParams.Evidence, + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, Abci: &cmtproto.ABCIParams{ VoteExtensionsEnableHeight: 1234, }, } - s.consensusParamsKeeper.UpdateParams(s.ctx, input) + _, err := s.consensusParamsKeeper.UpdateParams(s.ctx, input) + s.Require().NoError(err) }, types.QueryParamsResponse{ Params: &cmtproto.ConsensusParams{ - Block: defaultConsensusParams.Block, - Validator: defaultConsensusParams.Validator, - Evidence: defaultConsensusParams.Evidence, - Version: defaultConsensusParams.Version, + Block: modifiedConsensusParams.Block, + Validator: modifiedConsensusParams.Validator, + Evidence: modifiedConsensusParams.Evidence, + Version: modifiedConsensusParams.Version, Abci: &cmtproto.ABCIParams{ VoteExtensionsEnableHeight: 1234, }, @@ -204,6 +219,76 @@ func (s *KeeperTestSuite) TestUpdateParams() { expErr: true, expErrMsg: "all parameters must be present", }, + { + name: "valid ABCI update", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1235, + }, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "noop ABCI update", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 1235, + }, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "valid ABCI clear", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 0, + }, + }, + expErr: false, + expErrMsg: "", + }, + { + name: "invalid ABCI update - current height", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 5, + }, + }, + expErr: true, + expErrMsg: "vote extensions cannot be updated to a past or current height", + }, + { + name: "invalid ABCI update - past height", + input: &types.MsgUpdateParams{ + Authority: s.consensusParamsKeeper.GetAuthority(), + Block: defaultConsensusParams.Block, + Validator: defaultConsensusParams.Validator, + Evidence: defaultConsensusParams.Evidence, + Abci: &cmtproto.ABCIParams{ + VoteExtensionsEnableHeight: 4, + }, + }, + expErr: true, + expErrMsg: "vote extensions cannot be updated to a past or current height", + }, } for _, tc := range testCases { @@ -220,7 +305,9 @@ func (s *KeeperTestSuite) TestUpdateParams() { res, err := s.consensusParamsKeeper.Params(s.ctx, &types.QueryParamsRequest{}) s.Require().NoError(err) - s.Require().Equal(tc.input.Abci, res.Params.Abci) + if tc.input.Abci != nil { + s.Require().Equal(tc.input.Abci, res.Params.Abci) + } s.Require().Equal(tc.input.Block, res.Params.Block) s.Require().Equal(tc.input.Evidence, res.Params.Evidence) s.Require().Equal(tc.input.Validator, res.Params.Validator) diff --git a/x/crisis/abci.go b/x/crisis/abci.go index 8ce275ecd799..2eacc641c4ad 100644 --- a/x/crisis/abci.go +++ b/x/crisis/abci.go @@ -2,7 +2,6 @@ package crisis import ( "context" - "time" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +11,7 @@ import ( // check all registered invariants func EndBlocker(ctx context.Context, k keeper.Keeper) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) sdkCtx := sdk.UnwrapSDKContext(ctx) if k.InvCheckPeriod() == 0 || sdkCtx.BlockHeight()%int64(k.InvCheckPeriod()) != 0 { diff --git a/x/crisis/module.go b/x/crisis/module.go index 6dc6880a8043..87cad631b45a 100644 --- a/x/crisis/module.go +++ b/x/crisis/module.go @@ -4,7 +4,6 @@ import ( "context" "encoding/json" "fmt" - "time" gwruntime "github.com/grpc-ecosystem/grpc-gateway/runtime" "github.com/spf13/cast" @@ -21,7 +20,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/server" servertypes "github.com/cosmos/cosmos-sdk/server/types" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" authtypes "github.com/cosmos/cosmos-sdk/x/auth/types" @@ -139,10 +137,8 @@ func (am AppModule) RegisterServices(cfg module.Configurator) { // InitGenesis performs genesis initialization for the crisis module. It returns // no validator updates. func (am AppModule) InitGenesis(ctx sdk.Context, cdc codec.JSONCodec, data json.RawMessage) { - start := time.Now() var genesisState types.GenesisState cdc.MustUnmarshalJSON(data, &genesisState) - telemetry.MeasureSince(start, "InitGenesis", "crisis", "unmarshal") am.keeper.InitGenesis(ctx, &genesisState) if !am.skipGenesisInvariants { diff --git a/x/distribution/abci.go b/x/distribution/abci.go index 2751cfab83a1..70fdb7eeb270 100644 --- a/x/distribution/abci.go +++ b/x/distribution/abci.go @@ -1,8 +1,6 @@ package distribution import ( - "time" - "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/x/distribution/keeper" @@ -12,7 +10,7 @@ import ( // BeginBlocker sets the proposer for determining distribution during endblock // and distribute rewards for the previous block. func BeginBlocker(ctx sdk.Context, k keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // determine the total power signing the block var previousTotalPower int64 diff --git a/x/evidence/CHANGELOG.md b/x/evidence/CHANGELOG.md index f74e37c35c91..ec16f3188f1a 100644 --- a/x/evidence/CHANGELOG.md +++ b/x/evidence/CHANGELOG.md @@ -23,6 +23,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/evidence/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + ## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/evidence/v0.1.0) - 2023-11-07 ### Features @@ -35,7 +42,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#16008](https://github.com/cosmos/cosmos-sdk/pull/16008) NewKeeper now takes in a KVStoreService instead of KVStoreKey, most functions use context.Context instead of sdk.Context and `IterateEvidence` callback function now returns an error to stop interation (`errors.ErrStopIterating`). * (keeper) [#15825](https://github.com/cosmos/cosmos-sdk/pull/15825) Evidence constructor now requires an `address.Codec` (`import "cosmossdk.io/core/address"`) * [#16336](https://github.com/cosmos/cosmos-sdk/pull/16336) Use collections for state management: - * Removed: keeper `SetEvidence`, `GetEvidence`, `IterateEvidences`, `GetAllEvidences`, `MustMarshalEvidence`, `MustUnmarshalEvidence`, `MarshalEvidence`, `UnmarshalEvidence` + * Removed: keeper `SetEvidence`, `GetEvidence`, `IterateEvidences`, `GetAllEvidences`, `MustMarshalEvidence`, `MustUnmarshalEvidence`, `MarshalEvidence`, `UnmarshalEvidence` ### Client Breaking Changes diff --git a/x/evidence/go.mod b/x/evidence/go.mod index ff61035fc196..6997d63de67d 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -3,33 +3,34 @@ module cosmossdk.io/x/evidence go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/collections v0.4.0 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.0 - github.com/cometbft/cometbft v0.38.6 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/cosmos-sdk v0.50.1 - github.com/cosmos/gogoproto v1.4.11 + cosmossdk.io/store v1.1.0 + github.com/cometbft/cometbft v0.38.7 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) require ( - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect @@ -37,7 +38,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect @@ -48,7 +49,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -83,7 +84,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -99,7 +100,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -110,13 +111,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -137,15 +138,15 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 704c54fd704f..3567a0e69d81 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,10 +14,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -29,6 +29,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -90,8 +91,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= @@ -124,8 +125,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -140,19 +141,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -369,8 +370,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -458,8 +459,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -568,8 +569,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -590,32 +591,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -756,13 +757,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -777,8 +778,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -806,8 +807,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -819,8 +820,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -876,12 +877,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -913,8 +914,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -935,12 +936,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -958,8 +959,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/evidence/keeper/abci.go b/x/evidence/keeper/abci.go index 2273f793b7ac..d441ee174dd1 100644 --- a/x/evidence/keeper/abci.go +++ b/x/evidence/keeper/abci.go @@ -3,7 +3,6 @@ package keeper import ( "context" "fmt" - "time" "cosmossdk.io/core/comet" "cosmossdk.io/x/evidence/types" @@ -15,7 +14,7 @@ import ( // BeginBlocker iterates through and handles any newly discovered evidence of // misbehavior submitted by CometBFT. Currently, only equivocation is handled. func (k Keeper) BeginBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) bi := k.cometInfo.GetCometBlockInfo(ctx) if bi == nil { diff --git a/x/feegrant/CHANGELOG.md b/x/feegrant/CHANGELOG.md index 4aad36ffd99d..25070c242de3 100644 --- a/x/feegrant/CHANGELOG.md +++ b/x/feegrant/CHANGELOG.md @@ -25,6 +25,17 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/feegrant/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + +### Bug Fixes + +* [#20114](https://github.com/cosmos/cosmos-sdk/pull/20114) Follow up of [GHSA-4j93-fm92-rp4m](https://github.com/cosmos/cosmos-sdk/security/advisories/GHSA-4j93-fm92-rp4m) for `k.GrantAllowance`. + ## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/feegrant/v0.1.0) - 2023-11-07 ### Features diff --git a/x/feegrant/expected_keepers.go b/x/feegrant/expected_keepers.go index ce6a2d0a5698..e09da85fc080 100644 --- a/x/feegrant/expected_keepers.go +++ b/x/feegrant/expected_keepers.go @@ -24,4 +24,5 @@ type AccountKeeper interface { type BankKeeper interface { SpendableCoins(ctx context.Context, addr sdk.AccAddress) sdk.Coins SendCoinsFromAccountToModule(ctx context.Context, senderAddr sdk.AccAddress, recipientModule string, amt sdk.Coins) error + BlockedAddr(addr sdk.AccAddress) bool } diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index ea256e1c45f3..a0266bdfc092 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -3,41 +3,42 @@ module cosmossdk.io/x/feegrant go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.0 - github.com/cometbft/cometbft v0.38.6 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/cosmos-sdk v0.50.1 - github.com/cosmos/gogoproto v1.4.11 + cosmossdk.io/store v1.1.0 + github.com/cometbft/cometbft v0.38.7 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 ) require ( cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -49,7 +50,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -84,7 +85,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -100,7 +101,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -112,13 +113,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -139,15 +140,15 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index f8f718eeb1d7..c96fc174d62f 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,10 +14,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -29,6 +29,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -90,8 +91,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/logex v1.2.1 h1:XHDu3E6q+gdHgsdTPH6ImJMIp436vR6MPtH8gP05QzM= github.com/chzyer/logex v1.2.1/go.mod h1:JLbx6lG2kDbNRFnfkgvh4eRJRPX1QCoOIWomwysCBrQ= @@ -128,8 +129,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -144,19 +145,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -373,8 +374,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -462,8 +463,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -572,8 +573,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -594,32 +595,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -760,13 +761,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -781,8 +782,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -810,8 +811,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -823,8 +824,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -881,12 +882,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -918,8 +919,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -940,12 +941,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -963,8 +964,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/feegrant/keeper/keeper.go b/x/feegrant/keeper/keeper.go index 37f46d97a215..02ec88b69723 100644 --- a/x/feegrant/keeper/keeper.go +++ b/x/feegrant/keeper/keeper.go @@ -24,6 +24,7 @@ type Keeper struct { cdc codec.BinaryCodec storeService store.KVStoreService authKeeper feegrant.AccountKeeper + bankKeeper feegrant.BankKeeper } var _ ante.FeegrantKeeper = &Keeper{} @@ -37,6 +38,13 @@ func NewKeeper(cdc codec.BinaryCodec, storeService store.KVStoreService, ak feeg } } +// Super ugly hack to not be breaking in v0.50 and v0.47 +// DO NOT USE. +func (k Keeper) SetBankKeeper(bk feegrant.BankKeeper) Keeper { + k.bankKeeper = bk + return k +} + // Logger returns a module-specific logger. func (k Keeper) Logger(ctx sdk.Context) log.Logger { return ctx.Logger().With("module", fmt.Sprintf("x/%s", feegrant.ModuleName)) @@ -52,6 +60,10 @@ func (k Keeper) GrantAllowance(ctx context.Context, granter, grantee sdk.AccAddr // create the account if it is not in account state granteeAcc := k.authKeeper.GetAccount(ctx, grantee) if granteeAcc == nil { + if k.bankKeeper.BlockedAddr(grantee) { + return errorsmod.Wrapf(sdkerrors.ErrUnauthorized, "%s is not allowed to receive funds", grantee) + } + granteeAcc = k.authKeeper.NewAccountWithAddress(ctx, grantee) k.authKeeper.SetAccount(ctx, granteeAcc) } diff --git a/x/feegrant/keeper/keeper_test.go b/x/feegrant/keeper/keeper_test.go index fcfb5df2a5d5..fb7f661b217a 100644 --- a/x/feegrant/keeper/keeper_test.go +++ b/x/feegrant/keeper/keeper_test.go @@ -31,6 +31,7 @@ type KeeperTestSuite struct { atom sdk.Coins feegrantKeeper keeper.Keeper accountKeeper *feegranttestutil.MockAccountKeeper + bankKeeper *feegranttestutil.MockBankKeeper } func TestKeeperTestSuite(t *testing.T) { @@ -49,10 +50,11 @@ func (suite *KeeperTestSuite) SetupTest() { for i := 0; i < len(suite.addrs); i++ { suite.accountKeeper.EXPECT().GetAccount(gomock.Any(), suite.addrs[i]).Return(authtypes.NewBaseAccountWithAddress(suite.addrs[i])).AnyTimes() } - suite.accountKeeper.EXPECT().AddressCodec().Return(codecaddress.NewBech32Codec("cosmos")).AnyTimes() + suite.bankKeeper = feegranttestutil.NewMockBankKeeper(ctrl) + suite.bankKeeper.EXPECT().BlockedAddr(gomock.Any()).Return(false).AnyTimes() - suite.feegrantKeeper = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(key), suite.accountKeeper) + suite.feegrantKeeper = keeper.NewKeeper(encCfg.Codec, runtime.NewKVStoreService(key), suite.accountKeeper).SetBankKeeper(suite.bankKeeper) suite.ctx = testCtx.Ctx suite.msgSrvr = keeper.NewMsgServerImpl(suite.feegrantKeeper) suite.atom = sdk.NewCoins(sdk.NewCoin("atom", sdkmath.NewInt(555))) diff --git a/x/feegrant/module/module.go b/x/feegrant/module/module.go index 23ae96afce70..24805f6e667a 100644 --- a/x/feegrant/module/module.go +++ b/x/feegrant/module/module.go @@ -120,7 +120,7 @@ type AppModule struct { func NewAppModule(cdc codec.Codec, ak feegrant.AccountKeeper, bk feegrant.BankKeeper, keeper keeper.Keeper, registry cdctypes.InterfaceRegistry) AppModule { return AppModule{ AppModuleBasic: AppModuleBasic{cdc: cdc, ac: ak.AddressCodec()}, - keeper: keeper, + keeper: keeper.SetBankKeeper(bk), accountKeeper: ak, bankKeeper: bk, registry: registry, diff --git a/x/feegrant/testutil/expected_keepers_mocks.go b/x/feegrant/testutil/expected_keepers_mocks.go index d7567b8266d3..319a4d2a265a 100644 --- a/x/feegrant/testutil/expected_keepers_mocks.go +++ b/x/feegrant/testutil/expected_keepers_mocks.go @@ -141,6 +141,20 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { return m.recorder } +// BlockedAddr mocks base method. +func (m *MockBankKeeper) BlockedAddr(addr types.AccAddress) bool { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "BlockedAddr", addr) + ret0, _ := ret[0].(bool) + return ret0 +} + +// BlockedAddr indicates an expected call of BlockedAddr. +func (mr *MockBankKeeperMockRecorder) BlockedAddr(addr interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "BlockedAddr", reflect.TypeOf((*MockBankKeeper)(nil).BlockedAddr), addr) +} + // SendCoinsFromAccountToModule mocks base method. func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { m.ctrl.T.Helper() diff --git a/x/gov/abci.go b/x/gov/abci.go index d40964bff126..56ab8641bd10 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -18,7 +18,7 @@ import ( // EndBlocker called every block, process inflation, update validator set. func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) logger := ctx.Logger().With("module", "x/"+types.ModuleName) // delete dead proposals from store and returns theirs deposits. diff --git a/x/gov/autocli.go b/x/gov/autocli.go index 05764633b90a..8512a2878c38 100644 --- a/x/gov/autocli.go +++ b/x/gov/autocli.go @@ -28,7 +28,7 @@ func (am AppModule) AutoCLIOptions() *autocliv1.ModuleOptions { RpcMethod: "Proposals", Use: "proposals", Short: "Query proposals with optional filters", - Example: fmt.Sprintf("%[1]s query gov proposals --depositor cosmos1...\n%[1]s query gov proposals --voter cosmos1...\n%[1]s query gov proposals --proposal-status (PROPOSAL_STATUS_DEPOSIT_PERIOD|PROPOSAL_STATUS_VOTING_PERIOD|PROPOSAL_STATUS_PASSED|PROPOSAL_STATUS_REJECTED|PROPOSAL_STATUS_FAILED)", version.AppName), + Example: fmt.Sprintf("%[1]s query gov proposals --depositor cosmos1...\n%[1]s query gov proposals --voter cosmos1...\n%[1]s query gov proposals --proposal-status (unspecified | deposit-period | voting-period | passed | rejected | failed)", version.AppName), }, { RpcMethod: "Proposal", diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 9693c5168e48..9229c30432f8 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -168,6 +168,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito sdkCtx.EventManager().EmitEvent( sdk.NewEvent( types.EventTypeProposalDeposit, + sdk.NewAttribute(types.AttributeKeyDepositor, depositorAddr.String()), sdk.NewAttribute(sdk.AttributeKeyAmount, depositAmount.String()), sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), ), diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 20eb6763d069..a461c369ea05 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -123,6 +123,7 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met sdk.NewEvent( types.EventTypeSubmitProposal, sdk.NewAttribute(types.AttributeKeyProposalID, fmt.Sprintf("%d", proposalID)), + sdk.NewAttribute(types.AttributeKeyProposalProposer, proposer.String()), sdk.NewAttribute(types.AttributeKeyProposalMessages, msgsStr), ), ) diff --git a/x/gov/types/events.go b/x/gov/types/events.go index 96ccc5577e33..8f04e47cca17 100644 --- a/x/gov/types/events.go +++ b/x/gov/types/events.go @@ -13,6 +13,7 @@ const ( AttributeKeyVoter = "voter" AttributeKeyOption = "option" AttributeKeyProposalID = "proposal_id" + AttributeKeyDepositor = "depositor" AttributeKeyProposalMessages = "proposal_messages" // Msg type_urls in the proposal AttributeKeyVotingPeriodStart = "voting_period_start" AttributeKeyProposalLog = "proposal_log" // log of proposal execution @@ -22,6 +23,7 @@ const ( AttributeValueExpeditedProposalRejected = "expedited_proposal_rejected" // didn't meet expedited vote quorum AttributeValueProposalFailed = "proposal_failed" // error on proposal handler AttributeValueProposalCanceled = "proposal_canceled" // error on proposal handler + AttributeKeyProposalProposer = "proposal_proposer" // account address of the proposer AttributeKeyProposalType = "proposal_type" AttributeSignalTitle = "signal_title" diff --git a/x/mint/README.md b/x/mint/README.md index 900615bbabb3..80198010dcb0 100644 --- a/x/mint/README.md +++ b/x/mint/README.md @@ -39,11 +39,11 @@ which should help provide some liquidity. It can be broken down in the following way: -* If the inflation rate is below the goal %-bonded the inflation rate will +* If the actual percentage of bonded tokens is below the goal %-bonded the inflation rate will increase until a maximum value is reached * If the goal % bonded (67% in Cosmos-Hub) is maintained, then the inflation rate will stay constant -* If the inflation rate is above the goal %-bonded the inflation rate will +* If the actual percentage of bonded tokens is above the goal %-bonded the inflation rate will decrease until a minimum value is reached @@ -61,7 +61,7 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/mint/v1beta1/ ### Params -The mint module stores it's params in state with the prefix of `0x01`, +The mint module stores its params in state with the prefix of `0x01`, it can be updated with governance or the address with authority. * Params: `mint/params -> legacy_amino(params)` @@ -91,7 +91,7 @@ type InflationCalculationFn func(ctx sdk.Context, minter Minter, params Params, The target annual inflation rate is recalculated each block. The inflation is also subject to a rate change (positive or negative) depending on the distance from the desired ratio (67%). The maximum rate change -possible is defined to be 13% per year, however the annual inflation is capped +possible is defined to be 13% per year, however, the annual inflation is capped as between 7% and 20%. ```go @@ -169,7 +169,7 @@ A user can query and interact with the `mint` module using the CLI. #### Query -The `query` commands allow users to query `mint` state. +The `query` commands allows users to query `mint` state. ```shell simd query mint --help @@ -177,7 +177,7 @@ simd query mint --help ##### annual-provisions -The `annual-provisions` command allow users to query the current minting annual provisions value +The `annual-provisions` command allows users to query the current minting annual provisions value ```shell simd query mint annual-provisions [flags] @@ -197,7 +197,7 @@ Example Output: ##### inflation -The `inflation` command allow users to query the current minting inflation value +The `inflation` command allows users to query the current minting inflation value ```shell simd query mint inflation [flags] @@ -217,7 +217,7 @@ Example Output: ##### params -The `params` command allow users to query the current minting parameters +The `params` command allows users to query the current minting parameters ```shell simd query mint params [flags] @@ -240,7 +240,7 @@ A user can query the `mint` module using gRPC endpoints. #### AnnualProvisions -The `AnnualProvisions` endpoint allow users to query the current minting annual provisions value +The `AnnualProvisions` endpoint allows users to query the current minting annual provisions value ```shell /cosmos.mint.v1beta1.Query/AnnualProvisions @@ -262,7 +262,7 @@ Example Output: #### Inflation -The `Inflation` endpoint allow users to query the current minting inflation value +The `Inflation` endpoint allows users to query the current minting inflation value ```shell /cosmos.mint.v1beta1.Query/Inflation @@ -284,7 +284,7 @@ Example Output: #### Params -The `Params` endpoint allow users to query the current minting parameters +The `Params` endpoint allows users to query the current minting parameters ```shell /cosmos.mint.v1beta1.Query/Params diff --git a/x/mint/abci.go b/x/mint/abci.go index b225fa0e1fdd..e9108d3ee88d 100644 --- a/x/mint/abci.go +++ b/x/mint/abci.go @@ -2,7 +2,6 @@ package mint import ( "context" - "time" "github.com/cosmos/cosmos-sdk/telemetry" sdk "github.com/cosmos/cosmos-sdk/types" @@ -12,7 +11,7 @@ import ( // BeginBlocker mints new tokens for the previous block. func BeginBlocker(ctx context.Context, k keeper.Keeper, ic types.InflationCalculationFn) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // fetch stored minter & params minter, err := k.Minter.Get(ctx) diff --git a/x/nft/CHANGELOG.md b/x/nft/CHANGELOG.md index 3db748943414..0003432624d7 100644 --- a/x/nft/CHANGELOG.md +++ b/x/nft/CHANGELOG.md @@ -29,4 +29,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/nft/v0.1.1) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + ## [v0.1.0](https://github.com/cosmos/cosmos-sdk/releases/tag/x/nft/v0.1.0) - 2023-11-07 + +* Initial release of the standalone NFT module. \ No newline at end of file diff --git a/x/nft/go.mod b/x/nft/go.mod index d03a7e364150..2dfa740bc174 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -3,38 +3,39 @@ module cosmossdk.io/x/nft go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 - cosmossdk.io/store v1.0.0 - github.com/cometbft/cometbft v0.38.6 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/cosmos-sdk v0.50.1 - github.com/cosmos/gogoproto v1.4.11 + cosmossdk.io/store v1.1.0 + github.com/cometbft/cometbft v0.38.7 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/mock v1.6.0 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 ) require ( cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/beorn7/perks v1.0.1 // indirect github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 // indirect github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/pebble v1.1.0 // indirect @@ -45,7 +46,7 @@ require ( github.com/cosmos/cosmos-db v1.0.2 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -80,7 +81,7 @@ require ( github.com/gsterjov/go-libsecret v0.0.0-20161001094733-a6f4afe4910c // indirect github.com/hashicorp/go-hclog v1.5.0 // indirect github.com/hashicorp/go-immutable-radix v1.3.1 // indirect - github.com/hashicorp/go-metrics v0.5.1 // indirect + github.com/hashicorp/go-metrics v0.5.3 // indirect github.com/hashicorp/go-plugin v1.5.2 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect github.com/hashicorp/hcl v1.0.0 // indirect @@ -96,7 +97,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/mattn/go-colorable v0.1.13 // indirect github.com/mattn/go-isatty v0.0.20 // indirect @@ -107,13 +108,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -135,15 +136,15 @@ require ( github.com/zondax/ledger-go v0.14.3 // indirect go.etcd.io/bbolt v1.3.8 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/sync v0.7.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 - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect google.golang.org/protobuf v1.33.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/x/nft/go.sum b/x/nft/go.sum index 704c54fd704f..3567a0e69d81 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -1,7 +1,7 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -14,10 +14,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -29,6 +29,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -90,8 +91,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/readline v1.5.1 h1:upd/6fQk4src78LMRzh5vItIt361/o4uq553V8B5sGI= @@ -124,8 +125,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -140,19 +141,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -369,8 +370,8 @@ github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVH github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.1 h1:rfPwUqFU6uZXNvGl4hzjY8LEBsqFVU4si1H9/Hqck/U= -github.com/hashicorp/go-metrics v0.5.1/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -458,8 +459,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -568,8 +569,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -590,32 +591,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -756,13 +757,13 @@ golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8U golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20200331195152-e8c3332aa8e5/go.mod h1:4M0jN8W1tt0AVLNr8HDosyJCDCDuyL9N9+3m7wDWgKw= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -777,8 +778,8 @@ golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzB golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -806,8 +807,8 @@ golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220225172249-27dd8689420f/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/net v0.0.0-20220607020251-c690dde0001d/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -819,8 +820,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -876,12 +877,12 @@ golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20221010170243-090e33056c14/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= @@ -913,8 +914,8 @@ golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roY golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -935,12 +936,12 @@ google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfG google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= google.golang.org/genproto v0.0.0-20210126160654-44e461bb6506/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= google.golang.org/genproto v0.0.0-20220314164441-57ef72a4c106/go.mod h1:hAL49I2IFola2sVEjAn7MEwsja0xp51I0tlGAf9hz4E= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -958,8 +959,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= diff --git a/x/simulation/log.go b/x/simulation/log.go index b22709b65414..42eba43b8978 100644 --- a/x/simulation/log.go +++ b/x/simulation/log.go @@ -49,7 +49,7 @@ func (lw *StandardLogWriter) PrintLogs() { func createLogFile() *os.File { var f *os.File - fileName := fmt.Sprintf("%s.log", time.Now().Format("2006-01-02_15:04:05")) + fileName := fmt.Sprintf("%d.log", time.Now().UnixMilli()) folderPath := path.Join(os.ExpandEnv("$HOME"), ".simapp", "simulations") filePath := path.Join(folderPath, fileName) diff --git a/x/slashing/abci.go b/x/slashing/abci.go index af987c394a3b..42a95b7b10ff 100644 --- a/x/slashing/abci.go +++ b/x/slashing/abci.go @@ -2,7 +2,6 @@ package slashing import ( "context" - "time" "cosmossdk.io/core/comet" @@ -15,7 +14,7 @@ import ( // BeginBlocker check for infraction evidence or downtime of validators // on every begin block func BeginBlocker(ctx context.Context, k keeper.Keeper) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) // Iterate over all the validators which *should* have signed this block // store whether or not they have actually signed it and slash/unbond any diff --git a/x/staking/keeper/abci.go b/x/staking/keeper/abci.go index aa32e8cccc05..8131fa6dd16f 100644 --- a/x/staking/keeper/abci.go +++ b/x/staking/keeper/abci.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "time" abci "github.com/cometbft/cometbft/abci/types" @@ -13,12 +12,12 @@ import ( // BeginBlocker will persist the current header and validator set as a historical entry // and prune the oldest entry based on the HistoricalEntries parameter func (k *Keeper) BeginBlocker(ctx context.Context) error { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) return k.TrackHistoricalInfo(ctx) } // EndBlocker called at every block, update validator set func (k *Keeper) EndBlocker(ctx context.Context) ([]abci.ValidatorUpdate, error) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyEndBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyEndBlocker) return k.BlockValidatorUpdates(ctx) } diff --git a/x/tx/go.mod b/x/tx/go.mod index b6841dc64c4c..1e847f49db58 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -3,19 +3,19 @@ module cosmossdk.io/x/tx go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/math v1.3.0 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/gogoproto v1.4.12 github.com/google/go-cmp v0.6.0 github.com/google/gofuzz v1.2.0 github.com/iancoleman/strcase v0.3.0 github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.9.0 github.com/tendermint/go-amino v0.16.0 - google.golang.org/protobuf v1.32.0 + google.golang.org/protobuf v1.33.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) diff --git a/x/tx/go.sum b/x/tx/go.sum index 68c6a1e7ee63..a281090d990c 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -1,15 +1,15 @@ -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -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/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -64,8 +64,8 @@ google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= -google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= +google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= diff --git a/x/upgrade/CHANGELOG.md b/x/upgrade/CHANGELOG.md index 83049232eb48..1a7eb14bab5f 100644 --- a/x/upgrade/CHANGELOG.md +++ b/x/upgrade/CHANGELOG.md @@ -25,6 +25,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +## [v0.1.2](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.2) - 2024-04-22 + +### Improvements + +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Upgrade SDK version due to prometheus breaking change. +* (deps) [#19810](https://github.com/cosmos/cosmos-sdk/pull/19810) Bump `cosmossdk.io/store` to v1.1.0. + ### Bug Fixes * [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL. diff --git a/x/upgrade/abci.go b/x/upgrade/abci.go index 2ce5ea30666d..3018fa16ef3d 100644 --- a/x/upgrade/abci.go +++ b/x/upgrade/abci.go @@ -4,7 +4,6 @@ import ( "context" "errors" "fmt" - "time" "cosmossdk.io/core/appmodule" storetypes "cosmossdk.io/store/types" @@ -24,7 +23,7 @@ import ( // a migration to be executed if needed upon this switch (migration defined in the new binary) // skipUpgradeHeightArray is a set of block heights for which the upgrade must be skipped func PreBlocker(ctx context.Context, k *keeper.Keeper) (appmodule.ResponsePreBlock, error) { - defer telemetry.ModuleMeasureSince(types.ModuleName, time.Now(), telemetry.MetricKeyBeginBlocker) + defer telemetry.ModuleMeasureSince(types.ModuleName, telemetry.Now(), telemetry.MetricKeyBeginBlocker) sdkCtx := sdk.UnwrapSDKContext(ctx) blockHeight := sdkCtx.HeaderInfo().Height diff --git a/x/upgrade/go.mod b/x/upgrade/go.mod index 4b74370f6b3d..24516efc5521 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -3,28 +3,28 @@ module cosmossdk.io/x/upgrade go 1.21 require ( - cosmossdk.io/api v0.7.3 + cosmossdk.io/api v0.7.5 cosmossdk.io/core v0.11.0 cosmossdk.io/depinject v1.0.0-alpha.4 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 - cosmossdk.io/store v1.0.0 - github.com/cometbft/cometbft v0.38.6 + cosmossdk.io/store v1.1.0 + github.com/cometbft/cometbft v0.38.7 github.com/cosmos/cosmos-db v1.0.2 - github.com/cosmos/cosmos-proto v1.0.0-beta.4 - github.com/cosmos/cosmos-sdk v0.50.1 - github.com/cosmos/gogoproto v1.4.11 + github.com/cosmos/cosmos-proto v1.0.0-beta.5 + github.com/cosmos/cosmos-sdk v0.50.6 + github.com/cosmos/gogoproto v1.4.12 github.com/golang/protobuf v1.5.4 github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/hashicorp/go-cleanhttp v0.5.2 - github.com/hashicorp/go-getter v1.7.3 - github.com/hashicorp/go-metrics v0.5.2 + github.com/hashicorp/go-getter v1.7.4 + github.com/hashicorp/go-metrics v0.5.3 github.com/spf13/cast v1.6.0 github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.9.0 - google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 - google.golang.org/grpc v1.62.0 + google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de + google.golang.org/grpc v1.63.2 google.golang.org/protobuf v1.33.0 ) @@ -36,10 +36,11 @@ require ( cloud.google.com/go/storage v1.36.0 // indirect cosmossdk.io/collections v0.4.0 // indirect cosmossdk.io/math v1.3.0 // indirect - cosmossdk.io/x/tx v0.13.1 // indirect + cosmossdk.io/x/tx v0.13.3 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect + github.com/DataDog/datadog-go v3.2.0+incompatible // indirect github.com/DataDog/zstd v1.5.5 // indirect github.com/aws/aws-sdk-go v1.44.224 // indirect github.com/beorn7/perks v1.0.1 // indirect @@ -48,7 +49,7 @@ require ( github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // 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/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect @@ -59,7 +60,7 @@ require ( github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect github.com/cosmos/gogogateway v1.2.0 // indirect - github.com/cosmos/iavl v1.0.1 // indirect + github.com/cosmos/iavl v1.1.2 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect github.com/cosmos/ledger-cosmos-go v0.13.3 // indirect github.com/danieljoos/wincred v1.1.2 // indirect @@ -120,7 +121,7 @@ require ( github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect - github.com/linxGnu/grocksdb v1.8.12 // indirect + github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -133,13 +134,13 @@ require ( github.com/oasisprotocol/curve25519-voi v0.0.0-20230904125328-1f23a7beb09a // indirect github.com/oklog/run v1.1.0 // indirect github.com/pelletier/go-toml/v2 v2.1.0 // indirect - github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc // indirect + github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.18.0 // indirect - github.com/prometheus/client_model v0.6.0 // indirect - github.com/prometheus/common v0.47.0 // indirect - github.com/prometheus/procfs v0.12.0 // indirect + github.com/prometheus/client_golang v1.19.0 // indirect + github.com/prometheus/client_model v0.6.1 // indirect + github.com/prometheus/common v0.52.2 // indirect + github.com/prometheus/procfs v0.13.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect @@ -165,19 +166,19 @@ require ( go.opentelemetry.io/otel/metric v1.22.0 // indirect go.opentelemetry.io/otel/trace v1.22.0 // indirect go.uber.org/multierr v1.10.0 // indirect - golang.org/x/crypto v0.19.0 // indirect - golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect - golang.org/x/net v0.21.0 // indirect - golang.org/x/oauth2 v0.16.0 // indirect - golang.org/x/sync v0.6.0 // indirect - golang.org/x/sys v0.17.0 // indirect - golang.org/x/term v0.17.0 // indirect + golang.org/x/crypto v0.22.0 // indirect + golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 // indirect + golang.org/x/net v0.24.0 // indirect + golang.org/x/oauth2 v0.18.0 // indirect + golang.org/x/sync v0.7.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/time v0.5.0 // indirect google.golang.org/api v0.162.0 // indirect google.golang.org/appengine v1.6.8 // indirect - google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c // indirect + google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda // indirect gopkg.in/ini.v1 v1.67.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 90e1861c9fd5..914c4b95d627 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -184,8 +184,8 @@ cloud.google.com/go/webrisk v1.4.0/go.mod h1:Hn8X6Zr+ziE2aNd8SliSDWpEnSS1u4R9+xX cloud.google.com/go/webrisk v1.5.0/go.mod h1:iPG6fr52Tv7sGk0H6qUFzmL3HHZev1htXuWDEEsqMTg= cloud.google.com/go/workflows v1.6.0/go.mod h1:6t9F5h/unJz41YqfBmqSASJSXccBLtD1Vwf+KmJENM0= cloud.google.com/go/workflows v1.7.0/go.mod h1:JhSrZuVZWuiDfKEFxU0/F1PQjmpnpcoISEXH2bcHC3M= -cosmossdk.io/api v0.7.3 h1:V815i8YOwOAQa1rLCsSMjVG5Gnzs02JLq+l7ks8s1jk= -cosmossdk.io/api v0.7.3/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= +cosmossdk.io/api v0.7.5 h1:eMPTReoNmGUm8DeiQL9DyM8sYDjEhWzL1+nLbI9DqtQ= +cosmossdk.io/api v0.7.5/go.mod h1:IcxpYS5fMemZGqyYtErK7OqvdM0C8kdW3dq8Q/XIG38= 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.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= @@ -198,10 +198,10 @@ cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= cosmossdk.io/log v1.3.1/go.mod h1:2/dIomt8mKdk6vl3OWJcPk2be3pGOS8OQaLUM/3/tCM= cosmossdk.io/math v1.3.0 h1:RC+jryuKeytIiictDslBP9i1fhkVm6ZDmZEoNP316zE= cosmossdk.io/math v1.3.0/go.mod h1:vnRTxewy+M7BtXBNFybkuhSH4WfedVAAnERHgVFhp3k= -cosmossdk.io/store v1.0.0 h1:6tnPgTpTSIskaTmw/4s5C9FARdgFflycIc9OX8i1tOI= -cosmossdk.io/store v1.0.0/go.mod h1:ABMprwjvx6IpMp8l06TwuMrj6694/QP5NIW+X6jaTYc= -cosmossdk.io/x/tx v0.13.1 h1:Mg+EMp67Pz+NukbJqYxuo8uRp7N/a9uR+oVS9pONtj8= -cosmossdk.io/x/tx v0.13.1/go.mod h1:CBCU6fsRVz23QGFIQBb1DNX2DztJCf3jWyEkHY2nJQ0= +cosmossdk.io/store v1.1.0 h1:LnKwgYMc9BInn9PhpTFEQVbL9UK475G2H911CGGnWHk= +cosmossdk.io/store v1.1.0/go.mod h1:oZfW/4Fc/zYqu3JmQcQdUJ3fqu5vnYTn3LZFFy8P8ng= +cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= +cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= filippo.io/edwards25519 v1.0.0 h1:0wAIcmJUqRdI8IJ/3eGi5/HwXZWPujYXXlkrQogz0Ek= filippo.io/edwards25519 v1.0.0/go.mod h1:N1IkdkCkiLB6tki+MYJoSx2JTY9NUlxZE7eHn5EwJns= @@ -213,6 +213,7 @@ github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25 github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/DataDog/datadog-go v3.2.0+incompatible h1:qSG2N4FghB1He/r2mFrWKCaL7dXCilEuNEeAn20fdD4= github.com/DataDog/datadog-go v3.2.0+incompatible/go.mod h1:LButxg5PwREeZtORoXG3tL4fMGNddJ+vMq1mwgfaqoQ= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= @@ -282,8 +283,8 @@ github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA 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/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY= github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 h1:qSGYFH7+jGhDF8vLC+iwCD4WpbV1EBDSzWkJODFLams= @@ -328,8 +329,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.6 h1:QSgpCzrGWJ2KUq1qpw+FCfASRpE27T6LQbfEHscdyOk= -github.com/cometbft/cometbft v0.38.6/go.mod h1:8rSPxzUJYquCN8uuBgbUHOMg2KAwvr7CyUw+6ukO4nw= +github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= +github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= @@ -344,19 +345,19 @@ github.com/cosmos/btcutil v1.0.5 h1:t+ZFcX77LpKtDBhjucvnOH8C2l2ioGsBNEQ3jef8xFk= github.com/cosmos/btcutil v1.0.5/go.mod h1:IyB7iuqZMJlthe2tkIFL33xPyzbFYP0XVdS8P5lUPis= github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAKs= github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= -github.com/cosmos/cosmos-proto v1.0.0-beta.4 h1:aEL7tU/rLOmxZQ9z4i7mzxcLbSCY48OdY7lIWTLG7oU= -github.com/cosmos/cosmos-proto v1.0.0-beta.4/go.mod h1:oeB+FyVzG3XrQJbJng0EnV8Vljfk9XvTIpGILNU/9Co= -github.com/cosmos/cosmos-sdk v0.50.1 h1:2SYwAYqd7ZwtrWxu/J8PwbQV/cDcu90bCr/a78g3lVw= -github.com/cosmos/cosmos-sdk v0.50.1/go.mod h1:fsLSPGstCwn6MMsFDMAQWGJj8E4sYsN9Gnu1bGE5imA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= +github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= +github.com/cosmos/cosmos-sdk v0.50.6 h1:efR3MsvMHX5sxS3be+hOobGk87IzlZbSpsI2x/Vw3hk= +github.com/cosmos/cosmos-sdk v0.50.6/go.mod h1:lVkRY6cdMJ0fG3gp8y4hFrsKZqF4z7y0M2UXFb9Yt40= 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/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= github.com/cosmos/gogogateway v1.2.0/go.mod h1:iQpLkGWxYcnCdz5iAdLcRBSw3h7NXeOkZ4GUkT+tbFI= github.com/cosmos/gogoproto v1.4.2/go.mod h1:cLxOsn1ljAHSV527CHOtaIP91kK6cCrZETRBrkzItWU= -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/iavl v1.0.1 h1:D+mYbcRO2wptYzOM1Hxl9cpmmHU1ZEt9T2Wv5nZTeUw= -github.com/cosmos/iavl v1.0.1/go.mod h1:8xIUkgVvwvVrBu81scdPty+/Dx9GqwHnAvXz4cwF7RY= +github.com/cosmos/gogoproto v1.4.12 h1:vB6Lbe/rtnYGjQuFxkPiPYiCybqFT8QvLipDZP8JpFE= +github.com/cosmos/gogoproto v1.4.12/go.mod h1:LnZob1bXRdUoqMMtwYlcR3wjiElmlC+FkjaZRv1/eLY= +github.com/cosmos/iavl v1.1.2 h1:zL9FK7C4L/P4IF1Dm5fIwz0WXCnn7Bp1M2FxH0ayM7Y= +github.com/cosmos/iavl v1.1.2/go.mod h1:jLeUvm6bGT1YutCaL2fIar/8vGUE8cPZvh/gXEWDaDM= github.com/cosmos/ics23/go v0.10.0 h1:iXqLLgp2Lp+EdpIuwXTYIQU+AiHj9mOC2X9ab++bZDM= github.com/cosmos/ics23/go v0.10.0/go.mod h1:ZfJSmng/TBNTBkFemHHHj5YY7VAU/MBU980F4VU1NG0= github.com/cosmos/ledger-cosmos-go v0.13.3 h1:7ehuBGuyIytsXbd4MP43mLeoN2LTOEnk5nvue4rK+yM= @@ -643,15 +644,15 @@ github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtng github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9neXJWAZQ= github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= -github.com/hashicorp/go-getter v1.7.3 h1:bN2+Fw9XPFvOCjB0UOevFIMICZ7G2XSQHzfvLUyOM5E= -github.com/hashicorp/go-getter v1.7.3/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= +github.com/hashicorp/go-getter v1.7.4 h1:3yQjWuxICvSpYwqSayAdKRFcvBl1y/vogCxczWSmix0= +github.com/hashicorp/go-getter v1.7.4/go.mod h1:W7TalhMmbPmsSMdNjD0ZskARur/9GJ17cfHTRtXV744= github.com/hashicorp/go-hclog v1.5.0 h1:bI2ocEMgcVlz55Oj1xZNBsVi900c7II+fWDyV9o+13c= github.com/hashicorp/go-hclog v1.5.0/go.mod h1:W4Qnvbt70Wk/zYJryRzDRU/4r0kIg0PVHBcfoyhpF5M= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-immutable-radix v1.3.1 h1:DKHmCUm2hRBK510BaiZlwvpD40f8bJFeZnpfm2KLowc= github.com/hashicorp/go-immutable-radix v1.3.1/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= -github.com/hashicorp/go-metrics v0.5.2 h1:ErEYO2f//CjKsUDw4SmLzelsK6L3ZmOAR/4P9iS7ruY= -github.com/hashicorp/go-metrics v0.5.2/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= +github.com/hashicorp/go-metrics v0.5.3 h1:M5uADWMOGCTUNU1YuC4hfknOeHNaX54LDm4oYSucoNE= +github.com/hashicorp/go-metrics v0.5.3/go.mod h1:KEjodfebIOuBYSAe/bHTm+HChmKSxAOXPBieMLYozDE= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= github.com/hashicorp/go-plugin v1.5.2 h1:aWv8eimFqWlsEiMrYZdPYl+FdHaBJSN4AWwGWfT1G2Y= @@ -753,8 +754,8 @@ github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6 github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= -github.com/linxGnu/grocksdb v1.8.12 h1:1/pCztQUOa3BX/1gR3jSZDoaKFpeHFvQ1XrqZpSvZVo= -github.com/linxGnu/grocksdb v1.8.12/go.mod h1:xZCIb5Muw+nhbDK4Y5UJuOrin5MceOuiXkVUR7vp4WY= +github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= +github.com/linxGnu/grocksdb v1.8.14/go.mod h1:QYiYypR2d4v63Wj1adOOfzglnoII0gLj3PNh4fZkcFA= github.com/lyft/protoc-gen-validate v0.0.13/go.mod h1:XbGvPuh87YZc5TdIa2/I4pLk0QoUACkjt2znoq26NVQ= github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY= @@ -866,8 +867,8 @@ github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6 github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc= github.com/performancecopilot/speed v3.0.0+incompatible/go.mod h1:/CLtqpZ5gBg1M9iaPbIdPPGyKcA8hKdoy6hAWba7Yac= github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5/go.mod h1:jvVRKCrJTQWu0XVbaOlby/2lO20uSCHEMzzplHXte1o= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc h1:8bQZVK1X6BJR/6nYUPxQEP+ReTsceJTKizeuwjWOPUA= -github.com/petermattis/goid v0.0.0-20230904192822-1876fd5063bc/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67 h1:jik8PHtAIsPlCRJjJzl4udgEf7hawInF9texMeO2jrU= +github.com/petermattis/goid v0.0.0-20231207134359-e60b3f734c67/go.mod h1:pxMtw7cyUw6B2bRH0ZBANSPg+AoSud1I1iyJHI69jH4= github.com/pierrec/lz4 v1.0.2-0.20190131084431-473cd7ce01a1/go.mod h1:3/3N9NVKO0jef7pBehbT1qWhCMrIgbYNnFAZCqQ5LRc= github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pingcap/errors v0.11.4 h1:lFuQV/oaUMGcD2tqt+01ROSmJs75VG1ToEOkZIZ4nE4= @@ -888,32 +889,32 @@ github.com/prometheus/client_golang v1.0.0/go.mod h1:db9x61etRT2tGnBNRi70OPL5Fsn github.com/prometheus/client_golang v1.3.0/go.mod h1:hJaj2vgQTGQmVCsAACORcieXFeDPbaTKGT+JTgUa3og= github.com/prometheus/client_golang v1.4.0/go.mod h1:e9GMxYsXl05ICDXkRhurwBS4Q3OK1iX/F2sw+iXX5zU= github.com/prometheus/client_golang v1.7.1/go.mod h1:PY5Wy2awLA44sXw4AOSfFBetzPP4j5+D6mVACh+pe2M= -github.com/prometheus/client_golang v1.18.0 h1:HzFfmkOzH5Q8L8G+kSJKUx5dtG87sewO+FoDDqP5Tbk= -github.com/prometheus/client_golang v1.18.0/go.mod h1:T+GXkCk5wSJyOqMIzVgvvjFDlkOQntgjkJWKrN5txjA= +github.com/prometheus/client_golang v1.19.0 h1:ygXvpU1AoN1MhdzckN+PyD9QJOSD4x7kmXYlnfbA6JU= +github.com/prometheus/client_golang v1.19.0/go.mod h1:ZRM9uEAypZakd+q/x7+gmsvXdURP+DABIEIjnmDdp+k= github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.1.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= github.com/prometheus/client_model v0.2.0/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= -github.com/prometheus/client_model v0.6.0 h1:k1v3CzpSRUTrKMppY35TLwPvxHqBu0bYgxZzqGIgaos= -github.com/prometheus/client_model v0.6.0/go.mod h1:NTQHnmxFpouOD0DpvP4XujX3CdOAGQPoaGhyTchlyt8= +github.com/prometheus/client_model v0.6.1 h1:ZKSh/rekM+n3CeS952MLRAdFwIKqeY8b62p8ais2e9E= +github.com/prometheus/client_model v0.6.1/go.mod h1:OrxVMOVHjw3lKMa8+x6HeMGkHMQyHDk9E3jmP2AmGiY= github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.4.1/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= github.com/prometheus/common v0.7.0/go.mod h1:DjGbpBbp5NYNiECxcL/VnbXCCaQpKd3tt26CguLLsqA= github.com/prometheus/common v0.9.1/go.mod h1:yhUN8i9wzaXS3w1O07YhxHEBxD+W35wd8bs7vj7HSQ4= github.com/prometheus/common v0.10.0/go.mod h1:Tlit/dnDKsSWFlCLTWaA1cyBgKHSMdTB80sz/V91rCo= github.com/prometheus/common v0.15.0/go.mod h1:U+gB1OBLb1lF3O42bTCL+FK18tX9Oar16Clt/msog/s= -github.com/prometheus/common v0.47.0 h1:p5Cz0FNHo7SnWOmWmoRozVcjEp0bIVU8cV7OShpjL1k= -github.com/prometheus/common v0.47.0/go.mod h1:0/KsvlIEfPQCQ5I2iNSAWKPZziNCvRs5EC6ILDTlAPc= +github.com/prometheus/common v0.52.2 h1:LW8Vk7BccEdONfrJBDffQGRtpSzi5CQaRZGtboOO2ck= +github.com/prometheus/common v0.52.2/go.mod h1:lrWtQx+iDfn2mbH5GUzlH9TSHyfZpHkSiG1W7y3sF2Q= github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= github.com/prometheus/procfs v0.0.2/go.mod h1:TjEm7ze935MbeOT/UhFTIMYKhuLP4wbCsTZCD3I8kEA= github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+GxbHq6oeK9A= github.com/prometheus/procfs v0.1.3/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= github.com/prometheus/procfs v0.3.0/go.mod h1:lV6e/gmhEcM9IjHGsFOCxxuZ+z1YqCvr4OA4YeYWdaU= -github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= -github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= +github.com/prometheus/procfs v0.13.0 h1:GqzLlQyfsPbaEHaQkO7tbDlriv/4o5Hudv6OXHGKX7o= +github.com/prometheus/procfs v0.13.0/go.mod h1:cd4PFCR54QLnGKPaKGA6l+cfuNXtht43ZKY6tow0Y1g= github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 h1:N/ElC8H3+5XpJzTSTfLsJV/mx9Q9g7kxmchpfZyxgzM= github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4= @@ -1089,8 +1090,8 @@ golang.org/x/crypto v0.0.0-20200728195943-123391ffb6de/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.9.0/go.mod h1:yrmDGqONDYtNj3tH8X9dzUun2m2lzPa9ngI6/RUPGR0= -golang.org/x/crypto v0.19.0 h1:ENy+Az/9Y1vSrlrvBSyna3PITt4tiZLf7sgCjZBX7Wo= -golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= +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/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= @@ -1102,8 +1103,8 @@ golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u0 golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= 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-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= -golang.org/x/exp v0.0.0-20240222234643-814bf88cf225/go.mod h1:CxmFvTBINI24O/j8iY7H1xHzx2i4OsyguNBmN/uPtqc= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0 h1:985EYyeCOxTpcgOTJpflJUwOeEz0CQOdPt73OzpE9F8= +golang.org/x/exp v0.0.0-20240404231335-c0f41cb1a7a0/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= 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= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= @@ -1131,8 +1132,8 @@ golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4= golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs= -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.17.0 h1:zY54UmvipHiNd+pm+m0x9KhZ9hl1/7QNMyxXbc6ICqA= +golang.org/x/mod v0.17.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c= 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= golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -1195,8 +1196,8 @@ golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= -golang.org/x/net v0.21.0 h1:AQyQV4dYCvJ7vGmJyKki9+PBdyvhkSd8EIx/qb0AYv4= -golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= +golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= +golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= @@ -1222,8 +1223,8 @@ golang.org/x/oauth2 v0.0.0-20220822191816-0ebed06d0094/go.mod h1:h4gKUeWbJ4rQPri golang.org/x/oauth2 v0.0.0-20220909003341-f21342109be1/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.0.0-20221014153046-6fdb5e3db783/go.mod h1:h4gKUeWbJ4rQPri7E0u6Gs4e9Ri2zaLxzw5DI5XGrYg= golang.org/x/oauth2 v0.1.0/go.mod h1:G9FE4dLTsbXUu90h/Pf85g4w1D+SSAgR+q46nJZ8M4A= -golang.org/x/oauth2 v0.16.0 h1:aDkGMBSYxElaoP81NpoUoz2oo2R2wHdZpGToUxfyQrQ= -golang.org/x/oauth2 v0.16.0/go.mod h1:hqZ+0LWXsiVoZpeld6jVt06P3adbS2Uu911W1SsJv2o= +golang.org/x/oauth2 v0.18.0 h1:09qnuIAgzdx1XplqJvW6CQqMCtGZykZWcXzPMPUusvI= +golang.org/x/oauth2 v0.18.0/go.mod h1:Wf7knwG0MPoWIMMBgFlEaSUDaKskp0dCfrlJRJXbBi8= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -1239,8 +1240,8 @@ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJ 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.1.0/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.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M= +golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= 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= golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -1340,16 +1341,16 @@ 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.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.17.0 h1:25cE3gD+tdBA7lp7QfhuV+rJiE9YXTcS3VG1SqssI/Y= -golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +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/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.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= -golang.org/x/term v0.17.0 h1:mkTF7LCd6WGJNL3K1Ad7kwxNfYAW6a8a8QqtMblp/4U= -golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= +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/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= @@ -1436,8 +1437,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.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -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.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= +golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= 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= @@ -1614,12 +1615,12 @@ google.golang.org/genproto v0.0.0-20221010155953-15ba04fc1c0e/go.mod h1:3526vdqw google.golang.org/genproto v0.0.0-20221014173430-6e2ab493f96b/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221014213838-99cd37c6964a/go.mod h1:1vXfmgAz9N9Jx0QA82PqRVauvCz1SGSz739p0f183jM= google.golang.org/genproto v0.0.0-20221025140454-527a21cfbd71/go.mod h1:9qHF0xnpdSfF6knlcsnpzUu5y+rpwgbvsyGAZPBMg4s= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9 h1:9+tzLLstTlPTRyJTh+ah5wIMsBW5c4tQwGTN3thOW9Y= -google.golang.org/genproto v0.0.0-20240213162025-012b6fc9bca9/go.mod h1:mqHbVIp48Muh7Ywss/AD6I5kNVKZMmAa/QEW58Gxp2s= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014 h1:x9PwdEgd11LgK+orcck69WVRo7DezSO4VUMPI4xpc8A= -google.golang.org/genproto/googleapis/api v0.0.0-20240205150955-31a09d347014/go.mod h1:rbHMSEDyoYX62nRVLOCc4Qt1HbsdytAYoVwgjiOhF3I= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= -google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c/go.mod h1:H4O17MA/PE9BsGx3w+a+W2VOLLD1Qf7oJneAoU6WktY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de h1:F6qOa9AZTYJXOUEr4jDysRDLrm4PHePlge4v4TGAlxY= +google.golang.org/genproto v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:VUhTRKeHn9wwcdrk73nvdC9gF178Tzhmt/qyaFcPLSo= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de h1:jFNzHPIeuzhdRwVhbZdiym9q0ory/xY3sA+v2wPg8I0= +google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de/go.mod h1:5iCWqnniDlqZHrd3neWVTOwvh/v6s3232omMecelax8= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda h1:LI5DOvAxUPMv/50agcLLoo+AdWc1irS9Rzz4vPuD1V4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240401170217-c3f982113cda/go.mod h1:WtryC6hu0hhx87FDGxWCDptyssuo68sk10vYjF+T9fY= google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.0/go.mod h1:chYK+tFQF0nDUGJgXMSgLCQk3phJEuONr2DCgLDdAQM= @@ -1661,8 +1662,8 @@ google.golang.org/grpc v1.48.0/go.mod h1:vN9eftEi1UMyUsIF80+uQXhHjbXYbm0uXoFCACu google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= google.golang.org/grpc v1.50.1/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= -google.golang.org/grpc v1.62.0 h1:HQKZ/fa1bXkX1oFOvSjmZEUL8wLSaZTjCcLAlmZRtdk= -google.golang.org/grpc v1.62.0/go.mod h1:IWTG0VlJLCh1SkC58F7np9ka9mx/WNkjl4PGJaiq+QE= +google.golang.org/grpc v1.63.2 h1:MUeiw1B2maTVZthpU5xvASfTh3LDbxHd6IJ6QQVU+xM= +google.golang.org/grpc v1.63.2/go.mod h1:WAX/8DgncnokcFUldAxq7GeB5DXHDbMF+lLvDomNkRA= google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= From 36295f05159552946b974232cf0423a45e3c9f1b Mon Sep 17 00:00:00 2001 From: yihuang Date: Wed, 26 Jun 2024 12:00:48 +0800 Subject: [PATCH 27/37] Problem: mempool don't respect gas wanted returned by ante handler (#507) * Problem: mempool don't respect gas wanted returned by ante handler Solution: - support custom gas wanted in mempool * Update CHANGELOG.md Signed-off-by: yihuang * cleanup * cleanup * fix priorityIndex * fix process proposal * fix lint * fix lint --------- Signed-off-by: yihuang --- CHANGELOG.md | 1 + baseapp/abci_utils.go | 42 ++++++++++----------- baseapp/baseapp.go | 12 +++--- baseapp/testutil/mock/mocks.go | 6 ++- types/mempool/mempool.go | 21 ++++++++++- types/mempool/mempool_test.go | 2 +- types/mempool/noop.go | 9 +++-- types/mempool/priority_nonce.go | 25 ++++++++---- types/mempool/priority_nonce_test.go | 6 +-- types/mempool/sender_nonce.go | 21 ++++++++--- types/mempool/sender_nonce_property_test.go | 2 +- 11 files changed, 94 insertions(+), 53 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deb213d41b9c..b00bbf0151ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -60,6 +60,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (baseapp) [#20144](https://github.com/cosmos/cosmos-sdk/pull/20144) Remove txs from mempool when antehandler fails in recheck. * (baseapp) [#20107](https://github.com/cosmos/cosmos-sdk/pull/20107) Avoid header height overwrite block height. * (cli) [#20020](https://github.com/cosmos/cosmos-sdk/pull/20020) Make bootstrap-state command support both new and legacy genesis format. +* [#507](https://github.com/crypto-org-chain/cosmos-sdk/pull/507) mempool respect gas wanted returned by ante handler ### Bug Fixes diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 38672821dfcc..e07d5b19f73a 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -200,7 +200,7 @@ type ( // to verify a transaction. ProposalTxVerifier interface { PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error) - ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) + ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, uint64, error) TxDecode(txBz []byte) (sdk.Tx, error) TxEncode(tx sdk.Tx) ([]byte, error) } @@ -270,7 +270,14 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan return nil, err } - stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, tx, txBz) + var txGasLimit uint64 + if gasTx, ok := tx.(interface { + GetGas() uint64 + }); ok { + txGasLimit = gasTx.GetGas() + } + + stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, tx, txBz, txGasLimit) if stop { break } @@ -284,7 +291,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan var selectedTxsNums int for iterator != nil { memTx := iterator.Tx() - signerData, err := h.signerExtAdapter.GetSigners(memTx) + signerData, err := h.signerExtAdapter.GetSigners(memTx.Tx) if err != nil { return nil, err } @@ -318,14 +325,14 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan // which calls mempool.Insert, in theory everything in the pool should be // valid. But some mempool implementations may insert invalid txs, so we // check again. - txBz, err := h.txVerifier.PrepareProposalVerifyTx(memTx) + txBz, err := h.txVerifier.PrepareProposalVerifyTx(memTx.Tx) if err != nil { - err := h.mempool.Remove(memTx) + err := h.mempool.Remove(memTx.Tx) if err != nil && !errors.Is(err, mempool.ErrTxNotFound) { return nil, err } } else { - stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, memTx, txBz) + stop := h.txSelector.SelectTxForProposal(ctx, uint64(req.MaxTxBytes), maxBlockGas, memTx.Tx, txBz, memTx.GasWanted) if stop { break } @@ -383,17 +390,13 @@ func (h *DefaultProposalHandler) ProcessProposalHandler() sdk.ProcessProposalHan } for _, txBytes := range req.Txs { - tx, err := h.txVerifier.ProcessProposalVerifyTx(txBytes) + _, gasWanted, err := h.txVerifier.ProcessProposalVerifyTx(txBytes) if err != nil { return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil } if maxBlockGas > 0 { - gasTx, ok := tx.(GasTx) - if ok { - totalTxGas += gasTx.GetGas() - } - + totalTxGas += gasWanted if totalTxGas > uint64(maxBlockGas) { return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil } @@ -451,7 +454,7 @@ type TxSelector interface { // a proposal based on inclusion criteria defined by the TxSelector. It must // return if the caller should halt the transaction selection loop // (typically over a mempool) or otherwise. - SelectTxForProposal(ctx context.Context, maxTxBytes, maxBlockGas uint64, memTx sdk.Tx, txBz []byte) bool + SelectTxForProposal(ctx context.Context, maxTxBytes, maxBlockGas uint64, memTx sdk.Tx, txBz []byte, gasWanted uint64) bool } type defaultTxSelector struct { @@ -476,23 +479,16 @@ func (ts *defaultTxSelector) Clear() { ts.selectedTxs = nil } -func (ts *defaultTxSelector) SelectTxForProposal(_ context.Context, maxTxBytes, maxBlockGas uint64, memTx sdk.Tx, txBz []byte) bool { +func (ts *defaultTxSelector) SelectTxForProposal(_ context.Context, maxTxBytes, maxBlockGas uint64, memTx sdk.Tx, txBz []byte, gasWanted uint64) bool { txSize := uint64(len(txBz)) - var txGasLimit uint64 - if memTx != nil { - if gasTx, ok := memTx.(GasTx); ok { - txGasLimit = gasTx.GetGas() - } - } - // only add the transaction to the proposal if we have enough capacity if (txSize + ts.totalTxBytes) <= maxTxBytes { // If there is a max block gas limit, add the tx only if the limit has // not been met. if maxBlockGas > 0 { - if (txGasLimit + ts.totalTxGas) <= maxBlockGas { - ts.totalTxGas += txGasLimit + if (gasWanted + ts.totalTxGas) <= maxBlockGas { + ts.totalTxGas += gasWanted ts.totalTxBytes += txSize ts.selectedTxs = append(ts.selectedTxs, txBz) } diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 09a9f5827d04..526ee69fb0e2 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -957,7 +957,7 @@ func (app *BaseApp) runTxWithMultiStore(mode execMode, txBytes []byte, txIndex i } if mode == execModeCheck { - err = app.mempool.Insert(ctx, tx) + err = app.mempool.InsertWithGasWanted(ctx, tx, gasWanted) if err != nil { return gInfo, nil, anteEvents, err } @@ -1148,18 +1148,18 @@ func (app *BaseApp) PrepareProposalVerifyTx(tx sdk.Tx) ([]byte, error) { // ProcessProposal state internally will be discarded. will be // returned if the transaction cannot be decoded. will be returned if // the transaction is valid, otherwise will be returned. -func (app *BaseApp) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, error) { +func (app *BaseApp) ProcessProposalVerifyTx(txBz []byte) (sdk.Tx, uint64, error) { tx, err := app.txDecoder(txBz) if err != nil { - return nil, err + return nil, 0, err } - _, _, _, err = app.runTx(execModeProcessProposal, txBz) + gInfo, _, _, err := app.runTx(execModeProcessProposal, txBz) if err != nil { - return nil, err + return nil, 0, err } - return tx, nil + return tx, gInfo.GasWanted, nil } func (app *BaseApp) TxDecode(txBytes []byte) (sdk.Tx, error) { diff --git a/baseapp/testutil/mock/mocks.go b/baseapp/testutil/mock/mocks.go index 85d1cdeaf6d5..1e5eabea3871 100644 --- a/baseapp/testutil/mock/mocks.go +++ b/baseapp/testutil/mock/mocks.go @@ -127,12 +127,14 @@ func (mr *MockProposalTxVerifierMockRecorder) PrepareProposalVerifyTx(tx interfa } // ProcessProposalVerifyTx mocks base method. -func (m *MockProposalTxVerifier) ProcessProposalVerifyTx(txBz []byte) (types.Tx, error) { +func (m *MockProposalTxVerifier) ProcessProposalVerifyTx(txBz []byte) (types.Tx, uint64, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ProcessProposalVerifyTx", txBz) ret0, _ := ret[0].(types.Tx) ret1, _ := ret[1].(error) - return ret0, ret1 + return ret0, ret0.(interface { + Gas() uint64 + }).Gas(), ret1 } // ProcessProposalVerifyTx indicates an expected call of ProcessProposalVerifyTx. diff --git a/types/mempool/mempool.go b/types/mempool/mempool.go index 37f94d8f4d9f..0c74063628fc 100644 --- a/types/mempool/mempool.go +++ b/types/mempool/mempool.go @@ -7,11 +7,30 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +type Tx struct { + Tx sdk.Tx + GasWanted uint64 +} + +func NewMempoolTx(tx sdk.Tx, gasWanted uint64) Tx { + return Tx{ + Tx: tx, + GasWanted: gasWanted, + } +} + +type GasTx interface { + GetGas() uint64 +} + type Mempool interface { // Insert attempts to insert a Tx into the app-side mempool returning // an error upon failure. Insert(context.Context, sdk.Tx) error + // Insert with a custom gas wanted value + InsertWithGasWanted(context.Context, sdk.Tx, uint64) error + // Select returns an Iterator over the app-side mempool. If txs are specified, // then they shall be incorporated into the Iterator. The Iterator must // closed by the caller. @@ -34,7 +53,7 @@ type Iterator interface { Next() Iterator // Tx returns the transaction at the current position of the iterator. - Tx() sdk.Tx + Tx() Tx } var ( diff --git a/types/mempool/mempool_test.go b/types/mempool/mempool_test.go index 05f61e46decd..f281517e0482 100644 --- a/types/mempool/mempool_test.go +++ b/types/mempool/mempool_test.go @@ -123,7 +123,7 @@ func fetchTxs(iterator mempool.Iterator, maxBytes int64) []sdk.Tx { if numBytes += txSize; numBytes > maxBytes { break } - txs = append(txs, iterator.Tx()) + txs = append(txs, iterator.Tx().Tx) i := iterator.Next() iterator = i } diff --git a/types/mempool/noop.go b/types/mempool/noop.go index 73c12639d1d6..52a2c03077df 100644 --- a/types/mempool/noop.go +++ b/types/mempool/noop.go @@ -16,7 +16,8 @@ var _ Mempool = (*NoOpMempool)(nil) // is FIFO-ordered by default. type NoOpMempool struct{} -func (NoOpMempool) Insert(context.Context, sdk.Tx) error { return nil } -func (NoOpMempool) Select(context.Context, [][]byte) Iterator { return nil } -func (NoOpMempool) CountTx() int { return 0 } -func (NoOpMempool) Remove(sdk.Tx) error { return nil } +func (NoOpMempool) Insert(context.Context, sdk.Tx) error { return nil } +func (NoOpMempool) InsertWithGasWanted(context.Context, sdk.Tx, uint64) error { return nil } +func (NoOpMempool) Select(context.Context, [][]byte) Iterator { return nil } +func (NoOpMempool) CountTx() int { return 0 } +func (NoOpMempool) Remove(sdk.Tx) error { return nil } diff --git a/types/mempool/priority_nonce.go b/types/mempool/priority_nonce.go index 03e909475696..34a8aefae68d 100644 --- a/types/mempool/priority_nonce.go +++ b/types/mempool/priority_nonce.go @@ -189,7 +189,7 @@ func (mp *PriorityNonceMempool[C]) NextSenderTx(sender string) sdk.Tx { } cursor := senderIndex.Front() - return cursor.Value.(sdk.Tx) + return cursor.Value.(Tx).Tx } // Insert attempts to insert a Tx into the app-side mempool in O(log n) time, @@ -201,7 +201,7 @@ func (mp *PriorityNonceMempool[C]) NextSenderTx(sender string) sdk.Tx { // // Inserting a duplicate tx with a different priority overwrites the existing tx, // changing the total order of the mempool. -func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error { +func (mp *PriorityNonceMempool[C]) InsertWithGasWanted(ctx context.Context, tx sdk.Tx, gasWanted uint64) error { mp.mtx.Lock() defer mp.mtx.Unlock() if mp.cfg.MaxTx > 0 && mp.priorityIndex.Len() >= mp.cfg.MaxTx { @@ -210,6 +210,8 @@ func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error return nil } + memTx := NewMempoolTx(tx, gasWanted) + sigs, err := mp.cfg.SignerExtractor.GetSigners(tx) if err != nil { return err @@ -243,12 +245,12 @@ func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error // changes. sk := txMeta[C]{nonce: nonce, sender: sender} if oldScore, txExists := mp.scores[sk]; txExists { - if mp.cfg.TxReplacement != nil && !mp.cfg.TxReplacement(oldScore.priority, priority, senderIndex.Get(key).Value.(sdk.Tx), tx) { + if mp.cfg.TxReplacement != nil && !mp.cfg.TxReplacement(oldScore.priority, priority, senderIndex.Get(key).Value.(Tx).Tx, tx) { return fmt.Errorf( "tx doesn't fit the replacement rule, oldPriority: %v, newPriority: %v, oldTx: %v, newTx: %v", oldScore.priority, priority, - senderIndex.Get(key).Value.(sdk.Tx), + senderIndex.Get(key).Value.(Tx).Tx, tx, ) } @@ -266,7 +268,7 @@ func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error // Since senderIndex is scored by nonce, a changed priority will overwrite the // existing key. - key.senderElement = senderIndex.Set(key, tx) + key.senderElement = senderIndex.Set(key, memTx) mp.scores[sk] = txMeta[C]{priority: priority} mp.priorityIndex.Set(key, tx) @@ -274,6 +276,15 @@ func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error return nil } +func (mp *PriorityNonceMempool[C]) Insert(ctx context.Context, tx sdk.Tx) error { + var gasLimit uint64 + if gasTx, ok := tx.(GasTx); ok { + gasLimit = gasTx.GetGas() + } + + return mp.InsertWithGasWanted(ctx, tx, gasLimit) +} + func (i *PriorityNonceIterator[C]) iteratePriority() Iterator { // beginning of priority iteration if i.priorityNode == nil { @@ -337,8 +348,8 @@ func (i *PriorityNonceIterator[C]) Next() Iterator { return i } -func (i *PriorityNonceIterator[C]) Tx() sdk.Tx { - return i.senderCursors[i.sender].Value.(sdk.Tx) +func (i *PriorityNonceIterator[C]) Tx() Tx { + return i.senderCursors[i.sender].Value.(Tx) } // Select returns a set of transactions from the mempool, ordered by priority diff --git a/types/mempool/priority_nonce_test.go b/types/mempool/priority_nonce_test.go index 24016b417abf..e071bd55ca03 100644 --- a/types/mempool/priority_nonce_test.go +++ b/types/mempool/priority_nonce_test.go @@ -386,7 +386,7 @@ func (s *MempoolTestSuite) TestIterator() { // iterate through txs iterator := pool.Select(ctx, nil) for iterator != nil { - tx := iterator.Tx().(testTx) + tx := iterator.Tx().Tx.(testTx) require.Equal(t, tt.txs[tx.id].p, int(tx.priority)) require.Equal(t, tt.txs[tx.id].n, int(tx.nonce)) require.Equal(t, tt.txs[tx.id].a, tx.address) @@ -854,7 +854,7 @@ func TestNextSenderTx_TxReplacement(t *testing.T) { require.Equal(t, 1, mp.CountTx()) iter := mp.Select(ctx, nil) - require.Equal(t, tx, iter.Tx()) + require.Equal(t, tx, iter.Tx().Tx) } // test Priority with TxReplacement @@ -889,5 +889,5 @@ func TestNextSenderTx_TxReplacement(t *testing.T) { require.Equal(t, 1, mp.CountTx()) iter := mp.Select(ctx, nil) - require.Equal(t, txs[3], iter.Tx()) + require.Equal(t, txs[3], iter.Tx().Tx) } diff --git a/types/mempool/sender_nonce.go b/types/mempool/sender_nonce.go index 57cdb4dd4f95..d827244914c8 100644 --- a/types/mempool/sender_nonce.go +++ b/types/mempool/sender_nonce.go @@ -112,12 +112,12 @@ func (snm *SenderNonceMempool) NextSenderTx(sender string) sdk.Tx { } cursor := senderIndex.Front() - return cursor.Value.(sdk.Tx) + return cursor.Value.(Tx).Tx } // Insert adds a tx to the mempool. It returns an error if the tx does not have // at least one signer. Note, priority is ignored. -func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { +func (snm *SenderNonceMempool) InsertWithGasWanted(_ context.Context, tx sdk.Tx, gasLimit uint64) error { snm.mtx.Lock() defer snm.mtx.Unlock() if snm.maxTx > 0 && len(snm.existingTx) >= snm.maxTx { @@ -127,6 +127,8 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { return nil } + memTx := NewMempoolTx(tx, gasLimit) + sigs, err := tx.(signing.SigVerifiableTx).GetSignaturesV2() if err != nil { return err @@ -145,7 +147,7 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { snm.senders[sender] = senderTxs } - senderTxs.Set(nonce, tx) + senderTxs.Set(nonce, memTx) key := txKey{nonce: nonce, address: sender} snm.existingTx[key] = true @@ -153,6 +155,15 @@ func (snm *SenderNonceMempool) Insert(_ context.Context, tx sdk.Tx) error { return nil } +func (snm *SenderNonceMempool) Insert(ctx context.Context, tx sdk.Tx) error { + var gasLimit uint64 + if gasTx, ok := tx.(GasTx); ok { + gasLimit = gasTx.GetGas() + } + + return snm.InsertWithGasWanted(ctx, tx, gasLimit) +} + // Select returns an iterator ordering transactions the mempool with the lowest // nonce of a random selected sender first. // @@ -268,8 +279,8 @@ func (i *senderNonceMempoolIterator) Next() Iterator { return nil } -func (i *senderNonceMempoolIterator) Tx() sdk.Tx { - return i.currentTx.Value.(sdk.Tx) +func (i *senderNonceMempoolIterator) Tx() Tx { + return i.currentTx.Value.(Tx) } func removeAtIndex[T any](slice []T, index int) []T { diff --git a/types/mempool/sender_nonce_property_test.go b/types/mempool/sender_nonce_property_test.go index baaaa4abe9a2..b55f5ef8814a 100644 --- a/types/mempool/sender_nonce_property_test.go +++ b/types/mempool/sender_nonce_property_test.go @@ -96,7 +96,7 @@ func fetchAllTxs(iterator mempool.Iterator) []testTx { var txs []testTx for iterator != nil { tx := iterator.Tx() - txs = append(txs, tx.(testTx)) + txs = append(txs, tx.Tx.(testTx)) i := iterator.Next() iterator = i } From 52a97a815210952feb847e04a19e43dea911f6b5 Mon Sep 17 00:00:00 2001 From: mmsqe Date: Tue, 2 Jul 2024 11:11:16 +0800 Subject: [PATCH 28/37] Problem: mempool.GasTx interface is not reused (#536) * Problem: redundant mutex for InsertWithGasWanted cfg of PriorityNonceMempool remains unchanged once assigned, so no lock is required * make mocks * cleanup * keep order of check MaxTx --- baseapp/abci_utils.go | 4 +- baseapp/testutil/mock/mocks.go | 15 ++++--- x/gov/testutil/expected_keepers_mocks.go | 51 ++++++++++++++++-------- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index e07d5b19f73a..2f0636e75e04 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -271,9 +271,7 @@ func (h *DefaultProposalHandler) PrepareProposalHandler() sdk.PrepareProposalHan } var txGasLimit uint64 - if gasTx, ok := tx.(interface { - GetGas() uint64 - }); ok { + if gasTx, ok := tx.(mempool.GasTx); ok { txGasLimit = gasTx.GetGas() } diff --git a/baseapp/testutil/mock/mocks.go b/baseapp/testutil/mock/mocks.go index 1e5eabea3871..4486d505e9b8 100644 --- a/baseapp/testutil/mock/mocks.go +++ b/baseapp/testutil/mock/mocks.go @@ -131,10 +131,9 @@ func (m *MockProposalTxVerifier) ProcessProposalVerifyTx(txBz []byte) (types.Tx, m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ProcessProposalVerifyTx", txBz) ret0, _ := ret[0].(types.Tx) - ret1, _ := ret[1].(error) - return ret0, ret0.(interface { - Gas() uint64 - }).Gas(), ret1 + ret1, _ := ret[1].(uint64) + ret2, _ := ret[2].(error) + return ret0, ret1, ret2 } // ProcessProposalVerifyTx indicates an expected call of ProcessProposalVerifyTx. @@ -209,17 +208,17 @@ func (mr *MockTxSelectorMockRecorder) Clear() *gomock.Call { } // SelectTxForProposal mocks base method. -func (m *MockTxSelector) SelectTxForProposal(ctx context.Context, maxTxBytes, maxBlockGas uint64, memTx types.Tx, txBz []byte) bool { +func (m *MockTxSelector) SelectTxForProposal(ctx context.Context, maxTxBytes, maxBlockGas uint64, memTx types.Tx, txBz []byte, gasWanted uint64) bool { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SelectTxForProposal", ctx, maxTxBytes, maxBlockGas, memTx, txBz) + ret := m.ctrl.Call(m, "SelectTxForProposal", ctx, maxTxBytes, maxBlockGas, memTx, txBz, gasWanted) ret0, _ := ret[0].(bool) return ret0 } // SelectTxForProposal indicates an expected call of SelectTxForProposal. -func (mr *MockTxSelectorMockRecorder) SelectTxForProposal(ctx, maxTxBytes, maxBlockGas, memTx, txBz interface{}) *gomock.Call { +func (mr *MockTxSelectorMockRecorder) SelectTxForProposal(ctx, maxTxBytes, maxBlockGas, memTx, txBz, gasWanted interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectTxForProposal", reflect.TypeOf((*MockTxSelector)(nil).SelectTxForProposal), ctx, maxTxBytes, maxBlockGas, memTx, txBz) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SelectTxForProposal", reflect.TypeOf((*MockTxSelector)(nil).SelectTxForProposal), ctx, maxTxBytes, maxBlockGas, memTx, txBz, gasWanted) } // SelectedTxs mocks base method. diff --git a/x/gov/testutil/expected_keepers_mocks.go b/x/gov/testutil/expected_keepers_mocks.go index 43d2e05fd41e..89f600afd7df 100644 --- a/x/gov/testutil/expected_keepers_mocks.go +++ b/x/gov/testutil/expected_keepers_mocks.go @@ -226,6 +226,20 @@ func (mr *MockBankKeeperMockRecorder) ClearSendRestriction() *gomock.Call { return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ClearSendRestriction", reflect.TypeOf((*MockBankKeeper)(nil).ClearSendRestriction)) } +// CreditVirtualAccounts mocks base method. +func (m *MockBankKeeper) CreditVirtualAccounts(ctx context.Context) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "CreditVirtualAccounts", ctx) + ret0, _ := ret[0].(error) + return ret0 +} + +// CreditVirtualAccounts indicates an expected call of CreditVirtualAccounts. +func (mr *MockBankKeeperMockRecorder) CreditVirtualAccounts(ctx interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "CreditVirtualAccounts", reflect.TypeOf((*MockBankKeeper)(nil).CreditVirtualAccounts), ctx) +} + // DelegateCoins mocks base method. func (m *MockBankKeeper) DelegateCoins(ctx context.Context, delegatorAddr, moduleAccAddr types.AccAddress, amt types.Coins) error { m.ctrl.T.Helper() @@ -784,6 +798,12 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, sende return ret0 } +// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) +} + // SendCoinsFromAccountToModuleVirtual mocks base method. func (m *MockBankKeeper) SendCoinsFromAccountToModuleVirtual(ctx context.Context, senderAddr types.AccAddress, recipientModule string, amt types.Coins) error { m.ctrl.T.Helper() @@ -792,18 +812,10 @@ func (m *MockBankKeeper) SendCoinsFromAccountToModuleVirtual(ctx context.Context return ret0 } -// SendCoinsFromModuleToAccountVirtual mocks base method. -func (m *MockBankKeeper) SendCoinsFromModuleToAccountVirtual(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { - m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccountVirtual", ctx, senderModule, recipientAddr, amt) - ret0, _ := ret[0].(error) - return ret0 -} - -// SendCoinsFromAccountToModule indicates an expected call of SendCoinsFromAccountToModule. -func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { +// SendCoinsFromAccountToModuleVirtual indicates an expected call of SendCoinsFromAccountToModuleVirtual. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModuleVirtual(ctx, senderAddr, recipientModule, amt interface{}) *gomock.Call { mr.mock.ctrl.T.Helper() - return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModule", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModule), ctx, senderAddr, recipientModule, amt) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromAccountToModuleVirtual", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromAccountToModuleVirtual), ctx, senderAddr, recipientModule, amt) } // SendCoinsFromModuleToAccount mocks base method. @@ -820,17 +832,24 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccount(ctx, senderMo return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccount", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccount), ctx, senderModule, recipientAddr, amt) } -// SendCoinsFromModuleToModule mocks base method. -func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { +// SendCoinsFromModuleToAccountVirtual mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToAccountVirtual(ctx context.Context, senderModule string, recipientAddr types.AccAddress, amt types.Coins) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) + ret := m.ctrl.Call(m, "SendCoinsFromModuleToAccountVirtual", ctx, senderModule, recipientAddr, amt) ret0, _ := ret[0].(error) return ret0 } -func (m *MockBankKeeper) CreditVirtualAccounts(ctx context.Context) error { +// SendCoinsFromModuleToAccountVirtual indicates an expected call of SendCoinsFromModuleToAccountVirtual. +func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToAccountVirtual(ctx, senderModule, recipientAddr, amt interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "SendCoinsFromModuleToAccountVirtual", reflect.TypeOf((*MockBankKeeper)(nil).SendCoinsFromModuleToAccountVirtual), ctx, senderModule, recipientAddr, amt) +} + +// SendCoinsFromModuleToModule mocks base method. +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderModule, recipientModule string, amt types.Coins) error { m.ctrl.T.Helper() - ret := m.ctrl.Call(m, "CreditVirtualAccounts", ctx) + ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderModule, recipientModule, amt) ret0, _ := ret[0].(error) return ret0 } From 6c4b1991fe30778c24b021c63aaf88f559e7c942 Mon Sep 17 00:00:00 2001 From: kakysha Date: Wed, 3 Jul 2024 21:53:06 +0300 Subject: [PATCH 29/37] fix: compilation after merge --- baseapp/abci.go | 2 +- baseapp/baseapp.go | 2 +- baseapp/options.go | 3 +- store/cachemulti/store.go | 19 +++++++++++ store/types/store.go | 19 +++++------ x/bank/abci.go | 1 + x/bank/keeper/send.go | 11 ++++--- x/bank/keeper/virtual.go | 61 +++++++++++++++++++----------------- x/bank/module.go | 4 --- x/bank/types/restrictions.go | 3 -- 10 files changed, 70 insertions(+), 55 deletions(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index d4664ea20adc..d5dc8d1e6918 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -1249,7 +1249,7 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e // use custom query multi-store if provided qms := app.qms if qms == nil { - qms = storetypes.RootMultiStore(app.cms) + qms = storetypes.MultiStore(app.cms) } lastBlockHeight := qms.LatestVersion() diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 9b949bf8e25f..ef2d9c016b0f 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -70,7 +70,7 @@ type BaseApp struct { name string // application name from abci.BlockInfo db dbm.DB // common DB backend cms storetypes.CommitMultiStore // Main (uncached) state - qms storetypes.RootMultiStore // Optional alternative multistore for querying only. + qms storetypes.MultiStore // Optional alternative multistore for querying only. storeLoader StoreLoader // function to handle store loading, may be overridden with SetStoreLoader() grpcQueryRouter *GRPCQueryRouter // router for redirecting gRPC query calls msgServiceRouter *MsgServiceRouter // router for redirecting Msg service messages diff --git a/baseapp/options.go b/baseapp/options.go index 745ad1c6772b..c76929791c70 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -321,7 +321,7 @@ func (app *BaseApp) SetTxEncoder(txEncoder sdk.TxEncoder) { // SetQueryMultiStore set a alternative MultiStore implementation to support grpc query service. // // Ref: https://github.com/cosmos/cosmos-sdk/issues/13317 -func (app *BaseApp) SetQueryMultiStore(ms storetypes.RootMultiStore) { +func (app *BaseApp) SetQueryMultiStore(ms storetypes.MultiStore) { app.qms = ms } @@ -391,6 +391,7 @@ func (app *BaseApp) SetTraceFlightRecorder(tr *metrics.TraceRecorder) { func SetTraceFlightRecorder(tr *metrics.TraceRecorder) func(*BaseApp) { return func(app *BaseApp) { app.traceFlightRecorder = tr } +} // SetTxExecutor sets a custom tx executor for the BaseApp, usually for parallel execution. func (app *BaseApp) SetTxExecutor(executor TxExecutor) { diff --git a/store/cachemulti/store.go b/store/cachemulti/store.go index 96aafd41e656..a26f7d0919c9 100644 --- a/store/cachemulti/store.go +++ b/store/cachemulti/store.go @@ -90,6 +90,11 @@ func (cms Store) initStore(key types.StoreKey, store types.CacheWrapper) types.C return cache } +// LatestVersion returns the branch version of the store +func (cms Store) LatestVersion() int64 { + panic("cannot get latest version from branch cached multi-store") +} + // SetTracer sets the tracer for the MultiStore that the underlying // stores will utilize to trace operations. A MultiStore is returned. func (cms Store) SetTracer(w io.Writer) types.MultiStore { @@ -144,6 +149,11 @@ func (cms Store) CacheWrap() types.CacheWrap { return cms.CacheMultiStore().(types.CacheWrap) } +// CacheWrapWithTrace implements the KVStore interface. +func (cms Store) CacheWrapWithTrace(_ io.Writer, _ types.TraceContext) types.CacheWrap { + return cms.CacheWrap() +} + // Implements MultiStore. func (cms Store) CacheMultiStore() types.CacheMultiStore { return NewFromParent(cms.getCacheWrapper, cms.traceWriter, cms.traceContext) @@ -161,6 +171,15 @@ func (cms Store) getCacheWrapper(key types.StoreKey) types.CacheWrapper { return store } +// CacheMultiStoreWithVersion implements the MultiStore interface. It will panic +// as an already cached multi-store cannot load previous versions. +// +// TODO: The store implementation can possibly be modified to support this as it +// seems safe to load previous versions (heights). +func (cms Store) CacheMultiStoreWithVersion(_ int64) (types.CacheMultiStore, error) { + panic("cannot branch cached multi-store with a version") +} + // GetStore returns an underlying Store by key. func (cms Store) GetStore(key types.StoreKey) types.Store { store, ok := cms.getCacheWrapper(key).(types.Store) diff --git a/store/types/store.go b/store/types/store.go index 0ac8a2a2e5a1..4fc86f648d1c 100644 --- a/store/types/store.go +++ b/store/types/store.go @@ -128,6 +128,10 @@ type MultiStore interface { // call CacheMultiStore.Write(). CacheMultiStore() CacheMultiStore + // CacheMultiStoreWithVersion branches the underlying MultiStore where + // each stored is loaded at a specific version (height). + CacheMultiStoreWithVersion(version int64) (CacheMultiStore, error) + // Convenience for fetching substores. // If the store does not exist, panics. GetStore(StoreKey) Store @@ -146,14 +150,6 @@ type MultiStore interface { // implied that the caller should update the context when necessary between // tracing operations. The modified MultiStore is returned. SetTracingContext(TraceContext) MultiStore -} - -type RootMultiStore interface { - MultiStore - - // CacheMultiStoreWithVersion branches the underlying MultiStore where - // each stored is loaded at a specific version (height). - CacheMultiStoreWithVersion(version int64) (CacheMultiStore, error) // LatestVersion returns the latest version in the store LatestVersion() int64 @@ -170,7 +166,7 @@ type CacheMultiStore interface { // CommitMultiStore is an interface for a MultiStore without cache capabilities. type CommitMultiStore interface { Committer - RootMultiStore + MultiStore snapshottypes.Snapshotter // Mount a store of type using the given db. @@ -341,11 +337,12 @@ type CommitKVStore interface { // a Committer, since Commit ephemeral store make no sense. It can return KVStore, // HeapStore, SpaceStore, etc. type CacheWrap interface { - CacheWrapper - // Write syncs with the underlying store. Write() + // CacheWrap recursively wraps again. + CacheWrap() CacheWrap + // Discard the write set Discard() } diff --git a/x/bank/abci.go b/x/bank/abci.go index 1e58f3cc0a2a..91985ab6b9ef 100644 --- a/x/bank/abci.go +++ b/x/bank/abci.go @@ -8,4 +8,5 @@ import ( // EndBlocker is called every block, emits balance event func EndBlocker(ctx sdk.Context, k keeper.Keeper) { k.EmitAllTransientBalances(ctx) + k.CreditVirtualAccounts(ctx) } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index c9fbc9c883f4..423fdf2996b3 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -233,7 +233,7 @@ func (k BaseSendKeeper) sendCoin(ctx context.Context, fromAddr, toAddr sdk.AccAd } k.ensureAccountCreated(ctx, toAddr) - k.emitSendCoinsEvents(ctx, fromAddr, toAddr, amt) + k.emitSendCoinEvents(ctx, fromAddr, toAddr, amt) return nil } @@ -250,22 +250,23 @@ func (k BaseSendKeeper) ensureAccountCreated(ctx context.Context, toAddr sdk.Acc } // emitSendCoinsEvents emit send coins events. -func (k BaseSendKeeper) emitSendCoinsEvents(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) { +func (k BaseSendKeeper) emitSendCoinEvents(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) { + // bech32 encoding is expensive! Only do it once for fromAddr // bech32 encoding is expensive! Only do it once for fromAddr fromAddrString := fromAddr.String() sdkCtx := sdk.UnwrapSDKContext(ctx) - sdkCtx.EventManager().EmitEvent( + sdkCtx.EventManager().EmitEvents(sdk.Events{ sdk.NewEvent( types.EventTypeTransfer, sdk.NewAttribute(types.AttributeKeyRecipient, toAddr.String()), - sdk.NewAttribute(types.AttributeKeySender, fromAddr.String()), + sdk.NewAttribute(types.AttributeKeySender, fromAddrString), sdk.NewAttribute(sdk.AttributeKeyAmount, amt.String()), ), sdk.NewEvent( sdk.EventTypeMessage, sdk.NewAttribute(types.AttributeKeySender, fromAddrString), ), - ) + }) } // validateCoinsBeforeSend is checks extracted from subUnlockedCoins to be run before sendRestrictionFn inside SendCoins diff --git a/x/bank/keeper/virtual.go b/x/bank/keeper/virtual.go index f7288e7e0b52..e6c8400a469e 100644 --- a/x/bank/keeper/virtual.go +++ b/x/bank/keeper/virtual.go @@ -44,46 +44,49 @@ func (k BaseSendKeeper) SendCoinsFromModuleToAccountVirtual( // which are sumed up and added to the real account at the end of block. // Events are emiited the same as normal send. func (k BaseSendKeeper) SendCoinsToVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { - var err error - err = k.subUnlockedCoins(ctx, fromAddr, amt) - if err != nil { - return err - } + for _, coin := range amt { + newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) + if err != nil { + return err + } - toAddr, err = k.sendRestriction.apply(ctx, fromAddr, toAddr, amt) - if err != nil { - return err + err = k.subUnlockedCoins(ctx, fromAddr, sdk.NewCoins(coin), false) + if err != nil { + return err + } + + k.addVirtualCoin(ctx, newToAddr, coin) + k.emitSendCoinEvents(ctx, fromAddr, toAddr, coin) } - k.addVirtualCoins(ctx, toAddr, amt) - k.emitSendCoinsEvents(ctx, fromAddr, toAddr, amt) return nil } // SendCoinsFromVirtual deduct coins from virtual from account and send to recipient account. func (k BaseSendKeeper) SendCoinsFromVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { - var err error - err = k.subVirtualCoins(ctx, fromAddr, amt) - if err != nil { - return err - } + for _, coin := range amt { + toAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) + if err != nil { + return err + } - toAddr, err = k.sendRestriction.apply(ctx, fromAddr, toAddr, amt) - if err != nil { - return err - } + err = k.subVirtualCoin(ctx, fromAddr, coin) + if err != nil { + return err + } - err = k.addCoins(ctx, toAddr, amt) - if err != nil { - return err - } + err = k.addCoins(ctx, toAddr, sdk.NewCoins(coin)) + if err != nil { + return err + } - k.ensureAccountCreated(ctx, toAddr) - k.emitSendCoinsEvents(ctx, fromAddr, toAddr, amt) + k.ensureAccountCreated(ctx, toAddr) + k.emitSendCoinEvents(ctx, fromAddr, toAddr, coin) + } return nil } -func (k BaseSendKeeper) addVirtualCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) { +func (k BaseSendKeeper) addVirtualCoin(ctx context.Context, addr sdk.AccAddress, amt sdk.Coin) { sdkCtx := sdk.UnwrapSDKContext(ctx) store := sdkCtx.ObjectStore(k.objStoreKey) @@ -96,11 +99,11 @@ func (k BaseSendKeeper) addVirtualCoins(ctx context.Context, addr sdk.AccAddress if value != nil { coins = value.(sdk.Coins) } - coins = coins.Add(amt...) + coins = coins.Add(amt) store.Set(key, coins) } -func (k BaseSendKeeper) subVirtualCoins(ctx context.Context, addr sdk.AccAddress, amt sdk.Coins) error { +func (k BaseSendKeeper) subVirtualCoin(ctx context.Context, addr sdk.AccAddress, amt sdk.Coin) error { sdkCtx := sdk.UnwrapSDKContext(ctx) store := sdkCtx.ObjectStore(k.objStoreKey) @@ -117,7 +120,7 @@ func (k BaseSendKeeper) subVirtualCoins(ctx context.Context, addr sdk.AccAddress ) } spendable := value.(sdk.Coins) - balance, hasNeg := spendable.SafeSub(amt...) + balance, hasNeg := spendable.SafeSub(amt) if hasNeg { return errorsmod.Wrapf( sdkerrors.ErrInsufficientFunds, diff --git a/x/bank/module.go b/x/bank/module.go index fcc450dfb066..628fa66fdddc 100644 --- a/x/bank/module.go +++ b/x/bank/module.go @@ -206,10 +206,6 @@ func (am AppModule) WeightedOperations(simState module.SimulationState) []simtyp ) } -func (am AppModule) EndBlock(ctx context.Context) error { - return am.keeper.CreditVirtualAccounts(ctx) -} - // App Wiring Setup func init() { diff --git a/x/bank/types/restrictions.go b/x/bank/types/restrictions.go index a5d69dd92386..8cfd760d6015 100644 --- a/x/bank/types/restrictions.go +++ b/x/bank/types/restrictions.go @@ -57,9 +57,6 @@ type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (SendRestrictionFn) IsOnePerModuleType() {} -// IsOnePerModuleType implements the depinject.OnePerModuleType interface. -func (SendRestrictionFn) IsOnePerModuleType() {} - var _ SendRestrictionFn = NoOpSendRestrictionFn // NoOpSendRestrictionFn is a no-op SendRestrictionFn. From dee892be6d185a2219cee2f1c1336b1f550457bd Mon Sep 17 00:00:00 2001 From: kakysha Date: Thu, 25 Jul 2024 19:30:10 +0300 Subject: [PATCH 30/37] fix: compilation --- baseapp/options.go | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/baseapp/options.go b/baseapp/options.go index 701ff1f04d19..cb6491d5eadb 100644 --- a/baseapp/options.go +++ b/baseapp/options.go @@ -408,13 +408,3 @@ func (app *BaseApp) SetGRPCQueryRouter(grpcQueryRouter *GRPCQueryRouter) { func (app *BaseApp) SetTxExecutor(executor TxExecutor) { app.txExecutor = executor } - -// SetMsgServiceRouter sets the MsgServiceRouter of a BaseApp. -func (app *BaseApp) SetMsgServiceRouter(msgServiceRouter *MsgServiceRouter) { - app.msgServiceRouter = msgServiceRouter -} - -// SetGRPCQueryRouter sets the GRPCQueryRouter of the BaseApp. -func (app *BaseApp) SetGRPCQueryRouter(grpcQueryRouter *GRPCQueryRouter) { - app.grpcQueryRouter = grpcQueryRouter -} From 7ccb4edfc77f77d2d960c5efcb14b38bb4fcbf76 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Wed, 4 Sep 2024 11:02:53 +0200 Subject: [PATCH 31/37] chore: fix compile --- store/iavl/store_test.go | 6 +++--- store/rootmulti/proof_test.go | 2 +- store/types/iterator_test.go | 2 +- x/bank/keeper/send.go | 6 +++--- x/bank/keeper/virtual.go | 4 ++-- x/bank/types/restrictions.go | 6 +++--- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/store/iavl/store_test.go b/store/iavl/store_test.go index 46d9fa62371c..2d50f737b465 100644 --- a/store/iavl/store_test.go +++ b/store/iavl/store_test.go @@ -105,17 +105,17 @@ func TestLoadStore(t *testing.T) { require.Equal(t, string(hcStore.Get([]byte("hello"))), "ciao") // Querying a new store at some previous non-pruned height H - newHStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDH, DefaultIAVLCacheSize, false, metrics.NewNoOpMetrics()) + newHStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDH, DefaultIAVLCacheSize, false, false, metrics.NewNoOpMetrics()) require.NoError(t, err) require.Equal(t, string(newHStore.Get([]byte("hello"))), "hallo") // Querying a new store at some previous pruned height Hp - newHpStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHp, DefaultIAVLCacheSize, false, metrics.NewNoOpMetrics()) + newHpStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHp, DefaultIAVLCacheSize, false, false, metrics.NewNoOpMetrics()) require.NoError(t, err) require.Equal(t, string(newHpStore.Get([]byte("hello"))), "hola") // Querying a new store at current height H - newHcStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHc, DefaultIAVLCacheSize, false, metrics.NewNoOpMetrics()) + newHcStore, err := LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), cIDHc, DefaultIAVLCacheSize, false, false, metrics.NewNoOpMetrics()) require.NoError(t, err) require.Equal(t, string(newHcStore.Get([]byte("hello"))), "ciao") } diff --git a/store/rootmulti/proof_test.go b/store/rootmulti/proof_test.go index d573937c3d08..5b2f0d295521 100644 --- a/store/rootmulti/proof_test.go +++ b/store/rootmulti/proof_test.go @@ -15,7 +15,7 @@ import ( func TestVerifyIAVLStoreQueryProof(t *testing.T) { // Create main tree for testing. db := dbm.NewMemDB() - iStore, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, iavl.DefaultIAVLCacheSize, false, metrics.NewNoOpMetrics()) + iStore, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, iavl.DefaultIAVLCacheSize, false, false, metrics.NewNoOpMetrics()) store := iStore.(*iavl.Store) require.Nil(t, err) store.Set([]byte("MYKEY"), []byte("MYVALUE")) diff --git a/store/types/iterator_test.go b/store/types/iterator_test.go index a804b092c8ea..2c6538e5acbf 100644 --- a/store/types/iterator_test.go +++ b/store/types/iterator_test.go @@ -15,7 +15,7 @@ import ( func newMemTestKVStore(t *testing.T) types.KVStore { t.Helper() db := dbm.NewMemDB() - store, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, iavl.DefaultIAVLCacheSize, false, metrics.NewNoOpMetrics()) + store, err := iavl.LoadStore(db, log.NewNopLogger(), types.NewKVStoreKey("test"), types.CommitID{}, iavl.DefaultIAVLCacheSize, false, false, metrics.NewNoOpMetrics()) require.NoError(t, err) return store } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index ea3636243661..3f0bdc6036e4 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -168,7 +168,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, } for _, coin := range out.Coins { - newOutAddress, err := k.sendRestriction.apply(ctx, inAddress, outAddress, coin) + newOutAddress, err := k.sendRestriction.apply(ctx, inAddress, outAddress, sdk.NewCoins(coin)) if err != nil { return err } @@ -199,7 +199,7 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA } for _, coin := range amt { - newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) + newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, sdk.NewCoins(coin)) if err != nil { return err } @@ -539,7 +539,7 @@ func (r *sendRestriction) clear() { var _ types.SendRestrictionFn = (*sendRestriction)(nil).apply // apply applies the send restriction if there is one. If not, it's a no-op. -func (r *sendRestriction) apply(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { +func (r *sendRestriction) apply(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { if r == nil || r.fn == nil { return toAddr, nil } diff --git a/x/bank/keeper/virtual.go b/x/bank/keeper/virtual.go index e6c8400a469e..5ae48918de0e 100644 --- a/x/bank/keeper/virtual.go +++ b/x/bank/keeper/virtual.go @@ -45,7 +45,7 @@ func (k BaseSendKeeper) SendCoinsFromModuleToAccountVirtual( // Events are emiited the same as normal send. func (k BaseSendKeeper) SendCoinsToVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { for _, coin := range amt { - newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) + newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, sdk.NewCoins(coin)) if err != nil { return err } @@ -65,7 +65,7 @@ func (k BaseSendKeeper) SendCoinsToVirtual(ctx context.Context, fromAddr, toAddr // SendCoinsFromVirtual deduct coins from virtual from account and send to recipient account. func (k BaseSendKeeper) SendCoinsFromVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { for _, coin := range amt { - toAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) + toAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, sdk.NewCoins(coin)) if err != nil { return err } diff --git a/x/bank/types/restrictions.go b/x/bank/types/restrictions.go index 8cfd760d6015..2ec4489a0978 100644 --- a/x/bank/types/restrictions.go +++ b/x/bank/types/restrictions.go @@ -52,7 +52,7 @@ func ComposeMintingRestrictions(restrictions ...MintingRestrictionFn) MintingRes } // A SendRestrictionFn can restrict sends and/or provide a new receiver address. -type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (newToAddr sdk.AccAddress, err error) +type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (SendRestrictionFn) IsOnePerModuleType() {} @@ -60,7 +60,7 @@ func (SendRestrictionFn) IsOnePerModuleType() {} var _ SendRestrictionFn = NoOpSendRestrictionFn // NoOpSendRestrictionFn is a no-op SendRestrictionFn. -func NoOpSendRestrictionFn(_ context.Context, _, toAddr sdk.AccAddress, _ sdk.Coin) (sdk.AccAddress, error) { +func NoOpSendRestrictionFn(_ context.Context, _, toAddr sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { return toAddr, nil } @@ -89,7 +89,7 @@ func ComposeSendRestrictions(restrictions ...SendRestrictionFn) SendRestrictionF case 1: return toRun[0] } - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { var err error for _, r := range toRun { toAddr, err = r(ctx, fromAddr, toAddr, amt) From 69713c669d56a6938461c9e95a8a4c394168df64 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Wed, 4 Sep 2024 15:48:40 +0200 Subject: [PATCH 32/37] chore: revert changes to SendRestrictionFn --- x/bank/keeper/keeper_test.go | 40 +++++++++++++++---------------- x/bank/keeper/send.go | 6 ++--- x/bank/keeper/virtual.go | 4 ++-- x/bank/types/restrictions.go | 6 ++--- x/bank/types/restrictions_test.go | 14 +++++------ 5 files changed, 35 insertions(+), 35 deletions(-) diff --git a/x/bank/keeper/keeper_test.go b/x/bank/keeper/keeper_test.go index 11b25a0f6183..f6c4fe7ecb12 100644 --- a/x/bank/keeper/keeper_test.go +++ b/x/bank/keeper/keeper_test.go @@ -270,7 +270,7 @@ func (suite *KeeperTestSuite) mockUnDelegateCoins(ctx context.Context, acc, mAcc func (suite *KeeperTestSuite) TestAppendSendRestriction() { var calls []int testRestriction := func(index int) banktypes.SendRestrictionFn { - return func(_ context.Context, _, _ sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { + return func(_ context.Context, _, _ sdk.AccAddress, _ sdk.Coin) (sdk.AccAddress, error) { calls = append(calls, index) return nil, nil } @@ -281,25 +281,25 @@ func (suite *KeeperTestSuite) TestAppendSendRestriction() { // Initial append of the test restriction. bk.SetSendRestriction(nil) bk.AppendSendRestriction(testRestriction(1)) - _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, sdk.Coin{}) suite.Require().Equal([]int{1}, calls, "restriction calls after first append") // Append the test restriction again. calls = nil bk.AppendSendRestriction(testRestriction(2)) - _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, sdk.Coin{}) suite.Require().Equal([]int{1, 2}, calls, "restriction calls after second append") // make sure the original bank keeper has the restrictions too. calls = nil - _, _ = suite.bankKeeper.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + _, _ = suite.bankKeeper.GetSendRestrictionFn()(suite.ctx, nil, nil, sdk.Coin{}) suite.Require().Equal([]int{1, 2}, calls, "restriction calls from original bank keeper") } func (suite *KeeperTestSuite) TestPrependSendRestriction() { var calls []int testRestriction := func(index int) banktypes.SendRestrictionFn { - return func(_ context.Context, _, _ sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { + return func(_ context.Context, _, _ sdk.AccAddress, _ sdk.Coin) (sdk.AccAddress, error) { calls = append(calls, index) return nil, nil } @@ -310,18 +310,18 @@ func (suite *KeeperTestSuite) TestPrependSendRestriction() { // Initial append of the test restriction. bk.SetSendRestriction(nil) bk.PrependSendRestriction(testRestriction(1)) - _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, sdk.Coin{}) suite.Require().Equal([]int{1}, calls, "restriction calls after first append") // Append the test restriction again. calls = nil bk.PrependSendRestriction(testRestriction(2)) - _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + _, _ = bk.GetSendRestrictionFn()(suite.ctx, nil, nil, sdk.Coin{}) suite.Require().Equal([]int{2, 1}, calls, "restriction calls after second append") // make sure the original bank keeper has the restrictions too. calls = nil - _, _ = suite.bankKeeper.GetSendRestrictionFn()(suite.ctx, nil, nil, nil) + _, _ = suite.bankKeeper.GetSendRestrictionFn()(suite.ctx, nil, nil, sdk.Coin{}) suite.Require().Equal([]int{2, 1}, calls, "restriction calls from original bank keeper") } @@ -770,12 +770,12 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { var actualRestrictionArgs []*restrictionArgs restrictionError := func(messages ...string) banktypes.SendRestrictionFn { i := -1 - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { actualRestrictionArgs = append(actualRestrictionArgs, &restrictionArgs{ ctx: ctx, fromAddr: fromAddr, toAddr: toAddr, - amt: amt, + amt: sdk.NewCoins(amt), }) i++ if i < len(messages) { @@ -787,24 +787,24 @@ func (suite *KeeperTestSuite) TestInputOutputCoinsWithRestrictions() { } } restrictionPassthrough := func() banktypes.SendRestrictionFn { - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { actualRestrictionArgs = append(actualRestrictionArgs, &restrictionArgs{ ctx: ctx, fromAddr: fromAddr, toAddr: toAddr, - amt: amt, + amt: sdk.NewCoins(amt), }) return toAddr, nil } } restrictionNewTo := func(newToAddrs ...sdk.AccAddress) banktypes.SendRestrictionFn { i := -1 - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { actualRestrictionArgs = append(actualRestrictionArgs, &restrictionArgs{ ctx: ctx, fromAddr: fromAddr, toAddr: toAddr, - amt: amt, + amt: sdk.NewCoins(amt), }) i++ if i < len(newToAddrs) { @@ -1094,34 +1094,34 @@ func (suite *KeeperTestSuite) TestSendCoinsWithRestrictions() { } var actualRestrictionArgs *restrictionArgs restrictionError := func(message string) banktypes.SendRestrictionFn { - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { actualRestrictionArgs = &restrictionArgs{ ctx: ctx, fromAddr: fromAddr, toAddr: toAddr, - amt: amt, + amt: sdk.NewCoins(amt), } return nil, errors.New(message) } } restrictionPassthrough := func() banktypes.SendRestrictionFn { - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { actualRestrictionArgs = &restrictionArgs{ ctx: ctx, fromAddr: fromAddr, toAddr: toAddr, - amt: amt, + amt: sdk.NewCoins(amt), } return toAddr, nil } } restrictionNewTo := func(newToAddr sdk.AccAddress) banktypes.SendRestrictionFn { - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { actualRestrictionArgs = &restrictionArgs{ ctx: ctx, fromAddr: fromAddr, toAddr: toAddr, - amt: amt, + amt: sdk.NewCoins(amt), } return newToAddr, nil } diff --git a/x/bank/keeper/send.go b/x/bank/keeper/send.go index 3f0bdc6036e4..ea3636243661 100644 --- a/x/bank/keeper/send.go +++ b/x/bank/keeper/send.go @@ -168,7 +168,7 @@ func (k BaseSendKeeper) InputOutputCoins(ctx context.Context, input types.Input, } for _, coin := range out.Coins { - newOutAddress, err := k.sendRestriction.apply(ctx, inAddress, outAddress, sdk.NewCoins(coin)) + newOutAddress, err := k.sendRestriction.apply(ctx, inAddress, outAddress, coin) if err != nil { return err } @@ -199,7 +199,7 @@ func (k BaseSendKeeper) SendCoins(ctx context.Context, fromAddr, toAddr sdk.AccA } for _, coin := range amt { - newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, sdk.NewCoins(coin)) + newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) if err != nil { return err } @@ -539,7 +539,7 @@ func (r *sendRestriction) clear() { var _ types.SendRestrictionFn = (*sendRestriction)(nil).apply // apply applies the send restriction if there is one. If not, it's a no-op. -func (r *sendRestriction) apply(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { +func (r *sendRestriction) apply(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { if r == nil || r.fn == nil { return toAddr, nil } diff --git a/x/bank/keeper/virtual.go b/x/bank/keeper/virtual.go index 5ae48918de0e..e6c8400a469e 100644 --- a/x/bank/keeper/virtual.go +++ b/x/bank/keeper/virtual.go @@ -45,7 +45,7 @@ func (k BaseSendKeeper) SendCoinsFromModuleToAccountVirtual( // Events are emiited the same as normal send. func (k BaseSendKeeper) SendCoinsToVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { for _, coin := range amt { - newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, sdk.NewCoins(coin)) + newToAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) if err != nil { return err } @@ -65,7 +65,7 @@ func (k BaseSendKeeper) SendCoinsToVirtual(ctx context.Context, fromAddr, toAddr // SendCoinsFromVirtual deduct coins from virtual from account and send to recipient account. func (k BaseSendKeeper) SendCoinsFromVirtual(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) error { for _, coin := range amt { - toAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, sdk.NewCoins(coin)) + toAddr, err := k.sendRestriction.apply(ctx, fromAddr, toAddr, coin) if err != nil { return err } diff --git a/x/bank/types/restrictions.go b/x/bank/types/restrictions.go index 2ec4489a0978..8cfd760d6015 100644 --- a/x/bank/types/restrictions.go +++ b/x/bank/types/restrictions.go @@ -52,7 +52,7 @@ func ComposeMintingRestrictions(restrictions ...MintingRestrictionFn) MintingRes } // A SendRestrictionFn can restrict sends and/or provide a new receiver address. -type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (newToAddr sdk.AccAddress, err error) +type SendRestrictionFn func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (newToAddr sdk.AccAddress, err error) // IsOnePerModuleType implements the depinject.OnePerModuleType interface. func (SendRestrictionFn) IsOnePerModuleType() {} @@ -60,7 +60,7 @@ func (SendRestrictionFn) IsOnePerModuleType() {} var _ SendRestrictionFn = NoOpSendRestrictionFn // NoOpSendRestrictionFn is a no-op SendRestrictionFn. -func NoOpSendRestrictionFn(_ context.Context, _, toAddr sdk.AccAddress, _ sdk.Coins) (sdk.AccAddress, error) { +func NoOpSendRestrictionFn(_ context.Context, _, toAddr sdk.AccAddress, _ sdk.Coin) (sdk.AccAddress, error) { return toAddr, nil } @@ -89,7 +89,7 @@ func ComposeSendRestrictions(restrictions ...SendRestrictionFn) SendRestrictionF case 1: return toRun[0] } - return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coins) (sdk.AccAddress, error) { + return func(ctx context.Context, fromAddr, toAddr sdk.AccAddress, amt sdk.Coin) (sdk.AccAddress, error) { var err error for _, r := range toRun { toAddr, err = r(ctx, fromAddr, toAddr, amt) diff --git a/x/bank/types/restrictions_test.go b/x/bank/types/restrictions_test.go index 47cb047da9fc..9208848e686b 100644 --- a/x/bank/types/restrictions_test.go +++ b/x/bank/types/restrictions_test.go @@ -433,24 +433,24 @@ func (s *SendRestrictionTestHelper) NewArgs(name string, fromAddr, toAddr sdk.Ac // NamedRestriction creates a new SendRestrictionFn function that records the arguments it's called with and returns the provided toAddr. func (s *SendRestrictionTestHelper) NamedRestriction(name string) types.SendRestrictionFn { - return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) (sdk.AccAddress, error) { - s.RecordCall(name, fromAddr, toAddr, coins) + return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) (sdk.AccAddress, error) { + s.RecordCall(name, fromAddr, toAddr, sdk.NewCoins(coin)) return toAddr, nil } } // NewToRestriction creates a new SendRestrictionFn function that returns a different toAddr than provided. func (s *SendRestrictionTestHelper) NewToRestriction(name string, addr sdk.AccAddress) types.SendRestrictionFn { - return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) (sdk.AccAddress, error) { - s.RecordCall(name, fromAddr, toAddr, coins) + return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) (sdk.AccAddress, error) { + s.RecordCall(name, fromAddr, toAddr, sdk.NewCoins(coin)) return addr, nil } } // ErrorRestriction creates a new SendRestrictionFn function that returns a nil toAddr and an error. func (s *SendRestrictionTestHelper) ErrorRestriction(message string) types.SendRestrictionFn { - return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) (sdk.AccAddress, error) { - s.RecordCall(message, fromAddr, toAddr, coins) + return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) (sdk.AccAddress, error) { + s.RecordCall(message, fromAddr, toAddr, sdk.NewCoins(coin)) return nil, errors.New(message) } } @@ -911,7 +911,7 @@ func TestNoOpSendRestrictionFn(t *testing.T) { var addr sdk.AccAddress var err error testFunc := func() { - addr, err = types.NoOpSendRestrictionFn(sdk.Context{}, sdk.AccAddress("first_addr"), expAddr, sdk.Coins{}) + addr, err = types.NoOpSendRestrictionFn(sdk.Context{}, sdk.AccAddress("first_addr"), expAddr, sdk.Coin{}) } require.NotPanics(t, testFunc, "NoOpSendRestrictionFn") assert.NoError(t, err, "NoOpSendRestrictionFn error") From b4127ecb541033d15097f5c6bd190413c4e266c4 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Wed, 4 Sep 2024 16:08:03 +0200 Subject: [PATCH 33/37] chore: fix compile bank/types/restrictions_test --- x/bank/types/restrictions_test.go | 160 +++++++++++++++--------------- 1 file changed, 80 insertions(+), 80 deletions(-) diff --git a/x/bank/types/restrictions_test.go b/x/bank/types/restrictions_test.go index 9208848e686b..b41f0a01fb54 100644 --- a/x/bank/types/restrictions_test.go +++ b/x/bank/types/restrictions_test.go @@ -399,7 +399,7 @@ type SendRestrictionArgs struct { Name string FromAddr sdk.AccAddress ToAddr sdk.AccAddress - Coins sdk.Coins + Coin sdk.Coin } // SendRestrictionTestHelper is a struct with stuff helpful for testing the SendRestrictionFn stuff. @@ -412,8 +412,8 @@ func NewSendRestrictionTestHelper() *SendRestrictionTestHelper { } // RecordCall makes note that the provided args were used as a funcion call. -func (s *SendRestrictionTestHelper) RecordCall(name string, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) { - s.Calls = append(s.Calls, s.NewArgs(name, fromAddr, toAddr, coins)) +func (s *SendRestrictionTestHelper) RecordCall(name string, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) { + s.Calls = append(s.Calls, s.NewArgs(name, fromAddr, toAddr, coin)) } // NewCalls is just a shorter way to create a []*SendRestrictionArgs. @@ -422,19 +422,19 @@ func (s *SendRestrictionTestHelper) NewCalls(args ...*SendRestrictionArgs) []*Se } // NewArgs creates a new SendRestrictionArgs. -func (s *SendRestrictionTestHelper) NewArgs(name string, fromAddr, toAddr sdk.AccAddress, coins sdk.Coins) *SendRestrictionArgs { +func (s *SendRestrictionTestHelper) NewArgs(name string, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) *SendRestrictionArgs { return &SendRestrictionArgs{ Name: name, FromAddr: fromAddr, ToAddr: toAddr, - Coins: coins, + Coin: coin, } } // NamedRestriction creates a new SendRestrictionFn function that records the arguments it's called with and returns the provided toAddr. func (s *SendRestrictionTestHelper) NamedRestriction(name string) types.SendRestrictionFn { return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) (sdk.AccAddress, error) { - s.RecordCall(name, fromAddr, toAddr, sdk.NewCoins(coin)) + s.RecordCall(name, fromAddr, toAddr, coin) return toAddr, nil } } @@ -442,7 +442,7 @@ func (s *SendRestrictionTestHelper) NamedRestriction(name string) types.SendRest // NewToRestriction creates a new SendRestrictionFn function that returns a different toAddr than provided. func (s *SendRestrictionTestHelper) NewToRestriction(name string, addr sdk.AccAddress) types.SendRestrictionFn { return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) (sdk.AccAddress, error) { - s.RecordCall(name, fromAddr, toAddr, sdk.NewCoins(coin)) + s.RecordCall(name, fromAddr, toAddr, coin) return addr, nil } } @@ -450,7 +450,7 @@ func (s *SendRestrictionTestHelper) NewToRestriction(name string, addr sdk.AccAd // ErrorRestriction creates a new SendRestrictionFn function that returns a nil toAddr and an error. func (s *SendRestrictionTestHelper) ErrorRestriction(message string) types.SendRestrictionFn { return func(_ context.Context, fromAddr, toAddr sdk.AccAddress, coin sdk.Coin) (sdk.AccAddress, error) { - s.RecordCall(message, fromAddr, toAddr, sdk.NewCoins(coin)) + s.RecordCall(message, fromAddr, toAddr, coin) return nil, errors.New(message) } } @@ -464,8 +464,8 @@ type SendRestrictionTestParams struct { FromAddr sdk.AccAddress // ToAddr is the SendRestrictionFn toAddr input. ToAddr sdk.AccAddress - // Coins is the SendRestrictionFn coins input. - Coins sdk.Coins + // Coin is the SendRestrictionFn coin input. + Coin sdk.Coin // ExpAddr is the expected return address. ExpAddr sdk.AccAddress // ExpErr is the expected return error string. @@ -482,7 +482,7 @@ func (s *SendRestrictionTestHelper) TestActual(t *testing.T, tp *SendRestriction } else { require.NotNil(t, actual, "resulting SendRestrictionFn") s.Calls = s.Calls[:0] - addr, err := actual(sdk.Context{}, tp.FromAddr, tp.ToAddr, tp.Coins) + addr, err := actual(sdk.Context{}, tp.FromAddr, tp.ToAddr, tp.Coin) if len(tp.ExpErr) != 0 { assert.EqualError(t, err, tp.ExpErr, "composite SendRestrictionFn output error") } else { @@ -500,7 +500,7 @@ func TestSendRestriction_Then(t *testing.T) { addr2 := sdk.AccAddress("2addr_______________") addr3 := sdk.AccAddress("3addr_______________") addr4 := sdk.AccAddress("4addr_______________") - coins := sdk.NewCoins(sdk.NewInt64Coin("ecoin", 32), sdk.NewInt64Coin("fcoin", 64)) + coin := sdk.NewInt64Coin("ecoin", 32) h := NewSendRestrictionTestHelper() @@ -525,9 +525,9 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: addr1, - ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coins)), + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coin)), }, }, { @@ -537,9 +537,9 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: addr1, - ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coins)), + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coin)), }, }, { @@ -549,11 +549,11 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: addr1, ExpCalls: h.NewCalls( - h.NewArgs("noop1", fromAddr, addr1, coins), - h.NewArgs("noop2", fromAddr, addr1, coins), + h.NewArgs("noop1", fromAddr, addr1, coin), + h.NewArgs("noop2", fromAddr, addr1, coin), ), }, }, @@ -564,11 +564,11 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: addr3, ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr1, coins), - h.NewArgs("r2", fromAddr, addr2, coins), + h.NewArgs("r1", fromAddr, addr1, coin), + h.NewArgs("r2", fromAddr, addr2, coin), ), }, }, @@ -579,12 +579,12 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "this is a test error", ExpCalls: h.NewCalls(h.NewArgs( - "r1", fromAddr, addr1, coins), - h.NewArgs("this is a test error", fromAddr, addr2, coins), + "r1", fromAddr, addr1, coin), + h.NewArgs("this is a test error", fromAddr, addr2, coin), ), }, }, @@ -595,10 +595,10 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "another test error", - ExpCalls: h.NewCalls(h.NewArgs("another test error", fromAddr, addr1, coins)), + ExpCalls: h.NewCalls(h.NewArgs("another test error", fromAddr, addr1, coin)), }, }, { @@ -608,10 +608,10 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "first test error", - ExpCalls: h.NewCalls(h.NewArgs("first test error", fromAddr, addr1, coins)), + ExpCalls: h.NewCalls(h.NewArgs("first test error", fromAddr, addr1, coin)), }, }, { @@ -621,13 +621,13 @@ func TestSendRestriction_Then(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr0, - Coins: coins, + Coin: coin, ExpAddr: addr4, ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr0, coins), - h.NewArgs("r2", fromAddr, addr1, coins), - h.NewArgs("r3", fromAddr, addr2, coins), - h.NewArgs("r4", fromAddr, addr3, coins), + h.NewArgs("r1", fromAddr, addr0, coin), + h.NewArgs("r2", fromAddr, addr1, coin), + h.NewArgs("r3", fromAddr, addr2, coin), + h.NewArgs("r4", fromAddr, addr3, coin), ), }, }, @@ -655,7 +655,7 @@ func TestComposeSendRestrictions(t *testing.T) { addr2 := sdk.AccAddress("2addr_______________") addr3 := sdk.AccAddress("3addr_______________") addr4 := sdk.AccAddress("4addr_______________") - coins := sdk.NewCoins(sdk.NewInt64Coin("gcoin", 128), sdk.NewInt64Coin("hcoin", 256)) + coin := sdk.NewInt64Coin("gcoin", 128) h := NewSendRestrictionTestHelper() @@ -698,9 +698,9 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr0, - Coins: coins, + Coin: coin, ExpAddr: addr0, - ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr0, coins)), + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr0, coin)), }, }, { @@ -709,10 +709,10 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr0, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "test error", - ExpCalls: h.NewCalls(h.NewArgs("test error", fromAddr, addr0, coins)), + ExpCalls: h.NewCalls(h.NewArgs("test error", fromAddr, addr0, coin)), }, }, { @@ -721,9 +721,9 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr0, - Coins: coins, + Coin: coin, ExpAddr: addr0, - ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr0, coins)), + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr0, coin)), }, }, { @@ -732,9 +732,9 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: addr1, - ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coins)), + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr1, coin)), }, }, { @@ -743,9 +743,9 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr2, - Coins: coins, + Coin: coin, ExpAddr: addr2, - ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr2, coins)), + ExpCalls: h.NewCalls(h.NewArgs("noop", fromAddr, addr2, coin)), }, }, { @@ -754,11 +754,11 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr0, - Coins: coins, + Coin: coin, ExpAddr: addr0, ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr0, coins), - h.NewArgs("r2", fromAddr, addr0, coins), + h.NewArgs("r1", fromAddr, addr0, coin), + h.NewArgs("r2", fromAddr, addr0, coin), ), }, }, @@ -768,11 +768,11 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr1, - Coins: coins, + Coin: coin, ExpAddr: addr1, ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr1, coins), - h.NewArgs("r2", fromAddr, addr1, coins), + h.NewArgs("r1", fromAddr, addr1, coin), + h.NewArgs("r2", fromAddr, addr1, coin), ), }, }, @@ -782,11 +782,11 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr2, - Coins: coins, + Coin: coin, ExpAddr: addr2, ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr2, coins), - h.NewArgs("r2", fromAddr, addr2, coins), + h.NewArgs("r1", fromAddr, addr2, coin), + h.NewArgs("r2", fromAddr, addr2, coin), ), }, }, @@ -796,12 +796,12 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr3, - Coins: coins, + Coin: coin, ExpAddr: addr3, ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr3, coins), - h.NewArgs("r2", fromAddr, addr3, coins), - h.NewArgs("r3", fromAddr, addr3, coins), + h.NewArgs("r1", fromAddr, addr3, coin), + h.NewArgs("r2", fromAddr, addr3, coin), + h.NewArgs("r3", fromAddr, addr3, coin), ), }, }, @@ -811,10 +811,10 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr4, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "first error", - ExpCalls: h.NewCalls(h.NewArgs("first error", fromAddr, addr4, coins)), + ExpCalls: h.NewCalls(h.NewArgs("first error", fromAddr, addr4, coin)), }, }, { @@ -823,12 +823,12 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr4, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "second error", ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr4, coins), - h.NewArgs("second error", fromAddr, addr4, coins), + h.NewArgs("r1", fromAddr, addr4, coin), + h.NewArgs("second error", fromAddr, addr4, coin), ), }, }, @@ -838,13 +838,13 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr4, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "third error", ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr4, coins), - h.NewArgs("r2", fromAddr, addr4, coins), - h.NewArgs("third error", fromAddr, addr4, coins), + h.NewArgs("r1", fromAddr, addr4, coin), + h.NewArgs("r2", fromAddr, addr4, coin), + h.NewArgs("third error", fromAddr, addr4, coin), ), }, }, @@ -854,12 +854,12 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr4, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "second error", ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr4, coins), - h.NewArgs("second error", fromAddr, addr0, coins), + h.NewArgs("r1", fromAddr, addr4, coin), + h.NewArgs("second error", fromAddr, addr0, coin), ), }, }, @@ -876,19 +876,19 @@ func TestComposeSendRestrictions(t *testing.T) { exp: &SendRestrictionTestParams{ FromAddr: fromAddr, ToAddr: addr0, - Coins: coins, + Coin: coin, ExpAddr: nil, ExpErr: "oops, an error", ExpCalls: h.NewCalls( - h.NewArgs("r1", fromAddr, addr0, coins), - h.NewArgs("r2", fromAddr, addr0, coins), - h.NewArgs("r3", fromAddr, addr1, coins), - h.NewArgs("r4", fromAddr, addr1, coins), - h.NewArgs("r5", fromAddr, addr2, coins), - h.NewArgs("r6", fromAddr, addr3, coins), - h.NewArgs("r7", fromAddr, addr3, coins), - h.NewArgs("r8", fromAddr, addr4, coins), - h.NewArgs("oops, an error", fromAddr, addr4, coins), + h.NewArgs("r1", fromAddr, addr0, coin), + h.NewArgs("r2", fromAddr, addr0, coin), + h.NewArgs("r3", fromAddr, addr1, coin), + h.NewArgs("r4", fromAddr, addr1, coin), + h.NewArgs("r5", fromAddr, addr2, coin), + h.NewArgs("r6", fromAddr, addr3, coin), + h.NewArgs("r7", fromAddr, addr3, coin), + h.NewArgs("r8", fromAddr, addr4, coin), + h.NewArgs("oops, an error", fromAddr, addr4, coin), ), }, }, From 93c431f036324428a258a5a400403059770faac5 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Wed, 9 Oct 2024 12:24:36 +0200 Subject: [PATCH 34/37] feat: add LastBlockID to cometbft header --- baseapp/abci.go | 7 +++++++ go.mod | 4 ++-- go.sum | 26 ++++++++------------------ 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index 5afeef040702..600ad36e7e69 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -724,6 +724,13 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request ProposerAddress: req.ProposerAddress, NextValidatorsHash: req.NextValidatorsHash, AppHash: app.LastCommitID().Hash, + LastBlockId: cmtproto.BlockID{ + Hash: req.LastBlockHash, + PartSetHeader: cmtproto.PartSetHeader{ + Total: uint32(req.LastBlockPartSetTotal), + Hash: req.LastBlockPartSetHash, + }, + }, } // finalizeBlockState should be set on InitChain or ProcessProposal. If it is diff --git a/go.mod b/go.mod index 55e88b21b2c4..6fa07191e338 100644 --- a/go.mod +++ b/go.mod @@ -84,7 +84,7 @@ require ( github.com/Microsoft/go-winio v0.6.1 // indirect github.com/alexcesaro/statsd v2.0.0+incompatible // indirect github.com/beorn7/perks v1.0.1 // indirect - github.com/btcsuite/btcd/btcec/v2 v2.3.2 // indirect + github.com/btcsuite/btcd/btcec/v2 v2.3.4 // indirect github.com/bufbuild/protocompile v0.6.0 // indirect github.com/cenkalti/backoff/v4 v4.1.3 // indirect github.com/cespare/xxhash v1.1.0 // indirect @@ -208,7 +208,7 @@ replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-0 + github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-3 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 12a19cb633d1..176f88a55578 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/DataDog/sketches-go v1.4.2 h1:gppNudE9d19cQ98RYABOetxIhpTCl4m7CnbRZjv github.com/DataDog/sketches-go v1.4.2/go.mod h1:xJIXldczJyyjnbDop7ZZcLxJdV3+7Kra7H1KMgpgkLk= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/InjectiveLabs/cometbft v0.38.11-inj-0 h1:yf+qvOtlvmLZCBkQCInApRy9icp8+TuSWFwZwWPA5NU= -github.com/InjectiveLabs/cometbft v0.38.11-inj-0/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= +github.com/InjectiveLabs/cometbft v0.38.11-inj-3 h1:82i3DrztJxVs1R45wVTUKZ5+8g+HT5KPexu6mB92jaE= +github.com/InjectiveLabs/cometbft v0.38.11-inj-3/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240522173845-46ef88f66790 h1:F4FYZR9rLg9igzxitFdLU5s7ZU9XS0wUB7DbkBOVXc8= github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240522173845-46ef88f66790/go.mod h1:ZW4eIE98wivInyQyhxU2nHqEielc/iZAcr41qNyWSrw= github.com/InjectiveLabs/metrics v0.0.10 h1:BoOwXnCtRRIPmq06jcI20pXZYE758eusaCI5jDOoN4U= @@ -57,6 +57,7 @@ github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migc github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5 h1:TngWCqHvy9oXAN6lEVMRuU21PR1EtLVZJmdB18Gu3Rw= github.com/Nvveen/Gotty v0.0.0-20120604004816-cd527374f1e5/go.mod h1:lmUJ/7eu/Q8D7ML55dXQrVaamCz2vxCfdQBasLZfHKk= +github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo= github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI= @@ -93,8 +94,8 @@ github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816 h1:41iFGWnSlI2 github.com/bgentry/speakeasy v0.1.1-0.20220910012023-760eaf8b6816/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= github.com/bits-and-blooms/bitset v1.8.0 h1:FD+XqgOZDUxxZ8hzoBFuV9+cGWY9CslN6d5MS5JVb4c= github.com/bits-and-blooms/bitset v1.8.0/go.mod h1:7hO7Gc7Pp1vODcmWvKMRA9BNmbv6a/7QIWpPxHddWR8= -github.com/btcsuite/btcd/btcec/v2 v2.3.2 h1:5n0X6hX0Zk+6omWcihdYvdAlGf2DfasC0GMf7DClJ3U= -github.com/btcsuite/btcd/btcec/v2 v2.3.2/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= +github.com/btcsuite/btcd/btcec/v2 v2.3.4 h1:3EJjcN70HCu/mwqlUsGK8GcNVyLVxFDlWurTXGPFfiQ= +github.com/btcsuite/btcd/btcec/v2 v2.3.4/go.mod h1:zYzJ8etWJQIv1Ogk7OzpWjowwOdXY1W/17j2MW85J04= github.com/btcsuite/btcd/btcutil v1.1.3 h1:xfbtw8lwpp0G6NwSHb+UE67ryTFHJAiNuipusjXSohQ= github.com/btcsuite/btcd/btcutil v1.1.3/go.mod h1:UR7dsSJzJUfMmFiiLlIrMq1lS9jh9EdCV7FStZSnpi0= github.com/btcsuite/btcd/chaincfg/chainhash v1.0.1 h1:q0rUy8C/TYNBQS1+CGKw68tLOFYSNEs0TFnxxnS9+4U= @@ -112,6 +113,7 @@ github.com/cenkalti/backoff/v4 v4.1.1/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInq github.com/cenkalti/backoff/v4 v4.1.3 h1:cFAlzYUlVYDysBEH2T5hyJZMh3+5+WCBvSnK6Q8UtC4= github.com/cenkalti/backoff/v4 v4.1.3/go.mod h1:scbssz8iZGpm3xbr14ovlUdkxfGXNInqkPWOWmG2CLw= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +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.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= @@ -158,9 +160,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= +github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= -github.com/cometbft/cometbft-db v0.12.0 h1:v77/z0VyfSU7k682IzZeZPFZrQAKiQwkqGN0QzAjMi0= -github.com/cometbft/cometbft-db v0.12.0/go.mod h1:aX2NbCrjNVd2ZajYxt1BsiFf/Z+TQ2MN0VxdicheYuw= github.com/containerd/continuity v0.3.0 h1:nisirsYROK15TAMVukJOUyGJjz4BNQJBVsNvAXZJ/eg= github.com/containerd/continuity v0.3.0/go.mod h1:wJEAIwKOm/pBZuBd0JmeTvnLquTB1Ag8espWhkykbPM= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -207,9 +208,8 @@ github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etly github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f h1:U5y3Y5UE0w7amNe7Z5G/twsBW0KEalRQXZzf8ufSh9I= github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f/go.mod h1:xH/i4TFMt8koVQZ6WFms69WAsDWr2XsYL3Hkl7jkoLE= +github.com/dgraph-io/badger/v2 v2.2007.4 h1:TRWBQg8UrlUhaFdco01nO2uXwzKS7zd+HVdwV/GHc4o= github.com/dgraph-io/badger/v2 v2.2007.4/go.mod h1:vSw/ax2qojzbN6eXHIx6KPKtCSHJN/Uz0X0VPruTIhk= -github.com/dgraph-io/badger/v4 v4.2.0 h1:kJrlajbXXL9DFTNuhhu9yCx7JJa4qpYWxtE8BzuWsEs= -github.com/dgraph-io/badger/v4 v4.2.0/go.mod h1:qfCqhPoWDFJRx1gp5QwwyGo8xk1lbHUxvK9nK0OGAak= github.com/dgraph-io/ristretto v0.0.3-0.20200630154024-f66de99634de/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= @@ -326,9 +326,6 @@ 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-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da h1:oI5xCqsCo564l8iNU+DwB5epxmsaqB+rhGL0m5jtYqE= -github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.6.0 h1:ErTB+efbowRARo13NNdxyJji2egdxLGQhRaY+DUumQc= github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= @@ -358,14 +355,11 @@ github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Z github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.1.2 h1:xf4v41cLI2Z6FxbKm+8Bu+m8ifhj15JuZ9sa0jZCMUU= github.com/google/btree v1.1.2/go.mod h1:qOPhT0dTNdNzV6Z/lhRX0YXUafgPLFUh+gZMl761Gm4= -github.com/google/flatbuffers v1.12.1 h1:MVlul7pQNoDzWRLTw5imwYsl+usrS1TXG2H4jg6ImGw= -github.com/google/flatbuffers v1.12.1/go.mod h1:1AeVuKshWv4vARoZatz6mlQ0JxURH0Kv5+zNeJKJCa8= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= @@ -799,8 +793,6 @@ go.etcd.io/etcd v0.0.0-20191023171146-3cf2f69b5738/go.mod h1:dnLIgRNXwCJa5e+c6mI go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.20.2/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk= go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= -go.opencensus.io v0.24.0 h1:y73uSU6J157QMP2kn2r30vwW1A2W2WFwSCGnAVxeaD0= -go.opencensus.io v0.24.0/go.mod h1:vNK8G9p7aAivkbmorf4v+7Hgx+Zs0yY+0fOtgBfjQKo= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0 h1:KfYpVmrjI7JuToy5k8XV3nkapjWx48k4E4JOtVstzQI= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.44.0/go.mod h1:SeQhzAEccGVZVEy7aH87Nh0km+utSpo1pTv6eMMop48= go.opentelemetry.io/otel v1.24.0 h1:0LAOdjNmQeSTzGBzduGe/rU4tZhMwL5rWgtp9Ku5Jfo= @@ -894,7 +886,6 @@ golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81R golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210805182204-aaa1db679c0d/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= @@ -1076,7 +1067,6 @@ google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8 google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= -google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= google.golang.org/grpc v1.45.0/go.mod h1:lN7owxKUQEqMfSyQikvvk5tf/6zMPsrK+ONuO11+0rQ= google.golang.org/grpc v1.49.0/go.mod h1:ZgQEeidpAuNRZ8iRrlBKXZQP1ghovWIVhdJRyCDK+GI= From e87c4460bfa61bc104874baa16c3534fce28ac22 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Thu, 10 Oct 2024 15:04:54 +0200 Subject: [PATCH 35/37] feat: add fields to cometbft header --- baseapp/abci.go | 8 +++++++- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index 600ad36e7e69..973b10cece99 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -723,7 +723,13 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request Time: req.Time, ProposerAddress: req.ProposerAddress, NextValidatorsHash: req.NextValidatorsHash, - AppHash: app.LastCommitID().Hash, + AppHash: req.AppHash, + ValidatorsHash: req.ValidatorsHash, + ConsensusHash: req.ConsensusHash, + DataHash: req.DataHash, + EvidenceHash: req.EvidenceHash, + LastCommitHash: req.LastCommitHash, + LastResultsHash: req.LastResultsHash, LastBlockId: cmtproto.BlockID{ Hash: req.LastBlockHash, PartSetHeader: cmtproto.PartSetHeader{ diff --git a/go.mod b/go.mod index 6fa07191e338..374492608ecc 100644 --- a/go.mod +++ b/go.mod @@ -208,7 +208,7 @@ replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-3 + github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-4 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 176f88a55578..80306dd36f7a 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/DataDog/sketches-go v1.4.2 h1:gppNudE9d19cQ98RYABOetxIhpTCl4m7CnbRZjv github.com/DataDog/sketches-go v1.4.2/go.mod h1:xJIXldczJyyjnbDop7ZZcLxJdV3+7Kra7H1KMgpgkLk= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/InjectiveLabs/cometbft v0.38.11-inj-3 h1:82i3DrztJxVs1R45wVTUKZ5+8g+HT5KPexu6mB92jaE= -github.com/InjectiveLabs/cometbft v0.38.11-inj-3/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= +github.com/InjectiveLabs/cometbft v0.38.11-inj-4 h1:WBL3gGcPEYscqpIH+r1IkytmMhoLt247JtO71AlZ/iQ= +github.com/InjectiveLabs/cometbft v0.38.11-inj-4/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240522173845-46ef88f66790 h1:F4FYZR9rLg9igzxitFdLU5s7ZU9XS0wUB7DbkBOVXc8= github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240522173845-46ef88f66790/go.mod h1:ZW4eIE98wivInyQyhxU2nHqEielc/iZAcr41qNyWSrw= github.com/InjectiveLabs/metrics v0.0.10 h1:BoOwXnCtRRIPmq06jcI20pXZYE758eusaCI5jDOoN4U= From acf19ad6fc3f00621680771b1daffb925f565e0c Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Mon, 14 Oct 2024 09:35:49 +0200 Subject: [PATCH 36/37] chore: update cometbft version --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 374492608ecc..b1b139b99904 100644 --- a/go.mod +++ b/go.mod @@ -208,7 +208,7 @@ replace ( // use cosmos fork of keyring github.com/99designs/keyring => github.com/cosmos/keyring v1.2.0 - github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-4 + github.com/cometbft/cometbft => github.com/InjectiveLabs/cometbft v0.38.11-inj-5 // dgrijalva/jwt-go is deprecated and doesn't receive security updates. // TODO: remove it: https://github.com/cosmos/cosmos-sdk/issues/13134 github.com/dgrijalva/jwt-go => github.com/golang-jwt/jwt/v4 v4.4.2 diff --git a/go.sum b/go.sum index 80306dd36f7a..e4530a641fc0 100644 --- a/go.sum +++ b/go.sum @@ -45,8 +45,8 @@ github.com/DataDog/sketches-go v1.4.2 h1:gppNudE9d19cQ98RYABOetxIhpTCl4m7CnbRZjv github.com/DataDog/sketches-go v1.4.2/go.mod h1:xJIXldczJyyjnbDop7ZZcLxJdV3+7Kra7H1KMgpgkLk= github.com/DataDog/zstd v1.5.5 h1:oWf5W7GtOLgp6bciQYDmhHHjdhYkALu6S/5Ni9ZgSvQ= github.com/DataDog/zstd v1.5.5/go.mod h1:g4AWEaM3yOg3HYfnJ3YIawPnVdXJh9QME85blwSAmyw= -github.com/InjectiveLabs/cometbft v0.38.11-inj-4 h1:WBL3gGcPEYscqpIH+r1IkytmMhoLt247JtO71AlZ/iQ= -github.com/InjectiveLabs/cometbft v0.38.11-inj-4/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= +github.com/InjectiveLabs/cometbft v0.38.11-inj-5 h1:HHqZv2OY3LqHdDj5IxdMgun2Tp3je9EeDk9IET+eoUk= +github.com/InjectiveLabs/cometbft v0.38.11-inj-5/go.mod h1:WreBJKC7CtZ9cNsb5p6uNpfCBwNWDu+risVb58GTLfY= github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240522173845-46ef88f66790 h1:F4FYZR9rLg9igzxitFdLU5s7ZU9XS0wUB7DbkBOVXc8= github.com/InjectiveLabs/cosmos-sdk/store v1.1.1-0.20240522173845-46ef88f66790/go.mod h1:ZW4eIE98wivInyQyhxU2nHqEielc/iZAcr41qNyWSrw= github.com/InjectiveLabs/metrics v0.0.10 h1:BoOwXnCtRRIPmq06jcI20pXZYE758eusaCI5jDOoN4U= From 5654da5e6af9e2945c7cd291963563a0ef57be91 Mon Sep 17 00:00:00 2001 From: Martin Arrivets Date: Wed, 6 Nov 2024 18:03:25 +0100 Subject: [PATCH 37/37] fix: set correct header.AppHash field in internalFinalizeBlock --- baseapp/abci.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/baseapp/abci.go b/baseapp/abci.go index 973b10cece99..440f2b9ea0f6 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -723,7 +723,7 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request Time: req.Time, ProposerAddress: req.ProposerAddress, NextValidatorsHash: req.NextValidatorsHash, - AppHash: req.AppHash, + AppHash: app.LastCommitID().Hash, ValidatorsHash: req.ValidatorsHash, ConsensusHash: req.ConsensusHash, DataHash: req.DataHash,