diff --git a/.github/workflows/fork-cherry-pick.yml b/.github/workflows/fork-cherry-pick.yml deleted file mode 100644 index ebf90b2e8adf..000000000000 --- a/.github/workflows/fork-cherry-pick.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This CI is disabled on main and meant to be enabled on forks as an easy way to cherry pick fork commits into main. -# In order to submit a PR from your repo to the Cosmos SDK, a PRBOT_PAT secret (personal access token) must be available for the GitHub Action (Settings > Secrets > Actions). -# The PR will be submitted from the user of the PAT. Note, the PRBOT_PAT user must have write access to the repo. -name: Cherry pick PR to Cosmos SDK -on: - # Set to trigger on every merge to main, not just a closed PR. - workflow_dispatch: - pull_request_target: - branches: - - main - types: ["closed"] - -jobs: - cherry_pick: - permissions: write-all - runs-on: ubuntu-latest - name: Cherry pick into main - if: github.event.pull_request.merged == true - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Create PR Patch Branch - shell: bash - env: - PR_NAME: pr-patch-${{ github.sha }} - run: | - git config --global user.name "${{ github.actor }}" # Config have to be set for pushing the cherry-picked changes onto fork pr-patch branch. - git config --global user.email "${{ github.actor }}@users.noreply.github.com" - git remote add upstream https://github.com/cosmos/cosmos-sdk.git - git fetch --all # Get the latest code - git checkout -b $PR_NAME upstream/main # Create new branch based on main branch - git cherry-pick -X theirs ${{ github.sha }} # Cherry pick the latest commit of PR - git push -u origin $PR_NAME # Push your changes to the remote branch - - name: Autocreate PR - shell: bash - env: - GH_TOKEN: ${{ secrets.PRBOT_PAT }} - run: | - gh pr create --repo cosmos/cosmos-sdk --base main --head "${{ github.event.repository.owner.login }}:pr-patch-${{ github.sha }}" --title "${{ github.event.pull_request.title }}" --body "Automated PR for commit: ${{ github.sha }} from ${{ github.repository }}" diff --git a/.golangci.yml b/.golangci.yml index 11259002d8d1..e9714ba5811f 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -21,12 +21,12 @@ build-tags: linters: disable-all: true enable: - - errcheck - dogsled + - errcheck - exportloopref + - gci - goconst - gocritic - - gci - gofumpt - gosec - gosimple @@ -35,11 +35,11 @@ linters: - misspell - nakedret - nolintlint - - staticcheck - revive + - staticcheck - stylecheck - - typecheck - thelper + - typecheck - unconvert - unused diff --git a/CHANGELOG.md b/CHANGELOG.md index 943f05034c48..d41323763cf5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -40,6 +40,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features +* (x/auth) Support the ability to broadcast unordered transactions per ADR-070. See UPGRADING.md for more details on integration. * (client) [#18557](https://github.com/cosmos/cosmos-sdk/pull/18557) Add `--qrcode` flag to `keys show` command to support displaying keys address QR code. * (x/staking) [#18142](https://github.com/cosmos/cosmos-sdk/pull/18142) Introduce `key_rotation_fee` param to calculate fees while rotating the keys * (client) [#18101](https://github.com/cosmos/cosmos-sdk/pull/18101) Add a `keyring-default-keyname` in `client.toml` for specifying a default key name, and skip the need to use the `--from` flag when signing transactions. @@ -54,14 +55,17 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* (baseapp) [#18915](https://github.com/cosmos/cosmos-sdk/pull/18915) Add a new `ExecModeVerifyVoteExtension` exec mode and ensure it's populated in the `Context` during `VerifyVoteExtension` execution. +* (types) [#18888](https://github.com/cosmos/cosmos-sdk/pull/18888) Speedup DecCoin.Sort() if len(coins) <= 1 +* (types) [#18875](https://github.com/cosmos/cosmos-sdk/pull/18875) Speedup coins.Sort() if len(coins) <= 1 * (client/keys) [#18745](https://github.com/cosmos/cosmos-sdk/pull/18745) Improve ` keys export` and ` keys mnemonic` by adding --yes option to skip interactive confirmation. * (client/keys) [#18743](https://github.com/cosmos/cosmos-sdk/pull/18743) Improve ` keys add -i` by hiding inputting of bip39 passphrase. * (client/keys) [#18703](https://github.com/cosmos/cosmos-sdk/pull/18703) Improve ` keys add` and ` keys show` by checking whether there are duplicate keys in the multisig case. -* (x/gov) [#18707](https://github.com/cosmos/cosmos-sdk/pull/18707) Improve genesis validation. +* (x/gov) [#18707](https://github.com/cosmos/cosmos-sdk/pull/18707) Improve genesis validation. * (x/bank) [#18636](https://github.com/cosmos/cosmos-sdk/pull/18636) `SendCoinsFromModuleToAccount`, `SendCoinsFromModuleToModule`, `SendCoinsFromAccountToModule`, `DelegateCoinsFromAccountToModule`, `UndelegateCoinsFromModuleToAccount`, `MintCoins` and `BurnCoins` methods now returns an error instead of panicking if any module accounts does not exist or unauthorized. * (x/distribution) [#18636](https://github.com/cosmos/cosmos-sdk/pull/18636) `CalculateDelegationRewards` and `DelegationTotalRewards` methods no longer panics on any sanity checks and instead returns appropriate errors. * (x/slashing) [#18636](https://github.com/cosmos/cosmos-sdk/pull/18636) `JailUntil` and `Tombstone` methods no longer panics if the signing info does not exist for the validator but instead returns error. -* (x/staking) [#18636](https://github.com/cosmos/cosmos-sdk/pull/18636) `IterateBondedValidatorsByPower`, `GetDelegatorBonded`, `Delegate`, `Unbond`, `Slash`, `Jail`, `SlashRedelegation`, `ApplyAndReturnValidatorSetUpdates` methods no longer panics on any kind of errors but instead returns appropriate errors. +* (x/staking) [#18636](https://github.com/cosmos/cosmos-sdk/pull/18636) `IterateBondedValidatorsByPower`, `GetDelegatorBonded`, `Delegate`, `Unbond`, `Slash`, `Jail`, `SlashRedelegation`, `ApplyAndReturnValidatorSetUpdates` methods no longer panics on any kind of errors but instead returns appropriate errors. * Usage of `Must...` kind of functions are avoided in keeper methods. * (client/keys) [#18687](https://github.com/cosmos/cosmos-sdk/pull/18687) Improve ` keys mnemonic` by displaying mnemonic discreetly on an alternate screen and adding `--indiscreet` option to disable it. * (client/keys) [#18684](https://github.com/cosmos/cosmos-sdk/pull/18684) Improve ` keys export` by displaying unarmored hex private key discreetly on an alternate screen and adding `--indiscreet` option to disable it. @@ -78,6 +82,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (staking) [#18506](https://github.com/cosmos/cosmos-sdk/pull/18506) Detect the length of the ed25519 pubkey in CreateValidator to prevent panic. * (tx) [#18772](https://github.com/cosmos/cosmos-sdk/pull/18772) Remove misleading gas wanted from tx simulation failure log. * (tx) [#18852](https://github.com/cosmos/cosmos-sdk/pull/18852) Add `WithFromName` to tx factory. +* (testutil) [#18930](https://github.com/cosmos/cosmos-sdk/pull/18930) Add NodeURI for clientCtx. +* (types) [#18963](https://github.com/cosmos/cosmos-sdk/pull/18963) Swap out amino json encoding of `ABCIMessageLogs` for std lib json encoding ### Bug Fixes @@ -90,6 +96,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (simulation) [#17911](https://github.com/cosmos/cosmos-sdk/pull/17911) Fix all problems with executing command `make test-sim-custom-genesis-fast` for simulation test. * (simulation) [#18196](https://github.com/cosmos/cosmos-sdk/pull/18196) Fix the problem of `validator set is empty after InitGenesis` in simulation test. * (baseapp) [#18551](https://github.com/cosmos/cosmos-sdk/pull/18551) Fix SelectTxForProposal the calculation method of tx bytes size is inconsistent with CometBFT +* (baseapp) [#18895](https://github.com/cosmos/cosmos-sdk/pull/18895) Fix de-duplicating vote extensions during validation in ValidateVoteExtensions. ### API Breaking Changes @@ -97,7 +104,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov/testutil) [#17986](https://github.com/cosmos/cosmos-sdk/pull/18036) `MsgDeposit` has been removed because of AutoCLI migration. * (x/staking/testutil) [#17986](https://github.com/cosmos/cosmos-sdk/pull/17986) `MsgRedelegateExec`, `MsgUnbondExec` has been removed because of AutoCLI migration. * (x/bank/testutil) [#17868](https://github.com/cosmos/cosmos-sdk/pull/17868) `MsgSendExec` has been removed because of AutoCLI migration. -* (app) [#17838](https://github.com/cosmos/cosmos-sdk/pull/17838) Params module was removed from simapp and all imports of the params module removed throughout the repo. +* (app) [#17838](https://github.com/cosmos/cosmos-sdk/pull/17838) Params module was removed from simapp and all imports of the params module removed throughout the repo. * The Cosmos SDK has migrated away from using params, if your app still uses it, then you can leave it plugged into your app * (x/staking) [#17778](https://github.com/cosmos/cosmos-sdk/pull/17778) Use collections for `Params` * remove from `Keeper`: `GetParams`, `SetParams` @@ -161,7 +168,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [#17348](https://github.com/cosmos/cosmos-sdk/pull/17348) Remove the `WrapServiceResult` function. * The `*sdk.Result` returned by the msg server router will not contain the `.Data` field. * (x/staking) [#17335](https://github.com/cosmos/cosmos-sdk/pull/17335) Remove usage of `"cosmossdk.io/x/staking/types".Infraction_*` in favour of `"cosmossdk.io/api/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on staking -* (types) [#17426](https://github.com/cosmos/cosmos-sdk/pull/17426) `NewContext` does not take a `cmtproto.Header{}` any longer. +* (types) [#17426](https://github.com/cosmos/cosmos-sdk/pull/17426) `NewContext` does not take a `cmtproto.Header{}` any longer. * `WithChainID` / `WithBlockHeight` / `WithBlockHeader` must be used to set values on the context * (x/bank) [#17569](https://github.com/cosmos/cosmos-sdk/pull/17569) `BurnCoins` takes an address instead of a module name * (types) [#17738](https://github.com/cosmos/cosmos-sdk/pull/17738) `WithBlockTime()` was removed & `BlockTime()` were deprecated in favor of `WithHeaderInfo()` & `HeaderInfo()`. `BlockTime` now gets data from `HeaderInfo()` instead of `BlockHeader()`. @@ -178,12 +185,13 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/staking) [#18257](https://github.com/cosmos/cosmos-sdk/pull/18257) Staking module was moved to its own go.mod `cosmossdk.io/x/staking` * (x/authz) [#18265](https://github.com/cosmos/cosmos-sdk/pull/18265) Authz module was moved to its own go.mod `cosmossdk.io/x/authz` * (x/mint) [#18283](https://github.com/cosmos/cosmos-sdk/pull/18283) Mint module was moved to its own go.mod `cosmossdk.io/x/mint` -* (x/consensus) [#18041](https://github.com/cosmos/cosmos-sdk/pull/18041) `ToProtoConsensusParams()` returns an error +* (x/consensus) [#18041](https://github.com/cosmos/cosmos-sdk/pull/18041) `ToProtoConsensusParams()` returns an error * (x/slashing) [#18115](https://github.com/cosmos/cosmos-sdk/pull/18115) `NewValidatorSigningInfo` takes strings instead of `sdk.AccAddress` * (types) [#18268](https://github.com/cosmos/cosmos-sdk/pull/18268) Remove global setting of basedenom. Use the staking module parameter instead * (x/auth) [#18351](https://github.com/cosmos/cosmos-sdk/pull/18351) Auth module was moved to its own go.mod `cosmossdk.io/x/auth` * (types) [#18372](https://github.com/cosmos/cosmos-sdk/pull/18372) Removed global configuration for coin type and purpose. Setters and getters should be removed and access directly to defined types. * (types) [#18695](https://github.com/cosmos/cosmos-sdk/pull/18695) Removed global configuration for txEncoder. +* (server) [#18909](https://github.com/cosmos/cosmos-sdk/pull/18909) Remove configuration endpoint on grpc reflection endpoint in favour of auth module bech32prefix endpoint already exposed. ### CLI Breaking Changes @@ -193,7 +201,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### State Machine Breaking * (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) Upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp. -* (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `HistoricalInfo` was replaced with `HistoricalRecord`, it removes the validator set and comet header and only keep what is needed for IBC. +* (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `HistoricalInfo` was replaced with `HistoricalRecord`, it removes the validator set and comet header and only keep what is needed for IBC. ## [v0.50.2](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.2) - 2023-12-11 @@ -308,7 +316,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Improve construction through the use of a single `PriorityNonceMempoolConfig` instead of option functions * (x/authz) [#15164](https://github.com/cosmos/cosmos-sdk/pull/15164) Add `MsgCancelUnbondingDelegation` to staking authorization. * (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Remove unnecessary sleeps from gRPC and API server initiation. The servers will start and accept requests as soon as they're ready. -* (baseapp) [#15023](https://github.com/cosmos/cosmos-sdk/pull/15023) & [#15213](https://github.com/cosmos/cosmos-sdk/pull/15213) Add `MessageRouter` interface to baseapp and pass it to authz, gov and groups instead of concrete type. +* (baseapp) [#15023](https://github.com/cosmos/cosmos-sdk/pull/15023) & [#15213](https://github.com/cosmos/cosmos-sdk/pull/15213) Add `MessageRouter` interface to baseapp and pass it to authz, gov and groups instead of concrete type. * [#15011](https://github.com/cosmos/cosmos-sdk/pull/15011) Introduce `cosmossdk.io/log` package to provide a consistent logging interface through the SDK. CometBFT logger is now replaced by `cosmossdk.io/log.Logger`. * (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) ` tx staking create-validator` CLI command now takes a json file as an arg instead of using required flags. * (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Allow transaction event queries to directly passed to Tendermint, which will allow for full query operator support, e.g. `>`. @@ -317,10 +325,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) Added ability to query blocks by either height/hash ` q block --type=height|hash `. * (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) Return undelegate amount in MsgUndelegateResponse. * [#14529](https://github.com/cosmos/cosmos-sdk/pull/14529) Add new property `BondDenom` to `SimulationState` struct. -* (store) [#14439](https://github.com/cosmos/cosmos-sdk/pull/14439) Remove global metric gatherer from store. +* (store) [#14439](https://github.com/cosmos/cosmos-sdk/pull/14439) Remove global metric gatherer from store. * By default store has a no op metric gatherer, the application developer must set another metric gatherer or us the provided one in `store/metrics`. -* (store) [#14438](https://github.com/cosmos/cosmos-sdk/pull/14438) Pass logger from baseapp to store. -* (baseapp) [#14417](https://github.com/cosmos/cosmos-sdk/pull/14417) The store package no longer has a dependency on baseapp. +* (store) [#14438](https://github.com/cosmos/cosmos-sdk/pull/14438) Pass logger from baseapp to store. +* (baseapp) [#14417](https://github.com/cosmos/cosmos-sdk/pull/14417) The store package no longer has a dependency on baseapp. * (module) [#14415](https://github.com/cosmos/cosmos-sdk/pull/14415) Loosen assertions in SetOrderBeginBlockers() and SetOrderEndBlockers(). * (store) [#14410](https://github.com/cosmos/cosmos-sdk/pull/14410) `rootmulti.Store.loadVersion` has validation to check if all the module stores' height is correct, it will error if any module store has incorrect height. * [#14406](https://github.com/cosmos/cosmos-sdk/issues/14406) Migrate usage of `types/store.go` to `store/types/..`. @@ -349,10 +357,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) `module.BeginBlockAppModule` has been replaced by Core API `appmodule.HasBeginBlocker`. * (types) [#17358](https://github.com/cosmos/cosmos-sdk/pull/17358) Remove deprecated `sdk.Handler`, use `baseapp.MsgServiceHandler` instead. * (client) [#17197](https://github.com/cosmos/cosmos-sdk/pull/17197) `keys.Commands` does not take a home directory anymore. It is inferred from the root command. -* (x/staking) [#17157](https://github.com/cosmos/cosmos-sdk/pull/17157) `GetValidatorsByPowerIndexKey` and `ValidateBasic` for historical info takes a validator address codec in order to be able to decode/encode addresses. +* (x/staking) [#17157](https://github.com/cosmos/cosmos-sdk/pull/17157) `GetValidatorsByPowerIndexKey` and `ValidateBasic` for historical info takes a validator address codec in order to be able to decode/encode addresses. * `GetOperator()` now returns the address as it is represented in state, by default this is an encoded address - * `GetConsAddr() ([]byte, error)` returns `[]byte` instead of sdk.ConsAddres. - * `FromABCIEvidence` & `GetConsensusAddress(consAc address.Codec)` now take a consensus address codec to be able to decode the incoming address. + * `GetConsAddr() ([]byte, error)` returns `[]byte` instead of sdk.ConsAddres. + * `FromABCIEvidence` & `GetConsensusAddress(consAc address.Codec)` now take a consensus address codec to be able to decode the incoming address. * (x/distribution) `Delegate` & `SlashValidator` helper function added the mock staking keeper as a parameter passed to the function * (x/staking) [#17098](https://github.com/cosmos/cosmos-sdk/pull/17098) `NewMsgCreateValidator`, `NewValidator`, `NewMsgCancelUnbondingDelegation`, `NewMsgUndelegate`, `NewMsgBeginRedelegate`, `NewMsgDelegate` and `NewMsgEditValidator` takes a string instead of `sdk.ValAddress` or `sdk.AccAddress`: * `NewRedelegation` and `NewUnbondingDelegation` takes a validatorAddressCodec and a delegatorAddressCodec in order to decode the addresses. @@ -374,12 +382,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/mint) [#16329](https://github.com/cosmos/cosmos-sdk/pull/16329) Use collections for state management: * Removed: keeper `GetParams`, `SetParams`, `GetMinter`, `SetMinter`. * (x/crisis) [#16328](https://github.com/cosmos/cosmos-sdk/pull/16328) Use collections for state management: - * Removed: keeper `GetConstantFee`, `SetConstantFee` + * Removed: keeper `GetConstantFee`, `SetConstantFee` * (x/staking) [#16324](https://github.com/cosmos/cosmos-sdk/pull/16324) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`, and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context` and return an `error`. Notable changes: * `Validator` method now returns `types.ErrNoValidatorFound` instead of `nil` when not found. * (x/distribution) [#16302](https://github.com/cosmos/cosmos-sdk/pull/16302) Use collections for FeePool state management. * Removed: keeper `GetFeePool`, `SetFeePool`, `GetFeePoolCommunityCoins` -* (types) [#16272](https://github.com/cosmos/cosmos-sdk/pull/16272) `FeeGranter` in the `FeeTx` interface returns `[]byte` instead of `string`. +* (types) [#16272](https://github.com/cosmos/cosmos-sdk/pull/16272) `FeeGranter` in the `FeeTx` interface returns `[]byte` instead of `string`. * (x/gov) [#16268](https://github.com/cosmos/cosmos-sdk/pull/16268) Use collections for proposal state management (part 2): * this finalizes the gov collections migration * Removed: types all the key related functions @@ -396,7 +404,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#16164](https://github.com/cosmos/cosmos-sdk/pull/16164) Use collections for vote state management: * Removed: types `VoteKey`, `VoteKeys` * Removed: keeper `IterateVotes`, `IterateAllVotes`, `GetVotes`, `GetVote`, `SetVote` -* (sims) [#16155](https://github.com/cosmos/cosmos-sdk/pull/16155) +* (sims) [#16155](https://github.com/cosmos/cosmos-sdk/pull/16155) * `simulation.NewOperationMsg` now marshals the operation msg as proto bytes instead of legacy amino JSON bytes. * `simulation.NewOperationMsg` is now 2-arity instead of 3-arity with the obsolete argument `codec.ProtoCodec` removed. * The field `OperationMsg.Msg` is now of type `[]byte` instead of `json.RawMessage`. @@ -433,21 +441,21 @@ Ref: https://keepachangelog.com/en/1.0.0/ * `Codec` has new methods `InterfaceRegistry`, `GetMsgAnySigners`, `GetMsgV1Signers`, and `GetMsgV2Signers` as well as unexported methods. All implementations of `Codec` by other users must now embed an official implementation from the `codec` package. * `AminoCodec` is marked as deprecated and no longer implements `Codec. * (client) [#15597](https://github.com/cosmos/cosmos-sdk/pull/15597) `RegisterNodeService` now requires a config parameter. -* (x/nft) [#15588](https://github.com/cosmos/cosmos-sdk/pull/15588) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. +* (x/nft) [#15588](https://github.com/cosmos/cosmos-sdk/pull/15588) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. * (baseapp) [#15568](https://github.com/cosmos/cosmos-sdk/pull/15568) `SetIAVLLazyLoading` is removed from baseapp. * (x/genutil) [#15567](https://github.com/cosmos/cosmos-sdk/pull/15567) `CollectGenTxsCmd` & `GenTxCmd` takes a address.Codec to be able to decode addresses. * (x/bank) [#15567](https://github.com/cosmos/cosmos-sdk/pull/15567) `GenesisBalance.GetAddress` now returns a string instead of `sdk.AccAddress` - * `MsgSendExec` test helper function now takes a address.Codec -* (x/auth) [#15520](https://github.com/cosmos/cosmos-sdk/pull/15520) `NewAccountKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. + * `MsgSendExec` test helper function now takes a address.Codec +* (x/auth) [#15520](https://github.com/cosmos/cosmos-sdk/pull/15520) `NewAccountKeeper` now takes a `KVStoreService` instead of a `StoreKey` and methods in the `Keeper` now take a `context.Context` instead of a `sdk.Context`. * (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) `runTxMode`s were renamed to `execMode`. `ModeDeliver` as changed to `ModeFinalize` and a new `ModeVoteExtension` was added for vote extensions. -* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) Writing of state to the multistore was moved to `FinalizeBlock`. `Commit` still handles the committing values to disk. -* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) Calls to BeginBlock and EndBlock have been replaced with core api beginblock & endblock. -* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) BeginBlock and EndBlock are now internal to baseapp. For testing, user must call `FinalizeBlock`. BeginBlock and EndBlock calls are internal to Baseapp. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) Writing of state to the multistore was moved to `FinalizeBlock`. `Commit` still handles the committing values to disk. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) Calls to BeginBlock and EndBlock have been replaced with core api beginblock & endblock. +* (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) BeginBlock and EndBlock are now internal to baseapp. For testing, user must call `FinalizeBlock`. BeginBlock and EndBlock calls are internal to Baseapp. * (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) All calls to ABCI methods now accept a pointer of the abci request and response types * (x/consensus) [#15517](https://github.com/cosmos/cosmos-sdk/pull/15517) `NewKeeper` now takes a `KVStoreService` instead of a `StoreKey`. * (x/bank) [#15477](https://github.com/cosmos/cosmos-sdk/pull/15477) `banktypes.NewMsgMultiSend` and `keeper.InputOutputCoins` only accept one input. * (server) [#15358](https://github.com/cosmos/cosmos-sdk/pull/15358) Remove `server.ErrorCode` that was not used anywhere. -* (x/capability) [#15344](https://github.com/cosmos/cosmos-sdk/pull/15344) Capability module was removed and is now housed in [IBC-GO](https://github.com/cosmos/ibc-go). +* (x/capability) [#15344](https://github.com/cosmos/cosmos-sdk/pull/15344) Capability module was removed and is now housed in [IBC-GO](https://github.com/cosmos/ibc-go). * (mempool) [#15328](https://github.com/cosmos/cosmos-sdk/pull/15328) The `PriorityNonceMempool` is now generic over type `C comparable` and takes a single `PriorityNonceMempoolConfig[C]` argument. See `DefaultPriorityNonceMempoolConfig` for how to construct the configuration and a `TxPriority` type. * [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `StdTx` transaction and signing APIs. No SDK version has actually supported `StdTx` since before Stargate. * [#15284](https://github.com/cosmos/cosmos-sdk/pull/15284) @@ -460,7 +468,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * `SigVerifiableTx.GetSigners()` now returns `([][]byte, error)` instead of `[]sdk.AccAddress`. * `AccountKeeper` now has an `AddressCodec() address.Codec` method and the expected `AccountKeeper` for `x/auth/ante` expects this method. * [#15211](https://github.com/cosmos/cosmos-sdk/pull/15211) Remove usage of `github.com/cometbft/cometbft/libs/bytes.HexBytes` in favor of `[]byte` thorough the SDK. -* (crypto) [#15070](https://github.com/cosmos/cosmos-sdk/pull/15070) `GenerateFromPassword` and `Cost` from `bcrypt.go` now take a `uint32` instead of a `int` type. +* (crypto) [#15070](https://github.com/cosmos/cosmos-sdk/pull/15070) `GenerateFromPassword` and `Cost` from `bcrypt.go` now take a `uint32` instead of a `int` type. * (types) [#15067](https://github.com/cosmos/cosmos-sdk/pull/15067) Remove deprecated alias from `types/errors`. Use `cosmossdk.io/errors` instead. * (server) [#15041](https://github.com/cosmos/cosmos-sdk/pull/15041) Refactor how gRPC and API servers are started to remove unnecessary sleeps: * `api.Server#Start` now accepts a `context.Context`. The caller is responsible for ensuring that the context is canceled such that the API server can gracefully exit. The caller does not need to stop the server. @@ -471,7 +479,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (simapp) [#14977](https://github.com/cosmos/cosmos-sdk/pull/14977) Move simulation helpers functions (`AppStateFn` and `AppStateRandomizedFn`) to `testutil/sims`. These takes an extra genesisState argument which is the default state of the app. * (x/bank) [#14894](https://github.com/cosmos/cosmos-sdk/pull/14894) Allow a human readable denomination for coins when querying bank balances. Added a `ResolveDenom` parameter to `types.QueryAllBalancesRequest`. * [#14847](https://github.com/cosmos/cosmos-sdk/pull/14847) App and ModuleManager methods `InitGenesis`, `ExportGenesis`, `BeginBlock` and `EndBlock` now also return an error. -* (x/upgrade) [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module. +* (x/upgrade) [#14764](https://github.com/cosmos/cosmos-sdk/pull/14764) The `x/upgrade` module is extracted to have a separate go.mod file which allows it to be a standalone module. * (x/auth) [#14758](https://github.com/cosmos/cosmos-sdk/pull/14758) Refactor transaction searching: * Refactor `QueryTxsByEvents` to accept a `query` of type `string` instead of `events` of type `[]string` * Refactor CLI methods to accept `--query` flag instead of `--events` @@ -482,7 +490,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/gov) [#14720](https://github.com/cosmos/cosmos-sdk/pull/14720) Add an expedited field in the gov v1 proposal and `MsgNewMsgProposal`. * (x/feegrant) [#14649](https://github.com/cosmos/cosmos-sdk/pull/14649) Extract Feegrant in its own go.mod and rename the package to `cosmossdk.io/x/feegrant`. * (tx) [#14634](https://github.com/cosmos/cosmos-sdk/pull/14634) Move the `tx` go module to `x/tx`. -* (store/streaming)[#14603](https://github.com/cosmos/cosmos-sdk/pull/14603) `StoreDecoderRegistry` moved from store to `types/simulations` this breaks the `AppModuleSimulation` interface. +* (store/streaming)[#14603](https://github.com/cosmos/cosmos-sdk/pull/14603) `StoreDecoderRegistry` moved from store to `types/simulations` this breaks the `AppModuleSimulation` interface. * (snapshots) [#14597](https://github.com/cosmos/cosmos-sdk/pull/14597) Move `snapshots` to `store/snapshots`, rename and bump proto package to v1. * (x/staking) [#14590](https://github.com/cosmos/cosmos-sdk/pull/14590) `MsgUndelegateResponse` now includes undelegated amount. `x/staking` module's `keeper.Undelegate` now returns 3 values (completionTime,undelegateAmount,error) instead of 2. * (crypto/keyring) [#14151](https://github.com/cosmos/cosmos-sdk/pull/14151) Move keys presentation from `crypto/keyring` to `client/keys` @@ -501,7 +509,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (abci) [#15845](https://github.com/cosmos/cosmos-sdk/pull/15845) Remove duplicating events in `logs`. * (abci) [#15845](https://github.com/cosmos/cosmos-sdk/pull/15845) Add `msg_index` to all event attributes to associate events and messages. * (x/staking) [#15701](https://github.com/cosmos/cosmos-sdk/pull/15701) `HistoricalInfoKey` now has a binary format. -* (store/streaming) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) State Streaming removed emitting of beginblock, endblock and delivertx in favour of emitting FinalizeBlock. +* (store/streaming) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) State Streaming removed emitting of beginblock, endblock and delivertx in favour of emitting FinalizeBlock. * (baseapp) [#15519](https://github.com/cosmos/cosmos-sdk/pull/15519/files) BeginBlock & EndBlock events have begin or endblock in the events in order to identify which stage they are emitted from since they are returned to comet as FinalizeBlock events. * (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Use same port for gRPC-Web and the API server. @@ -516,15 +524,15 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (cli) [#17184](https://github.com/cosmos/cosmos-sdk/pull/17184) All json keys returned by the `status` command are now snake case instead of pascal case. * (server) [#17177](https://github.com/cosmos/cosmos-sdk/pull/17177) Remove `iavl-lazy-loading` configuration. * (x/gov) [#16987](https://github.com/cosmos/cosmos-sdk/pull/16987) In ` query gov proposals` the proposal status flag have renamed from `--status` to `--proposal-status`. Additionally, that flags now uses the ENUM values: `PROPOSAL_STATUS_DEPOSIT_PERIOD`, `PROPOSAL_STATUS_VOTING_PERIOD`, `PROPOSAL_STATUS_PASSED`, `PROPOSAL_STATUS_REJECTED`, `PROPOSAL_STATUS_FAILED`. -* (x/bank) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) With the migration to AutoCLI some bank commands have been split in two: - * Use `total-supply` (or `total`) for querying the total supply and `total-supply-of` for querying the supply of a specific denom. +* (x/bank) [#16899](https://github.com/cosmos/cosmos-sdk/pull/16899) With the migration to AutoCLI some bank commands have been split in two: + * Use `total-supply` (or `total`) for querying the total supply and `total-supply-of` for querying the supply of a specific denom. * Use `denoms-metadata` for querying all denom metadata and `denom-metadata` for querying a specific denom metadata. * (rosetta) [#16276](https://github.com/cosmos/cosmos-sdk/issues/16276) Rosetta migration to standalone repo. * (cli) [#15826](https://github.com/cosmos/cosmos-sdk/pull/15826) Remove ` q account` command. Use ` q auth account` instead. -* (cli) [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `--amino` flag from `sign` and `multi-sign` commands. Amino `StdTx` has been deprecated for a while. Amino JSON signing still works as expected. +* (cli) [#15299](https://github.com/cosmos/cosmos-sdk/pull/15299) Remove `--amino` flag from `sign` and `multi-sign` commands. Amino `StdTx` has been deprecated for a while. Amino JSON signing still works as expected. * (x/gov) [#14880](https://github.com/cosmos/cosmos-sdk/pull/14880) Remove ` tx gov submit-legacy-proposal cancel-software-upgrade` and `software-upgrade` commands. These commands are now in the `x/upgrade` module and using gov v1. Use `tx upgrade software-upgrade` instead. * (x/staking) [#14864](https://github.com/cosmos/cosmos-sdk/pull/14864) ` tx staking create-validator` CLI command now takes a json file as an arg instead of using required flags. -* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) ` q block ` is removed as it just output json. The new command allows either height/hash and is ` q block --type=height|hash `. +* (cli) [#14659](https://github.com/cosmos/cosmos-sdk/pull/14659) ` q block ` is removed as it just output json. The new command allows either height/hash and is ` q block --type=height|hash `. * (grpc-web) [#14652](https://github.com/cosmos/cosmos-sdk/pull/14652) Remove `grpc-web.address` flag. * (client) [#14342](https://github.com/cosmos/cosmos-sdk/pull/14342) ` config` command is now a sub-command using Confix. Use ` config --help` to learn more. @@ -597,11 +605,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Features * (client/rpc) [#17274](https://github.com/cosmos/cosmos-sdk/pull/17274) Add `QueryEventForTxCmd` cmd to subscribe and wait event for transaction by hash. -* (keyring) [#17424](https://github.com/cosmos/cosmos-sdk/pull/17424) Allows to import private keys encoded in hex. +* (keyring) [#17424](https://github.com/cosmos/cosmos-sdk/pull/17424) Allows to import private keys encoded in hex. ### Improvements -* (x/gov) [#17387](https://github.com/cosmos/cosmos-sdk/pull/17387) Add `MsgSubmitProposal` `SetMsgs` method. +* (x/gov) [#17387](https://github.com/cosmos/cosmos-sdk/pull/17387) Add `MsgSubmitProposal` `SetMsgs` method. * (x/gov) [#17354](https://github.com/cosmos/cosmos-sdk/issues/17354) Emit `VoterAddr` in `proposal_vote` event. * (x/group, x/gov) [#17220](https://github.com/cosmos/cosmos-sdk/pull/17220) Add `--skip-metadata` flag in `draft-proposal` to skip metadata prompt. * (x/genutil) [#17296](https://github.com/cosmos/cosmos-sdk/pull/17296) Add `MigrateHandler` to allow reuse migrate genesis related function. @@ -708,7 +716,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Bug Fixes * (baseapp) [#15487](https://github.com/cosmos/cosmos-sdk/pull/15487) Reset state before calling PrepareProposal and ProcessProposal. -* (cli) [#15123](https://github.com/cosmos/cosmos-sdk/pull/15123) Fix the CLI `offline` mode behavior to be really offline. The API of `clienttx.NewFactoryCLI` is updated to return an error. +* (cli) [#15123](https://github.com/cosmos/cosmos-sdk/pull/15123) Fix the CLI `offline` mode behavior to be really offline. The API of `clienttx.NewFactoryCLI` is updated to return an error. ### Deprecated @@ -816,7 +824,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#13802](https://github.com/cosmos/cosmos-sdk/pull/13802) Add --output-document flag to the export CLI command to allow writing genesis state to a file. * [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) `types/module.Manager` now supports the `cosmossdk.io/core/appmodule.AppModule` API via the new `NewManagerFromMap` constructor. -* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go. +* [#14175](https://github.com/cosmos/cosmos-sdk/pull/14175) Add `server.DefaultBaseappOptions(appopts)` function to reduce boiler plate in root.go. ### State Machine Breaking @@ -828,7 +836,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (x/group) [#14071](https://github.com/cosmos/cosmos-sdk/pull/14071) Don't re-tally proposal after voting period end if they have been marked as ACCEPTED or REJECTED. * (x/group) [#13742](https://github.com/cosmos/cosmos-sdk/pull/13742) Migrate group policy account from module accounts to base account. * (x/auth)[#13780](https://github.com/cosmos/cosmos-sdk/pull/13780) `id` (type of int64) in `AccountAddressByID` grpc query is now deprecated, update to account-id(type of uint64) to use `AccountAddressByID`. -* (codec) [#13307](https://github.com/cosmos/cosmos-sdk/pull/13307) Register all modules' `Msg`s with group's ModuleCdc so that Amino sign bytes are correctly generated.* (x/gov) +* (codec) [#13307](https://github.com/cosmos/cosmos-sdk/pull/13307) Register all modules' `Msg`s with group's ModuleCdc so that Amino sign bytes are correctly generated.* (x/gov) * (codec) [#13196](https://github.com/cosmos/cosmos-sdk/pull/13196) Register all modules' `Msg`s with gov's ModuleCdc so that Amino sign bytes are correctly generated. * (group) [#13592](https://github.com/cosmos/cosmos-sdk/pull/13592) Fix group types registration with Amino. * (x/distribution) [#12852](https://github.com/cosmos/cosmos-sdk/pull/12852) Deprecate `CommunityPoolSpendProposal`. Please execute a `MsgCommunityPoolSpend` message via the new v1 `x/gov` module instead. This message can be used to directly fund the `x/gov` module account. @@ -904,8 +912,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (types) [#13430](https://github.com/cosmos/cosmos-sdk/pull/13430) Remove unused code `ResponseCheckTx` and `ResponseDeliverTx` * (store) [#13529](https://github.com/cosmos/cosmos-sdk/pull/13529) Add method `LatestVersion` to `MultiStore` interface, add method `SetQueryMultiStore` to baesapp to support alternative `MultiStore` implementation for query service. * (pruning) [#13609](https://github.com/cosmos/cosmos-sdk/pull/13609) Move pruning package to be under store package -* [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) Most methods on `types/module.AppModule` have been moved to -extension interfaces. `module.Manager.Modules` is now of type `map[string]interface{}` to support in parallel the new +* [#13794](https://github.com/cosmos/cosmos-sdk/pull/13794) Most methods on `types/module.AppModule` have been moved to +extension interfaces. `module.Manager.Modules` is now of type `map[string]interface{}` to support in parallel the new `cosmossdk.io/core/appmodule.AppModule` API. ### CLI Breaking Changes @@ -916,7 +924,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf ### Bug Fixes * (x/auth/vesting) [#15373](https://github.com/cosmos/cosmos-sdk/pull/15373) Add extra checks when creating a periodic vesting account. -* (x/auth) [#13838](https://github.com/cosmos/cosmos-sdk/pull/13838) Fix calling `String()` and `MarshalYAML` panics when pubkey is set on a `BaseAccount``. +* (x/auth) [#13838](https://github.com/cosmos/cosmos-sdk/pull/13838) Fix calling `String()` and `MarshalYAML` panics when pubkey is set on a `BaseAccount``. * (x/evidence) [#13740](https://github.com/cosmos/cosmos-sdk/pull/13740) Fix evidence query API to decode the hash properly. * (bank) [#13691](https://github.com/cosmos/cosmos-sdk/issues/13691) Fix unhandled error for vesting account transfers, when total vesting amount exceeds total balance. * [#13553](https://github.com/cosmos/cosmos-sdk/pull/13553) Ensure all parameter validation for decimal types handles nil decimal values. @@ -928,7 +936,7 @@ extension interfaces. `module.Manager.Modules` is now of type `map[string]interf * (sdk/dec_coins) [#12903](https://github.com/cosmos/cosmos-sdk/pull/12903) Fix nil `DecCoin` creation when converting `Coins` to `DecCoins` * (store) [#12945](https://github.com/cosmos/cosmos-sdk/pull/12945) Fix nil end semantics in store/cachekv/iterator when iterating a dirty cache. * (x/gov) [#13051](https://github.com/cosmos/cosmos-sdk/pull/13051) In SubmitPropsal, when a legacy msg fails it's handler call, wrap the error as ErrInvalidProposalContent (instead of ErrNoProposalHandlerExists). -* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in golang 1.19. +* (snapshot) [#13400](https://github.com/cosmos/cosmos-sdk/pull/13400) Fix snapshot checksum issue in golang 1.19. * (server) [#13778](https://github.com/cosmos/cosmos-sdk/pull/13778) Set Cosmos SDK default endpoints to localhost to avoid unknown exposure of endpoints. * (x/auth) [#13877](https://github.com/cosmos/cosmos-sdk/pull/13877) Handle missing account numbers during `InitGenesis`. * (x/gov) [#13918](https://github.com/cosmos/cosmos-sdk/pull/13918) Propagate message errors when executing a proposal. @@ -953,7 +961,7 @@ EOL notice. This is the last release of the `v0.46.x` line. Per this version, th ### Improvements -* (x/gov) [#17387](https://github.com/cosmos/cosmos-sdk/pull/17387) Add `MsgSubmitProposal` `SetMsgs` method. +* (x/gov) [#17387](https://github.com/cosmos/cosmos-sdk/pull/17387) Add `MsgSubmitProposal` `SetMsgs` method. * (x/gov) [#17354](https://github.com/cosmos/cosmos-sdk/issues/17354) Emit `VoterAddr` in `proposal_vote` event. * (x/genutil) [#17296](https://github.com/cosmos/cosmos-sdk/pull/17296) Add `MigrateHandler` to allow reuse migrate genesis related function. * In v0.46, v0.47 this function is additive to the `genesis migrate` command. However in v0.50+, adding custom migrations to the `genesis migrate` command is directly possible. @@ -982,7 +990,7 @@ EOL notice. This is the last release of the `v0.46.x` line. Per this version, th ## [v0.46.13](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.46.13) - 2023-06-08 -### Features +### Features * (snapshots) [#16060](https://github.com/cosmos/cosmos-sdk/pull/16060) Support saving and restoring snapshot locally. * (baseapp) [#16290](https://github.com/cosmos/cosmos-sdk/pull/16290) Add circuit breaker setter in baseapp. @@ -1042,12 +1050,12 @@ EOL notice. This is the last release of the `v0.46.x` line. Per this version, th * (deps) [#14846](https://github.com/cosmos/cosmos-sdk/pull/14846) Bump btcd. * (deps) Bump Tendermint version to [v0.34.26](https://github.com/informalsystems/tendermint/releases/tag/v0.34.26). * (store/cache) [#14189](https://github.com/cosmos/cosmos-sdk/pull/14189) Add config `iavl-lazy-loading` to enable lazy loading of iavl store, to improve start up time of archive nodes, add method `SetLazyLoading` to `CommitMultiStore` interface. - * A new field has been added to the app.toml. This allows nodes with larger databases to startup quicker + * A new field has been added to the app.toml. This allows nodes with larger databases to startup quicker ```toml # IAVLLazyLoading enable/disable the lazy loading of iavl store. # Default is false. - iavl-lazy-loading = "" + iavl-lazy-loading = "" ``` ### Bug Fixes diff --git a/README.md b/README.md index 03c776f2d301..c7efd2454a7f 100644 --- a/README.md +++ b/README.md @@ -56,14 +56,56 @@ If you want to follow the updates or learn more about the latest design then joi The Cosmos ecosystem is vast. [Awesome Cosmos](https://github.com/cosmos/awesome-cosmos) is a community-curated list of notable frameworks, modules and tools. -### Cosmos Hub Mainnet - -The Cosmos Hub application, `gaia`, has its own [cosmos/gaia repository](https://github.com/cosmos/gaia). Go there to join the Cosmos Hub mainnet and more. - ### Inter-Blockchain Communication (IBC) The IBC module for the Cosmos SDK has its own [cosmos/ibc-go repository](https://github.com/cosmos/ibc-go). Go there to build and integrate with the IBC module. +### Version Matrix + +The version matrix below shows which versions of the Cosmos SDK, modules and libraries are compatible with each other. + +#### Core Dependencies + +Core Dependencies are the core libraries that a application may depend on. + +> Note: the ❌ signals that the version of the Cosmos SDK does not need to import the dependency. + +| Cosmos SDK | cosmossdk.io/core | cosmossdk.io/api | cosmossdk.io/math | cosmossdk.io/errors | cosmossdk.io/depinject | cosmossdk.io/log | cosmossdk.io/store | +|------------|-------------------|------------------|-------------------|---------------------|------------------------|------------------|--------------------| +| 0.50.z | 0.11.z | 0.7.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | +| 0.47.z | 0.5.z | 0.3.z | 1.y.z | 1.y.z | 1.y.z | 1.y.z | ❌ | +| 0.46.z | ❌ | ❌ | 1.y.z | 1.y.z | ❌ | ❌ | ❌ | + +#### Module Dependencies + +Module Dependencies are the modules that a application may depend on and which version of the Cosmos SDK they are compatible with. + +> Note: The version table only goes back to 0.50.x, this is due to the reason that modules were not spun out into their own go.mods until 0.50.z. ❌ signals that the module was not spun out into its own go.mod file. + + +| Cosmos SDK | 0.50.z | 0.y.z | +|-----------------------------|-----------|-------| +| cosmossdk.io/x/auth | ❌ | | +| cosmossdk.io/x/accounts | ❌ | | +| cosmossdk.io/x/bank | ❌ | | +| cosmossdk.io/x/circuit | 0.1.z | | +| cosmossdk.io/x/consensus | ❌ | | +| cosmossdk.io/x/distribution | ❌ | | +| cosmossdk.io/x/evidence | 0.1.z | | +| cosmossdk.io/x/feegrant | 0.1.z | | +| cosmossdk.io/x/gov | ❌ | | +| cosmossdk.io/x/group | ❌ | | +| cosmossdk.io/x/mint | ❌ | | +| cosmossdk.io/x/nft | 0.1.z | | +| cosmossdk.io/x/protcolpool | ❌ | | +| cosmossdk.io/x/slashing | ❌ | | +| cosmossdk.io/x/staking | ❌ | | +| cosmossdk.io/x/tx | =< 0.13.z | | +| cosmossdk.io/x/upgrade | 0.1.z | | + + + + ## Disambiguation This Cosmos SDK project is not related to the [React-Cosmos](https://github.com/react-cosmos/react-cosmos) project (yet). Many thanks to Evan Coury and Ovidiu (@skidding) for this Github organization name. As per our agreement, this disambiguation notice will stay here. diff --git a/UPGRADING.md b/UPGRADING.md index 9d97ceed29b4..326bee2c9a90 100644 --- a/UPGRADING.md +++ b/UPGRADING.md @@ -5,6 +5,81 @@ Note, always read the **SimApp** section for more information on application wir ## [Unreleased] +### Unordered Transactions + +The Cosmos SDK now supports unordered transactions. This means that transactions +can be executed in any order and doesn't require the client to deal with or manage +nonces. This also means the order of execution is not guaranteed. To enable unordered +transactions in your application: + +* Update the `App` constructor to create, load, and save the unordered transaction + manager. + + ```go + func NewApp(...) *App { + // ... + + // create, start, and load the unordered tx manager + utxDataDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data") + app.UnorderedTxManager = unorderedtx.NewManager(utxDataDir) + app.UnorderedTxManager.Start() + + if err := app.UnorderedTxManager.OnInit(); err != nil { + panic(fmt.Errorf("failed to initialize unordered tx manager: %w", err)) + } + } + ``` + +* Add the decorator to the existing AnteHandler chain, which should be as early + as possible. + + ```go + anteDecorators := []sdk.AnteDecorator{ + ante.NewSetUpContextDecorator(), + // ... + ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, app.UnorderedTxManager), + // ... + } + + return sdk.ChainAnteDecorators(anteDecorators...), nil + ``` + +* If the App has a SnapshotManager defined, you must also register the extension + for the TxManager. + + ```go + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions(unorderedtx.NewSnapshotter(app.UnorderedTxManager)) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + ``` + +* Create or update the App's `Close()` method to close the unordered tx manager. + Note, this is critical as it ensures the manager's state is written to file + such that when the node restarts, it can recover the state to provide replay + protection. + + ```go + func (app *App) Close() error { + // ... + + // close the unordered tx manager + if e := app.UnorderedTxManager.Close(); e != nil { + err = errors.Join(err, e) + } + + return err + } + ``` + +To submit an unordered transaction, the client must set the `unordered` flag to +`true` and ensure a reasonable `timeout_height` is set. The `timeout_height` is +used as a TTL for the transaction and is used to provide replay protection. See +[ADR-070](https://github.com/cosmos/cosmos-sdk/blob/main/docs/architecture/adr-070-unordered-account.md) +for more details. + ### Params * Params Migrations were removed. It is required to migrate to 0.50 prior to upgrading to .51. diff --git a/api/cosmos/accounts/v1/account_abstraction.pulsar.go b/api/cosmos/accounts/v1/account_abstraction.pulsar.go index e2f15e492d2e..8f792dc8ac17 100644 --- a/api/cosmos/accounts/v1/account_abstraction.pulsar.go +++ b/api/cosmos/accounts/v1/account_abstraction.pulsar.go @@ -125,6 +125,7 @@ var ( fd_UserOperation_bundler_payment_gas_limit protoreflect.FieldDescriptor fd_UserOperation_execution_messages protoreflect.FieldDescriptor fd_UserOperation_execution_gas_limit protoreflect.FieldDescriptor + fd_UserOperation_tx_compat protoreflect.FieldDescriptor ) func init() { @@ -138,6 +139,7 @@ func init() { fd_UserOperation_bundler_payment_gas_limit = md_UserOperation.Fields().ByName("bundler_payment_gas_limit") fd_UserOperation_execution_messages = md_UserOperation.Fields().ByName("execution_messages") fd_UserOperation_execution_gas_limit = md_UserOperation.Fields().ByName("execution_gas_limit") + fd_UserOperation_tx_compat = md_UserOperation.Fields().ByName("tx_compat") } var _ protoreflect.Message = (*fastReflection_UserOperation)(nil) @@ -217,8 +219,8 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor return } } - if len(x.AuthenticationData) != 0 { - value := protoreflect.ValueOfBytes(x.AuthenticationData) + if x.AuthenticationData != nil { + value := protoreflect.ValueOfMessage(x.AuthenticationData.ProtoReflect()) if !f(fd_UserOperation_authentication_data, value) { return } @@ -253,6 +255,12 @@ func (x *fastReflection_UserOperation) Range(f func(protoreflect.FieldDescriptor return } } + if x.TxCompat != nil { + value := protoreflect.ValueOfMessage(x.TxCompat.ProtoReflect()) + if !f(fd_UserOperation_tx_compat, value) { + return + } + } } // Has reports whether a field is populated. @@ -273,7 +281,7 @@ func (x *fastReflection_UserOperation) Has(fd protoreflect.FieldDescriptor) bool case "cosmos.accounts.v1.UserOperation.authentication_method": return x.AuthenticationMethod != "" case "cosmos.accounts.v1.UserOperation.authentication_data": - return len(x.AuthenticationData) != 0 + return x.AuthenticationData != nil case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": return x.AuthenticationGasLimit != uint64(0) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -284,6 +292,8 @@ func (x *fastReflection_UserOperation) Has(fd protoreflect.FieldDescriptor) bool return len(x.ExecutionMessages) != 0 case "cosmos.accounts.v1.UserOperation.execution_gas_limit": return x.ExecutionGasLimit != uint64(0) + case "cosmos.accounts.v1.UserOperation.tx_compat": + return x.TxCompat != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -316,6 +326,8 @@ func (x *fastReflection_UserOperation) Clear(fd protoreflect.FieldDescriptor) { x.ExecutionMessages = nil case "cosmos.accounts.v1.UserOperation.execution_gas_limit": x.ExecutionGasLimit = uint64(0) + case "cosmos.accounts.v1.UserOperation.tx_compat": + x.TxCompat = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -340,7 +352,7 @@ func (x *fastReflection_UserOperation) Get(descriptor protoreflect.FieldDescript return protoreflect.ValueOfString(value) case "cosmos.accounts.v1.UserOperation.authentication_data": value := x.AuthenticationData - return protoreflect.ValueOfBytes(value) + return protoreflect.ValueOfMessage(value.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": value := x.AuthenticationGasLimit return protoreflect.ValueOfUint64(value) @@ -362,6 +374,9 @@ func (x *fastReflection_UserOperation) Get(descriptor protoreflect.FieldDescript case "cosmos.accounts.v1.UserOperation.execution_gas_limit": value := x.ExecutionGasLimit return protoreflect.ValueOfUint64(value) + case "cosmos.accounts.v1.UserOperation.tx_compat": + value := x.TxCompat + return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -387,7 +402,7 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu case "cosmos.accounts.v1.UserOperation.authentication_method": x.AuthenticationMethod = value.Interface().(string) case "cosmos.accounts.v1.UserOperation.authentication_data": - x.AuthenticationData = value.Bytes() + x.AuthenticationData = value.Message().Interface().(*anypb.Any) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": x.AuthenticationGasLimit = value.Uint() case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -402,6 +417,8 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu x.ExecutionMessages = *clv.list case "cosmos.accounts.v1.UserOperation.execution_gas_limit": x.ExecutionGasLimit = value.Uint() + case "cosmos.accounts.v1.UserOperation.tx_compat": + x.TxCompat = value.Message().Interface().(*TxCompat) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -422,6 +439,11 @@ func (x *fastReflection_UserOperation) Set(fd protoreflect.FieldDescriptor, valu // Mutable is a mutating operation and unsafe for concurrent use. func (x *fastReflection_UserOperation) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { switch fd.FullName() { + case "cosmos.accounts.v1.UserOperation.authentication_data": + if x.AuthenticationData == nil { + x.AuthenticationData = new(anypb.Any) + } + return protoreflect.ValueOfMessage(x.AuthenticationData.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": if x.BundlerPaymentMessages == nil { x.BundlerPaymentMessages = []*anypb.Any{} @@ -434,12 +456,15 @@ func (x *fastReflection_UserOperation) Mutable(fd protoreflect.FieldDescriptor) } value := &_UserOperation_7_list{list: &x.ExecutionMessages} return protoreflect.ValueOfList(value) + case "cosmos.accounts.v1.UserOperation.tx_compat": + if x.TxCompat == nil { + x.TxCompat = new(TxCompat) + } + return protoreflect.ValueOfMessage(x.TxCompat.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.sender": panic(fmt.Errorf("field sender of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.authentication_method": panic(fmt.Errorf("field authentication_method of message cosmos.accounts.v1.UserOperation is not mutable")) - case "cosmos.accounts.v1.UserOperation.authentication_data": - panic(fmt.Errorf("field authentication_data of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": panic(fmt.Errorf("field authentication_gas_limit of message cosmos.accounts.v1.UserOperation is not mutable")) case "cosmos.accounts.v1.UserOperation.bundler_payment_gas_limit": @@ -464,7 +489,8 @@ func (x *fastReflection_UserOperation) NewField(fd protoreflect.FieldDescriptor) case "cosmos.accounts.v1.UserOperation.authentication_method": return protoreflect.ValueOfString("") case "cosmos.accounts.v1.UserOperation.authentication_data": - return protoreflect.ValueOfBytes(nil) + m := new(anypb.Any) + return protoreflect.ValueOfMessage(m.ProtoReflect()) case "cosmos.accounts.v1.UserOperation.authentication_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) case "cosmos.accounts.v1.UserOperation.bundler_payment_messages": @@ -477,6 +503,9 @@ func (x *fastReflection_UserOperation) NewField(fd protoreflect.FieldDescriptor) return protoreflect.ValueOfList(&_UserOperation_7_list{list: &list}) case "cosmos.accounts.v1.UserOperation.execution_gas_limit": return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.accounts.v1.UserOperation.tx_compat": + m := new(TxCompat) + return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.UserOperation")) @@ -554,8 +583,8 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if l > 0 { n += 1 + l + runtime.Sov(uint64(l)) } - l = len(x.AuthenticationData) - if l > 0 { + if x.AuthenticationData != nil { + l = options.Size(x.AuthenticationData) n += 1 + l + runtime.Sov(uint64(l)) } if x.AuthenticationGasLimit != 0 { @@ -579,6 +608,10 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if x.ExecutionGasLimit != 0 { n += 1 + runtime.Sov(uint64(x.ExecutionGasLimit)) } + if x.TxCompat != nil { + l = options.Size(x.TxCompat) + n += 1 + l + runtime.Sov(uint64(l)) + } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -608,6 +641,20 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } + if x.TxCompat != nil { + encoded, err := options.Marshal(x.TxCompat) + 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] = 0x4a + } if x.ExecutionGasLimit != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.ExecutionGasLimit)) i-- @@ -655,10 +702,17 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x20 } - if len(x.AuthenticationData) > 0 { - i -= len(x.AuthenticationData) - copy(dAtA[i:], x.AuthenticationData) - i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthenticationData))) + if x.AuthenticationData != nil { + encoded, err := options.Marshal(x.AuthenticationData) + 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] = 0x1a } @@ -793,7 +847,7 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field AuthenticationData", 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 @@ -803,24 +857,26 @@ func (x *fastReflection_UserOperation) 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.AuthenticationData = append(x.AuthenticationData[:0], dAtA[iNdEx:postIndex]...) if x.AuthenticationData == nil { - x.AuthenticationData = []byte{} + x.AuthenticationData = &anypb.Any{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.AuthenticationData); err != nil { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex case 4: @@ -948,6 +1004,530 @@ func (x *fastReflection_UserOperation) ProtoMethods() *protoiface.Methods { break } } + case 9: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field TxCompat", 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.TxCompat == nil { + x.TxCompat = &TxCompat{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.TxCompat); 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_TxCompat protoreflect.MessageDescriptor + fd_TxCompat_auth_info_bytes protoreflect.FieldDescriptor + fd_TxCompat_body_bytes protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_accounts_v1_account_abstraction_proto_init() + md_TxCompat = File_cosmos_accounts_v1_account_abstraction_proto.Messages().ByName("TxCompat") + fd_TxCompat_auth_info_bytes = md_TxCompat.Fields().ByName("auth_info_bytes") + fd_TxCompat_body_bytes = md_TxCompat.Fields().ByName("body_bytes") +} + +var _ protoreflect.Message = (*fastReflection_TxCompat)(nil) + +type fastReflection_TxCompat TxCompat + +func (x *TxCompat) ProtoReflect() protoreflect.Message { + return (*fastReflection_TxCompat)(x) +} + +func (x *TxCompat) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + 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_TxCompat_messageType fastReflection_TxCompat_messageType +var _ protoreflect.MessageType = fastReflection_TxCompat_messageType{} + +type fastReflection_TxCompat_messageType struct{} + +func (x fastReflection_TxCompat_messageType) Zero() protoreflect.Message { + return (*fastReflection_TxCompat)(nil) +} +func (x fastReflection_TxCompat_messageType) New() protoreflect.Message { + return new(fastReflection_TxCompat) +} +func (x fastReflection_TxCompat_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_TxCompat +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_TxCompat) Descriptor() protoreflect.MessageDescriptor { + return md_TxCompat +} + +// 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_TxCompat) Type() protoreflect.MessageType { + return _fastReflection_TxCompat_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_TxCompat) New() protoreflect.Message { + return new(fastReflection_TxCompat) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_TxCompat) Interface() protoreflect.ProtoMessage { + return (*TxCompat)(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_TxCompat) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.AuthInfoBytes) != 0 { + value := protoreflect.ValueOfBytes(x.AuthInfoBytes) + if !f(fd_TxCompat_auth_info_bytes, value) { + return + } + } + if len(x.BodyBytes) != 0 { + value := protoreflect.ValueOfBytes(x.BodyBytes) + if !f(fd_TxCompat_body_bytes, 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_TxCompat) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + return len(x.AuthInfoBytes) != 0 + case "cosmos.accounts.v1.TxCompat.body_bytes": + return len(x.BodyBytes) != 0 + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat 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_TxCompat) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + x.AuthInfoBytes = nil + case "cosmos.accounts.v1.TxCompat.body_bytes": + x.BodyBytes = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat 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_TxCompat) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + value := x.AuthInfoBytes + return protoreflect.ValueOfBytes(value) + case "cosmos.accounts.v1.TxCompat.body_bytes": + value := x.BodyBytes + return protoreflect.ValueOfBytes(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat 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_TxCompat) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + x.AuthInfoBytes = value.Bytes() + case "cosmos.accounts.v1.TxCompat.body_bytes": + x.BodyBytes = value.Bytes() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat 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_TxCompat) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + panic(fmt.Errorf("field auth_info_bytes of message cosmos.accounts.v1.TxCompat is not mutable")) + case "cosmos.accounts.v1.TxCompat.body_bytes": + panic(fmt.Errorf("field body_bytes of message cosmos.accounts.v1.TxCompat is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat 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_TxCompat) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.accounts.v1.TxCompat.auth_info_bytes": + return protoreflect.ValueOfBytes(nil) + case "cosmos.accounts.v1.TxCompat.body_bytes": + return protoreflect.ValueOfBytes(nil) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.accounts.v1.TxCompat")) + } + panic(fmt.Errorf("message cosmos.accounts.v1.TxCompat 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_TxCompat) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.accounts.v1.TxCompat", 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_TxCompat) 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_TxCompat) 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_TxCompat) 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_TxCompat) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*TxCompat) + 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.AuthInfoBytes) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.BodyBytes) + 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().(*TxCompat) + 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.BodyBytes) > 0 { + i -= len(x.BodyBytes) + copy(dAtA[i:], x.BodyBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.BodyBytes))) + i-- + dAtA[i] = 0x12 + } + if len(x.AuthInfoBytes) > 0 { + i -= len(x.AuthInfoBytes) + copy(dAtA[i:], x.AuthInfoBytes) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.AuthInfoBytes))) + 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().(*TxCompat) + 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: TxCompat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: TxCompat: 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 AuthInfoBytes", 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.AuthInfoBytes = append(x.AuthInfoBytes[:0], dAtA[iNdEx:postIndex]...) + if x.AuthInfoBytes == nil { + x.AuthInfoBytes = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field BodyBytes", 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.BodyBytes = append(x.BodyBytes[:0], dAtA[iNdEx:postIndex]...) + if x.BodyBytes == nil { + x.BodyBytes = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1115,7 +1695,7 @@ func (x *UserOperationResponse) ProtoReflect() protoreflect.Message { } func (x *UserOperationResponse) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[2] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1851,7 +2431,7 @@ type UserOperation struct { AuthenticationMethod string `protobuf:"bytes,2,opt,name=authentication_method,json=authenticationMethod,proto3" json:"authentication_method,omitempty"` // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. - AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` + AuthenticationData *anypb.Any `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. AuthenticationGasLimit uint64 `protobuf:"varint,4,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` @@ -1876,6 +2456,12 @@ type UserOperation struct { // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. ExecutionGasLimit uint64 `protobuf:"varint,8,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` + // tx_compat is populated only when the operation is composed from a raw tx. + // In fact if a TX comes and the sender of the TX is an abstracted account, + // we convert the TX into a user operation, and try to authenticate using the + // x/accounts authenticate method. If a bundler tries to send a UserOperation + // with a populated tx_compat, the operation will immediately yield a failure. + TxCompat *TxCompat `protobuf:"bytes,9,opt,name=tx_compat,json=txCompat,proto3" json:"tx_compat,omitempty"` } func (x *UserOperation) Reset() { @@ -1912,7 +2498,7 @@ func (x *UserOperation) GetAuthenticationMethod() string { return "" } -func (x *UserOperation) GetAuthenticationData() []byte { +func (x *UserOperation) GetAuthenticationData() *anypb.Any { if x != nil { return x.AuthenticationData } @@ -1954,6 +2540,63 @@ func (x *UserOperation) GetExecutionGasLimit() uint64 { return 0 } +func (x *UserOperation) GetTxCompat() *TxCompat { + if x != nil { + return x.TxCompat + } + return nil +} + +// TxCompat provides compatibility for x/accounts abstracted account with the cosmos-sdk's Txs. +// In fact TxCompat contains fields coming from the Tx in raw and decoded format. The Raw format +// is mainly needed for proper sig verification. +type TxCompat struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // auth_info_bytes contains the auth info bytes of the tx. + // Must not be modified. + AuthInfoBytes []byte `protobuf:"bytes,1,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"` + // body_bytes contains the body bytes of the tx. + // must not be modified. + BodyBytes []byte `protobuf:"bytes,2,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` +} + +func (x *TxCompat) Reset() { + *x = TxCompat{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *TxCompat) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*TxCompat) ProtoMessage() {} + +// Deprecated: Use TxCompat.ProtoReflect.Descriptor instead. +func (*TxCompat) Descriptor() ([]byte, []int) { + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{1} +} + +func (x *TxCompat) GetAuthInfoBytes() []byte { + if x != nil { + return x.AuthInfoBytes + } + return nil +} + +func (x *TxCompat) GetBodyBytes() []byte { + if x != nil { + return x.BodyBytes + } + return nil +} + // UserOperationResponse defines the response of a UserOperation. // If the operation fails the error field will be populated. type UserOperationResponse struct { @@ -1983,7 +2626,7 @@ type UserOperationResponse struct { func (x *UserOperationResponse) Reset() { *x = UserOperationResponse{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1] + mi := &file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[2] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1997,7 +2640,7 @@ func (*UserOperationResponse) ProtoMessage() {} // Deprecated: Use UserOperationResponse.ProtoReflect.Descriptor instead. func (*UserOperationResponse) Descriptor() ([]byte, []int) { - return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{1} + return file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP(), []int{2} } func (x *UserOperationResponse) GetAuthenticationGasUsed() uint64 { @@ -2050,72 +2693,82 @@ var file_cosmos_accounts_v1_account_abstraction_proto_rawDesc = []byte{ 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 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, 0xc7, 0x03, + 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x98, 0x04, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x33, 0x0a, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x14, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, - 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x2f, 0x0a, 0x13, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x74, 0x68, 0x6f, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, - 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, - 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, - 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, + 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, - 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, - 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, - 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, - 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, - 0x69, 0x74, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, - 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x22, 0xe5, 0x02, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, - 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, 0x18, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x67, 0x61, 0x73, - 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x64, 0x12, 0x50, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, - 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, - 0x03, 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, 0x52, 0x17, 0x62, 0x75, 0x6e, - 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, - 0x6e, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, - 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, - 0x65, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, - 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, + 0x12, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x44, + 0x61, 0x74, 0x61, 0x12, 0x38, 0x0a, 0x18, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, + 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x16, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, 0x63, + 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x4e, 0x0a, + 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 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, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x72, 0x72, - 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x42, - 0xd2, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, - 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x17, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x72, - 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, - 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2f, 0x76, - 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, - 0x41, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x1e, 0x43, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, - 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x14, - 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, + 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x39, 0x0a, + 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x16, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x43, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 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, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x2e, 0x0a, + 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x6c, + 0x69, 0x6d, 0x69, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28, 0x04, 0x52, 0x11, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x39, 0x0a, + 0x09, 0x74, 0x78, 0x5f, 0x63, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x1c, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x52, 0x08, + 0x74, 0x78, 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x74, 0x22, 0x51, 0x0a, 0x08, 0x54, 0x78, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x74, 0x12, 0x26, 0x0a, 0x0f, 0x61, 0x75, 0x74, 0x68, 0x5f, 0x69, 0x6e, 0x66, + 0x6f, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0d, 0x61, + 0x75, 0x74, 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, + 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x22, 0xe5, 0x02, 0x0a, 0x15, + 0x55, 0x73, 0x65, 0x72, 0x4f, 0x70, 0x65, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x17, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, + 0x69, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x15, 0x61, 0x75, 0x74, 0x68, 0x65, 0x6e, 0x74, 0x69, + 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x47, 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x37, 0x0a, + 0x18, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, + 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, + 0x15, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x50, 0x0a, 0x19, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, + 0x72, 0x5f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, + 0x73, 0x65, 0x73, 0x18, 0x03, 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, 0x52, + 0x17, 0x62, 0x75, 0x6e, 0x64, 0x6c, 0x65, 0x72, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x2c, 0x0a, 0x12, 0x65, 0x78, 0x65, 0x63, + 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x67, 0x61, 0x73, 0x5f, 0x75, 0x73, 0x65, 0x64, 0x18, 0x04, + 0x20, 0x01, 0x28, 0x04, 0x52, 0x10, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x47, + 0x61, 0x73, 0x55, 0x73, 0x65, 0x64, 0x12, 0x45, 0x0a, 0x13, 0x65, 0x78, 0x65, 0x63, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x18, 0x05, 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, 0x52, 0x12, 0x65, 0x78, 0x65, 0x63, 0x75, + 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x73, 0x12, 0x14, 0x0a, + 0x05, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x72, + 0x72, 0x6f, 0x72, 0x42, 0xd2, 0x01, 0x0a, 0x16, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x42, 0x17, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x41, 0x62, 0x73, 0x74, 0x72, 0x61, 0x63, 0x74, 0x69, + 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x35, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x76, 0x31, + 0xa2, 0x02, 0x03, 0x43, 0x41, 0x58, 0xaa, 0x02, 0x12, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x12, 0x43, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x73, 0x5c, 0x56, 0x31, + 0xe2, 0x02, 0x1e, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x73, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, + 0x61, 0xea, 0x02, 0x14, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x41, 0x63, 0x63, 0x6f, + 0x75, 0x6e, 0x74, 0x73, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2130,22 +2783,25 @@ func file_cosmos_accounts_v1_account_abstraction_proto_rawDescGZIP() []byte { return file_cosmos_accounts_v1_account_abstraction_proto_rawDescData } -var file_cosmos_accounts_v1_account_abstraction_proto_msgTypes = make([]protoimpl.MessageInfo, 2) +var file_cosmos_accounts_v1_account_abstraction_proto_msgTypes = make([]protoimpl.MessageInfo, 3) var file_cosmos_accounts_v1_account_abstraction_proto_goTypes = []interface{}{ (*UserOperation)(nil), // 0: cosmos.accounts.v1.UserOperation - (*UserOperationResponse)(nil), // 1: cosmos.accounts.v1.UserOperationResponse - (*anypb.Any)(nil), // 2: google.protobuf.Any + (*TxCompat)(nil), // 1: cosmos.accounts.v1.TxCompat + (*UserOperationResponse)(nil), // 2: cosmos.accounts.v1.UserOperationResponse + (*anypb.Any)(nil), // 3: google.protobuf.Any } var file_cosmos_accounts_v1_account_abstraction_proto_depIdxs = []int32{ - 2, // 0: cosmos.accounts.v1.UserOperation.bundler_payment_messages:type_name -> google.protobuf.Any - 2, // 1: cosmos.accounts.v1.UserOperation.execution_messages:type_name -> google.protobuf.Any - 2, // 2: cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses:type_name -> google.protobuf.Any - 2, // 3: cosmos.accounts.v1.UserOperationResponse.execution_responses:type_name -> google.protobuf.Any - 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, // 0: cosmos.accounts.v1.UserOperation.authentication_data:type_name -> google.protobuf.Any + 3, // 1: cosmos.accounts.v1.UserOperation.bundler_payment_messages:type_name -> google.protobuf.Any + 3, // 2: cosmos.accounts.v1.UserOperation.execution_messages:type_name -> google.protobuf.Any + 1, // 3: cosmos.accounts.v1.UserOperation.tx_compat:type_name -> cosmos.accounts.v1.TxCompat + 3, // 4: cosmos.accounts.v1.UserOperationResponse.bundler_payment_responses:type_name -> google.protobuf.Any + 3, // 5: cosmos.accounts.v1.UserOperationResponse.execution_responses:type_name -> google.protobuf.Any + 6, // [6:6] is the sub-list for method output_type + 6, // [6:6] is the sub-list for method input_type + 6, // [6:6] is the sub-list for extension type_name + 6, // [6:6] is the sub-list for extension extendee + 0, // [0:6] is the sub-list for field type_name } func init() { file_cosmos_accounts_v1_account_abstraction_proto_init() } @@ -2167,6 +2823,18 @@ func file_cosmos_accounts_v1_account_abstraction_proto_init() { } } file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TxCompat); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_accounts_v1_account_abstraction_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*UserOperationResponse); i { case 0: return &v.state @@ -2185,7 +2853,7 @@ func file_cosmos_accounts_v1_account_abstraction_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_accounts_v1_account_abstraction_proto_rawDesc, NumEnums: 0, - NumMessages: 2, + NumMessages: 3, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/gov/v1/gov.pulsar.go b/api/cosmos/gov/v1/gov.pulsar.go index 01cc4429985a..b24ddb4fe583 100644 --- a/api/cosmos/gov/v1/gov.pulsar.go +++ b/api/cosmos/gov/v1/gov.pulsar.go @@ -2640,6 +2640,682 @@ func (x *fastReflection_Proposal) ProtoMethods() *protoiface.Methods { } } +var ( + md_ProposalVoteOptions protoreflect.MessageDescriptor + fd_ProposalVoteOptions_option_one protoreflect.FieldDescriptor + fd_ProposalVoteOptions_option_two protoreflect.FieldDescriptor + fd_ProposalVoteOptions_option_three protoreflect.FieldDescriptor + fd_ProposalVoteOptions_option_four protoreflect.FieldDescriptor + fd_ProposalVoteOptions_option_spam protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_gov_proto_init() + md_ProposalVoteOptions = File_cosmos_gov_v1_gov_proto.Messages().ByName("ProposalVoteOptions") + fd_ProposalVoteOptions_option_one = md_ProposalVoteOptions.Fields().ByName("option_one") + fd_ProposalVoteOptions_option_two = md_ProposalVoteOptions.Fields().ByName("option_two") + fd_ProposalVoteOptions_option_three = md_ProposalVoteOptions.Fields().ByName("option_three") + fd_ProposalVoteOptions_option_four = md_ProposalVoteOptions.Fields().ByName("option_four") + fd_ProposalVoteOptions_option_spam = md_ProposalVoteOptions.Fields().ByName("option_spam") +} + +var _ protoreflect.Message = (*fastReflection_ProposalVoteOptions)(nil) + +type fastReflection_ProposalVoteOptions ProposalVoteOptions + +func (x *ProposalVoteOptions) ProtoReflect() protoreflect.Message { + return (*fastReflection_ProposalVoteOptions)(x) +} + +func (x *ProposalVoteOptions) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_gov_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_ProposalVoteOptions_messageType fastReflection_ProposalVoteOptions_messageType +var _ protoreflect.MessageType = fastReflection_ProposalVoteOptions_messageType{} + +type fastReflection_ProposalVoteOptions_messageType struct{} + +func (x fastReflection_ProposalVoteOptions_messageType) Zero() protoreflect.Message { + return (*fastReflection_ProposalVoteOptions)(nil) +} +func (x fastReflection_ProposalVoteOptions_messageType) New() protoreflect.Message { + return new(fastReflection_ProposalVoteOptions) +} +func (x fastReflection_ProposalVoteOptions_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_ProposalVoteOptions +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_ProposalVoteOptions) Descriptor() protoreflect.MessageDescriptor { + return md_ProposalVoteOptions +} + +// 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_ProposalVoteOptions) Type() protoreflect.MessageType { + return _fastReflection_ProposalVoteOptions_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_ProposalVoteOptions) New() protoreflect.Message { + return new(fastReflection_ProposalVoteOptions) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_ProposalVoteOptions) Interface() protoreflect.ProtoMessage { + return (*ProposalVoteOptions)(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_ProposalVoteOptions) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.OptionOne != "" { + value := protoreflect.ValueOfString(x.OptionOne) + if !f(fd_ProposalVoteOptions_option_one, value) { + return + } + } + if x.OptionTwo != "" { + value := protoreflect.ValueOfString(x.OptionTwo) + if !f(fd_ProposalVoteOptions_option_two, value) { + return + } + } + if x.OptionThree != "" { + value := protoreflect.ValueOfString(x.OptionThree) + if !f(fd_ProposalVoteOptions_option_three, value) { + return + } + } + if x.OptionFour != "" { + value := protoreflect.ValueOfString(x.OptionFour) + if !f(fd_ProposalVoteOptions_option_four, value) { + return + } + } + if x.OptionSpam != "" { + value := protoreflect.ValueOfString(x.OptionSpam) + if !f(fd_ProposalVoteOptions_option_spam, 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_ProposalVoteOptions) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.ProposalVoteOptions.option_one": + return x.OptionOne != "" + case "cosmos.gov.v1.ProposalVoteOptions.option_two": + return x.OptionTwo != "" + case "cosmos.gov.v1.ProposalVoteOptions.option_three": + return x.OptionThree != "" + case "cosmos.gov.v1.ProposalVoteOptions.option_four": + return x.OptionFour != "" + case "cosmos.gov.v1.ProposalVoteOptions.option_spam": + return x.OptionSpam != "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.ProposalVoteOptions")) + } + panic(fmt.Errorf("message cosmos.gov.v1.ProposalVoteOptions 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_ProposalVoteOptions) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.ProposalVoteOptions.option_one": + x.OptionOne = "" + case "cosmos.gov.v1.ProposalVoteOptions.option_two": + x.OptionTwo = "" + case "cosmos.gov.v1.ProposalVoteOptions.option_three": + x.OptionThree = "" + case "cosmos.gov.v1.ProposalVoteOptions.option_four": + x.OptionFour = "" + case "cosmos.gov.v1.ProposalVoteOptions.option_spam": + x.OptionSpam = "" + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.ProposalVoteOptions")) + } + panic(fmt.Errorf("message cosmos.gov.v1.ProposalVoteOptions 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_ProposalVoteOptions) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.ProposalVoteOptions.option_one": + value := x.OptionOne + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.ProposalVoteOptions.option_two": + value := x.OptionTwo + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.ProposalVoteOptions.option_three": + value := x.OptionThree + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.ProposalVoteOptions.option_four": + value := x.OptionFour + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.ProposalVoteOptions.option_spam": + value := x.OptionSpam + return protoreflect.ValueOfString(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.ProposalVoteOptions")) + } + panic(fmt.Errorf("message cosmos.gov.v1.ProposalVoteOptions 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_ProposalVoteOptions) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.ProposalVoteOptions.option_one": + x.OptionOne = value.Interface().(string) + case "cosmos.gov.v1.ProposalVoteOptions.option_two": + x.OptionTwo = value.Interface().(string) + case "cosmos.gov.v1.ProposalVoteOptions.option_three": + x.OptionThree = value.Interface().(string) + case "cosmos.gov.v1.ProposalVoteOptions.option_four": + x.OptionFour = value.Interface().(string) + case "cosmos.gov.v1.ProposalVoteOptions.option_spam": + x.OptionSpam = value.Interface().(string) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.ProposalVoteOptions")) + } + panic(fmt.Errorf("message cosmos.gov.v1.ProposalVoteOptions 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_ProposalVoteOptions) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.ProposalVoteOptions.option_one": + panic(fmt.Errorf("field option_one of message cosmos.gov.v1.ProposalVoteOptions is not mutable")) + case "cosmos.gov.v1.ProposalVoteOptions.option_two": + panic(fmt.Errorf("field option_two of message cosmos.gov.v1.ProposalVoteOptions is not mutable")) + case "cosmos.gov.v1.ProposalVoteOptions.option_three": + panic(fmt.Errorf("field option_three of message cosmos.gov.v1.ProposalVoteOptions is not mutable")) + case "cosmos.gov.v1.ProposalVoteOptions.option_four": + panic(fmt.Errorf("field option_four of message cosmos.gov.v1.ProposalVoteOptions is not mutable")) + case "cosmos.gov.v1.ProposalVoteOptions.option_spam": + panic(fmt.Errorf("field option_spam of message cosmos.gov.v1.ProposalVoteOptions is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.ProposalVoteOptions")) + } + panic(fmt.Errorf("message cosmos.gov.v1.ProposalVoteOptions 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_ProposalVoteOptions) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.ProposalVoteOptions.option_one": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.ProposalVoteOptions.option_two": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.ProposalVoteOptions.option_three": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.ProposalVoteOptions.option_four": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.ProposalVoteOptions.option_spam": + return protoreflect.ValueOfString("") + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.ProposalVoteOptions")) + } + panic(fmt.Errorf("message cosmos.gov.v1.ProposalVoteOptions 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_ProposalVoteOptions) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.ProposalVoteOptions", 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_ProposalVoteOptions) 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_ProposalVoteOptions) 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_ProposalVoteOptions) 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_ProposalVoteOptions) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*ProposalVoteOptions) + 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.OptionOne) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.OptionTwo) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.OptionThree) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.OptionFour) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.OptionSpam) + 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().(*ProposalVoteOptions) + 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.OptionSpam) > 0 { + i -= len(x.OptionSpam) + copy(dAtA[i:], x.OptionSpam) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OptionSpam))) + i-- + dAtA[i] = 0x2a + } + if len(x.OptionFour) > 0 { + i -= len(x.OptionFour) + copy(dAtA[i:], x.OptionFour) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OptionFour))) + i-- + dAtA[i] = 0x22 + } + if len(x.OptionThree) > 0 { + i -= len(x.OptionThree) + copy(dAtA[i:], x.OptionThree) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OptionThree))) + i-- + dAtA[i] = 0x1a + } + if len(x.OptionTwo) > 0 { + i -= len(x.OptionTwo) + copy(dAtA[i:], x.OptionTwo) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OptionTwo))) + i-- + dAtA[i] = 0x12 + } + if len(x.OptionOne) > 0 { + i -= len(x.OptionOne) + copy(dAtA[i:], x.OptionOne) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.OptionOne))) + 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().(*ProposalVoteOptions) + 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: ProposalVoteOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: ProposalVoteOptions: 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 OptionOne", 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.OptionOne = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OptionTwo", 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.OptionTwo = 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 OptionThree", 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.OptionThree = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OptionFour", 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.OptionFour = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OptionSpam", 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.OptionSpam = 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_TallyResult protoreflect.MessageDescriptor fd_TallyResult_yes_count protoreflect.FieldDescriptor @@ -2668,7 +3344,7 @@ func (x *TallyResult) ProtoReflect() protoreflect.Message { } func (x *TallyResult) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[3] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[4] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3393,7 +4069,7 @@ func (x *Vote) ProtoReflect() protoreflect.Message { } func (x *Vote) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[4] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[5] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4059,7 +4735,7 @@ func (x *DepositParams) ProtoReflect() protoreflect.Message { } func (x *DepositParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[5] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[6] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -4579,7 +5255,7 @@ func (x *VotingParams) ProtoReflect() protoreflect.Message { } func (x *VotingParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[6] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[7] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5018,7 +5694,7 @@ func (x *TallyParams) ProtoReflect() protoreflect.Message { } func (x *TallyParams) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[7] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[8] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5644,49 +6320,49 @@ func (x *_Params_12_list) IsValid() bool { return x.list != nil } -var _ protoreflect.List = (*_Params_17_list)(nil) +var _ protoreflect.List = (*_Params_18_list)(nil) -type _Params_17_list struct { +type _Params_18_list struct { list *[]string } -func (x *_Params_17_list) Len() int { +func (x *_Params_18_list) Len() int { if x.list == nil { return 0 } return len(*x.list) } -func (x *_Params_17_list) Get(i int) protoreflect.Value { +func (x *_Params_18_list) Get(i int) protoreflect.Value { return protoreflect.ValueOfString((*x.list)[i]) } -func (x *_Params_17_list) Set(i int, value protoreflect.Value) { +func (x *_Params_18_list) Set(i int, value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped (*x.list)[i] = concreteValue } -func (x *_Params_17_list) Append(value protoreflect.Value) { +func (x *_Params_18_list) Append(value protoreflect.Value) { valueUnwrapped := value.String() concreteValue := valueUnwrapped *x.list = append(*x.list, concreteValue) } -func (x *_Params_17_list) AppendMutable() protoreflect.Value { +func (x *_Params_18_list) AppendMutable() protoreflect.Value { panic(fmt.Errorf("AppendMutable can not be called on message Params at list field OptimisticAuthorizedAddresses as it is not of Message kind")) } -func (x *_Params_17_list) Truncate(n int) { +func (x *_Params_18_list) Truncate(n int) { *x.list = (*x.list)[:n] } -func (x *_Params_17_list) NewElement() protoreflect.Value { +func (x *_Params_18_list) NewElement() protoreflect.Value { v := "" return protoreflect.ValueOfString(v) } -func (x *_Params_17_list) IsValid() bool { +func (x *_Params_18_list) IsValid() bool { return x.list != nil } @@ -5708,6 +6384,7 @@ var ( fd_Params_burn_proposal_deposit_prevote protoreflect.FieldDescriptor fd_Params_burn_vote_veto protoreflect.FieldDescriptor fd_Params_min_deposit_ratio protoreflect.FieldDescriptor + fd_Params_proposal_cancel_max_period protoreflect.FieldDescriptor fd_Params_optimistic_authorized_addresses protoreflect.FieldDescriptor fd_Params_optimistic_rejected_threshold protoreflect.FieldDescriptor ) @@ -5731,6 +6408,7 @@ func init() { fd_Params_burn_proposal_deposit_prevote = md_Params.Fields().ByName("burn_proposal_deposit_prevote") fd_Params_burn_vote_veto = md_Params.Fields().ByName("burn_vote_veto") fd_Params_min_deposit_ratio = md_Params.Fields().ByName("min_deposit_ratio") + fd_Params_proposal_cancel_max_period = md_Params.Fields().ByName("proposal_cancel_max_period") fd_Params_optimistic_authorized_addresses = md_Params.Fields().ByName("optimistic_authorized_addresses") fd_Params_optimistic_rejected_threshold = md_Params.Fields().ByName("optimistic_rejected_threshold") } @@ -5744,7 +6422,7 @@ func (x *Params) ProtoReflect() protoreflect.Message { } func (x *Params) slowProtoReflect() protoreflect.Message { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[8] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[9] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -5896,8 +6574,14 @@ func (x *fastReflection_Params) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.ProposalCancelMaxPeriod != "" { + value := protoreflect.ValueOfString(x.ProposalCancelMaxPeriod) + if !f(fd_Params_proposal_cancel_max_period, value) { + return + } + } if len(x.OptimisticAuthorizedAddresses) != 0 { - value := protoreflect.ValueOfList(&_Params_17_list{list: &x.OptimisticAuthorizedAddresses}) + value := protoreflect.ValueOfList(&_Params_18_list{list: &x.OptimisticAuthorizedAddresses}) if !f(fd_Params_optimistic_authorized_addresses, value) { return } @@ -5955,6 +6639,8 @@ func (x *fastReflection_Params) Has(fd protoreflect.FieldDescriptor) bool { return x.BurnVoteVeto != false case "cosmos.gov.v1.Params.min_deposit_ratio": return x.MinDepositRatio != "" + case "cosmos.gov.v1.Params.proposal_cancel_max_period": + return x.ProposalCancelMaxPeriod != "" case "cosmos.gov.v1.Params.optimistic_authorized_addresses": return len(x.OptimisticAuthorizedAddresses) != 0 case "cosmos.gov.v1.Params.optimistic_rejected_threshold": @@ -6007,6 +6693,8 @@ func (x *fastReflection_Params) Clear(fd protoreflect.FieldDescriptor) { x.BurnVoteVeto = false case "cosmos.gov.v1.Params.min_deposit_ratio": x.MinDepositRatio = "" + case "cosmos.gov.v1.Params.proposal_cancel_max_period": + x.ProposalCancelMaxPeriod = "" case "cosmos.gov.v1.Params.optimistic_authorized_addresses": x.OptimisticAuthorizedAddresses = nil case "cosmos.gov.v1.Params.optimistic_rejected_threshold": @@ -6081,11 +6769,14 @@ func (x *fastReflection_Params) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.gov.v1.Params.min_deposit_ratio": value := x.MinDepositRatio return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.Params.proposal_cancel_max_period": + value := x.ProposalCancelMaxPeriod + return protoreflect.ValueOfString(value) case "cosmos.gov.v1.Params.optimistic_authorized_addresses": if len(x.OptimisticAuthorizedAddresses) == 0 { - return protoreflect.ValueOfList(&_Params_17_list{}) + return protoreflect.ValueOfList(&_Params_18_list{}) } - listValue := &_Params_17_list{list: &x.OptimisticAuthorizedAddresses} + listValue := &_Params_18_list{list: &x.OptimisticAuthorizedAddresses} return protoreflect.ValueOfList(listValue) case "cosmos.gov.v1.Params.optimistic_rejected_threshold": value := x.OptimisticRejectedThreshold @@ -6146,9 +6837,11 @@ func (x *fastReflection_Params) Set(fd protoreflect.FieldDescriptor, value proto x.BurnVoteVeto = value.Bool() case "cosmos.gov.v1.Params.min_deposit_ratio": x.MinDepositRatio = value.Interface().(string) + case "cosmos.gov.v1.Params.proposal_cancel_max_period": + x.ProposalCancelMaxPeriod = value.Interface().(string) case "cosmos.gov.v1.Params.optimistic_authorized_addresses": lv := value.List() - clv := lv.(*_Params_17_list) + clv := lv.(*_Params_18_list) x.OptimisticAuthorizedAddresses = *clv.list case "cosmos.gov.v1.Params.optimistic_rejected_threshold": x.OptimisticRejectedThreshold = value.Interface().(string) @@ -6203,7 +6896,7 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore if x.OptimisticAuthorizedAddresses == nil { x.OptimisticAuthorizedAddresses = []string{} } - value := &_Params_17_list{list: &x.OptimisticAuthorizedAddresses} + value := &_Params_18_list{list: &x.OptimisticAuthorizedAddresses} return protoreflect.ValueOfList(value) case "cosmos.gov.v1.Params.quorum": panic(fmt.Errorf("field quorum of message cosmos.gov.v1.Params is not mutable")) @@ -6227,6 +6920,8 @@ func (x *fastReflection_Params) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field burn_vote_veto of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.min_deposit_ratio": panic(fmt.Errorf("field min_deposit_ratio of message cosmos.gov.v1.Params is not mutable")) + case "cosmos.gov.v1.Params.proposal_cancel_max_period": + panic(fmt.Errorf("field proposal_cancel_max_period of message cosmos.gov.v1.Params is not mutable")) case "cosmos.gov.v1.Params.optimistic_rejected_threshold": panic(fmt.Errorf("field optimistic_rejected_threshold of message cosmos.gov.v1.Params is not mutable")) default: @@ -6279,9 +6974,11 @@ func (x *fastReflection_Params) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfBool(false) case "cosmos.gov.v1.Params.min_deposit_ratio": return protoreflect.ValueOfString("") + case "cosmos.gov.v1.Params.proposal_cancel_max_period": + return protoreflect.ValueOfString("") case "cosmos.gov.v1.Params.optimistic_authorized_addresses": list := []string{} - return protoreflect.ValueOfList(&_Params_17_list{list: &list}) + return protoreflect.ValueOfList(&_Params_18_list{list: &list}) case "cosmos.gov.v1.Params.optimistic_rejected_threshold": return protoreflect.ValueOfString("") default: @@ -6418,6 +7115,10 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { if l > 0 { n += 2 + l + runtime.Sov(uint64(l)) } + l = len(x.ProposalCancelMaxPeriod) + if l > 0 { + n += 2 + l + runtime.Sov(uint64(l)) + } if len(x.OptimisticAuthorizedAddresses) > 0 { for _, s := range x.OptimisticAuthorizedAddresses { l = len(s) @@ -6464,7 +7165,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x92 + dAtA[i] = 0x9a } if len(x.OptimisticAuthorizedAddresses) > 0 { for iNdEx := len(x.OptimisticAuthorizedAddresses) - 1; iNdEx >= 0; iNdEx-- { @@ -6474,9 +7175,18 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x8a + dAtA[i] = 0x92 } } + if len(x.ProposalCancelMaxPeriod) > 0 { + i -= len(x.ProposalCancelMaxPeriod) + copy(dAtA[i:], x.ProposalCancelMaxPeriod) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.ProposalCancelMaxPeriod))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } if len(x.MinDepositRatio) > 0 { i -= len(x.MinDepositRatio) copy(dAtA[i:], x.MinDepositRatio) @@ -7181,6 +7891,38 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { x.MinDepositRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 17: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelMaxPeriod", 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.ProposalCancelMaxPeriod = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OptimisticAuthorizedAddresses", wireType) } @@ -7212,7 +7954,7 @@ func (x *fastReflection_Params) ProtoMethods() *protoiface.Methods { } x.OptimisticAuthorizedAddresses = append(x.OptimisticAuthorizedAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 18: + case 19: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field OptimisticRejectedThreshold", wireType) } @@ -7664,7 +8406,7 @@ type Proposal struct { FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` // proposal_type defines the type of the proposal // - // Since: cosmos-sdk 0.51 + // Since: x/gov v1.0.0 ProposalType ProposalType `protobuf:"varint,16,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } @@ -7801,6 +8543,82 @@ func (x *Proposal) GetProposalType() ProposalType { return ProposalType_PROPOSAL_TYPE_UNSPECIFIED } +// ProposalVoteOptions defines the stringified vote options for proposals. +// This allows to support multiple choice options for a given proposal. +// +// Since: x/gov v1.0.0 +type ProposalVoteOptions struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // option_one is the first option of the proposal + OptionOne string `protobuf:"bytes,1,opt,name=option_one,json=optionOne,proto3" json:"option_one,omitempty"` + // option_two is the second option of the proposal + OptionTwo string `protobuf:"bytes,2,opt,name=option_two,json=optionTwo,proto3" json:"option_two,omitempty"` + // option_three is the third option of the proposal + OptionThree string `protobuf:"bytes,3,opt,name=option_three,json=optionThree,proto3" json:"option_three,omitempty"` + // option_four is the fourth option of the proposal + OptionFour string `protobuf:"bytes,4,opt,name=option_four,json=optionFour,proto3" json:"option_four,omitempty"` + // option_spam is always present for all proposals. + OptionSpam string `protobuf:"bytes,5,opt,name=option_spam,json=optionSpam,proto3" json:"option_spam,omitempty"` +} + +func (x *ProposalVoteOptions) Reset() { + *x = ProposalVoteOptions{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *ProposalVoteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ProposalVoteOptions) ProtoMessage() {} + +// Deprecated: Use ProposalVoteOptions.ProtoReflect.Descriptor instead. +func (*ProposalVoteOptions) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{3} +} + +func (x *ProposalVoteOptions) GetOptionOne() string { + if x != nil { + return x.OptionOne + } + return "" +} + +func (x *ProposalVoteOptions) GetOptionTwo() string { + if x != nil { + return x.OptionTwo + } + return "" +} + +func (x *ProposalVoteOptions) GetOptionThree() string { + if x != nil { + return x.OptionThree + } + return "" +} + +func (x *ProposalVoteOptions) GetOptionFour() string { + if x != nil { + return x.OptionFour + } + return "" +} + +func (x *ProposalVoteOptions) GetOptionSpam() string { + if x != nil { + return x.OptionSpam + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { state protoimpl.MessageState @@ -7822,7 +8640,7 @@ type TallyResult struct { func (x *TallyResult) Reset() { *x = TallyResult{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[3] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[4] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7836,7 +8654,7 @@ func (*TallyResult) ProtoMessage() {} // Deprecated: Use TallyResult.ProtoReflect.Descriptor instead. func (*TallyResult) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{3} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{4} } func (x *TallyResult) GetYesCount() string { @@ -7895,7 +8713,7 @@ type Vote struct { func (x *Vote) Reset() { *x = Vote{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[4] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[5] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7909,7 +8727,7 @@ func (*Vote) ProtoMessage() {} // Deprecated: Use Vote.ProtoReflect.Descriptor instead. func (*Vote) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{4} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{5} } func (x *Vote) GetProposalId() uint64 { @@ -7958,7 +8776,7 @@ type DepositParams struct { func (x *DepositParams) Reset() { *x = DepositParams{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[5] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[6] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -7972,7 +8790,7 @@ func (*DepositParams) ProtoMessage() {} // Deprecated: Use DepositParams.ProtoReflect.Descriptor instead. func (*DepositParams) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{5} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{6} } func (x *DepositParams) GetMinDeposit() []*v1beta1.Coin { @@ -8004,7 +8822,7 @@ type VotingParams struct { func (x *VotingParams) Reset() { *x = VotingParams{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[6] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[7] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8018,7 +8836,7 @@ func (*VotingParams) ProtoMessage() {} // Deprecated: Use VotingParams.ProtoReflect.Descriptor instead. func (*VotingParams) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{6} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{7} } func (x *VotingParams) GetVotingPeriod() *durationpb.Duration { @@ -8049,7 +8867,7 @@ type TallyParams struct { func (x *TallyParams) Reset() { *x = TallyParams{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[7] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[8] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8063,7 +8881,7 @@ func (*TallyParams) ProtoMessage() {} // Deprecated: Use TallyParams.ProtoReflect.Descriptor instead. func (*TallyParams) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{7} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{8} } func (x *TallyParams) GetQuorum() string { @@ -8132,10 +8950,16 @@ type Params struct { // Minimum expedited deposit for a proposal to enter voting period. ExpeditedMinDeposit []*v1beta1.Coin `protobuf:"bytes,12,rep,name=expedited_min_deposit,json=expeditedMinDeposit,proto3" json:"expedited_min_deposit,omitempty"` // burn deposits if a proposal does not meet quorum + // + // Since: cosmos-sdk 0.47 BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` // burn deposits if the proposal does not enter voting period + // + // Since: cosmos-sdk 0.47 BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met + // + // Since: cosmos-sdk 0.47 BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be @@ -8143,22 +8967,29 @@ type Params struct { // // Since: cosmos-sdk 0.50 MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` + // proposal_cancel_max_period defines how far in the voting period a proposer can cancel a proposal. + // If the proposal is cancelled before the max cancel period, the deposit will be returned/burn to the + // depositors, according to the proposal_cancel_ratio and proposal_cancel_dest parameters. + // After the max cancel period, the proposal cannot be cancelled anymore. + // + // Since: x/gov v1.0.0 + ProposalCancelMaxPeriod string `protobuf:"bytes,17,opt,name=proposal_cancel_max_period,json=proposalCancelMaxPeriod,proto3" json:"proposal_cancel_max_period,omitempty"` // optimistic_authorized_addresses is an optional governance parameter that limits the authorized accounts than can // submit optimistic proposals // // Since: x/gov v1.0.0 - OptimisticAuthorizedAddresses []string `protobuf:"bytes,17,rep,name=optimistic_authorized_addresses,json=optimisticAuthorizedAddresses,proto3" json:"optimistic_authorized_addresses,omitempty"` + OptimisticAuthorizedAddresses []string `protobuf:"bytes,18,rep,name=optimistic_authorized_addresses,json=optimisticAuthorizedAddresses,proto3" json:"optimistic_authorized_addresses,omitempty"` // optimistic rejected threshold defines at which percentage of NO votes, the optimistic proposal should fail and be // converted to a standard proposal. The threshold is expressed as a percentage of the total bonded tokens. // // Since: x/gov v1.0.0 - OptimisticRejectedThreshold string `protobuf:"bytes,18,opt,name=optimistic_rejected_threshold,json=optimisticRejectedThreshold,proto3" json:"optimistic_rejected_threshold,omitempty"` + OptimisticRejectedThreshold string `protobuf:"bytes,19,opt,name=optimistic_rejected_threshold,json=optimisticRejectedThreshold,proto3" json:"optimistic_rejected_threshold,omitempty"` } func (x *Params) Reset() { *x = Params{} if protoimpl.UnsafeEnabled { - mi := &file_cosmos_gov_v1_gov_proto_msgTypes[8] + mi := &file_cosmos_gov_v1_gov_proto_msgTypes[9] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -8172,7 +9003,7 @@ func (*Params) ProtoMessage() {} // Deprecated: Use Params.ProtoReflect.Descriptor instead. func (*Params) Descriptor() ([]byte, []int) { - return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{8} + return file_cosmos_gov_v1_gov_proto_rawDescGZIP(), []int{9} } func (x *Params) GetMinDeposit() []*v1beta1.Coin { @@ -8287,6 +9118,13 @@ func (x *Params) GetMinDepositRatio() string { return "" } +func (x *Params) GetProposalCancelMaxPeriod() string { + if x != nil { + return x.ProposalCancelMaxPeriod + } + return "" +} + func (x *Params) GetOptimisticAuthorizedAddresses() []string { if x != nil { return x.OptimisticAuthorizedAddresses @@ -8388,191 +9226,208 @@ var file_cosmos_gov_v1_gov_proto_rawDesc = []byte{ 0x73, 0x61, 0x6c, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x10, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x52, 0x0c, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x22, 0x86, 0x02, 0x0a, 0x0b, 0x54, 0x61, - 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, - 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, - 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, - 0x73, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, - 0x6e, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, - 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, - 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, - 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, - 0x68, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x22, 0xb8, 0x01, 0x0a, 0x13, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x6e, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x6e, 0x65, + 0x12, 0x1d, 0x0a, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x77, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x77, 0x6f, 0x12, + 0x21, 0x0a, 0x0c, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x65, 0x18, + 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x54, 0x68, 0x72, + 0x65, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x66, 0x6f, 0x75, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x46, + 0x6f, 0x75, 0x72, 0x12, 0x1f, 0x0a, 0x0b, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x70, + 0x61, 0x6d, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x53, 0x70, 0x61, 0x6d, 0x22, 0x86, 0x02, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, + 0x73, 0x75, 0x6c, 0x74, 0x12, 0x2b, 0x0a, 0x09, 0x79, 0x65, 0x73, 0x5f, 0x63, 0x6f, 0x75, 0x6e, + 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x08, 0x79, 0x65, 0x73, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x33, 0x0a, 0x0d, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, 0x6e, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0c, 0x61, 0x62, 0x73, 0x74, 0x61, 0x69, + 0x6e, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x29, 0x0a, 0x08, 0x6e, 0x6f, 0x5f, 0x63, 0x6f, 0x75, + 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x07, 0x6e, 0x6f, 0x43, 0x6f, 0x75, 0x6e, + 0x74, 0x12, 0x3b, 0x0a, 0x12, 0x6e, 0x6f, 0x5f, 0x77, 0x69, 0x74, 0x68, 0x5f, 0x76, 0x65, 0x74, + 0x6f, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, + 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x0f, 0x6e, + 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2d, + 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x49, - 0x6e, 0x74, 0x52, 0x0f, 0x6e, 0x6f, 0x57, 0x69, 0x74, 0x68, 0x56, 0x65, 0x74, 0x6f, 0x43, 0x6f, - 0x75, 0x6e, 0x74, 0x12, 0x2d, 0x0a, 0x0a, 0x73, 0x70, 0x61, 0x6d, 0x5f, 0x63, 0x6f, 0x75, 0x6e, - 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x49, 0x6e, 0x74, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6d, 0x43, 0x6f, 0x75, - 0x6e, 0x74, 0x22, 0xb6, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, - 0x76, 0x6f, 0x74, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, - 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, - 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, - 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, - 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 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, 0x1d, 0xc8, - 0xde, 0x1f, 0x00, 0xea, 0xde, 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, - 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, - 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, 0x42, - 0x24, 0xea, 0xde, 0x1f, 0x1c, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, - 0x79, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, - 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, - 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 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, 0x42, 0x04, 0x98, - 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, - 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, - 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, - 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, + 0x6e, 0x74, 0x52, 0x09, 0x73, 0x70, 0x61, 0x6d, 0x43, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0xb6, 0x01, + 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x12, 0x2e, 0x0a, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, + 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, + 0x52, 0x05, 0x76, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x3b, 0x0a, 0x07, 0x6f, 0x70, 0x74, 0x69, 0x6f, + 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, + 0x64, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x07, 0x6f, 0x70, 0x74, + 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, + 0x4a, 0x04, 0x08, 0x03, 0x10, 0x04, 0x22, 0xdd, 0x01, 0x0a, 0x0d, 0x44, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x59, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 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, 0x1d, 0xc8, 0xde, 0x1f, 0x00, 0xea, 0xde, + 0x1f, 0x15, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x2c, 0x6f, 0x6d, + 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x6d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 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, 0x42, 0x24, 0xea, 0xde, 0x1f, 0x1c, + 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x2c, 0x6f, 0x6d, 0x69, 0x74, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x98, 0xdf, 0x1f, 0x01, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x58, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, + 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 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, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, + 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x3a, 0x02, 0x18, 0x01, + 0x22, 0x9e, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, - 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, - 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, + 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, + 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, + 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, + 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, + 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x3a, 0x02, 0x18, + 0x01, 0x22, 0x92, 0x0a, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x45, 0x0a, 0x0b, + 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 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, 0x09, 0xc8, 0xde, + 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, + 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, 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, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, + 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x65, 0x72, 0x69, + 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, + 0x69, 0x6f, 0x64, 0x18, 0x03, 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, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x0c, 0x76, 0x6f, 0x74, 0x69, + 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x71, 0x75, 0x6f, 0x72, + 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, + 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xc5, 0x09, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x45, 0x0a, 0x0b, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 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, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0a, 0x6d, 0x69, - 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x4d, 0x0a, 0x12, 0x6d, 0x61, 0x78, 0x5f, - 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x02, - 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, 0x42, - 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x10, 0x6d, 0x61, 0x78, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x44, 0x0a, 0x0d, 0x76, 0x6f, 0x74, 0x69, 0x6e, - 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x03, 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, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, - 0x0c, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x26, 0x0a, - 0x06, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x06, 0x71, - 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x2c, 0x0a, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, - 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, - 0x6f, 0x6c, 0x64, 0x12, 0x35, 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, - 0x6f, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, - 0x6e, 0x5f, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, - 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, - 0x69, 0x6e, 0x49, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, - 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x42, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x44, 0x65, 0x63, 0x52, 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, - 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, - 0x67, 0x52, 0x12, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, - 0x6c, 0x44, 0x65, 0x73, 0x74, 0x12, 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, - 0x65, 0x64, 0x5f, 0x76, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, - 0x18, 0x0a, 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, 0x42, 0x04, 0x98, 0xdf, 0x1f, 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, - 0x65, 0x64, 0x56, 0x6f, 0x74, 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, - 0x0a, 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, - 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, - 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, - 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, - 0x58, 0x0a, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, - 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x18, 0x0c, 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, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, - 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, - 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, - 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x08, 0x52, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, - 0x72, 0x75, 0x6d, 0x12, 0x41, 0x0a, 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, - 0x76, 0x6f, 0x74, 0x65, 0x18, 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, - 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, - 0x6f, 0x74, 0x65, 0x5f, 0x76, 0x65, 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, - 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, - 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, - 0x6f, 0x18, 0x10, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, - 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, 0x12, 0x60, 0x0a, 0x1f, 0x6f, 0x70, 0x74, 0x69, - 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x61, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, - 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x18, 0x11, 0x20, 0x03, 0x28, - 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, - 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x1d, 0x6f, 0x70, 0x74, - 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x41, 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, - 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x65, 0x73, 0x12, 0x52, 0x0a, 0x1d, 0x6f, 0x70, - 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, - 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x18, 0x12, 0x20, 0x01, 0x28, - 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, - 0x63, 0x52, 0x1b, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x6a, - 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0xa7, - 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, - 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, - 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, - 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, - 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, - 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, - 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x43, 0x48, 0x4f, 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, - 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, - 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, 0x54, 0x49, 0x43, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x50, - 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, - 0x45, 0x44, 0x49, 0x54, 0x45, 0x44, 0x10, 0x04, 0x2a, 0xfa, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, - 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, - 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, - 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, - 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x4e, 0x45, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, - 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x13, - 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, - 0x4f, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, 0x49, 0x4e, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, - 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x48, 0x52, 0x45, - 0x45, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, - 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, - 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x1c, 0x0a, - 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, - 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, 0x4f, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, - 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, - 0x05, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0xce, 0x01, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, - 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, - 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, - 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, - 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, - 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, - 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, - 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, - 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, - 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, - 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, - 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, - 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x9b, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, - 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, - 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, - 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, - 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, - 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x44, 0x65, 0x63, 0x52, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x35, + 0x0a, 0x0e, 0x76, 0x65, 0x74, 0x6f, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x0d, 0x76, 0x65, 0x74, 0x6f, 0x54, 0x68, 0x72, 0x65, + 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x49, 0x0a, 0x19, 0x6d, 0x69, 0x6e, 0x5f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, + 0x69, 0x6f, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x16, 0x6d, 0x69, 0x6e, 0x49, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, 0x74, 0x69, 0x6f, + 0x12, 0x42, 0x0a, 0x15, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x63, 0x61, 0x6e, + 0x63, 0x65, 0x6c, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, + 0x13, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x52, + 0x61, 0x74, 0x69, 0x6f, 0x12, 0x4a, 0x0a, 0x14, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x18, 0x09, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, + 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x12, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x44, 0x65, 0x73, 0x74, + 0x12, 0x57, 0x0a, 0x17, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x76, 0x6f, + 0x74, 0x69, 0x6e, 0x67, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x18, 0x0a, 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, 0x42, 0x04, 0x98, 0xdf, + 0x1f, 0x01, 0x52, 0x15, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x56, 0x6f, 0x74, + 0x69, 0x6e, 0x67, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, 0x12, 0x3f, 0x0a, 0x13, 0x65, 0x78, 0x70, + 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, + 0x18, 0x0b, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x12, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, + 0x64, 0x54, 0x68, 0x72, 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x12, 0x58, 0x0a, 0x15, 0x65, 0x78, + 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x5f, 0x6d, 0x69, 0x6e, 0x5f, 0x64, 0x65, 0x70, 0x6f, + 0x73, 0x69, 0x74, 0x18, 0x0c, 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, 0x09, 0xc8, 0xde, 0x1f, 0x00, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x13, 0x65, 0x78, 0x70, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x4d, 0x69, 0x6e, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x12, 0x28, 0x0a, 0x10, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, + 0x65, 0x5f, 0x71, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0e, + 0x62, 0x75, 0x72, 0x6e, 0x56, 0x6f, 0x74, 0x65, 0x51, 0x75, 0x6f, 0x72, 0x75, 0x6d, 0x12, 0x41, + 0x0a, 0x1d, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x70, 0x72, 0x65, 0x76, 0x6f, 0x74, 0x65, 0x18, + 0x0e, 0x20, 0x01, 0x28, 0x08, 0x52, 0x1a, 0x62, 0x75, 0x72, 0x6e, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x50, 0x72, 0x65, 0x76, 0x6f, 0x74, + 0x65, 0x12, 0x24, 0x0a, 0x0e, 0x62, 0x75, 0x72, 0x6e, 0x5f, 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x76, + 0x65, 0x74, 0x6f, 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x62, 0x75, 0x72, 0x6e, 0x56, + 0x6f, 0x74, 0x65, 0x56, 0x65, 0x74, 0x6f, 0x12, 0x3a, 0x0a, 0x11, 0x6d, 0x69, 0x6e, 0x5f, 0x64, + 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x5f, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x18, 0x10, 0x20, 0x01, + 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, + 0x65, 0x63, 0x52, 0x0f, 0x6d, 0x69, 0x6e, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x61, + 0x74, 0x69, 0x6f, 0x12, 0x4b, 0x0a, 0x1a, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x5f, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x65, 0x72, 0x69, 0x6f, + 0x64, 0x18, 0x11, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x17, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x4d, 0x61, 0x78, 0x50, 0x65, 0x72, 0x69, 0x6f, 0x64, + 0x12, 0x60, 0x0a, 0x1f, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x5f, 0x61, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, + 0x73, 0x65, 0x73, 0x18, 0x12, 0x20, 0x03, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x1d, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, 0x41, + 0x75, 0x74, 0x68, 0x6f, 0x72, 0x69, 0x7a, 0x65, 0x64, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x65, 0x73, 0x12, 0x52, 0x0a, 0x1d, 0x6f, 0x70, 0x74, 0x69, 0x6d, 0x69, 0x73, 0x74, 0x69, 0x63, + 0x5f, 0x72, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, + 0x6f, 0x6c, 0x64, 0x18, 0x13, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0e, 0xd2, 0xb4, 0x2d, 0x0a, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x44, 0x65, 0x63, 0x52, 0x1b, 0x6f, 0x70, 0x74, 0x69, 0x6d, + 0x69, 0x73, 0x74, 0x69, 0x63, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74, 0x65, 0x64, 0x54, 0x68, 0x72, + 0x65, 0x73, 0x68, 0x6f, 0x6c, 0x64, 0x2a, 0xa7, 0x01, 0x0a, 0x0c, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x50, 0x52, 0x4f, 0x50, 0x4f, + 0x53, 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, + 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, + 0x41, 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x41, 0x4e, 0x44, 0x41, 0x52, 0x44, + 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x54, + 0x59, 0x50, 0x45, 0x5f, 0x4d, 0x55, 0x4c, 0x54, 0x49, 0x50, 0x4c, 0x45, 0x5f, 0x43, 0x48, 0x4f, + 0x49, 0x43, 0x45, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4d, 0x49, 0x53, 0x54, 0x49, + 0x43, 0x10, 0x03, 0x12, 0x1b, 0x0a, 0x17, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, + 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x58, 0x50, 0x45, 0x44, 0x49, 0x54, 0x45, 0x44, 0x10, 0x04, + 0x2a, 0xfa, 0x01, 0x0a, 0x0a, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, + 0x1b, 0x0a, 0x17, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55, + 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13, 0x0a, 0x0f, + 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4f, 0x4e, 0x45, 0x10, + 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, + 0x5f, 0x59, 0x45, 0x53, 0x10, 0x01, 0x12, 0x13, 0x0a, 0x0f, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, + 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x57, 0x4f, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x56, + 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x41, 0x42, 0x53, 0x54, 0x41, + 0x49, 0x4e, 0x10, 0x02, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, + 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x48, 0x52, 0x45, 0x45, 0x10, 0x03, 0x12, 0x12, 0x0a, 0x0e, 0x56, + 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x10, 0x03, 0x12, + 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x46, + 0x4f, 0x55, 0x52, 0x10, 0x04, 0x12, 0x1c, 0x0a, 0x18, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, + 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x4e, 0x4f, 0x5f, 0x57, 0x49, 0x54, 0x48, 0x5f, 0x56, 0x45, 0x54, + 0x4f, 0x10, 0x04, 0x12, 0x14, 0x0a, 0x10, 0x56, 0x4f, 0x54, 0x45, 0x5f, 0x4f, 0x50, 0x54, 0x49, + 0x4f, 0x4e, 0x5f, 0x53, 0x50, 0x41, 0x4d, 0x10, 0x05, 0x1a, 0x02, 0x10, 0x01, 0x2a, 0xce, 0x01, + 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, + 0x12, 0x1f, 0x0a, 0x1b, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, + 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, + 0x00, 0x12, 0x22, 0x0a, 0x1e, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, + 0x41, 0x54, 0x55, 0x53, 0x5f, 0x44, 0x45, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x5f, 0x50, 0x45, 0x52, + 0x49, 0x4f, 0x44, 0x10, 0x01, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, + 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x56, 0x4f, 0x54, 0x49, 0x4e, 0x47, 0x5f, + 0x50, 0x45, 0x52, 0x49, 0x4f, 0x44, 0x10, 0x02, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, + 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x41, 0x53, 0x53, + 0x45, 0x44, 0x10, 0x03, 0x12, 0x1c, 0x0a, 0x18, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, + 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, + 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x50, 0x52, 0x4f, 0x50, 0x4f, 0x53, 0x41, 0x4c, 0x5f, 0x53, + 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x05, 0x42, 0x9b, + 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x42, 0x08, 0x47, 0x6f, 0x76, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, + 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, + 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, + 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -8588,7 +9443,7 @@ func file_cosmos_gov_v1_gov_proto_rawDescGZIP() []byte { } var file_cosmos_gov_v1_gov_proto_enumTypes = make([]protoimpl.EnumInfo, 3) -var file_cosmos_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 9) +var file_cosmos_gov_v1_gov_proto_msgTypes = make([]protoimpl.MessageInfo, 10) var file_cosmos_gov_v1_gov_proto_goTypes = []interface{}{ (ProposalType)(0), // 0: cosmos.gov.v1.ProposalType (VoteOption)(0), // 1: cosmos.gov.v1.VoteOption @@ -8596,38 +9451,39 @@ var file_cosmos_gov_v1_gov_proto_goTypes = []interface{}{ (*WeightedVoteOption)(nil), // 3: cosmos.gov.v1.WeightedVoteOption (*Deposit)(nil), // 4: cosmos.gov.v1.Deposit (*Proposal)(nil), // 5: cosmos.gov.v1.Proposal - (*TallyResult)(nil), // 6: cosmos.gov.v1.TallyResult - (*Vote)(nil), // 7: cosmos.gov.v1.Vote - (*DepositParams)(nil), // 8: cosmos.gov.v1.DepositParams - (*VotingParams)(nil), // 9: cosmos.gov.v1.VotingParams - (*TallyParams)(nil), // 10: cosmos.gov.v1.TallyParams - (*Params)(nil), // 11: cosmos.gov.v1.Params - (*v1beta1.Coin)(nil), // 12: cosmos.base.v1beta1.Coin - (*anypb.Any)(nil), // 13: google.protobuf.Any - (*timestamppb.Timestamp)(nil), // 14: google.protobuf.Timestamp - (*durationpb.Duration)(nil), // 15: google.protobuf.Duration + (*ProposalVoteOptions)(nil), // 6: cosmos.gov.v1.ProposalVoteOptions + (*TallyResult)(nil), // 7: cosmos.gov.v1.TallyResult + (*Vote)(nil), // 8: cosmos.gov.v1.Vote + (*DepositParams)(nil), // 9: cosmos.gov.v1.DepositParams + (*VotingParams)(nil), // 10: cosmos.gov.v1.VotingParams + (*TallyParams)(nil), // 11: cosmos.gov.v1.TallyParams + (*Params)(nil), // 12: cosmos.gov.v1.Params + (*v1beta1.Coin)(nil), // 13: cosmos.base.v1beta1.Coin + (*anypb.Any)(nil), // 14: google.protobuf.Any + (*timestamppb.Timestamp)(nil), // 15: google.protobuf.Timestamp + (*durationpb.Duration)(nil), // 16: google.protobuf.Duration } var file_cosmos_gov_v1_gov_proto_depIdxs = []int32{ 1, // 0: cosmos.gov.v1.WeightedVoteOption.option:type_name -> cosmos.gov.v1.VoteOption - 12, // 1: cosmos.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin - 13, // 2: cosmos.gov.v1.Proposal.messages:type_name -> google.protobuf.Any + 13, // 1: cosmos.gov.v1.Deposit.amount:type_name -> cosmos.base.v1beta1.Coin + 14, // 2: cosmos.gov.v1.Proposal.messages:type_name -> google.protobuf.Any 2, // 3: cosmos.gov.v1.Proposal.status:type_name -> cosmos.gov.v1.ProposalStatus - 6, // 4: cosmos.gov.v1.Proposal.final_tally_result:type_name -> cosmos.gov.v1.TallyResult - 14, // 5: cosmos.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp - 14, // 6: cosmos.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp - 12, // 7: cosmos.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin - 14, // 8: cosmos.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp - 14, // 9: cosmos.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp + 7, // 4: cosmos.gov.v1.Proposal.final_tally_result:type_name -> cosmos.gov.v1.TallyResult + 15, // 5: cosmos.gov.v1.Proposal.submit_time:type_name -> google.protobuf.Timestamp + 15, // 6: cosmos.gov.v1.Proposal.deposit_end_time:type_name -> google.protobuf.Timestamp + 13, // 7: cosmos.gov.v1.Proposal.total_deposit:type_name -> cosmos.base.v1beta1.Coin + 15, // 8: cosmos.gov.v1.Proposal.voting_start_time:type_name -> google.protobuf.Timestamp + 15, // 9: cosmos.gov.v1.Proposal.voting_end_time:type_name -> google.protobuf.Timestamp 0, // 10: cosmos.gov.v1.Proposal.proposal_type:type_name -> cosmos.gov.v1.ProposalType 3, // 11: cosmos.gov.v1.Vote.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 12, // 12: cosmos.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 15, // 13: cosmos.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration - 15, // 14: cosmos.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration - 12, // 15: cosmos.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin - 15, // 16: cosmos.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration - 15, // 17: cosmos.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration - 15, // 18: cosmos.gov.v1.Params.expedited_voting_period:type_name -> google.protobuf.Duration - 12, // 19: cosmos.gov.v1.Params.expedited_min_deposit:type_name -> cosmos.base.v1beta1.Coin + 13, // 12: cosmos.gov.v1.DepositParams.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 16, // 13: cosmos.gov.v1.DepositParams.max_deposit_period:type_name -> google.protobuf.Duration + 16, // 14: cosmos.gov.v1.VotingParams.voting_period:type_name -> google.protobuf.Duration + 13, // 15: cosmos.gov.v1.Params.min_deposit:type_name -> cosmos.base.v1beta1.Coin + 16, // 16: cosmos.gov.v1.Params.max_deposit_period:type_name -> google.protobuf.Duration + 16, // 17: cosmos.gov.v1.Params.voting_period:type_name -> google.protobuf.Duration + 16, // 18: cosmos.gov.v1.Params.expedited_voting_period:type_name -> google.protobuf.Duration + 13, // 19: cosmos.gov.v1.Params.expedited_min_deposit:type_name -> cosmos.base.v1beta1.Coin 20, // [20:20] is the sub-list for method output_type 20, // [20:20] is the sub-list for method input_type 20, // [20:20] is the sub-list for extension type_name @@ -8678,7 +9534,7 @@ func file_cosmos_gov_v1_gov_proto_init() { } } file_cosmos_gov_v1_gov_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TallyResult); i { + switch v := v.(*ProposalVoteOptions); i { case 0: return &v.state case 1: @@ -8690,7 +9546,7 @@ func file_cosmos_gov_v1_gov_proto_init() { } } file_cosmos_gov_v1_gov_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Vote); i { + switch v := v.(*TallyResult); i { case 0: return &v.state case 1: @@ -8702,7 +9558,7 @@ func file_cosmos_gov_v1_gov_proto_init() { } } file_cosmos_gov_v1_gov_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DepositParams); i { + switch v := v.(*Vote); i { case 0: return &v.state case 1: @@ -8714,7 +9570,7 @@ func file_cosmos_gov_v1_gov_proto_init() { } } file_cosmos_gov_v1_gov_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VotingParams); i { + switch v := v.(*DepositParams); i { case 0: return &v.state case 1: @@ -8726,7 +9582,7 @@ func file_cosmos_gov_v1_gov_proto_init() { } } file_cosmos_gov_v1_gov_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*TallyParams); i { + switch v := v.(*VotingParams); i { case 0: return &v.state case 1: @@ -8738,6 +9594,18 @@ func file_cosmos_gov_v1_gov_proto_init() { } } file_cosmos_gov_v1_gov_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*TallyParams); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1_gov_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*Params); i { case 0: return &v.state @@ -8756,7 +9624,7 @@ func file_cosmos_gov_v1_gov_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_gov_proto_rawDesc, NumEnums: 3, - NumMessages: 9, + NumMessages: 10, NumExtensions: 0, NumServices: 0, }, diff --git a/api/cosmos/gov/v1/query.pulsar.go b/api/cosmos/gov/v1/query.pulsar.go index 4280e95753d1..b1f96838f05b 100644 --- a/api/cosmos/gov/v1/query.pulsar.go +++ b/api/cosmos/gov/v1/query.pulsar.go @@ -8663,6 +8663,845 @@ func (x *fastReflection_QueryTallyResultResponse) ProtoMethods() *protoiface.Met } } +var ( + md_QueryProposalVoteOptionsRequest protoreflect.MessageDescriptor + fd_QueryProposalVoteOptionsRequest_proposal_id protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_query_proto_init() + md_QueryProposalVoteOptionsRequest = File_cosmos_gov_v1_query_proto.Messages().ByName("QueryProposalVoteOptionsRequest") + fd_QueryProposalVoteOptionsRequest_proposal_id = md_QueryProposalVoteOptionsRequest.Fields().ByName("proposal_id") +} + +var _ protoreflect.Message = (*fastReflection_QueryProposalVoteOptionsRequest)(nil) + +type fastReflection_QueryProposalVoteOptionsRequest QueryProposalVoteOptionsRequest + +func (x *QueryProposalVoteOptionsRequest) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryProposalVoteOptionsRequest)(x) +} + +func (x *QueryProposalVoteOptionsRequest) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_query_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_QueryProposalVoteOptionsRequest_messageType fastReflection_QueryProposalVoteOptionsRequest_messageType +var _ protoreflect.MessageType = fastReflection_QueryProposalVoteOptionsRequest_messageType{} + +type fastReflection_QueryProposalVoteOptionsRequest_messageType struct{} + +func (x fastReflection_QueryProposalVoteOptionsRequest_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryProposalVoteOptionsRequest)(nil) +} +func (x fastReflection_QueryProposalVoteOptionsRequest_messageType) New() protoreflect.Message { + return new(fastReflection_QueryProposalVoteOptionsRequest) +} +func (x fastReflection_QueryProposalVoteOptionsRequest_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryProposalVoteOptionsRequest +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryProposalVoteOptionsRequest) Descriptor() protoreflect.MessageDescriptor { + return md_QueryProposalVoteOptionsRequest +} + +// 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_QueryProposalVoteOptionsRequest) Type() protoreflect.MessageType { + return _fastReflection_QueryProposalVoteOptionsRequest_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryProposalVoteOptionsRequest) New() protoreflect.Message { + return new(fastReflection_QueryProposalVoteOptionsRequest) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryProposalVoteOptionsRequest) Interface() protoreflect.ProtoMessage { + return (*QueryProposalVoteOptionsRequest)(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_QueryProposalVoteOptionsRequest) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProposalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalId) + if !f(fd_QueryProposalVoteOptionsRequest_proposal_id, 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_QueryProposalVoteOptionsRequest) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsRequest.proposal_id": + return x.ProposalId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsRequest")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsRequest 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_QueryProposalVoteOptionsRequest) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsRequest.proposal_id": + x.ProposalId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsRequest")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsRequest 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_QueryProposalVoteOptionsRequest) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsRequest.proposal_id": + value := x.ProposalId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsRequest")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsRequest 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_QueryProposalVoteOptionsRequest) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsRequest.proposal_id": + x.ProposalId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsRequest")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsRequest 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_QueryProposalVoteOptionsRequest) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsRequest.proposal_id": + panic(fmt.Errorf("field proposal_id of message cosmos.gov.v1.QueryProposalVoteOptionsRequest is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsRequest")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsRequest 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_QueryProposalVoteOptionsRequest) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsRequest.proposal_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsRequest")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsRequest 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_QueryProposalVoteOptionsRequest) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.QueryProposalVoteOptionsRequest", 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_QueryProposalVoteOptionsRequest) 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_QueryProposalVoteOptionsRequest) 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_QueryProposalVoteOptionsRequest) 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_QueryProposalVoteOptionsRequest) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryProposalVoteOptionsRequest) + 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.ProposalId != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalId)) + } + 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().(*QueryProposalVoteOptionsRequest) + 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.ProposalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId)) + i-- + dAtA[i] = 0x8 + } + 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().(*QueryProposalVoteOptionsRequest) + 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: QueryProposalVoteOptionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryProposalVoteOptionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + x.ProposalId = 0 + 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++ + x.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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_QueryProposalVoteOptionsResponse protoreflect.MessageDescriptor + fd_QueryProposalVoteOptionsResponse_vote_options protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_query_proto_init() + md_QueryProposalVoteOptionsResponse = File_cosmos_gov_v1_query_proto.Messages().ByName("QueryProposalVoteOptionsResponse") + fd_QueryProposalVoteOptionsResponse_vote_options = md_QueryProposalVoteOptionsResponse.Fields().ByName("vote_options") +} + +var _ protoreflect.Message = (*fastReflection_QueryProposalVoteOptionsResponse)(nil) + +type fastReflection_QueryProposalVoteOptionsResponse QueryProposalVoteOptionsResponse + +func (x *QueryProposalVoteOptionsResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_QueryProposalVoteOptionsResponse)(x) +} + +func (x *QueryProposalVoteOptionsResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_query_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_QueryProposalVoteOptionsResponse_messageType fastReflection_QueryProposalVoteOptionsResponse_messageType +var _ protoreflect.MessageType = fastReflection_QueryProposalVoteOptionsResponse_messageType{} + +type fastReflection_QueryProposalVoteOptionsResponse_messageType struct{} + +func (x fastReflection_QueryProposalVoteOptionsResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_QueryProposalVoteOptionsResponse)(nil) +} +func (x fastReflection_QueryProposalVoteOptionsResponse_messageType) New() protoreflect.Message { + return new(fastReflection_QueryProposalVoteOptionsResponse) +} +func (x fastReflection_QueryProposalVoteOptionsResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_QueryProposalVoteOptionsResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_QueryProposalVoteOptionsResponse) Descriptor() protoreflect.MessageDescriptor { + return md_QueryProposalVoteOptionsResponse +} + +// 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_QueryProposalVoteOptionsResponse) Type() protoreflect.MessageType { + return _fastReflection_QueryProposalVoteOptionsResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_QueryProposalVoteOptionsResponse) New() protoreflect.Message { + return new(fastReflection_QueryProposalVoteOptionsResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_QueryProposalVoteOptionsResponse) Interface() protoreflect.ProtoMessage { + return (*QueryProposalVoteOptionsResponse)(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_QueryProposalVoteOptionsResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.VoteOptions != nil { + value := protoreflect.ValueOfMessage(x.VoteOptions.ProtoReflect()) + if !f(fd_QueryProposalVoteOptionsResponse_vote_options, 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_QueryProposalVoteOptionsResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options": + return x.VoteOptions != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsResponse 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_QueryProposalVoteOptionsResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options": + x.VoteOptions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsResponse 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_QueryProposalVoteOptionsResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options": + value := x.VoteOptions + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsResponse 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_QueryProposalVoteOptionsResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options": + x.VoteOptions = value.Message().Interface().(*ProposalVoteOptions) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsResponse 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_QueryProposalVoteOptionsResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options": + if x.VoteOptions == nil { + x.VoteOptions = new(ProposalVoteOptions) + } + return protoreflect.ValueOfMessage(x.VoteOptions.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsResponse 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_QueryProposalVoteOptionsResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options": + m := new(ProposalVoteOptions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.QueryProposalVoteOptionsResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.QueryProposalVoteOptionsResponse 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_QueryProposalVoteOptionsResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.QueryProposalVoteOptionsResponse", 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_QueryProposalVoteOptionsResponse) 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_QueryProposalVoteOptionsResponse) 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_QueryProposalVoteOptionsResponse) 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_QueryProposalVoteOptionsResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*QueryProposalVoteOptionsResponse) + 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.VoteOptions != nil { + l = options.Size(x.VoteOptions) + 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().(*QueryProposalVoteOptionsResponse) + 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.VoteOptions != nil { + encoded, err := options.Marshal(x.VoteOptions) + 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().(*QueryProposalVoteOptionsResponse) + 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: QueryProposalVoteOptionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: QueryProposalVoteOptionsResponse: 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 VoteOptions", 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.VoteOptions == nil { + x.VoteOptions = &ProposalVoteOptions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VoteOptions); 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, + } +} + // Since: cosmos-sdk 0.46 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -9466,6 +10305,80 @@ func (x *QueryTallyResultResponse) GetTally() *TallyResult { return nil } +// QueryProposalVoteOptionsRequest is the request type for the Query/ProposalVoteOptions RPC method. +type QueryProposalVoteOptionsRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (x *QueryProposalVoteOptionsRequest) Reset() { + *x = QueryProposalVoteOptionsRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_query_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryProposalVoteOptionsRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryProposalVoteOptionsRequest) ProtoMessage() {} + +// Deprecated: Use QueryProposalVoteOptionsRequest.ProtoReflect.Descriptor instead. +func (*QueryProposalVoteOptionsRequest) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_query_proto_rawDescGZIP(), []int{18} +} + +func (x *QueryProposalVoteOptionsRequest) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + +// QueryProposalVoteOptionsResponse is the response type for the Query/ProposalVoteOptions RPC method. +type QueryProposalVoteOptionsResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // vote_options defines the valid voting options for a proposal. + VoteOptions *ProposalVoteOptions `protobuf:"bytes,1,opt,name=vote_options,json=voteOptions,proto3" json:"vote_options,omitempty"` +} + +func (x *QueryProposalVoteOptionsResponse) Reset() { + *x = QueryProposalVoteOptionsResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_query_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *QueryProposalVoteOptionsResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*QueryProposalVoteOptionsResponse) ProtoMessage() {} + +// Deprecated: Use QueryProposalVoteOptionsResponse.ProtoReflect.Descriptor instead. +func (*QueryProposalVoteOptionsResponse) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_query_proto_rawDescGZIP(), []int{19} +} + +func (x *QueryProposalVoteOptionsResponse) GetVoteOptions() *ProposalVoteOptions { + if x != nil { + return x.VoteOptions + } + return nil +} + var File_cosmos_gov_v1_query_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_query_proto_rawDesc = []byte{ @@ -9606,95 +10519,118 @@ var file_cosmos_gov_v1_query_proto_rawDesc = []byte{ 0x30, 0x0a, 0x05, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x05, 0x74, 0x61, 0x6c, 0x6c, - 0x79, 0x32, 0xe3, 0x09, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x86, 0x01, 0x0a, 0x0c, - 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, - 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x85, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, - 0x6c, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, - 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, - 0xe4, 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, - 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x09, - 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, - 0x25, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, - 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, - 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, + 0x79, 0x22, 0x42, 0x0a, 0x1f, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x49, 0x64, 0x22, 0x69, 0x0a, 0x20, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x45, 0x0a, 0x0c, 0x76, 0x6f, 0x74, + 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, + 0x6f, 0x6e, 0x73, 0x52, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, + 0x32, 0x99, 0x0b, 0x0a, 0x05, 0x51, 0x75, 0x65, 0x72, 0x79, 0x12, 0x86, 0x01, 0x0a, 0x0c, 0x43, + 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x27, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x43, 0x6f, 0x6e, 0x73, 0x74, 0x69, + 0x74, 0x75, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, + 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6e, 0x73, 0x74, 0x69, 0x74, 0x75, 0x74, + 0x69, 0x6f, 0x6e, 0x12, 0x85, 0x01, 0x0a, 0x08, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2e, 0x82, 0xd3, 0xe4, + 0x93, 0x02, 0x28, 0x12, 0x26, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, + 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x7a, 0x0a, 0x09, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x52, 0x65, 0x73, + 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x20, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1a, 0x12, 0x18, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, + 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, + 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x76, 0x6f, 0x74, 0x65, 0x72, + 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x05, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, + 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, + 0x2f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x7c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, + 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, + 0x23, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, + 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, 0x74, + 0x79, 0x70, 0x65, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, + 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x3d, 0x12, 0x3b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, + 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, + 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x7d, 0x12, 0x8e, + 0x01, 0x0a, 0x08, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, + 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, + 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, 0x2f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, - 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x12, 0x87, 0x01, 0x0a, 0x04, 0x56, 0x6f, 0x74, - 0x65, 0x12, 0x1f, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, - 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x36, 0x12, 0x34, 0x2f, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, - 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x2f, 0x7b, 0x76, 0x6f, 0x74, 0x65, - 0x72, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x05, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x20, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, + 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, + 0x94, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x12, + 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, + 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, + 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, + 0x2f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x12, 0xb3, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x2e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x56, 0x6f, 0x74, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x76, 0x6f, 0x74, 0x65, 0x73, 0x12, 0x7c, 0x0a, 0x06, 0x50, 0x61, 0x72, 0x61, 0x6d, - 0x73, 0x12, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, - 0x12, 0x23, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, - 0x2f, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x5f, - 0x74, 0x79, 0x70, 0x65, 0x7d, 0x12, 0x97, 0x01, 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, - 0x74, 0x12, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, - 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x43, 0x82, 0xd3, 0xe4, 0x93, - 0x02, 0x3d, 0x12, 0x3b, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, - 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, - 0x69, 0x74, 0x73, 0x2f, 0x7b, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x7d, 0x12, - 0x8e, 0x01, 0x0a, 0x08, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x12, 0x23, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, - 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, - 0x74, 0x1a, 0x24, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x37, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x12, - 0x2f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, - 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, - 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x73, - 0x12, 0x94, 0x01, 0x0a, 0x0b, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, - 0x12, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, - 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, - 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, 0x75, 0x65, 0x72, 0x79, 0x54, 0x61, - 0x6c, 0x6c, 0x79, 0x52, 0x65, 0x73, 0x75, 0x6c, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x22, 0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, - 0x7d, 0x2f, 0x74, 0x61, 0x6c, 0x6c, 0x79, 0x42, 0x9d, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x0a, 0x51, - 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x3b, 0x67, 0x6f, - 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, - 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, - 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x51, + 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, + 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x3b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x35, 0x12, 0x33, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x73, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x7d, 0x2f, + 0x76, 0x6f, 0x74, 0x65, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x42, 0x9d, 0x01, 0x0a, + 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, + 0x76, 0x31, 0x42, 0x0a, 0x51, 0x75, 0x65, 0x72, 0x79, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, + 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, + 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, + 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, + 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, + 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, + 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, + 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -9709,80 +10645,86 @@ func file_cosmos_gov_v1_query_proto_rawDescGZIP() []byte { return file_cosmos_gov_v1_query_proto_rawDescData } -var file_cosmos_gov_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 18) +var file_cosmos_gov_v1_query_proto_msgTypes = make([]protoimpl.MessageInfo, 20) var file_cosmos_gov_v1_query_proto_goTypes = []interface{}{ - (*QueryConstitutionRequest)(nil), // 0: cosmos.gov.v1.QueryConstitutionRequest - (*QueryConstitutionResponse)(nil), // 1: cosmos.gov.v1.QueryConstitutionResponse - (*QueryProposalRequest)(nil), // 2: cosmos.gov.v1.QueryProposalRequest - (*QueryProposalResponse)(nil), // 3: cosmos.gov.v1.QueryProposalResponse - (*QueryProposalsRequest)(nil), // 4: cosmos.gov.v1.QueryProposalsRequest - (*QueryProposalsResponse)(nil), // 5: cosmos.gov.v1.QueryProposalsResponse - (*QueryVoteRequest)(nil), // 6: cosmos.gov.v1.QueryVoteRequest - (*QueryVoteResponse)(nil), // 7: cosmos.gov.v1.QueryVoteResponse - (*QueryVotesRequest)(nil), // 8: cosmos.gov.v1.QueryVotesRequest - (*QueryVotesResponse)(nil), // 9: cosmos.gov.v1.QueryVotesResponse - (*QueryParamsRequest)(nil), // 10: cosmos.gov.v1.QueryParamsRequest - (*QueryParamsResponse)(nil), // 11: cosmos.gov.v1.QueryParamsResponse - (*QueryDepositRequest)(nil), // 12: cosmos.gov.v1.QueryDepositRequest - (*QueryDepositResponse)(nil), // 13: cosmos.gov.v1.QueryDepositResponse - (*QueryDepositsRequest)(nil), // 14: cosmos.gov.v1.QueryDepositsRequest - (*QueryDepositsResponse)(nil), // 15: cosmos.gov.v1.QueryDepositsResponse - (*QueryTallyResultRequest)(nil), // 16: cosmos.gov.v1.QueryTallyResultRequest - (*QueryTallyResultResponse)(nil), // 17: cosmos.gov.v1.QueryTallyResultResponse - (*Proposal)(nil), // 18: cosmos.gov.v1.Proposal - (ProposalStatus)(0), // 19: cosmos.gov.v1.ProposalStatus - (*v1beta1.PageRequest)(nil), // 20: cosmos.base.query.v1beta1.PageRequest - (*v1beta1.PageResponse)(nil), // 21: cosmos.base.query.v1beta1.PageResponse - (*Vote)(nil), // 22: cosmos.gov.v1.Vote - (*VotingParams)(nil), // 23: cosmos.gov.v1.VotingParams - (*DepositParams)(nil), // 24: cosmos.gov.v1.DepositParams - (*TallyParams)(nil), // 25: cosmos.gov.v1.TallyParams - (*Params)(nil), // 26: cosmos.gov.v1.Params - (*Deposit)(nil), // 27: cosmos.gov.v1.Deposit - (*TallyResult)(nil), // 28: cosmos.gov.v1.TallyResult + (*QueryConstitutionRequest)(nil), // 0: cosmos.gov.v1.QueryConstitutionRequest + (*QueryConstitutionResponse)(nil), // 1: cosmos.gov.v1.QueryConstitutionResponse + (*QueryProposalRequest)(nil), // 2: cosmos.gov.v1.QueryProposalRequest + (*QueryProposalResponse)(nil), // 3: cosmos.gov.v1.QueryProposalResponse + (*QueryProposalsRequest)(nil), // 4: cosmos.gov.v1.QueryProposalsRequest + (*QueryProposalsResponse)(nil), // 5: cosmos.gov.v1.QueryProposalsResponse + (*QueryVoteRequest)(nil), // 6: cosmos.gov.v1.QueryVoteRequest + (*QueryVoteResponse)(nil), // 7: cosmos.gov.v1.QueryVoteResponse + (*QueryVotesRequest)(nil), // 8: cosmos.gov.v1.QueryVotesRequest + (*QueryVotesResponse)(nil), // 9: cosmos.gov.v1.QueryVotesResponse + (*QueryParamsRequest)(nil), // 10: cosmos.gov.v1.QueryParamsRequest + (*QueryParamsResponse)(nil), // 11: cosmos.gov.v1.QueryParamsResponse + (*QueryDepositRequest)(nil), // 12: cosmos.gov.v1.QueryDepositRequest + (*QueryDepositResponse)(nil), // 13: cosmos.gov.v1.QueryDepositResponse + (*QueryDepositsRequest)(nil), // 14: cosmos.gov.v1.QueryDepositsRequest + (*QueryDepositsResponse)(nil), // 15: cosmos.gov.v1.QueryDepositsResponse + (*QueryTallyResultRequest)(nil), // 16: cosmos.gov.v1.QueryTallyResultRequest + (*QueryTallyResultResponse)(nil), // 17: cosmos.gov.v1.QueryTallyResultResponse + (*QueryProposalVoteOptionsRequest)(nil), // 18: cosmos.gov.v1.QueryProposalVoteOptionsRequest + (*QueryProposalVoteOptionsResponse)(nil), // 19: cosmos.gov.v1.QueryProposalVoteOptionsResponse + (*Proposal)(nil), // 20: cosmos.gov.v1.Proposal + (ProposalStatus)(0), // 21: cosmos.gov.v1.ProposalStatus + (*v1beta1.PageRequest)(nil), // 22: cosmos.base.query.v1beta1.PageRequest + (*v1beta1.PageResponse)(nil), // 23: cosmos.base.query.v1beta1.PageResponse + (*Vote)(nil), // 24: cosmos.gov.v1.Vote + (*VotingParams)(nil), // 25: cosmos.gov.v1.VotingParams + (*DepositParams)(nil), // 26: cosmos.gov.v1.DepositParams + (*TallyParams)(nil), // 27: cosmos.gov.v1.TallyParams + (*Params)(nil), // 28: cosmos.gov.v1.Params + (*Deposit)(nil), // 29: cosmos.gov.v1.Deposit + (*TallyResult)(nil), // 30: cosmos.gov.v1.TallyResult + (*ProposalVoteOptions)(nil), // 31: cosmos.gov.v1.ProposalVoteOptions } var file_cosmos_gov_v1_query_proto_depIdxs = []int32{ - 18, // 0: cosmos.gov.v1.QueryProposalResponse.proposal:type_name -> cosmos.gov.v1.Proposal - 19, // 1: cosmos.gov.v1.QueryProposalsRequest.proposal_status:type_name -> cosmos.gov.v1.ProposalStatus - 20, // 2: cosmos.gov.v1.QueryProposalsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 18, // 3: cosmos.gov.v1.QueryProposalsResponse.proposals:type_name -> cosmos.gov.v1.Proposal - 21, // 4: cosmos.gov.v1.QueryProposalsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 22, // 5: cosmos.gov.v1.QueryVoteResponse.vote:type_name -> cosmos.gov.v1.Vote - 20, // 6: cosmos.gov.v1.QueryVotesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 22, // 7: cosmos.gov.v1.QueryVotesResponse.votes:type_name -> cosmos.gov.v1.Vote - 21, // 8: cosmos.gov.v1.QueryVotesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 23, // 9: cosmos.gov.v1.QueryParamsResponse.voting_params:type_name -> cosmos.gov.v1.VotingParams - 24, // 10: cosmos.gov.v1.QueryParamsResponse.deposit_params:type_name -> cosmos.gov.v1.DepositParams - 25, // 11: cosmos.gov.v1.QueryParamsResponse.tally_params:type_name -> cosmos.gov.v1.TallyParams - 26, // 12: cosmos.gov.v1.QueryParamsResponse.params:type_name -> cosmos.gov.v1.Params - 27, // 13: cosmos.gov.v1.QueryDepositResponse.deposit:type_name -> cosmos.gov.v1.Deposit - 20, // 14: cosmos.gov.v1.QueryDepositsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest - 27, // 15: cosmos.gov.v1.QueryDepositsResponse.deposits:type_name -> cosmos.gov.v1.Deposit - 21, // 16: cosmos.gov.v1.QueryDepositsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse - 28, // 17: cosmos.gov.v1.QueryTallyResultResponse.tally:type_name -> cosmos.gov.v1.TallyResult - 0, // 18: cosmos.gov.v1.Query.Constitution:input_type -> cosmos.gov.v1.QueryConstitutionRequest - 2, // 19: cosmos.gov.v1.Query.Proposal:input_type -> cosmos.gov.v1.QueryProposalRequest - 4, // 20: cosmos.gov.v1.Query.Proposals:input_type -> cosmos.gov.v1.QueryProposalsRequest - 6, // 21: cosmos.gov.v1.Query.Vote:input_type -> cosmos.gov.v1.QueryVoteRequest - 8, // 22: cosmos.gov.v1.Query.Votes:input_type -> cosmos.gov.v1.QueryVotesRequest - 10, // 23: cosmos.gov.v1.Query.Params:input_type -> cosmos.gov.v1.QueryParamsRequest - 12, // 24: cosmos.gov.v1.Query.Deposit:input_type -> cosmos.gov.v1.QueryDepositRequest - 14, // 25: cosmos.gov.v1.Query.Deposits:input_type -> cosmos.gov.v1.QueryDepositsRequest - 16, // 26: cosmos.gov.v1.Query.TallyResult:input_type -> cosmos.gov.v1.QueryTallyResultRequest - 1, // 27: cosmos.gov.v1.Query.Constitution:output_type -> cosmos.gov.v1.QueryConstitutionResponse - 3, // 28: cosmos.gov.v1.Query.Proposal:output_type -> cosmos.gov.v1.QueryProposalResponse - 5, // 29: cosmos.gov.v1.Query.Proposals:output_type -> cosmos.gov.v1.QueryProposalsResponse - 7, // 30: cosmos.gov.v1.Query.Vote:output_type -> cosmos.gov.v1.QueryVoteResponse - 9, // 31: cosmos.gov.v1.Query.Votes:output_type -> cosmos.gov.v1.QueryVotesResponse - 11, // 32: cosmos.gov.v1.Query.Params:output_type -> cosmos.gov.v1.QueryParamsResponse - 13, // 33: cosmos.gov.v1.Query.Deposit:output_type -> cosmos.gov.v1.QueryDepositResponse - 15, // 34: cosmos.gov.v1.Query.Deposits:output_type -> cosmos.gov.v1.QueryDepositsResponse - 17, // 35: cosmos.gov.v1.Query.TallyResult:output_type -> cosmos.gov.v1.QueryTallyResultResponse - 27, // [27:36] is the sub-list for method output_type - 18, // [18:27] is the sub-list for method input_type - 18, // [18:18] is the sub-list for extension type_name - 18, // [18:18] is the sub-list for extension extendee - 0, // [0:18] is the sub-list for field type_name + 20, // 0: cosmos.gov.v1.QueryProposalResponse.proposal:type_name -> cosmos.gov.v1.Proposal + 21, // 1: cosmos.gov.v1.QueryProposalsRequest.proposal_status:type_name -> cosmos.gov.v1.ProposalStatus + 22, // 2: cosmos.gov.v1.QueryProposalsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 20, // 3: cosmos.gov.v1.QueryProposalsResponse.proposals:type_name -> cosmos.gov.v1.Proposal + 23, // 4: cosmos.gov.v1.QueryProposalsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 24, // 5: cosmos.gov.v1.QueryVoteResponse.vote:type_name -> cosmos.gov.v1.Vote + 22, // 6: cosmos.gov.v1.QueryVotesRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 24, // 7: cosmos.gov.v1.QueryVotesResponse.votes:type_name -> cosmos.gov.v1.Vote + 23, // 8: cosmos.gov.v1.QueryVotesResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 25, // 9: cosmos.gov.v1.QueryParamsResponse.voting_params:type_name -> cosmos.gov.v1.VotingParams + 26, // 10: cosmos.gov.v1.QueryParamsResponse.deposit_params:type_name -> cosmos.gov.v1.DepositParams + 27, // 11: cosmos.gov.v1.QueryParamsResponse.tally_params:type_name -> cosmos.gov.v1.TallyParams + 28, // 12: cosmos.gov.v1.QueryParamsResponse.params:type_name -> cosmos.gov.v1.Params + 29, // 13: cosmos.gov.v1.QueryDepositResponse.deposit:type_name -> cosmos.gov.v1.Deposit + 22, // 14: cosmos.gov.v1.QueryDepositsRequest.pagination:type_name -> cosmos.base.query.v1beta1.PageRequest + 29, // 15: cosmos.gov.v1.QueryDepositsResponse.deposits:type_name -> cosmos.gov.v1.Deposit + 23, // 16: cosmos.gov.v1.QueryDepositsResponse.pagination:type_name -> cosmos.base.query.v1beta1.PageResponse + 30, // 17: cosmos.gov.v1.QueryTallyResultResponse.tally:type_name -> cosmos.gov.v1.TallyResult + 31, // 18: cosmos.gov.v1.QueryProposalVoteOptionsResponse.vote_options:type_name -> cosmos.gov.v1.ProposalVoteOptions + 0, // 19: cosmos.gov.v1.Query.Constitution:input_type -> cosmos.gov.v1.QueryConstitutionRequest + 2, // 20: cosmos.gov.v1.Query.Proposal:input_type -> cosmos.gov.v1.QueryProposalRequest + 4, // 21: cosmos.gov.v1.Query.Proposals:input_type -> cosmos.gov.v1.QueryProposalsRequest + 6, // 22: cosmos.gov.v1.Query.Vote:input_type -> cosmos.gov.v1.QueryVoteRequest + 8, // 23: cosmos.gov.v1.Query.Votes:input_type -> cosmos.gov.v1.QueryVotesRequest + 10, // 24: cosmos.gov.v1.Query.Params:input_type -> cosmos.gov.v1.QueryParamsRequest + 12, // 25: cosmos.gov.v1.Query.Deposit:input_type -> cosmos.gov.v1.QueryDepositRequest + 14, // 26: cosmos.gov.v1.Query.Deposits:input_type -> cosmos.gov.v1.QueryDepositsRequest + 16, // 27: cosmos.gov.v1.Query.TallyResult:input_type -> cosmos.gov.v1.QueryTallyResultRequest + 18, // 28: cosmos.gov.v1.Query.ProposalVoteOptions:input_type -> cosmos.gov.v1.QueryProposalVoteOptionsRequest + 1, // 29: cosmos.gov.v1.Query.Constitution:output_type -> cosmos.gov.v1.QueryConstitutionResponse + 3, // 30: cosmos.gov.v1.Query.Proposal:output_type -> cosmos.gov.v1.QueryProposalResponse + 5, // 31: cosmos.gov.v1.Query.Proposals:output_type -> cosmos.gov.v1.QueryProposalsResponse + 7, // 32: cosmos.gov.v1.Query.Vote:output_type -> cosmos.gov.v1.QueryVoteResponse + 9, // 33: cosmos.gov.v1.Query.Votes:output_type -> cosmos.gov.v1.QueryVotesResponse + 11, // 34: cosmos.gov.v1.Query.Params:output_type -> cosmos.gov.v1.QueryParamsResponse + 13, // 35: cosmos.gov.v1.Query.Deposit:output_type -> cosmos.gov.v1.QueryDepositResponse + 15, // 36: cosmos.gov.v1.Query.Deposits:output_type -> cosmos.gov.v1.QueryDepositsResponse + 17, // 37: cosmos.gov.v1.Query.TallyResult:output_type -> cosmos.gov.v1.QueryTallyResultResponse + 19, // 38: cosmos.gov.v1.Query.ProposalVoteOptions:output_type -> cosmos.gov.v1.QueryProposalVoteOptionsResponse + 29, // [29:39] is the sub-list for method output_type + 19, // [19:29] is the sub-list for method input_type + 19, // [19:19] is the sub-list for extension type_name + 19, // [19:19] is the sub-list for extension extendee + 0, // [0:19] is the sub-list for field type_name } func init() { file_cosmos_gov_v1_query_proto_init() } @@ -10008,6 +10950,30 @@ func file_cosmos_gov_v1_query_proto_init() { return nil } } + file_cosmos_gov_v1_query_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryProposalVoteOptionsRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1_query_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*QueryProposalVoteOptionsResponse); 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{ @@ -10015,7 +10981,7 @@ func file_cosmos_gov_v1_query_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_query_proto_rawDesc, NumEnums: 0, - NumMessages: 18, + NumMessages: 20, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/gov/v1/query_grpc.pb.go b/api/cosmos/gov/v1/query_grpc.pb.go index 9ca690fcf0ed..22025298870c 100644 --- a/api/cosmos/gov/v1/query_grpc.pb.go +++ b/api/cosmos/gov/v1/query_grpc.pb.go @@ -21,15 +21,16 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Query_Constitution_FullMethodName = "/cosmos.gov.v1.Query/Constitution" - Query_Proposal_FullMethodName = "/cosmos.gov.v1.Query/Proposal" - Query_Proposals_FullMethodName = "/cosmos.gov.v1.Query/Proposals" - Query_Vote_FullMethodName = "/cosmos.gov.v1.Query/Vote" - Query_Votes_FullMethodName = "/cosmos.gov.v1.Query/Votes" - Query_Params_FullMethodName = "/cosmos.gov.v1.Query/Params" - Query_Deposit_FullMethodName = "/cosmos.gov.v1.Query/Deposit" - Query_Deposits_FullMethodName = "/cosmos.gov.v1.Query/Deposits" - Query_TallyResult_FullMethodName = "/cosmos.gov.v1.Query/TallyResult" + Query_Constitution_FullMethodName = "/cosmos.gov.v1.Query/Constitution" + Query_Proposal_FullMethodName = "/cosmos.gov.v1.Query/Proposal" + Query_Proposals_FullMethodName = "/cosmos.gov.v1.Query/Proposals" + Query_Vote_FullMethodName = "/cosmos.gov.v1.Query/Vote" + Query_Votes_FullMethodName = "/cosmos.gov.v1.Query/Votes" + Query_Params_FullMethodName = "/cosmos.gov.v1.Query/Params" + Query_Deposit_FullMethodName = "/cosmos.gov.v1.Query/Deposit" + Query_Deposits_FullMethodName = "/cosmos.gov.v1.Query/Deposits" + Query_TallyResult_FullMethodName = "/cosmos.gov.v1.Query/TallyResult" + Query_ProposalVoteOptions_FullMethodName = "/cosmos.gov.v1.Query/ProposalVoteOptions" ) // QueryClient is the client API for Query service. @@ -54,6 +55,8 @@ type QueryClient interface { Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) // TallyResult queries the tally of a proposal vote. TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) + // ProposalVoteOptions queries the valid voting options for a proposal. + ProposalVoteOptions(ctx context.Context, in *QueryProposalVoteOptionsRequest, opts ...grpc.CallOption) (*QueryProposalVoteOptionsResponse, error) } type queryClient struct { @@ -145,6 +148,15 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque return out, nil } +func (c *queryClient) ProposalVoteOptions(ctx context.Context, in *QueryProposalVoteOptionsRequest, opts ...grpc.CallOption) (*QueryProposalVoteOptionsResponse, error) { + out := new(QueryProposalVoteOptionsResponse) + err := c.cc.Invoke(ctx, Query_ProposalVoteOptions_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. // All implementations must embed UnimplementedQueryServer // for forward compatibility @@ -167,6 +179,8 @@ type QueryServer interface { Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) // TallyResult queries the tally of a proposal vote. TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) + // ProposalVoteOptions queries the valid voting options for a proposal. + ProposalVoteOptions(context.Context, *QueryProposalVoteOptionsRequest) (*QueryProposalVoteOptionsResponse, error) mustEmbedUnimplementedQueryServer() } @@ -201,6 +215,9 @@ func (UnimplementedQueryServer) Deposits(context.Context, *QueryDepositsRequest) func (UnimplementedQueryServer) TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") } +func (UnimplementedQueryServer) ProposalVoteOptions(context.Context, *QueryProposalVoteOptionsRequest) (*QueryProposalVoteOptionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProposalVoteOptions not implemented") +} func (UnimplementedQueryServer) mustEmbedUnimplementedQueryServer() {} // UnsafeQueryServer may be embedded to opt out of forward compatibility for this service. @@ -376,6 +393,24 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_ProposalVoteOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalVoteOptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ProposalVoteOptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Query_ProposalVoteOptions_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProposalVoteOptions(ctx, req.(*QueryProposalVoteOptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + // Query_ServiceDesc is the grpc.ServiceDesc for Query service. // It's only intended for direct use with grpc.RegisterService, // and not to be introspected or modified (even as a copy) @@ -419,6 +454,10 @@ var Query_ServiceDesc = grpc.ServiceDesc{ MethodName: "TallyResult", Handler: _Query_TallyResult_Handler, }, + { + MethodName: "ProposalVoteOptions", + Handler: _Query_ProposalVoteOptions_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/query.proto", diff --git a/api/cosmos/gov/v1/tx.pulsar.go b/api/cosmos/gov/v1/tx.pulsar.go index f7706715bc4b..2b4d8aee9c43 100644 --- a/api/cosmos/gov/v1/tx.pulsar.go +++ b/api/cosmos/gov/v1/tx.pulsar.go @@ -7046,6 +7046,1239 @@ func (x *fastReflection_MsgCancelProposalResponse) ProtoMethods() *protoiface.Me } } +var _ protoreflect.List = (*_MsgSubmitMultipleChoiceProposal_1_list)(nil) + +type _MsgSubmitMultipleChoiceProposal_1_list struct { + list *[]*v1beta1.Coin +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) Len() int { + if x.list == nil { + return 0 + } + return len(*x.list) +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) Get(i int) protoreflect.Value { + return protoreflect.ValueOfMessage((*x.list)[i].ProtoReflect()) +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) Set(i int, value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + (*x.list)[i] = concreteValue +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) Append(value protoreflect.Value) { + valueUnwrapped := value.Message() + concreteValue := valueUnwrapped.Interface().(*v1beta1.Coin) + *x.list = append(*x.list, concreteValue) +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) AppendMutable() protoreflect.Value { + v := new(v1beta1.Coin) + *x.list = append(*x.list, v) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) Truncate(n int) { + for i := n; i < len(*x.list); i++ { + (*x.list)[i] = nil + } + *x.list = (*x.list)[:n] +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) NewElement() protoreflect.Value { + v := new(v1beta1.Coin) + return protoreflect.ValueOfMessage(v.ProtoReflect()) +} + +func (x *_MsgSubmitMultipleChoiceProposal_1_list) IsValid() bool { + return x.list != nil +} + +var ( + md_MsgSubmitMultipleChoiceProposal protoreflect.MessageDescriptor + fd_MsgSubmitMultipleChoiceProposal_initial_deposit protoreflect.FieldDescriptor + fd_MsgSubmitMultipleChoiceProposal_proposer protoreflect.FieldDescriptor + fd_MsgSubmitMultipleChoiceProposal_metadata protoreflect.FieldDescriptor + fd_MsgSubmitMultipleChoiceProposal_title protoreflect.FieldDescriptor + fd_MsgSubmitMultipleChoiceProposal_summary protoreflect.FieldDescriptor + fd_MsgSubmitMultipleChoiceProposal_vote_options protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_tx_proto_init() + md_MsgSubmitMultipleChoiceProposal = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgSubmitMultipleChoiceProposal") + fd_MsgSubmitMultipleChoiceProposal_initial_deposit = md_MsgSubmitMultipleChoiceProposal.Fields().ByName("initial_deposit") + fd_MsgSubmitMultipleChoiceProposal_proposer = md_MsgSubmitMultipleChoiceProposal.Fields().ByName("proposer") + fd_MsgSubmitMultipleChoiceProposal_metadata = md_MsgSubmitMultipleChoiceProposal.Fields().ByName("metadata") + fd_MsgSubmitMultipleChoiceProposal_title = md_MsgSubmitMultipleChoiceProposal.Fields().ByName("title") + fd_MsgSubmitMultipleChoiceProposal_summary = md_MsgSubmitMultipleChoiceProposal.Fields().ByName("summary") + fd_MsgSubmitMultipleChoiceProposal_vote_options = md_MsgSubmitMultipleChoiceProposal.Fields().ByName("vote_options") +} + +var _ protoreflect.Message = (*fastReflection_MsgSubmitMultipleChoiceProposal)(nil) + +type fastReflection_MsgSubmitMultipleChoiceProposal MsgSubmitMultipleChoiceProposal + +func (x *MsgSubmitMultipleChoiceProposal) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSubmitMultipleChoiceProposal)(x) +} + +func (x *MsgSubmitMultipleChoiceProposal) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[14] + 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_MsgSubmitMultipleChoiceProposal_messageType fastReflection_MsgSubmitMultipleChoiceProposal_messageType +var _ protoreflect.MessageType = fastReflection_MsgSubmitMultipleChoiceProposal_messageType{} + +type fastReflection_MsgSubmitMultipleChoiceProposal_messageType struct{} + +func (x fastReflection_MsgSubmitMultipleChoiceProposal_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSubmitMultipleChoiceProposal)(nil) +} +func (x fastReflection_MsgSubmitMultipleChoiceProposal_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSubmitMultipleChoiceProposal) +} +func (x fastReflection_MsgSubmitMultipleChoiceProposal_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitMultipleChoiceProposal +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSubmitMultipleChoiceProposal) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitMultipleChoiceProposal +} + +// 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_MsgSubmitMultipleChoiceProposal) Type() protoreflect.MessageType { + return _fastReflection_MsgSubmitMultipleChoiceProposal_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSubmitMultipleChoiceProposal) New() protoreflect.Message { + return new(fastReflection_MsgSubmitMultipleChoiceProposal) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSubmitMultipleChoiceProposal) Interface() protoreflect.ProtoMessage { + return (*MsgSubmitMultipleChoiceProposal)(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_MsgSubmitMultipleChoiceProposal) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if len(x.InitialDeposit) != 0 { + value := protoreflect.ValueOfList(&_MsgSubmitMultipleChoiceProposal_1_list{list: &x.InitialDeposit}) + if !f(fd_MsgSubmitMultipleChoiceProposal_initial_deposit, value) { + return + } + } + if x.Proposer != "" { + value := protoreflect.ValueOfString(x.Proposer) + if !f(fd_MsgSubmitMultipleChoiceProposal_proposer, value) { + return + } + } + if x.Metadata != "" { + value := protoreflect.ValueOfString(x.Metadata) + if !f(fd_MsgSubmitMultipleChoiceProposal_metadata, value) { + return + } + } + if x.Title != "" { + value := protoreflect.ValueOfString(x.Title) + if !f(fd_MsgSubmitMultipleChoiceProposal_title, value) { + return + } + } + if x.Summary != "" { + value := protoreflect.ValueOfString(x.Summary) + if !f(fd_MsgSubmitMultipleChoiceProposal_summary, value) { + return + } + } + if x.VoteOptions != nil { + value := protoreflect.ValueOfMessage(x.VoteOptions.ProtoReflect()) + if !f(fd_MsgSubmitMultipleChoiceProposal_vote_options, 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_MsgSubmitMultipleChoiceProposal) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit": + return len(x.InitialDeposit) != 0 + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.proposer": + return x.Proposer != "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.metadata": + return x.Metadata != "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.title": + return x.Title != "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.summary": + return x.Summary != "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options": + return x.VoteOptions != nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal 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_MsgSubmitMultipleChoiceProposal) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit": + x.InitialDeposit = nil + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.proposer": + x.Proposer = "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.metadata": + x.Metadata = "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.title": + x.Title = "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.summary": + x.Summary = "" + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options": + x.VoteOptions = nil + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal 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_MsgSubmitMultipleChoiceProposal) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit": + if len(x.InitialDeposit) == 0 { + return protoreflect.ValueOfList(&_MsgSubmitMultipleChoiceProposal_1_list{}) + } + listValue := &_MsgSubmitMultipleChoiceProposal_1_list{list: &x.InitialDeposit} + return protoreflect.ValueOfList(listValue) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.proposer": + value := x.Proposer + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.metadata": + value := x.Metadata + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.title": + value := x.Title + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.summary": + value := x.Summary + return protoreflect.ValueOfString(value) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options": + value := x.VoteOptions + return protoreflect.ValueOfMessage(value.ProtoReflect()) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal 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_MsgSubmitMultipleChoiceProposal) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit": + lv := value.List() + clv := lv.(*_MsgSubmitMultipleChoiceProposal_1_list) + x.InitialDeposit = *clv.list + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.proposer": + x.Proposer = value.Interface().(string) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.metadata": + x.Metadata = value.Interface().(string) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.title": + x.Title = value.Interface().(string) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.summary": + x.Summary = value.Interface().(string) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options": + x.VoteOptions = value.Message().Interface().(*ProposalVoteOptions) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal 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_MsgSubmitMultipleChoiceProposal) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit": + if x.InitialDeposit == nil { + x.InitialDeposit = []*v1beta1.Coin{} + } + value := &_MsgSubmitMultipleChoiceProposal_1_list{list: &x.InitialDeposit} + return protoreflect.ValueOfList(value) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options": + if x.VoteOptions == nil { + x.VoteOptions = new(ProposalVoteOptions) + } + return protoreflect.ValueOfMessage(x.VoteOptions.ProtoReflect()) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.proposer": + panic(fmt.Errorf("field proposer of message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal is not mutable")) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.metadata": + panic(fmt.Errorf("field metadata of message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal is not mutable")) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.title": + panic(fmt.Errorf("field title of message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal is not mutable")) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.summary": + panic(fmt.Errorf("field summary of message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal 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_MsgSubmitMultipleChoiceProposal) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit": + list := []*v1beta1.Coin{} + return protoreflect.ValueOfList(&_MsgSubmitMultipleChoiceProposal_1_list{list: &list}) + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.proposer": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.metadata": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.title": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.summary": + return protoreflect.ValueOfString("") + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options": + m := new(ProposalVoteOptions) + return protoreflect.ValueOfMessage(m.ProtoReflect()) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposal 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_MsgSubmitMultipleChoiceProposal) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.MsgSubmitMultipleChoiceProposal", 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_MsgSubmitMultipleChoiceProposal) 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_MsgSubmitMultipleChoiceProposal) 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_MsgSubmitMultipleChoiceProposal) 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_MsgSubmitMultipleChoiceProposal) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSubmitMultipleChoiceProposal) + 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.InitialDeposit) > 0 { + for _, e := range x.InitialDeposit { + l = options.Size(e) + n += 1 + l + runtime.Sov(uint64(l)) + } + } + l = len(x.Proposer) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Metadata) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Title) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + l = len(x.Summary) + if l > 0 { + n += 1 + l + runtime.Sov(uint64(l)) + } + if x.VoteOptions != nil { + l = options.Size(x.VoteOptions) + 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().(*MsgSubmitMultipleChoiceProposal) + 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.VoteOptions != nil { + encoded, err := options.Marshal(x.VoteOptions) + 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] = 0x32 + } + if len(x.Summary) > 0 { + i -= len(x.Summary) + copy(dAtA[i:], x.Summary) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Summary))) + i-- + dAtA[i] = 0x2a + } + if len(x.Title) > 0 { + i -= len(x.Title) + copy(dAtA[i:], x.Title) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Title))) + i-- + dAtA[i] = 0x22 + } + if len(x.Metadata) > 0 { + i -= len(x.Metadata) + copy(dAtA[i:], x.Metadata) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Metadata))) + i-- + dAtA[i] = 0x1a + } + if len(x.Proposer) > 0 { + i -= len(x.Proposer) + copy(dAtA[i:], x.Proposer) + i = runtime.EncodeVarint(dAtA, i, uint64(len(x.Proposer))) + i-- + dAtA[i] = 0x12 + } + if len(x.InitialDeposit) > 0 { + for iNdEx := len(x.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { + encoded, err := options.Marshal(x.InitialDeposit[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().(*MsgSubmitMultipleChoiceProposal) + 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: MsgSubmitMultipleChoiceProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSubmitMultipleChoiceProposal: 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 InitialDeposit", 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.InitialDeposit = append(x.InitialDeposit, &v1beta1.Coin{}) + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.InitialDeposit[len(x.InitialDeposit)-1]); 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 Proposer", 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.Proposer = 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 Metadata", 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.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Title", 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.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Summary", 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.Summary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field VoteOptions", 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.VoteOptions == nil { + x.VoteOptions = &ProposalVoteOptions{} + } + if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.VoteOptions); 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_MsgSubmitMultipleChoiceProposalResponse protoreflect.MessageDescriptor + fd_MsgSubmitMultipleChoiceProposalResponse_proposal_id protoreflect.FieldDescriptor +) + +func init() { + file_cosmos_gov_v1_tx_proto_init() + md_MsgSubmitMultipleChoiceProposalResponse = File_cosmos_gov_v1_tx_proto.Messages().ByName("MsgSubmitMultipleChoiceProposalResponse") + fd_MsgSubmitMultipleChoiceProposalResponse_proposal_id = md_MsgSubmitMultipleChoiceProposalResponse.Fields().ByName("proposal_id") +} + +var _ protoreflect.Message = (*fastReflection_MsgSubmitMultipleChoiceProposalResponse)(nil) + +type fastReflection_MsgSubmitMultipleChoiceProposalResponse MsgSubmitMultipleChoiceProposalResponse + +func (x *MsgSubmitMultipleChoiceProposalResponse) ProtoReflect() protoreflect.Message { + return (*fastReflection_MsgSubmitMultipleChoiceProposalResponse)(x) +} + +func (x *MsgSubmitMultipleChoiceProposalResponse) slowProtoReflect() protoreflect.Message { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[15] + 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_MsgSubmitMultipleChoiceProposalResponse_messageType fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType +var _ protoreflect.MessageType = fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType{} + +type fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType struct{} + +func (x fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType) Zero() protoreflect.Message { + return (*fastReflection_MsgSubmitMultipleChoiceProposalResponse)(nil) +} +func (x fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType) New() protoreflect.Message { + return new(fastReflection_MsgSubmitMultipleChoiceProposalResponse) +} +func (x fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitMultipleChoiceProposalResponse +} + +// Descriptor returns message descriptor, which contains only the protobuf +// type information for the message. +func (x *fastReflection_MsgSubmitMultipleChoiceProposalResponse) Descriptor() protoreflect.MessageDescriptor { + return md_MsgSubmitMultipleChoiceProposalResponse +} + +// 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_MsgSubmitMultipleChoiceProposalResponse) Type() protoreflect.MessageType { + return _fastReflection_MsgSubmitMultipleChoiceProposalResponse_messageType +} + +// New returns a newly allocated and mutable empty message. +func (x *fastReflection_MsgSubmitMultipleChoiceProposalResponse) New() protoreflect.Message { + return new(fastReflection_MsgSubmitMultipleChoiceProposalResponse) +} + +// Interface unwraps the message reflection interface and +// returns the underlying ProtoMessage interface. +func (x *fastReflection_MsgSubmitMultipleChoiceProposalResponse) Interface() protoreflect.ProtoMessage { + return (*MsgSubmitMultipleChoiceProposalResponse)(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_MsgSubmitMultipleChoiceProposalResponse) Range(f func(protoreflect.FieldDescriptor, protoreflect.Value) bool) { + if x.ProposalId != uint64(0) { + value := protoreflect.ValueOfUint64(x.ProposalId) + if !f(fd_MsgSubmitMultipleChoiceProposalResponse_proposal_id, 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_MsgSubmitMultipleChoiceProposalResponse) Has(fd protoreflect.FieldDescriptor) bool { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse.proposal_id": + return x.ProposalId != uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse 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_MsgSubmitMultipleChoiceProposalResponse) Clear(fd protoreflect.FieldDescriptor) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse.proposal_id": + x.ProposalId = uint64(0) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse 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_MsgSubmitMultipleChoiceProposalResponse) Get(descriptor protoreflect.FieldDescriptor) protoreflect.Value { + switch descriptor.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse.proposal_id": + value := x.ProposalId + return protoreflect.ValueOfUint64(value) + default: + if descriptor.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse 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_MsgSubmitMultipleChoiceProposalResponse) Set(fd protoreflect.FieldDescriptor, value protoreflect.Value) { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse.proposal_id": + x.ProposalId = value.Uint() + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse 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_MsgSubmitMultipleChoiceProposalResponse) Mutable(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse.proposal_id": + panic(fmt.Errorf("field proposal_id of message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse is not mutable")) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse 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_MsgSubmitMultipleChoiceProposalResponse) NewField(fd protoreflect.FieldDescriptor) protoreflect.Value { + switch fd.FullName() { + case "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse.proposal_id": + return protoreflect.ValueOfUint64(uint64(0)) + default: + if fd.IsExtension() { + panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse")) + } + panic(fmt.Errorf("message cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse 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_MsgSubmitMultipleChoiceProposalResponse) WhichOneof(d protoreflect.OneofDescriptor) protoreflect.FieldDescriptor { + switch d.FullName() { + default: + panic(fmt.Errorf("%s is not a oneof field in cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse", 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_MsgSubmitMultipleChoiceProposalResponse) 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_MsgSubmitMultipleChoiceProposalResponse) 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_MsgSubmitMultipleChoiceProposalResponse) 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_MsgSubmitMultipleChoiceProposalResponse) ProtoMethods() *protoiface.Methods { + size := func(input protoiface.SizeInput) protoiface.SizeOutput { + x := input.Message.Interface().(*MsgSubmitMultipleChoiceProposalResponse) + 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.ProposalId != 0 { + n += 1 + runtime.Sov(uint64(x.ProposalId)) + } + 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().(*MsgSubmitMultipleChoiceProposalResponse) + 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.ProposalId != 0 { + i = runtime.EncodeVarint(dAtA, i, uint64(x.ProposalId)) + i-- + dAtA[i] = 0x8 + } + 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().(*MsgSubmitMultipleChoiceProposalResponse) + 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: MsgSubmitMultipleChoiceProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: MsgSubmitMultipleChoiceProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + x.ProposalId = 0 + 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++ + x.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + 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, + } +} + // Since: cosmos-sdk 0.46 // Code generated by protoc-gen-go. DO NOT EDIT. @@ -7096,7 +8329,7 @@ type MsgSubmitProposal struct { // proposal_type defines the type of proposal // When not set defaults to PROPOSAL_TYPE_STANDARD // - // Since: cosmos-sdk 0.51 + // Since: x/gov v1.0.0 ProposalType ProposalType `protobuf:"varint,8,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } @@ -7738,6 +8971,129 @@ func (x *MsgCancelProposalResponse) GetCanceledHeight() uint64 { return 0 } +// MsgSubmitMultipleChoiceProposal defines a message to submit a multiple choice proposal. +// +// Since: x/gov 1.0.0 +type MsgSubmitMultipleChoiceProposal struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // initial_deposit is the deposit value that must be paid at proposal submission. + InitialDeposit []*v1beta1.Coin `protobuf:"bytes,1,rep,name=initial_deposit,json=initialDeposit,proto3" json:"initial_deposit,omitempty"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + // metadata is any arbitrary metadata attached to the proposal. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // title is the title of the proposal. + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + // summary is the summary of the proposal + Summary string `protobuf:"bytes,5,opt,name=summary,proto3" json:"summary,omitempty"` + // vote_options defines the vote options for the proposal. + VoteOptions *ProposalVoteOptions `protobuf:"bytes,6,opt,name=vote_options,json=voteOptions,proto3" json:"vote_options,omitempty"` +} + +func (x *MsgSubmitMultipleChoiceProposal) Reset() { + *x = MsgSubmitMultipleChoiceProposal{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSubmitMultipleChoiceProposal) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSubmitMultipleChoiceProposal) ProtoMessage() {} + +// Deprecated: Use MsgSubmitMultipleChoiceProposal.ProtoReflect.Descriptor instead. +func (*MsgSubmitMultipleChoiceProposal) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{14} +} + +func (x *MsgSubmitMultipleChoiceProposal) GetInitialDeposit() []*v1beta1.Coin { + if x != nil { + return x.InitialDeposit + } + return nil +} + +func (x *MsgSubmitMultipleChoiceProposal) GetProposer() string { + if x != nil { + return x.Proposer + } + return "" +} + +func (x *MsgSubmitMultipleChoiceProposal) GetMetadata() string { + if x != nil { + return x.Metadata + } + return "" +} + +func (x *MsgSubmitMultipleChoiceProposal) GetTitle() string { + if x != nil { + return x.Title + } + return "" +} + +func (x *MsgSubmitMultipleChoiceProposal) GetSummary() string { + if x != nil { + return x.Summary + } + return "" +} + +func (x *MsgSubmitMultipleChoiceProposal) GetVoteOptions() *ProposalVoteOptions { + if x != nil { + return x.VoteOptions + } + return nil +} + +// MsgSubmitMultipleChoiceProposalResponse defines the Msg/SubmitMultipleChoiceProposal response type. +// +// Since: x/gov 1.0.0 +type MsgSubmitMultipleChoiceProposalResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (x *MsgSubmitMultipleChoiceProposalResponse) Reset() { + *x = MsgSubmitMultipleChoiceProposalResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_cosmos_gov_v1_tx_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *MsgSubmitMultipleChoiceProposalResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MsgSubmitMultipleChoiceProposalResponse) ProtoMessage() {} + +// Deprecated: Use MsgSubmitMultipleChoiceProposalResponse.ProtoReflect.Descriptor instead. +func (*MsgSubmitMultipleChoiceProposalResponse) Descriptor() ([]byte, []int) { + return file_cosmos_gov_v1_tx_proto_rawDescGZIP(), []int{15} +} + +func (x *MsgSubmitMultipleChoiceProposalResponse) GetProposalId() uint64 { + if x != nil { + return x.ProposalId + } + return 0 +} + var File_cosmos_gov_v1_tx_proto protoreflect.FileDescriptor var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ @@ -7889,56 +9245,94 @@ var file_cosmos_gov_v1_tx_proto_rawDesc = []byte{ 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x27, 0x0a, 0x0f, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0e, 0x63, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x65, 0x64, 0x48, 0x65, - 0x69, 0x67, 0x68, 0x74, 0x32, 0xe8, 0x04, 0x0a, 0x03, 0x4d, 0x73, 0x67, 0x12, 0x5c, 0x0a, 0x0e, - 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, - 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, - 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x65, 0x0a, 0x11, 0x45, 0x78, - 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x12, - 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, - 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x69, 0x67, 0x68, 0x74, 0x22, 0x86, 0x03, 0x0a, 0x1f, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, + 0x69, 0x74, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, + 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x8a, 0x01, 0x0a, 0x0f, 0x69, 0x6e, 0x69, + 0x74, 0x69, 0x61, 0x6c, 0x5f, 0x64, 0x65, 0x70, 0x6f, 0x73, 0x69, 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, 0x46, 0xc8, + 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 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, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 0x9a, + 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, + 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0e, 0x69, 0x6e, 0x69, 0x74, 0x69, 0x61, 0x6c, 0x44, 0x65, + 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x34, 0x0a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, + 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, + 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, + 0x67, 0x52, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, + 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x18, 0x0a, + 0x07, 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, + 0x73, 0x75, 0x6d, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x45, 0x0a, 0x0c, 0x76, 0x6f, 0x74, 0x65, 0x5f, + 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, + 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x56, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, + 0x73, 0x52, 0x0b, 0x76, 0x6f, 0x74, 0x65, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x0d, + 0x82, 0xe7, 0xb0, 0x2a, 0x08, 0x70, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x65, 0x72, 0x22, 0x4a, 0x0a, + 0x27, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, + 0x6c, 0x65, 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x6f, 0x70, + 0x6f, 0x73, 0x61, 0x6c, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0a, 0x70, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x49, 0x64, 0x32, 0xf1, 0x05, 0x0a, 0x03, 0x4d, 0x73, + 0x67, 0x12, 0x5c, 0x0a, 0x0e, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, + 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x50, + 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x65, 0x0a, 0x11, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, + 0x74, 0x65, 0x6e, 0x74, 0x12, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, 0x63, 0x4c, 0x65, 0x67, 0x61, - 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, - 0x65, 0x1a, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, - 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, - 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, 0x69, 0x67, 0x68, 0x74, 0x65, - 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, 0x0a, 0x07, 0x44, 0x65, 0x70, - 0x6f, 0x73, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, - 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x1a, - 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, - 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, - 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, - 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x61, 0x72, 0x61, - 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x5c, 0x0a, 0x0e, 0x43, 0x61, - 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x20, 0x2e, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, - 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x28, + 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x1a, 0x2b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x45, 0x78, 0x65, + 0x63, 0x4c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x43, 0x6f, 0x6e, 0x74, 0x65, 0x6e, 0x74, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x04, 0x56, 0x6f, 0x74, 0x65, 0x12, 0x16, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x1a, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, + 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x56, 0x6f, 0x74, 0x65, 0x57, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x65, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x47, + 0x0a, 0x07, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x12, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, + 0x6f, 0x73, 0x69, 0x74, 0x1a, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, + 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x44, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x52, + 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, 0x0c, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x12, 0x1e, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x1a, 0x26, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, + 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x55, 0x70, 0x64, 0x61, 0x74, + 0x65, 0x50, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, + 0x5c, 0x0a, 0x0e, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, + 0x6c, 0x12, 0x20, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, + 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, + 0x73, 0x61, 0x6c, 0x1a, 0x28, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x2e, 0x4d, 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, + 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x86, 0x01, + 0x0a, 0x1c, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x12, 0x2e, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, + 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x1a, 0x36, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x2e, 0x4d, - 0x73, 0x67, 0x43, 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, - 0x9a, 0x01, 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, - 0x6f, 0x76, 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, - 0x5a, 0x26, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, - 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, - 0x76, 0x31, 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, - 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, - 0x0d, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, - 0x19, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, - 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, - 0x6f, 0x74, 0x6f, 0x33, + 0x73, 0x67, 0x53, 0x75, 0x62, 0x6d, 0x69, 0x74, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x70, 0x6c, 0x65, + 0x43, 0x68, 0x6f, 0x69, 0x63, 0x65, 0x50, 0x72, 0x6f, 0x70, 0x6f, 0x73, 0x61, 0x6c, 0x52, 0x65, + 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x1a, 0x05, 0x80, 0xe7, 0xb0, 0x2a, 0x01, 0x42, 0x9a, 0x01, + 0x0a, 0x11, 0x63, 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x67, 0x6f, 0x76, + 0x2e, 0x76, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x67, + 0x6f, 0x76, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x67, 0x6f, 0x76, 0x2f, 0x76, 0x31, + 0x3b, 0x67, 0x6f, 0x76, 0x76, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x47, 0x58, 0xaa, 0x02, 0x0d, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x47, 0x6f, 0x76, 0x2e, 0x56, 0x31, 0xca, 0x02, 0x0d, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0xe2, 0x02, 0x19, 0x43, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x47, 0x6f, 0x76, 0x5c, 0x56, 0x31, 0x5c, 0x47, 0x50, 0x42, + 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x0f, 0x43, 0x6f, 0x73, 0x6d, 0x6f, + 0x73, 0x3a, 0x3a, 0x47, 0x6f, 0x76, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, + 0x6f, 0x33, } var ( @@ -7953,59 +9347,66 @@ func file_cosmos_gov_v1_tx_proto_rawDescGZIP() []byte { return file_cosmos_gov_v1_tx_proto_rawDescData } -var file_cosmos_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 14) +var file_cosmos_gov_v1_tx_proto_msgTypes = make([]protoimpl.MessageInfo, 16) var file_cosmos_gov_v1_tx_proto_goTypes = []interface{}{ - (*MsgSubmitProposal)(nil), // 0: cosmos.gov.v1.MsgSubmitProposal - (*MsgSubmitProposalResponse)(nil), // 1: cosmos.gov.v1.MsgSubmitProposalResponse - (*MsgExecLegacyContent)(nil), // 2: cosmos.gov.v1.MsgExecLegacyContent - (*MsgExecLegacyContentResponse)(nil), // 3: cosmos.gov.v1.MsgExecLegacyContentResponse - (*MsgVote)(nil), // 4: cosmos.gov.v1.MsgVote - (*MsgVoteResponse)(nil), // 5: cosmos.gov.v1.MsgVoteResponse - (*MsgVoteWeighted)(nil), // 6: cosmos.gov.v1.MsgVoteWeighted - (*MsgVoteWeightedResponse)(nil), // 7: cosmos.gov.v1.MsgVoteWeightedResponse - (*MsgDeposit)(nil), // 8: cosmos.gov.v1.MsgDeposit - (*MsgDepositResponse)(nil), // 9: cosmos.gov.v1.MsgDepositResponse - (*MsgUpdateParams)(nil), // 10: cosmos.gov.v1.MsgUpdateParams - (*MsgUpdateParamsResponse)(nil), // 11: cosmos.gov.v1.MsgUpdateParamsResponse - (*MsgCancelProposal)(nil), // 12: cosmos.gov.v1.MsgCancelProposal - (*MsgCancelProposalResponse)(nil), // 13: cosmos.gov.v1.MsgCancelProposalResponse - (*anypb.Any)(nil), // 14: google.protobuf.Any - (*v1beta1.Coin)(nil), // 15: cosmos.base.v1beta1.Coin - (ProposalType)(0), // 16: cosmos.gov.v1.ProposalType - (VoteOption)(0), // 17: cosmos.gov.v1.VoteOption - (*WeightedVoteOption)(nil), // 18: cosmos.gov.v1.WeightedVoteOption - (*Params)(nil), // 19: cosmos.gov.v1.Params - (*timestamppb.Timestamp)(nil), // 20: google.protobuf.Timestamp + (*MsgSubmitProposal)(nil), // 0: cosmos.gov.v1.MsgSubmitProposal + (*MsgSubmitProposalResponse)(nil), // 1: cosmos.gov.v1.MsgSubmitProposalResponse + (*MsgExecLegacyContent)(nil), // 2: cosmos.gov.v1.MsgExecLegacyContent + (*MsgExecLegacyContentResponse)(nil), // 3: cosmos.gov.v1.MsgExecLegacyContentResponse + (*MsgVote)(nil), // 4: cosmos.gov.v1.MsgVote + (*MsgVoteResponse)(nil), // 5: cosmos.gov.v1.MsgVoteResponse + (*MsgVoteWeighted)(nil), // 6: cosmos.gov.v1.MsgVoteWeighted + (*MsgVoteWeightedResponse)(nil), // 7: cosmos.gov.v1.MsgVoteWeightedResponse + (*MsgDeposit)(nil), // 8: cosmos.gov.v1.MsgDeposit + (*MsgDepositResponse)(nil), // 9: cosmos.gov.v1.MsgDepositResponse + (*MsgUpdateParams)(nil), // 10: cosmos.gov.v1.MsgUpdateParams + (*MsgUpdateParamsResponse)(nil), // 11: cosmos.gov.v1.MsgUpdateParamsResponse + (*MsgCancelProposal)(nil), // 12: cosmos.gov.v1.MsgCancelProposal + (*MsgCancelProposalResponse)(nil), // 13: cosmos.gov.v1.MsgCancelProposalResponse + (*MsgSubmitMultipleChoiceProposal)(nil), // 14: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal + (*MsgSubmitMultipleChoiceProposalResponse)(nil), // 15: cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse + (*anypb.Any)(nil), // 16: google.protobuf.Any + (*v1beta1.Coin)(nil), // 17: cosmos.base.v1beta1.Coin + (ProposalType)(0), // 18: cosmos.gov.v1.ProposalType + (VoteOption)(0), // 19: cosmos.gov.v1.VoteOption + (*WeightedVoteOption)(nil), // 20: cosmos.gov.v1.WeightedVoteOption + (*Params)(nil), // 21: cosmos.gov.v1.Params + (*timestamppb.Timestamp)(nil), // 22: google.protobuf.Timestamp + (*ProposalVoteOptions)(nil), // 23: cosmos.gov.v1.ProposalVoteOptions } var file_cosmos_gov_v1_tx_proto_depIdxs = []int32{ - 14, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any - 15, // 1: cosmos.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin - 16, // 2: cosmos.gov.v1.MsgSubmitProposal.proposal_type:type_name -> cosmos.gov.v1.ProposalType - 14, // 3: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any - 17, // 4: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption - 18, // 5: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption - 15, // 6: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin - 19, // 7: cosmos.gov.v1.MsgUpdateParams.params:type_name -> cosmos.gov.v1.Params - 20, // 8: cosmos.gov.v1.MsgCancelProposalResponse.canceled_time:type_name -> google.protobuf.Timestamp - 0, // 9: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal - 2, // 10: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent - 4, // 11: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote - 6, // 12: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted - 8, // 13: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit - 10, // 14: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams - 12, // 15: cosmos.gov.v1.Msg.CancelProposal:input_type -> cosmos.gov.v1.MsgCancelProposal - 1, // 16: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse - 3, // 17: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse - 5, // 18: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse - 7, // 19: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse - 9, // 20: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse - 11, // 21: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse - 13, // 22: cosmos.gov.v1.Msg.CancelProposal:output_type -> cosmos.gov.v1.MsgCancelProposalResponse - 16, // [16:23] is the sub-list for method output_type - 9, // [9:16] 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 + 16, // 0: cosmos.gov.v1.MsgSubmitProposal.messages:type_name -> google.protobuf.Any + 17, // 1: cosmos.gov.v1.MsgSubmitProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin + 18, // 2: cosmos.gov.v1.MsgSubmitProposal.proposal_type:type_name -> cosmos.gov.v1.ProposalType + 16, // 3: cosmos.gov.v1.MsgExecLegacyContent.content:type_name -> google.protobuf.Any + 19, // 4: cosmos.gov.v1.MsgVote.option:type_name -> cosmos.gov.v1.VoteOption + 20, // 5: cosmos.gov.v1.MsgVoteWeighted.options:type_name -> cosmos.gov.v1.WeightedVoteOption + 17, // 6: cosmos.gov.v1.MsgDeposit.amount:type_name -> cosmos.base.v1beta1.Coin + 21, // 7: cosmos.gov.v1.MsgUpdateParams.params:type_name -> cosmos.gov.v1.Params + 22, // 8: cosmos.gov.v1.MsgCancelProposalResponse.canceled_time:type_name -> google.protobuf.Timestamp + 17, // 9: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.initial_deposit:type_name -> cosmos.base.v1beta1.Coin + 23, // 10: cosmos.gov.v1.MsgSubmitMultipleChoiceProposal.vote_options:type_name -> cosmos.gov.v1.ProposalVoteOptions + 0, // 11: cosmos.gov.v1.Msg.SubmitProposal:input_type -> cosmos.gov.v1.MsgSubmitProposal + 2, // 12: cosmos.gov.v1.Msg.ExecLegacyContent:input_type -> cosmos.gov.v1.MsgExecLegacyContent + 4, // 13: cosmos.gov.v1.Msg.Vote:input_type -> cosmos.gov.v1.MsgVote + 6, // 14: cosmos.gov.v1.Msg.VoteWeighted:input_type -> cosmos.gov.v1.MsgVoteWeighted + 8, // 15: cosmos.gov.v1.Msg.Deposit:input_type -> cosmos.gov.v1.MsgDeposit + 10, // 16: cosmos.gov.v1.Msg.UpdateParams:input_type -> cosmos.gov.v1.MsgUpdateParams + 12, // 17: cosmos.gov.v1.Msg.CancelProposal:input_type -> cosmos.gov.v1.MsgCancelProposal + 14, // 18: cosmos.gov.v1.Msg.SubmitMultipleChoiceProposal:input_type -> cosmos.gov.v1.MsgSubmitMultipleChoiceProposal + 1, // 19: cosmos.gov.v1.Msg.SubmitProposal:output_type -> cosmos.gov.v1.MsgSubmitProposalResponse + 3, // 20: cosmos.gov.v1.Msg.ExecLegacyContent:output_type -> cosmos.gov.v1.MsgExecLegacyContentResponse + 5, // 21: cosmos.gov.v1.Msg.Vote:output_type -> cosmos.gov.v1.MsgVoteResponse + 7, // 22: cosmos.gov.v1.Msg.VoteWeighted:output_type -> cosmos.gov.v1.MsgVoteWeightedResponse + 9, // 23: cosmos.gov.v1.Msg.Deposit:output_type -> cosmos.gov.v1.MsgDepositResponse + 11, // 24: cosmos.gov.v1.Msg.UpdateParams:output_type -> cosmos.gov.v1.MsgUpdateParamsResponse + 13, // 25: cosmos.gov.v1.Msg.CancelProposal:output_type -> cosmos.gov.v1.MsgCancelProposalResponse + 15, // 26: cosmos.gov.v1.Msg.SubmitMultipleChoiceProposal:output_type -> cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse + 19, // [19:27] is the sub-list for method output_type + 11, // [11:19] 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 } func init() { file_cosmos_gov_v1_tx_proto_init() } @@ -8183,6 +9584,30 @@ func file_cosmos_gov_v1_tx_proto_init() { return nil } } + file_cosmos_gov_v1_tx_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSubmitMultipleChoiceProposal); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_cosmos_gov_v1_tx_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*MsgSubmitMultipleChoiceProposalResponse); 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{ @@ -8190,7 +9615,7 @@ func file_cosmos_gov_v1_tx_proto_init() { GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_cosmos_gov_v1_tx_proto_rawDesc, NumEnums: 0, - NumMessages: 14, + NumMessages: 16, NumExtensions: 0, NumServices: 1, }, diff --git a/api/cosmos/gov/v1/tx_grpc.pb.go b/api/cosmos/gov/v1/tx_grpc.pb.go index 4f77b03d617b..4fb31e17f478 100644 --- a/api/cosmos/gov/v1/tx_grpc.pb.go +++ b/api/cosmos/gov/v1/tx_grpc.pb.go @@ -21,13 +21,14 @@ import ( const _ = grpc.SupportPackageIsVersion7 const ( - Msg_SubmitProposal_FullMethodName = "/cosmos.gov.v1.Msg/SubmitProposal" - Msg_ExecLegacyContent_FullMethodName = "/cosmos.gov.v1.Msg/ExecLegacyContent" - Msg_Vote_FullMethodName = "/cosmos.gov.v1.Msg/Vote" - Msg_VoteWeighted_FullMethodName = "/cosmos.gov.v1.Msg/VoteWeighted" - Msg_Deposit_FullMethodName = "/cosmos.gov.v1.Msg/Deposit" - Msg_UpdateParams_FullMethodName = "/cosmos.gov.v1.Msg/UpdateParams" - Msg_CancelProposal_FullMethodName = "/cosmos.gov.v1.Msg/CancelProposal" + Msg_SubmitProposal_FullMethodName = "/cosmos.gov.v1.Msg/SubmitProposal" + Msg_ExecLegacyContent_FullMethodName = "/cosmos.gov.v1.Msg/ExecLegacyContent" + Msg_Vote_FullMethodName = "/cosmos.gov.v1.Msg/Vote" + Msg_VoteWeighted_FullMethodName = "/cosmos.gov.v1.Msg/VoteWeighted" + Msg_Deposit_FullMethodName = "/cosmos.gov.v1.Msg/Deposit" + Msg_UpdateParams_FullMethodName = "/cosmos.gov.v1.Msg/UpdateParams" + Msg_CancelProposal_FullMethodName = "/cosmos.gov.v1.Msg/CancelProposal" + Msg_SubmitMultipleChoiceProposal_FullMethodName = "/cosmos.gov.v1.Msg/SubmitMultipleChoiceProposal" ) // MsgClient is the client API for Msg service. @@ -54,6 +55,10 @@ type MsgClient interface { // // Since: cosmos-sdk 0.50 CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) + // SubmitMultipleChoiceProposal defines a method to create new multiple choice proposal. + // + // Since: x/gov 1.0.0 + SubmitMultipleChoiceProposal(ctx context.Context, in *MsgSubmitMultipleChoiceProposal, opts ...grpc.CallOption) (*MsgSubmitMultipleChoiceProposalResponse, error) } type msgClient struct { @@ -127,6 +132,15 @@ func (c *msgClient) CancelProposal(ctx context.Context, in *MsgCancelProposal, o return out, nil } +func (c *msgClient) SubmitMultipleChoiceProposal(ctx context.Context, in *MsgSubmitMultipleChoiceProposal, opts ...grpc.CallOption) (*MsgSubmitMultipleChoiceProposalResponse, error) { + out := new(MsgSubmitMultipleChoiceProposalResponse) + err := c.cc.Invoke(ctx, Msg_SubmitMultipleChoiceProposal_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 @@ -151,6 +165,10 @@ type MsgServer interface { // // Since: cosmos-sdk 0.50 CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) + // SubmitMultipleChoiceProposal defines a method to create new multiple choice proposal. + // + // Since: x/gov 1.0.0 + SubmitMultipleChoiceProposal(context.Context, *MsgSubmitMultipleChoiceProposal) (*MsgSubmitMultipleChoiceProposalResponse, error) mustEmbedUnimplementedMsgServer() } @@ -179,6 +197,9 @@ func (UnimplementedMsgServer) UpdateParams(context.Context, *MsgUpdateParams) (* func (UnimplementedMsgServer) CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelProposal not implemented") } +func (UnimplementedMsgServer) SubmitMultipleChoiceProposal(context.Context, *MsgSubmitMultipleChoiceProposal) (*MsgSubmitMultipleChoiceProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitMultipleChoiceProposal not implemented") +} func (UnimplementedMsgServer) mustEmbedUnimplementedMsgServer() {} // UnsafeMsgServer may be embedded to opt out of forward compatibility for this service. @@ -318,6 +339,24 @@ func _Msg_CancelProposal_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_SubmitMultipleChoiceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitMultipleChoiceProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitMultipleChoiceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Msg_SubmitMultipleChoiceProposal_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitMultipleChoiceProposal(ctx, req.(*MsgSubmitMultipleChoiceProposal)) + } + 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) @@ -353,6 +392,10 @@ var Msg_ServiceDesc = grpc.ServiceDesc{ MethodName: "CancelProposal", Handler: _Msg_CancelProposal_Handler, }, + { + MethodName: "SubmitMultipleChoiceProposal", + Handler: _Msg_SubmitMultipleChoiceProposal_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/tx.proto", diff --git a/api/cosmos/tx/v1beta1/tx.pulsar.go b/api/cosmos/tx/v1beta1/tx.pulsar.go index 362609bcfc0f..eb43d518b4d3 100644 --- a/api/cosmos/tx/v1beta1/tx.pulsar.go +++ b/api/cosmos/tx/v1beta1/tx.pulsar.go @@ -2767,6 +2767,7 @@ var ( fd_TxBody_messages protoreflect.FieldDescriptor fd_TxBody_memo protoreflect.FieldDescriptor fd_TxBody_timeout_height protoreflect.FieldDescriptor + fd_TxBody_unordered protoreflect.FieldDescriptor fd_TxBody_extension_options protoreflect.FieldDescriptor fd_TxBody_non_critical_extension_options protoreflect.FieldDescriptor ) @@ -2777,6 +2778,7 @@ func init() { fd_TxBody_messages = md_TxBody.Fields().ByName("messages") fd_TxBody_memo = md_TxBody.Fields().ByName("memo") fd_TxBody_timeout_height = md_TxBody.Fields().ByName("timeout_height") + fd_TxBody_unordered = md_TxBody.Fields().ByName("unordered") fd_TxBody_extension_options = md_TxBody.Fields().ByName("extension_options") fd_TxBody_non_critical_extension_options = md_TxBody.Fields().ByName("non_critical_extension_options") } @@ -2864,6 +2866,12 @@ func (x *fastReflection_TxBody) Range(f func(protoreflect.FieldDescriptor, proto return } } + if x.Unordered != false { + value := protoreflect.ValueOfBool(x.Unordered) + if !f(fd_TxBody_unordered, value) { + return + } + } if len(x.ExtensionOptions) != 0 { value := protoreflect.ValueOfList(&_TxBody_1023_list{list: &x.ExtensionOptions}) if !f(fd_TxBody_extension_options, value) { @@ -2897,6 +2905,8 @@ func (x *fastReflection_TxBody) Has(fd protoreflect.FieldDescriptor) bool { return x.Memo != "" case "cosmos.tx.v1beta1.TxBody.timeout_height": return x.TimeoutHeight != uint64(0) + case "cosmos.tx.v1beta1.TxBody.unordered": + return x.Unordered != false case "cosmos.tx.v1beta1.TxBody.extension_options": return len(x.ExtensionOptions) != 0 case "cosmos.tx.v1beta1.TxBody.non_critical_extension_options": @@ -2923,6 +2933,8 @@ func (x *fastReflection_TxBody) Clear(fd protoreflect.FieldDescriptor) { x.Memo = "" case "cosmos.tx.v1beta1.TxBody.timeout_height": x.TimeoutHeight = uint64(0) + case "cosmos.tx.v1beta1.TxBody.unordered": + x.Unordered = false case "cosmos.tx.v1beta1.TxBody.extension_options": x.ExtensionOptions = nil case "cosmos.tx.v1beta1.TxBody.non_critical_extension_options": @@ -2955,6 +2967,9 @@ func (x *fastReflection_TxBody) Get(descriptor protoreflect.FieldDescriptor) pro case "cosmos.tx.v1beta1.TxBody.timeout_height": value := x.TimeoutHeight return protoreflect.ValueOfUint64(value) + case "cosmos.tx.v1beta1.TxBody.unordered": + value := x.Unordered + return protoreflect.ValueOfBool(value) case "cosmos.tx.v1beta1.TxBody.extension_options": if len(x.ExtensionOptions) == 0 { return protoreflect.ValueOfList(&_TxBody_1023_list{}) @@ -2995,6 +3010,8 @@ func (x *fastReflection_TxBody) Set(fd protoreflect.FieldDescriptor, value proto x.Memo = value.Interface().(string) case "cosmos.tx.v1beta1.TxBody.timeout_height": x.TimeoutHeight = value.Uint() + case "cosmos.tx.v1beta1.TxBody.unordered": + x.Unordered = value.Bool() case "cosmos.tx.v1beta1.TxBody.extension_options": lv := value.List() clv := lv.(*_TxBody_1023_list) @@ -3045,6 +3062,8 @@ func (x *fastReflection_TxBody) Mutable(fd protoreflect.FieldDescriptor) protore panic(fmt.Errorf("field memo of message cosmos.tx.v1beta1.TxBody is not mutable")) case "cosmos.tx.v1beta1.TxBody.timeout_height": panic(fmt.Errorf("field timeout_height of message cosmos.tx.v1beta1.TxBody is not mutable")) + case "cosmos.tx.v1beta1.TxBody.unordered": + panic(fmt.Errorf("field unordered of message cosmos.tx.v1beta1.TxBody is not mutable")) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: cosmos.tx.v1beta1.TxBody")) @@ -3065,6 +3084,8 @@ func (x *fastReflection_TxBody) NewField(fd protoreflect.FieldDescriptor) protor return protoreflect.ValueOfString("") case "cosmos.tx.v1beta1.TxBody.timeout_height": return protoreflect.ValueOfUint64(uint64(0)) + case "cosmos.tx.v1beta1.TxBody.unordered": + return protoreflect.ValueOfBool(false) case "cosmos.tx.v1beta1.TxBody.extension_options": list := []*anypb.Any{} return protoreflect.ValueOfList(&_TxBody_1023_list{list: &list}) @@ -3153,6 +3174,9 @@ func (x *fastReflection_TxBody) ProtoMethods() *protoiface.Methods { if x.TimeoutHeight != 0 { n += 1 + runtime.Sov(uint64(x.TimeoutHeight)) } + if x.Unordered { + n += 2 + } if len(x.ExtensionOptions) > 0 { for _, e := range x.ExtensionOptions { l = options.Size(e) @@ -3230,6 +3254,16 @@ func (x *fastReflection_TxBody) ProtoMethods() *protoiface.Methods { dAtA[i] = 0xfa } } + if x.Unordered { + i-- + if x.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if x.TimeoutHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeoutHeight)) i-- @@ -3392,6 +3426,26 @@ func (x *fastReflection_TxBody) ProtoMethods() *protoiface.Methods { break } } + case 4: + if wireType != 0 { + return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Unordered", wireType) + } + var v 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++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + x.Unordered = bool(v != 0) case 1023: if wireType != 2 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field ExtensionOptions", wireType) @@ -8414,11 +8468,26 @@ type TxBody struct { Messages []*anypb.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + // but should be called `note` instead (see + // https://github.com/cosmos/cosmos-sdk/issues/9122). Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` - // timeout is the block height after which this transaction will not - // be processed by the chain + // timeout_height is the block height after which this transaction will not + // be processed by the chain. + // + // Note, if unordered=true this value MUST be set + // and will act as a short-lived TTL in which the transaction is deemed valid + // and kept in memory to prevent duplicates. TimeoutHeight uint64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + // unordered, when set to true, indicates that the transaction signer(s) + // intend for the transaction to be evaluated and executed in an un-ordered + // fashion. Specifically, the account's nonce will NOT be checked or + // incremented, which allows for fire-and-forget as well as concurrent + // transaction execution. + // + // Note, when set to true, the existing 'timeout_height' value must be set and + // will be used to correspond to a height in which the transaction is deemed + // valid. + Unordered bool `protobuf:"varint,4,opt,name=unordered,proto3" json:"unordered,omitempty"` // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected @@ -8470,6 +8539,13 @@ func (x *TxBody) GetTimeoutHeight() uint64 { return 0 } +func (x *TxBody) GetUnordered() bool { + if x != nil { + return x.Unordered + } + return false +} + func (x *TxBody) GetExtensionOptions() []*anypb.Any { if x != nil { return x.ExtensionOptions @@ -8703,13 +8779,15 @@ type Fee struct { // gas_limit is the maximum gas that can be used in transaction processing // before an out of gas error occurs GasLimit uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. + // if unset, the first signer is responsible for paying the fees. If set, the + // specified account must pay the fees. the payer must be a tx signer (and + // thus have signed this field in AuthInfo). setting this field does *not* + // change the ordering of required signers for the transaction. Payer string `protobuf:"bytes,3,opt,name=payer,proto3" json:"payer,omitempty"` - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail + // if set, the fee payer (either the first signer or the value of the payer + // field) requests that a fee grant be used to pay fees instead of the fee + // payer's own balance. If an appropriate fee grant does not exist or the + // chain does not support fee grants, this will fail Granter string `protobuf:"bytes,4,opt,name=granter,proto3" json:"granter,omitempty"` } @@ -9030,119 +9108,121 @@ var file_cosmos_tx_v1beta1_tx_proto_rawDesc = []byte{ 0x63, 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x06, 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, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, 0x70, - 0x22, 0x95, 0x02, 0x0a, 0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x6d, + 0x22, 0xb3, 0x02, 0x0a, 0x06, 0x54, 0x78, 0x42, 0x6f, 0x64, 0x79, 0x12, 0x30, 0x0a, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 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, 0x52, 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 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, 0x42, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 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, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, - 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x1e, - 0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, - 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, - 0x0f, 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, 0x52, 0x1b, 0x6e, 0x6f, 0x6e, - 0x43, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, - 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x74, - 0x68, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x5f, - 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, - 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x02, - 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, 0x46, 0x65, 0x65, 0x52, 0x03, 0x66, 0x65, - 0x65, 0x12, 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x03, 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, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, - 0x97, 0x01, 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, - 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, + 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x1c, 0x0a, 0x09, 0x75, 0x6e, 0x6f, 0x72, + 0x64, 0x65, 0x72, 0x65, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x75, 0x6e, 0x6f, + 0x72, 0x64, 0x65, 0x72, 0x65, 0x64, 0x12, 0x42, 0x0a, 0x11, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 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, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x38, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x08, 0x4d, 0x6f, - 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, - 0x6e, 0x66, 0x6f, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69, - 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, - 0x2e, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x1a, - 0x41, 0x0a, 0x06, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, - 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, - 0x64, 0x65, 0x1a, 0x90, 0x01, 0x0a, 0x05, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x12, 0x4b, 0x0a, 0x08, - 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, - 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6d, - 0x75, 0x6c, 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, - 0x43, 0x6f, 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42, 0x69, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, - 0x08, 0x62, 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, - 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, - 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x81, 0x02, 0x0a, - 0x03, 0x46, 0x65, 0x65, 0x12, 0x79, 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, - 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 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, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, - 0x73, 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, - 0x1b, 0x0a, 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x05, - 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, + 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x10, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x73, + 0x69, 0x6f, 0x6e, 0x4f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x5a, 0x0a, 0x1e, 0x6e, 0x6f, + 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x65, 0x78, 0x74, 0x65, 0x6e, + 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0xff, 0x0f, 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, 0x52, 0x1b, 0x6e, 0x6f, 0x6e, 0x43, 0x72, + 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x45, 0x78, 0x74, 0x65, 0x6e, 0x73, 0x69, 0x6f, 0x6e, 0x4f, + 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x22, 0xa4, 0x01, 0x0a, 0x08, 0x41, 0x75, 0x74, 0x68, 0x49, + 0x6e, 0x66, 0x6f, 0x12, 0x40, 0x0a, 0x0c, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x6e, + 0x66, 0x6f, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, + 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x0b, 0x73, 0x69, 0x67, 0x6e, 0x65, 0x72, + 0x49, 0x6e, 0x66, 0x6f, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x02, 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, 0x46, 0x65, 0x65, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, + 0x2c, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x03, 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, 0x42, 0x02, 0x18, 0x01, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, 0x97, 0x01, + 0x0a, 0x0a, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x33, 0x0a, 0x0a, + 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, + 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, + 0x79, 0x12, 0x38, 0x0a, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x6e, 0x66, 0x6f, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x52, 0x08, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x1a, 0x0a, 0x08, 0x73, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, + 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x22, 0xe0, 0x02, 0x0a, 0x08, 0x4d, 0x6f, 0x64, 0x65, + 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x3c, 0x0a, 0x06, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, + 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, + 0x6f, 0x2e, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x48, 0x00, 0x52, 0x06, 0x73, 0x69, 0x6e, 0x67, + 0x6c, 0x65, 0x12, 0x39, 0x0a, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x21, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x2e, 0x4d, + 0x75, 0x6c, 0x74, 0x69, 0x48, 0x00, 0x52, 0x05, 0x6d, 0x75, 0x6c, 0x74, 0x69, 0x1a, 0x41, 0x0a, + 0x06, 0x53, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x12, 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, + 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, + 0x1a, 0x90, 0x01, 0x0a, 0x05, 0x4d, 0x75, 0x6c, 0x74, 0x69, 0x12, 0x4b, 0x0a, 0x08, 0x62, 0x69, + 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2f, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x6f, 0x2e, 0x6d, 0x75, 0x6c, + 0x74, 0x69, 0x73, 0x69, 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, + 0x6d, 0x70, 0x61, 0x63, 0x74, 0x42, 0x69, 0x74, 0x41, 0x72, 0x72, 0x61, 0x79, 0x52, 0x08, 0x62, + 0x69, 0x74, 0x61, 0x72, 0x72, 0x61, 0x79, 0x12, 0x3a, 0x0a, 0x0a, 0x6d, 0x6f, 0x64, 0x65, 0x5f, + 0x69, 0x6e, 0x66, 0x6f, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, + 0x4d, 0x6f, 0x64, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x09, 0x6d, 0x6f, 0x64, 0x65, 0x49, 0x6e, + 0x66, 0x6f, 0x73, 0x42, 0x05, 0x0a, 0x03, 0x73, 0x75, 0x6d, 0x22, 0x81, 0x02, 0x0a, 0x03, 0x46, + 0x65, 0x65, 0x12, 0x79, 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, 0x46, 0xc8, + 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 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, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x73, 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, 0x1b, 0x0a, + 0x09, 0x67, 0x61, 0x73, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, + 0x52, 0x08, 0x67, 0x61, 0x73, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x12, 0x2e, 0x0a, 0x05, 0x70, 0x61, + 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, + 0x69, 0x6e, 0x67, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, 0x67, 0x72, + 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, - 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x32, 0x0a, 0x07, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, - 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, - 0x22, 0xb6, 0x01, 0x0a, 0x03, 0x54, 0x69, 0x70, 0x12, 0x79, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 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, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, - 0x43, 0x6f, 0x69, 0x6e, 0x73, 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, 0x30, 0x0a, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, - 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x74, - 0x69, 0x70, 0x70, 0x65, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xce, 0x01, 0x0a, 0x0d, 0x41, 0x75, - 0x78, 0x53, 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x07, 0x61, - 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, - 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, - 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, - 0x3e, 0x0a, 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, - 0x0b, 0x32, 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, - 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72, - 0x65, 0x63, 0x74, 0x41, 0x75, 0x78, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, - 0x37, 0x0a, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, - 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, - 0x67, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, - 0x64, 0x65, 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, - 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0xb4, 0x01, 0x0a, 0x15, 0x63, - 0x6f, 0x6d, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, - 0x65, 0x74, 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, - 0x2c, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, - 0x69, 0x2f, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, - 0x74, 0x61, 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, - 0x43, 0x54, 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x2e, - 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, - 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, - 0x73, 0x6d, 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, - 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xb6, + 0x01, 0x0a, 0x03, 0x54, 0x69, 0x70, 0x12, 0x79, 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, 0x46, 0xc8, 0xde, 0x1f, 0x00, 0xaa, 0xdf, 0x1f, 0x28, 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, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x43, 0x6f, + 0x69, 0x6e, 0x73, 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, 0x30, 0x0a, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, + 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x52, 0x06, 0x74, 0x69, 0x70, + 0x70, 0x65, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xce, 0x01, 0x0a, 0x0d, 0x41, 0x75, 0x78, 0x53, + 0x69, 0x67, 0x6e, 0x65, 0x72, 0x44, 0x61, 0x74, 0x61, 0x12, 0x32, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x18, 0xd2, 0xb4, 0x2d, 0x14, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x53, 0x74, + 0x72, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3e, 0x0a, + 0x08, 0x73, 0x69, 0x67, 0x6e, 0x5f, 0x64, 0x6f, 0x63, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x23, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, + 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72, 0x65, 0x63, + 0x74, 0x41, 0x75, 0x78, 0x52, 0x07, 0x73, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, 0x37, 0x0a, + 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x23, 0x2e, 0x63, 0x6f, + 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x73, 0x69, 0x67, 0x6e, 0x69, 0x6e, 0x67, 0x2e, + 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x53, 0x69, 0x67, 0x6e, 0x4d, 0x6f, 0x64, 0x65, + 0x52, 0x04, 0x6d, 0x6f, 0x64, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x73, 0x69, 0x67, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x0c, 0x52, 0x03, 0x73, 0x69, 0x67, 0x42, 0xb4, 0x01, 0x0a, 0x15, 0x63, 0x6f, 0x6d, + 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x42, 0x07, 0x54, 0x78, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x2c, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, 0x6f, 0x2f, 0x61, 0x70, 0x69, 0x2f, + 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, + 0x31, 0x3b, 0x74, 0x78, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xa2, 0x02, 0x03, 0x43, 0x54, + 0x58, 0xaa, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x54, 0x78, 0x2e, 0x56, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0xca, 0x02, 0x11, 0x43, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5c, 0x54, + 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0xe2, 0x02, 0x1d, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x5c, 0x54, 0x78, 0x5c, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x5c, 0x47, 0x50, + 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x13, 0x43, 0x6f, 0x73, 0x6d, + 0x6f, 0x73, 0x3a, 0x3a, 0x54, 0x78, 0x3a, 0x3a, 0x56, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x62, + 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( diff --git a/api/go.mod b/api/go.mod index 9efa84a711b7..3ce148159c09 100644 --- a/api/go.mod +++ b/api/go.mod @@ -7,7 +7,7 @@ require ( github.com/cosmos/gogoproto v1.4.11 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( diff --git a/api/go.sum b/api/go.sum index f62b664f404d..5a9e759aba03 100644 --- a/api/go.sum +++ b/api/go.sum @@ -27,5 +27,5 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= diff --git a/baseapp/abci.go b/baseapp/abci.go index 756336c756ff..f83604fd366c 100644 --- a/baseapp/abci.go +++ b/baseapp/abci.go @@ -70,7 +70,7 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha // done after the finalizeBlockState and context have been set as it's persisted // to state. if req.ConsensusParams != nil { - err := app.StoreConsensusParams(app.finalizeBlockState.ctx, *req.ConsensusParams) + err := app.StoreConsensusParams(app.finalizeBlockState.Context(), *req.ConsensusParams) if err != nil { return nil, err } @@ -82,18 +82,18 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha // handler, the block height is zero by default. However, after Commit is called // the height needs to reflect the true block height. initHeader.Height = req.InitialHeight - app.checkState.ctx = app.checkState.ctx.WithBlockHeader(initHeader). + app.checkState.SetContext(app.checkState.Context().WithBlockHeader(initHeader). WithHeaderInfo(coreheader.Info{ ChainID: req.ChainId, Height: req.InitialHeight, Time: req.Time, - }) - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockHeader(initHeader). + })) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockHeader(initHeader). WithHeaderInfo(coreheader.Info{ ChainID: req.ChainId, Height: req.InitialHeight, Time: req.Time, - }) + })) }() if app.initChainer == nil { @@ -101,9 +101,9 @@ func (app *BaseApp) InitChain(req *abci.RequestInitChain) (*abci.ResponseInitCha } // add block gas meter for any genesis transactions (allow infinite gas) - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockGasMeter(storetypes.NewInfiniteGasMeter()) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(storetypes.NewInfiniteGasMeter())) - res, err := app.initChainer(app.finalizeBlockState.ctx, req) + res, err := app.initChainer(app.finalizeBlockState.Context(), req) if err != nil { return nil, err } @@ -410,7 +410,7 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc return nil, errors.New("PrepareProposal called with invalid height") } - app.prepareProposalState.ctx = app.getContextForProposal(app.prepareProposalState.ctx, req.Height). + app.prepareProposalState.SetContext(app.getContextForProposal(app.prepareProposalState.Context(), req.Height). WithVoteInfos(toVoteInfo(req.LocalLastCommit.Votes)). // this is a set of votes that are not finalized yet, wait for commit WithBlockHeight(req.Height). WithProposer(req.ProposerAddress). @@ -425,11 +425,11 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc ChainID: app.chainID, Height: req.Height, Time: req.Time, - }) + })) - app.prepareProposalState.ctx = app.prepareProposalState.ctx. - WithConsensusParams(app.GetConsensusParams(app.prepareProposalState.ctx)). - WithBlockGasMeter(app.getBlockGasMeter(app.prepareProposalState.ctx)) + app.prepareProposalState.SetContext(app.prepareProposalState.Context(). + WithConsensusParams(app.GetConsensusParams(app.prepareProposalState.Context())). + WithBlockGasMeter(app.getBlockGasMeter(app.prepareProposalState.Context()))) defer func() { if err := recover(); err != nil { @@ -444,7 +444,7 @@ func (app *BaseApp) PrepareProposal(req *abci.RequestPrepareProposal) (resp *abc } }() - resp, err = app.prepareProposal(app.prepareProposalState.ctx, req) + resp, err = app.prepareProposal(app.prepareProposalState.Context(), req) if err != nil { app.logger.Error("failed to prepare proposal", "height", req.Height, "time", req.Time, "err", err) return &abci.ResponsePrepareProposal{Txs: req.Txs}, nil @@ -502,7 +502,7 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc app.setState(execModeFinalize, header) } - app.processProposalState.ctx = app.getContextForProposal(app.processProposalState.ctx, req.Height). + app.processProposalState.SetContext(app.getContextForProposal(app.processProposalState.Context(), req.Height). WithVoteInfos(req.ProposedLastCommit.Votes). // this is a set of votes that are not finalized yet, wait for commit WithBlockHeight(req.Height). WithHeaderHash(req.Hash). @@ -519,11 +519,11 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc ChainID: app.chainID, Height: req.Height, Time: req.Time, - }) + })) - app.processProposalState.ctx = app.processProposalState.ctx. - WithConsensusParams(app.GetConsensusParams(app.processProposalState.ctx)). - WithBlockGasMeter(app.getBlockGasMeter(app.processProposalState.ctx)) + app.processProposalState.SetContext(app.processProposalState.Context(). + WithConsensusParams(app.GetConsensusParams(app.processProposalState.Context())). + WithBlockGasMeter(app.getBlockGasMeter(app.processProposalState.Context()))) defer func() { if err := recover(); err != nil { @@ -538,7 +538,7 @@ func (app *BaseApp) ProcessProposal(req *abci.RequestProcessProposal) (resp *abc } }() - resp, err = app.processProposal(app.processProposalState.ctx, req) + resp, err = app.processProposal(app.processProposalState.Context(), req) if err != nil { app.logger.Error("failed to process proposal", "height", req.Height, "time", req.Time, "hash", fmt.Sprintf("%X", req.Hash), "err", err) return &abci.ResponseProcessProposal{Status: abci.ResponseProcessProposal_REJECT}, nil @@ -578,7 +578,7 @@ func (app *BaseApp) ExtendVote(_ context.Context, req *abci.RequestExtendVote) ( // finalizeBlockState context, otherwise we don't get the uncommitted data // from InitChain. if req.Height == app.initialHeight { - ctx, _ = app.finalizeBlockState.ctx.CacheContext() + ctx, _ = app.finalizeBlockState.Context().CacheContext() } else { ms := app.cms.CacheMultiStore() ctx = sdk.NewContext(ms, false, app.logger).WithStreamingManager(app.streamingManager).WithChainID(app.chainID).WithBlockHeight(req.Height) @@ -654,7 +654,7 @@ func (app *BaseApp) VerifyVoteExtension(req *abci.RequestVerifyVoteExtension) (r // finalizeBlockState context, otherwise we don't get the uncommitted data // from InitChain. if req.Height == app.initialHeight { - ctx, _ = app.finalizeBlockState.ctx.CacheContext() + ctx, _ = app.finalizeBlockState.Context().CacheContext() } else { ms := app.cms.CacheMultiStore() ctx = sdk.NewContext(ms, false, app.logger).WithStreamingManager(app.streamingManager).WithChainID(app.chainID).WithBlockHeight(req.Height) @@ -685,6 +685,18 @@ func (app *BaseApp) VerifyVoteExtension(req *abci.RequestVerifyVoteExtension) (r } }() + ctx = ctx. + WithConsensusParams(cp). + WithBlockGasMeter(storetypes.NewInfiniteGasMeter()). + WithBlockHeight(req.Height). + WithHeaderHash(req.Hash). + WithExecMode(sdk.ExecModeVerifyVoteExtension). + WithHeaderInfo(coreheader.Info{ + ChainID: app.chainID, + Height: req.Height, + Hash: req.Hash, + }) + resp, err = app.verifyVoteExt(ctx, req) if err != nil { app.logger.Error("failed to verify vote extension", "height", req.Height, "err", err) @@ -696,7 +708,7 @@ func (app *BaseApp) VerifyVoteExtension(req *abci.RequestVerifyVoteExtension) (r // internalFinalizeBlock executes the block, called by the Optimistic // Execution flow or by the FinalizeBlock ABCI method. The context received is -// only used to handle early cancellation, for anything related to state app.finalizeBlockState.ctx +// only used to handle early cancellation, for anything related to state app.finalizeBlockState.Context() // must be used. func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.RequestFinalizeBlock) (*abci.ResponseFinalizeBlock, error) { var events []abci.Event @@ -732,7 +744,7 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request } // Context is now updated with Header information. - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx. + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context(). WithBlockHeader(header). WithHeaderHash(req.Hash). WithHeaderInfo(coreheader.Info{ @@ -742,7 +754,7 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request Hash: req.Hash, AppHash: app.LastCommitID().Hash, }). - WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.ctx)). + WithConsensusParams(app.GetConsensusParams(app.finalizeBlockState.Context())). WithVoteInfos(req.DecidedLastCommit.Votes). WithExecMode(sdk.ExecModeFinalize). WithCometInfo(corecomet.Info{ @@ -750,16 +762,16 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request ValidatorsHash: req.NextValidatorsHash, ProposerAddress: req.ProposerAddress, LastCommit: sdk.ToSDKCommitInfo(req.DecidedLastCommit), - }) + })) // GasMeter must be set after we get a context with updated consensus params. - gasMeter := app.getBlockGasMeter(app.finalizeBlockState.ctx) - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockGasMeter(gasMeter) + gasMeter := app.getBlockGasMeter(app.finalizeBlockState.Context()) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) if app.checkState != nil { - app.checkState.ctx = app.checkState.ctx. + app.checkState.SetContext(app.checkState.Context(). WithBlockGasMeter(gasMeter). - WithHeaderHash(req.Hash) + WithHeaderHash(req.Hash)) } if err := app.preBlock(req); err != nil { @@ -783,8 +795,8 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request events = append(events, beginBlock.Events...) // Reset the gas meter so that the AnteHandlers aren't required to - gasMeter = app.getBlockGasMeter(app.finalizeBlockState.ctx) - app.finalizeBlockState.ctx = app.finalizeBlockState.ctx.WithBlockGasMeter(gasMeter) + gasMeter = app.getBlockGasMeter(app.finalizeBlockState.Context()) + app.finalizeBlockState.SetContext(app.finalizeBlockState.Context().WithBlockGasMeter(gasMeter)) // Iterate over all raw transactions in the proposal and attempt to execute // them, gathering the execution results. @@ -825,7 +837,7 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request app.finalizeBlockState.ms = app.finalizeBlockState.ms.SetTracingContext(nil).(storetypes.CacheMultiStore) } - endBlock, err := app.endBlock(app.finalizeBlockState.ctx) + endBlock, err := app.endBlock(app.finalizeBlockState.Context()) if err != nil { return nil, err } @@ -839,7 +851,7 @@ func (app *BaseApp) internalFinalizeBlock(ctx context.Context, req *abci.Request } events = append(events, endBlock.Events...) - cp := app.GetConsensusParams(app.finalizeBlockState.ctx) + cp := app.GetConsensusParams(app.finalizeBlockState.Context()) return &abci.ResponseFinalizeBlock{ Events: events, @@ -887,7 +899,7 @@ func (app *BaseApp) FinalizeBlock(req *abci.RequestFinalizeBlock) (*abci.Respons // call the streaming service hooks with the FinalizeBlock messages for _, streamingListener := range app.streamingManager.ABCIListeners { - if err := streamingListener.ListenFinalizeBlock(app.finalizeBlockState.ctx, *req, *res); err != nil { + if err := streamingListener.ListenFinalizeBlock(app.finalizeBlockState.Context(), *req, *res); err != nil { app.logger.Error("ListenFinalizeBlock listening hook failed", "height", req.Height, "err", err) } } @@ -921,11 +933,11 @@ func (app *BaseApp) checkHalt(height int64, time time.Time) error { // against that height and gracefully halt if it matches the latest committed // height. func (app *BaseApp) Commit() (*abci.ResponseCommit, error) { - header := app.finalizeBlockState.ctx.BlockHeader() + header := app.finalizeBlockState.Context().BlockHeader() retainHeight := app.GetBlockRetentionHeight(header.Height) if app.precommiter != nil { - app.precommiter(app.finalizeBlockState.ctx) + app.precommiter(app.finalizeBlockState.Context()) } rms, ok := app.cms.(*rootmulti.Store) @@ -941,7 +953,7 @@ func (app *BaseApp) Commit() (*abci.ResponseCommit, error) { abciListeners := app.streamingManager.ABCIListeners if len(abciListeners) > 0 { - ctx := app.finalizeBlockState.ctx + ctx := app.finalizeBlockState.Context() blockHeight := ctx.BlockHeight() changeSet := app.cms.PopStateCache() @@ -961,7 +973,7 @@ func (app *BaseApp) Commit() (*abci.ResponseCommit, error) { app.finalizeBlockState = nil if app.prepareCheckStater != nil { - app.prepareCheckStater(app.checkState.ctx) + app.prepareCheckStater(app.checkState.Context()) } // The SnapshotIfApplicable method will create the snapshot by starting the goroutine @@ -1126,7 +1138,7 @@ func (app *BaseApp) FilterPeerByID(info string) *abci.ResponseQuery { // access any state changes made in InitChain. func (app *BaseApp) getContextForProposal(ctx sdk.Context, height int64) sdk.Context { if height == app.initialHeight { - ctx, _ = app.finalizeBlockState.ctx.CacheContext() + ctx, _ = app.finalizeBlockState.Context().CacheContext() // clear all context data set during InitChain to avoid inconsistent behavior ctx = ctx.WithHeaderInfo(coreheader.Info{}).WithBlockHeader(cmtproto.Header{}) @@ -1236,7 +1248,7 @@ func (app *BaseApp) CreateQueryContext(height int64, prove bool) (sdk.Context, e ctx := sdk.NewContext(cacheMS, true, app.logger). WithMinGasPrices(app.minGasPrices). WithBlockHeight(height). - WithGasMeter(storetypes.NewGasMeter(app.queryGasLimit)).WithBlockHeader(app.checkState.ctx.BlockHeader()) + WithGasMeter(storetypes.NewGasMeter(app.queryGasLimit)).WithBlockHeader(app.checkState.Context().BlockHeader()) if height != lastBlockHeight { rms, ok := app.cms.(*rootmulti.Store) @@ -1304,7 +1316,7 @@ func (app *BaseApp) GetBlockRetentionHeight(commitHeight int64) int64 { // evidence parameters instead of computing an estimated number of blocks based // on the unbonding period and block commitment time as the two should be // equivalent. - cp := app.GetConsensusParams(app.finalizeBlockState.ctx) + cp := app.GetConsensusParams(app.finalizeBlockState.Context()) if cp.Evidence != nil && cp.Evidence.MaxAgeNumBlocks > 0 { retentionHeight = commitHeight - cp.Evidence.MaxAgeNumBlocks } diff --git a/baseapp/abci_test.go b/baseapp/abci_test.go index 48682b974eb0..efca5b74079b 100644 --- a/baseapp/abci_test.go +++ b/baseapp/abci_test.go @@ -2082,15 +2082,25 @@ func TestBaseApp_VoteExtensions(t *testing.T) { ctrl := gomock.NewController(t) valStore := mock.NewMockValidatorStore(ctrl) - // for brevity and simplicity, all validators have the same key - privKey := secp256k1.GenPrivKey() - pubKey := privKey.PubKey() - tmPk := cmtprotocrypto.PublicKey{ - Sum: &cmtprotocrypto.PublicKey_Secp256K1{ - Secp256K1: pubKey.Bytes(), - }, + // 10 good vote extensions, 2 bad ones from 12 total validators + numVals := 12 + privKeys := make([]secp256k1.PrivKey, numVals) + vals := make([]sdk.ConsAddress, numVals) + for i := 0; i < numVals; i++ { + privKey := secp256k1.GenPrivKey() + privKeys[i] = privKey + + pubKey := privKey.PubKey() + val := sdk.ConsAddress(pubKey.Bytes()) + vals[i] = val + + tmPk := cmtprotocrypto.PublicKey{ + Sum: &cmtprotocrypto.PublicKey_Secp256K1{ + Secp256K1: pubKey.Bytes(), + }, + } + valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), val).Return(tmPk, nil) } - valStore.EXPECT().GetPubKeyByConsAddr(gomock.Any(), gomock.Any()).Return(tmPk, nil).AnyTimes() baseappOpts := func(app *baseapp.BaseApp) { app.SetExtendVoteHandler(func(sdk.Context, *abci.RequestExtendVote) (*abci.ResponseExtendVote, error) { @@ -2256,7 +2266,7 @@ func TestBaseApp_VoteExtensions(t *testing.T) { // Now onto the second block, this time we process vote extensions from the // previous block (which we sign now) - for _, ve := range allVEs { + for i, ve := range allVEs { cve := cmtproto.CanonicalVoteExtension{ Extension: ve, Height: 1, @@ -2267,6 +2277,7 @@ func TestBaseApp_VoteExtensions(t *testing.T) { bz, err := marshalDelimitedFn(&cve) require.NoError(t, err) + privKey := privKeys[i] extSig, err := privKey.Sign(bz) require.NoError(t, err) @@ -2274,6 +2285,9 @@ func TestBaseApp_VoteExtensions(t *testing.T) { VoteExtension: ve, BlockIdFlag: cmtproto.BlockIDFlagCommit, ExtensionSignature: extSig, + Validator: abci.Validator{ + Address: vals[i].Bytes(), + }, }) } diff --git a/baseapp/abci_utils.go b/baseapp/abci_utils.go index 4cf9fa8e2282..b09a22b33ecf 100644 --- a/baseapp/abci_utils.go +++ b/baseapp/abci_utils.go @@ -72,6 +72,7 @@ func ValidateVoteExtensions( sumVP int64 ) + cache := make(map[string]struct{}) for _, vote := range extCommit.Votes { totalVP += vote.Validator.Power @@ -96,7 +97,13 @@ func ValidateVoteExtensions( return fmt.Errorf("vote extensions enabled; received empty vote extension signature at height %d", currentHeight) } + // Ensure that the validator has not already submitted a vote extension. valConsAddr := sdk.ConsAddress(vote.Validator.Address) + if _, ok := cache[valConsAddr.String()]; ok { + return fmt.Errorf("duplicate validator; validator %s has already submitted a vote extension", valConsAddr.String()) + } + cache[valConsAddr.String()] = struct{}{} + pubKeyProto, err := valStore.GetPubKeyByConsAddr(ctx, valConsAddr) if err != nil { return fmt.Errorf("failed to get validator %X public key: %w", valConsAddr, err) diff --git a/baseapp/abci_utils_test.go b/baseapp/abci_utils_test.go index bf3748101e17..ac72b90e8e26 100644 --- a/baseapp/abci_utils_test.go +++ b/baseapp/abci_utils_test.go @@ -196,6 +196,40 @@ func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsSingleVoteAbsent() { s.Require().NoError(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 3, chainID, llc)) } +// check ValidateVoteExtensions works with duplicate votes +func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsDuplicateVotes() { + ext := []byte("vote-extension") + cve := cmtproto.CanonicalVoteExtension{ + Extension: ext, + Height: 2, + Round: int64(0), + ChainId: chainID, + } + + bz, err := marshalDelimitedFn(&cve) + s.Require().NoError(err) + + extSig0, err := s.vals[0].privKey.Sign(bz) + s.Require().NoError(err) + + ve := abci.ExtendedVoteInfo{ + Validator: s.vals[0].toValidator(333), + VoteExtension: ext, + ExtensionSignature: extSig0, + BlockIdFlag: cmtproto.BlockIDFlagCommit, + } + + llc := abci.ExtendedCommitInfo{ + Round: 0, + Votes: []abci.ExtendedVoteInfo{ + ve, + ve, + }, + } + // expect fail (duplicate votes) + s.Require().Error(baseapp.ValidateVoteExtensions(s.ctx, s.valStore, 3, chainID, llc)) +} + // check ValidateVoteExtensions works when a single node has submitted a BlockID_Nil func (s *ABCIUtilsTestSuite) TestValidateVoteExtensionsSingleVoteNil() { ext := []byte("vote-extension") diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index b03b0ce5c0fe..391f6bc0d112 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -46,13 +46,14 @@ type ( ) const ( - execModeCheck execMode = iota // Check a transaction - execModeReCheck // Recheck a (pending) transaction after a commit - execModeSimulate // Simulate a transaction - execModePrepareProposal // Prepare a block proposal - execModeProcessProposal // Process a block proposal - execModeVoteExtension // Extend or verify a pre-commit vote - execModeFinalize // Finalize a block proposal + execModeCheck execMode = iota // Check a transaction + execModeReCheck // Recheck a (pending) transaction after a commit + execModeSimulate // Simulate a transaction + execModePrepareProposal // Prepare a block proposal + execModeProcessProposal // Process a block proposal + execModeVoteExtension // Extend or verify a pre-commit vote + execModeVerifyVoteExtension // Verify a vote extension + execModeFinalize // Finalize a block proposal ) var _ servertypes.ABCI = (*BaseApp)(nil) @@ -487,7 +488,7 @@ func (app *BaseApp) setState(mode execMode, header cmtproto.Header) { switch mode { case execModeCheck: - baseState.ctx = baseState.ctx.WithIsCheckTx(true).WithMinGasPrices(app.minGasPrices) + baseState.SetContext(baseState.Context().WithIsCheckTx(true).WithMinGasPrices(app.minGasPrices)) app.checkState = baseState case execModePrepareProposal: @@ -656,7 +657,7 @@ func (app *BaseApp) getContextForTx(mode execMode, txBytes []byte) sdk.Context { if modeState == nil { panic(fmt.Sprintf("state is nil for mode %v", mode)) } - ctx := modeState.ctx. + ctx := modeState.Context(). WithTxBytes(txBytes) // WithVoteInfos(app.voteInfos) // TODO: identify if this is needed @@ -696,7 +697,7 @@ func (app *BaseApp) cacheTxContext(ctx sdk.Context, txBytes []byte) (sdk.Context func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) error { if app.preBlocker != nil { - ctx := app.finalizeBlockState.ctx + ctx := app.finalizeBlockState.Context() rsp, err := app.preBlocker(ctx, req) if err != nil { return err @@ -708,7 +709,7 @@ func (app *BaseApp) preBlock(req *abci.RequestFinalizeBlock) error { // GasMeter must be set after we get a context with updated consensus params. gasMeter := app.getBlockGasMeter(ctx) ctx = ctx.WithBlockGasMeter(gasMeter) - app.finalizeBlockState.ctx = ctx + app.finalizeBlockState.SetContext(ctx) } } return nil @@ -721,7 +722,7 @@ func (app *BaseApp) beginBlock(req *abci.RequestFinalizeBlock) (sdk.BeginBlock, ) if app.beginBlocker != nil { - resp, err = app.beginBlocker(app.finalizeBlockState.ctx) + resp, err = app.beginBlocker(app.finalizeBlockState.Context()) if err != nil { return resp, err } @@ -783,7 +784,7 @@ func (app *BaseApp) endBlock(ctx context.Context) (sdk.EndBlock, error) { var endblock sdk.EndBlock if app.endBlocker != nil { - eb, err := app.endBlocker(app.finalizeBlockState.ctx) + eb, err := app.endBlocker(app.finalizeBlockState.Context()) if err != nil { return endblock, err } diff --git a/baseapp/state.go b/baseapp/state.go index ddfb82f92de1..19ee4e7eaa40 100644 --- a/baseapp/state.go +++ b/baseapp/state.go @@ -1,13 +1,17 @@ package baseapp import ( + "sync" + storetypes "cosmossdk.io/store/types" sdk "github.com/cosmos/cosmos-sdk/types" ) type state struct { - ms storetypes.CacheMultiStore + ms storetypes.CacheMultiStore + + mtx sync.RWMutex ctx sdk.Context } @@ -17,7 +21,16 @@ func (st *state) CacheMultiStore() storetypes.CacheMultiStore { return st.ms.CacheMultiStore() } +// SetContext updates the state's context to the context provided. +func (st *state) SetContext(ctx sdk.Context) { + st.mtx.Lock() + defer st.mtx.Unlock() + st.ctx = ctx +} + // Context returns the Context of the state. func (st *state) Context() sdk.Context { + st.mtx.RLock() + defer st.mtx.RUnlock() return st.ctx } diff --git a/client/context.go b/client/context.go index cafc180dc20b..b93fab97840c 100644 --- a/client/context.go +++ b/client/context.go @@ -29,7 +29,6 @@ type PreprocessTxFn func(chainID string, key keyring.KeyType, tx TxBuilder) erro // Context implements a typical context created in SDK modules for transaction // handling and queries. type Context struct { - FromAddress sdk.AccAddress Client CometRPC GRPCClient *grpc.ClientConn ChainID string @@ -44,23 +43,28 @@ type Context struct { OutputFormat string Height int64 HomeDir string - From string - BroadcastMode string - FromName string - SignModeStr string - UseLedger bool - Simulate bool - GenerateOnly bool - Offline bool - SkipConfirm bool - TxConfig TxConfig - AccountRetriever AccountRetriever - NodeURI string - FeePayer sdk.AccAddress - FeeGranter sdk.AccAddress - Viper *viper.Viper - LedgerHasProtobuf bool - PreprocessTxHook PreprocessTxFn + // From is a name or an address of a keyring account used to set FromName and FromAddress fields. + // Should be set by the "from" flag. + From string + // Name of a keyring account used to sign transactions. + FromName string + // Address of a keyring account used to sign transactions. + FromAddress sdk.AccAddress + BroadcastMode string + SignModeStr string + UseLedger bool + Simulate bool + GenerateOnly bool + Offline bool + SkipConfirm bool + TxConfig TxConfig + AccountRetriever AccountRetriever + NodeURI string + FeePayer sdk.AccAddress + FeeGranter sdk.AccAddress + Viper *viper.Viper + LedgerHasProtobuf bool + PreprocessTxHook PreprocessTxFn // IsAux is true when the signer is an auxiliary signer (e.g. the tipper). IsAux bool diff --git a/client/flags/flags.go b/client/flags/flags.go index 26a93a5e6e2f..f2af30eb0714 100644 --- a/client/flags/flags.go +++ b/client/flags/flags.go @@ -74,6 +74,7 @@ const ( FlagOffset = "offset" FlagCountTotal = "count-total" FlagTimeoutHeight = "timeout-height" + FlagUnordered = "unordered" FlagKeyAlgorithm = "algo" FlagKeyType = "key-type" FlagFeePayer = "fee-payer" @@ -136,6 +137,7 @@ func AddTxFlagsToCmd(cmd *cobra.Command) { f.BoolP(FlagSkipConfirmation, "y", false, "Skip tx broadcasting prompt confirmation") f.String(FlagSignMode, "", "Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature") f.Uint64(FlagTimeoutHeight, 0, "Set a block timeout height to prevent the tx from being committed past a certain height") + f.Bool(FlagUnordered, false, "Enable unordered transaction delivery; must be used in conjunction with --timeout-height") f.String(FlagFeePayer, "", "Fee payer pays fees for the transaction instead of deducting from the signer") f.String(FlagFeeGranter, "", "Fee granter grants fees for the transaction") f.String(FlagTip, "", "Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator") diff --git a/client/keys/show.go b/client/keys/show.go index afda1b5fd6ff..fd2abe33b720 100644 --- a/client/keys/show.go +++ b/client/keys/show.go @@ -47,9 +47,9 @@ consisting of all the keys provided by name and multisig threshold.`, } f := cmd.Flags() f.String(FlagBechPrefix, sdk.PrefixAccount, "The Bech32 prefix encoding for a key (acc|val|cons)") - f.BoolP(FlagAddress, "a", false, "Output the address only (overrides --output)") - f.BoolP(FlagPublicKey, "p", false, "Output the public key only (overrides --output)") - f.BoolP(FlagDevice, "d", false, "Output the address in a ledger device") + f.BoolP(FlagAddress, "a", false, "Output the address only (cannot be used with --output)") + f.BoolP(FlagPublicKey, "p", false, "Output the public key only (cannot be used with --output)") + f.BoolP(FlagDevice, "d", false, "Output the address in a ledger device (cannot be used with --pubkey)") f.Int(flagMultiSigThreshold, 1, "K out of N required signatures") f.Bool(flagQRCode, false, "Display key address QR code (will be ignored if -a or --address is false)") diff --git a/client/tx/factory.go b/client/tx/factory.go index 196260f1fad6..f8c8f9b85b15 100644 --- a/client/tx/factory.go +++ b/client/tx/factory.go @@ -36,6 +36,7 @@ type Factory struct { gasAdjustment float64 chainID string fromName string + unordered bool offline bool generateOnly bool memo string @@ -86,6 +87,7 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e gasAdj := clientCtx.Viper.GetFloat64(flags.FlagGasAdjustment) memo := clientCtx.Viper.GetString(flags.FlagNote) timeoutHeight := clientCtx.Viper.GetUint64(flags.FlagTimeoutHeight) + unordered := clientCtx.Viper.GetBool(flags.FlagUnordered) gasStr := clientCtx.Viper.GetString(flags.FlagGas) gasSetting, _ := flags.ParseGasSetting(gasStr) @@ -103,6 +105,7 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e accountNumber: accNum, sequence: accSeq, timeoutHeight: timeoutHeight, + unordered: unordered, gasAdjustment: gasAdj, memo: memo, signMode: signMode, @@ -132,6 +135,7 @@ func (f Factory) Fees() sdk.Coins { return f.fees } func (f Factory) GasPrices() sdk.DecCoins { return f.gasPrices } func (f Factory) AccountRetriever() client.AccountRetriever { return f.accountRetriever } func (f Factory) TimeoutHeight() uint64 { return f.timeoutHeight } +func (f Factory) Unordered() bool { return f.unordered } func (f Factory) FromName() string { return f.fromName } // SimulateAndExecute returns the option to simulate and then execute the transaction @@ -245,6 +249,12 @@ func (f Factory) WithTimeoutHeight(height uint64) Factory { return f } +// WithUnordered returns a copy of the Factory with an updated unordered field. +func (f Factory) WithUnordered(v bool) Factory { + f.unordered = v + return f +} + // WithFeeGranter returns a copy of the Factory with an updated fee granter. func (f Factory) WithFeeGranter(fg sdk.AccAddress) Factory { f.feeGranter = fg diff --git a/client/tx_config.go b/client/tx_config.go index c28139be909a..fe60fe4625c1 100644 --- a/client/tx_config.go +++ b/client/tx_config.go @@ -48,6 +48,7 @@ type ( SetFeePayer(feePayer sdk.AccAddress) SetGasLimit(limit uint64) SetTimeoutHeight(height uint64) + SetUnordered(v bool) SetFeeGranter(feeGranter sdk.AccAddress) AddAuxSignerData(tx.AuxSignerData) error } diff --git a/client/v2/autocli/flag/coin.go b/client/v2/autocli/flag/coin.go index 3cf5afc5818b..8496a2b0f656 100644 --- a/client/v2/autocli/flag/coin.go +++ b/client/v2/autocli/flag/coin.go @@ -8,7 +8,7 @@ import ( "google.golang.org/protobuf/reflect/protoreflect" basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/core/coins" + "cosmossdk.io/client/v2/internal/coins" ) type coinType struct{} @@ -22,8 +22,7 @@ func (c coinType) NewValue(context.Context, *Builder) Value { } func (c coinType) DefaultValue() string { - stringCoin, _ := coins.FormatCoins([]*basev1beta1.Coin{}, nil) - return stringCoin + return "zero" } func (c *coinValue) Get(protoreflect.Value) (protoreflect.Value, error) { diff --git a/client/v2/autocli/testdata/help-echo-msg.golden b/client/v2/autocli/testdata/help-echo-msg.golden index 7bfc86445b56..a4ba521452ea 100644 --- a/client/v2/autocli/testdata/help-echo-msg.golden +++ b/client/v2/autocli/testdata/help-echo-msg.golden @@ -29,4 +29,5 @@ Flags: --sign-mode string Choose sign mode (direct|amino-json|direct-aux|textual), this is an advanced feature --timeout-height uint Set a block timeout height to prevent the tx from being committed past a certain height --tip string Tip is the amount that is going to be transferred to the fee payer on the target chain. This flag is only valid when used with --aux, and is ignored if the target chain didn't enable the TipDecorator + --unordered Enable unordered transaction delivery; must be used in conjunction with --timeout-height -y, --yes Skip tx broadcasting prompt confirmation diff --git a/client/v2/autocli/testdata/msg-output.golden b/client/v2/autocli/testdata/msg-output.golden index 73bddd4ad8ae..447c986f0d6e 100644 --- a/client/v2/autocli/testdata/msg-output.golden +++ b/client/v2/autocli/testdata/msg-output.golden @@ -1 +1 @@ -{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","to_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","amount":[{"denom":"foo","amount":"1"}]}],"memo":"","timeout_height":"0","extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":[]} +{"body":{"messages":[{"@type":"/cosmos.bank.v1beta1.MsgSend","from_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","to_address":"cosmos1y74p8wyy4enfhfn342njve6cjmj5c8dtl6emdk","amount":[{"denom":"foo","amount":"1"}]}],"memo":"","timeout_height":"0","unordered":false,"extension_options":[],"non_critical_extension_options":[]},"auth_info":{"signer_infos":[],"fee":{"amount":[],"gas_limit":"200000","payer":"","granter":""},"tip":null},"signatures":[]} diff --git a/client/v2/go.mod b/client/v2/go.mod index ebe65b4ef94e..ec21e84e47ae 100644 --- a/client/v2/go.mod +++ b/client/v2/go.mod @@ -17,7 +17,7 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) @@ -43,9 +43,8 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -102,7 +101,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -122,12 +121,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -149,10 +148,10 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/client/v2/go.sum b/client/v2/go.sum index 3b6cf582fb0a..aa8a920b3c3d 100644 --- a/client/v2/go.sum +++ b/client/v2/go.sum @@ -115,20 +115,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -440,8 +436,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -595,8 +591,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -628,8 +624,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -768,8 +764,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -826,8 +822,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -982,8 +978,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/client/v2/internal/coins/format.go b/client/v2/internal/coins/format.go new file mode 100644 index 000000000000..1c84fe9beab9 --- /dev/null +++ b/client/v2/internal/coins/format.go @@ -0,0 +1,35 @@ +package coins + +import ( + "fmt" + "regexp" + "strings" + + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" +) + +// Amount can be a whole number or a decimal number. Denominations can be 3 ~ 128 +// characters long and support letters, followed by either a letter, a number or +// a separator ('/', ':', '.', '_' or '-'). +var coinRegex = regexp.MustCompile(`^(\d+(\.\d+)?)([a-zA-Z][a-zA-Z0-9\/\:\._\-]{2,127})$`) + +// ParseCoin parses a coin from a string. The string must be in the format +// , where is a number and is a valid denom. +func ParseCoin(input string) (*basev1beta1.Coin, error) { + input = strings.TrimSpace(input) + + if input == "" { + return nil, fmt.Errorf("empty input when parsing coin") + } + + matches := coinRegex.FindStringSubmatch(input) + + if len(matches) == 0 { + return nil, fmt.Errorf("invalid input format") + } + + return &basev1beta1.Coin{ + Amount: matches[1], + Denom: matches[3], + }, nil +} diff --git a/client/v2/internal/coins/format_test.go b/client/v2/internal/coins/format_test.go new file mode 100644 index 000000000000..4cddeb7cfdbf --- /dev/null +++ b/client/v2/internal/coins/format_test.go @@ -0,0 +1,17 @@ +package coins_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/client/v2/internal/coins" +) + +func TestDecodeCoin(t *testing.T) { + encodedCoin := "1000000000foo" + coin, err := coins.ParseCoin(encodedCoin) + require.NoError(t, err) + require.Equal(t, "1000000000", coin.Amount) + require.Equal(t, "foo", coin.Denom) +} diff --git a/codec/types/any_internal_test.go b/codec/types/any_internal_test.go index 9adab2946653..0b3c155821b7 100644 --- a/codec/types/any_internal_test.go +++ b/codec/types/any_internal_test.go @@ -8,7 +8,7 @@ import ( ) type Dog struct { - Name string `protobuf:"bytes,1,opt,name=size,proto3" json:"size,omitempty"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` } func (d Dog) Greet() string { return d.Name } diff --git a/collections/go.mod b/collections/go.mod index 52656535bb84..19cae8b8c4ab 100644 --- a/collections/go.mod +++ b/collections/go.mod @@ -17,17 +17,17 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect + github.com/cockroachdb/pebble v1.0.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.25.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.8.10 // indirect @@ -35,19 +35,19 @@ require ( github.com/onsi/gomega v1.20.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/grpc v1.60.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/collections/go.sum b/collections/go.sum index d9411dcf0027..54115b4edb13 100644 --- a/collections/go.sum +++ b/collections/go.sum @@ -13,14 +13,14 @@ github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XL 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= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= @@ -38,8 +38,8 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= +github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= @@ -71,8 +71,8 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= 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= @@ -103,17 +103,17 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +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.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +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.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -128,8 +128,8 @@ github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9dec 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/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -198,8 +198,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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/core/CHANGELOG.md b/core/CHANGELOG.md index 803225487c10..71e06fa3727f 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -36,9 +36,16 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Features + * [#18379](https://github.com/cosmos/cosmos-sdk/pull/18379) Add branch service. * [#18457](https://github.com/cosmos/cosmos-sdk/pull/18457) Add branch.ExecuteWithGasLimit. +### API Breaking + +* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` to `x/tx`. +* [#18861](httpes://github.com/cosmos/cosmos-sdk/pull/18861) Moved `coin.ParseCoin` to `client/v2/internal`. + ## [v0.12.0](https://github.com/cosmos/cosmos-sdk/releases/tag/core%2Fv0.11.0) :::note diff --git a/core/coins/format.go b/core/coins/format.go deleted file mode 100644 index 315c96d78f46..000000000000 --- a/core/coins/format.go +++ /dev/null @@ -1,123 +0,0 @@ -package coins - -import ( - "fmt" - "regexp" - "sort" - "strings" - - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/math" -) - -const emptyCoins = "zero" - -// Amount can be a whole number or a decimal number. Denominations can be 3 ~ 128 -// characters long and support letters, followed by either a letter, a number or -// a separator ('/', ':', '.', '_' or '-'). -var coinRegex = regexp.MustCompile(`^(\d+(\.\d+)?)([a-zA-Z][a-zA-Z0-9\/\:\._\-]{2,127})$`) - -// 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 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 -} - -// ParseCoin parses a coin from a string. The string must be in the format -// , where is a number and is a valid denom. -func ParseCoin(input string) (*basev1beta1.Coin, error) { - input = strings.TrimSpace(input) - - if input == "" { - return nil, fmt.Errorf("empty input when parsing coin") - } - - matches := coinRegex.FindStringSubmatch(input) - - if len(matches) == 0 { - return nil, fmt.Errorf("invalid input format") - } - - return &basev1beta1.Coin{ - Amount: matches[1], - Denom: matches[3], - }, nil -} diff --git a/core/coins/format_test.go b/core/coins/format_test.go deleted file mode 100644 index 994be1a82925..000000000000 --- a/core/coins/format_test.go +++ /dev/null @@ -1,90 +0,0 @@ -package coins_test - -import ( - "encoding/json" - "os" - "testing" - - "github.com/stretchr/testify/require" - - bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - "cosmossdk.io/core/coins" -) - -// coinsJsonTest is the type of test cases in the coin.json file. -type coinJSONTest struct { - Proto *basev1beta1.Coin - Metadata *bankv1beta1.Metadata - Text string - Error bool -} - -// coinsJSONTest is the type of test cases in the coins.json file. -type coinsJSONTest struct { - Proto []*basev1beta1.Coin - Metadata map[string]*bankv1beta1.Metadata - Text string - Error bool -} - -func TestFormatCoin(t *testing.T) { - var testcases []coinJSONTest - raw, err := os.ReadFile("../../x/tx/signing/textual/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 := coins.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("../../x/tx/signing/textual/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 := coins.FormatCoins(tc.Proto, metadata) - - if tc.Error { - require.Error(t, err) - return - } - - require.NoError(t, err) - require.Equal(t, tc.Text, out) - } - }) - } -} - -func TestDecodeCoin(t *testing.T) { - encodedCoin := "1000000000foo" - coin, err := coins.ParseCoin(encodedCoin) - require.NoError(t, err) - require.Equal(t, "1000000000", coin.Amount) - require.Equal(t, "foo", coin.Denom) -} diff --git a/core/go.mod b/core/go.mod index 45b8c6cbf502..5623e6ba3e10 100644 --- a/core/go.mod +++ b/core/go.mod @@ -5,11 +5,10 @@ go 1.20 require ( cosmossdk.io/api v0.7.2 cosmossdk.io/depinject v1.0.0-alpha.4 - cosmossdk.io/math v1.2.0 github.com/cosmos/cosmos-proto v1.0.0-beta.3 github.com/stretchr/testify v1.8.4 google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 sigs.k8s.io/yaml v1.4.0 ) @@ -18,7 +17,6 @@ require ( github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cosmos/gogoproto v1.4.11 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/getsentry/sentry-go v0.23.0 // indirect github.com/gogo/protobuf v1.3.2 // indirect @@ -33,8 +31,6 @@ require ( golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.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/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 3fdcb56f087f..12ea1612fc97 100644 --- a/core/go.sum +++ b/core/go.sum @@ -2,8 +2,6 @@ cosmossdk.io/api v0.7.2 h1:BO3i5fvKMKvfaUiMkCznxViuBEfyWA/k6w2eAF6q1C4= cosmossdk.io/api v0.7.2/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.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= -cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= @@ -12,8 +10,6 @@ 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/cosmos/cosmos-proto v1.0.0-beta.3 h1:VitvZ1lPORTVxkmF2fAp3IiA61xVwArQYKXTdEcpW6o= github.com/cosmos/cosmos-proto v1.0.0-beta.3/go.mod h1:t8IASdLaAq+bbHbjq4p960BvcTqtwuAxid3b/2rOD6I= -github.com/cosmos/gogoproto v1.4.11 h1:LZcMHrx4FjUgrqQSWeaGC1v/TeuVFqSLa43CC6aWR2g= -github.com/cosmos/gogoproto v1.4.11/go.mod h1:/g39Mh8m17X8Q/GDEs5zYTSNaNnInBSohtaxzQnYq1Y= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= 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= @@ -81,18 +77,14 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T 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= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -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.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= diff --git a/core/store/store.go b/core/store/store.go index 64c8c434a129..2969ef29b9d3 100644 --- a/core/store/store.go +++ b/core/store/store.go @@ -77,6 +77,6 @@ type Iterator interface { // Error returns the last error encountered by the iterator, if any. Error() error - // Close closes the iterator, relasing any allocated resources. + // Close closes the iterator, releasing any allocated resources. Close() error } diff --git a/docs/architecture/README.md b/docs/architecture/README.md index 6ff313fb0be2..25beab425910 100644 --- a/docs/architecture/README.md +++ b/docs/architecture/README.md @@ -61,6 +61,7 @@ When writing ADRs, follow the same best practices for writing RFCs. When writing * [ADR 060: ABCI 1.0 (Phase I)](adr-060-abci-1.0.md) * [ADR 061: Liquid Staking](./adr-061-liquid-staking.md) * [ADR 070: Un-Ordered Transaction Inclusion](./adr-070-unordered-account.md) +* [ADR 065: Store v2](./adr-065-store-v2.md) ### Proposed @@ -86,7 +87,6 @@ When writing ADRs, follow the same best practices for writing RFCs. When writing * [ADR 059: Test Scopes](./adr-059-test-scopes.md) * [ADR 062: Collections State Layer](./adr-062-collections-state-layer.md) * [ADR 063: Core Module API](./adr-063-core-module-api.md) -* [ADR 065: Store v2](./adr-065-store-v2.md) * [ADR 067: Simulator v2](./adr-067-simulator-v2.md) * [ADR 069: `x/gov` modularity, multiple choice and optimisic proposals](./adr-069-gov-improvements.md) diff --git a/docs/architecture/adr-065-store-v2.md b/docs/architecture/adr-065-store-v2.md index 8faed0463d38..b1377555e020 100644 --- a/docs/architecture/adr-065-store-v2.md +++ b/docs/architecture/adr-065-store-v2.md @@ -3,10 +3,11 @@ ## Changelog * Feb 14, 2023: Initial Draft (@alexanderbez) +* Dec 21, 2023: Updates after implementation (@alexanderbez) ## Status -DRAFT +ACCEPTED ## Abstract @@ -51,7 +52,7 @@ design of storage in the Cosmos SDK: * Note, we can still allow modules to have their own IAVL `KVStore`, but the IAVL library will need to support the ability to pass a DB instance as an argument to various IAVL APIs. -* Since IAVL is responsible for both state storage and commitment, running an +* Since IAVL is responsible for both state storage and commitment, running an archive node becomes increasingly expensive as disk space grows exponentially. * As the size of a network increases, various performance bottlenecks start to emerge in many areas such as query performance, network upgrades, state @@ -81,73 +82,73 @@ less intrusive. Specifically, we propose to: * Separate the concerns of state commitment (**SC**), needed for consensus, and state storage (**SS**), needed for state machine and clients. * Reduce layers of abstractions necessary between the RMS and underlying stores. -* Provide atomic module store commitments by providing a batch database object - to core IAVL APIs. -* Reduce complexities in the `CacheKVStore` implementation while also improving - performance[3]. +* Remove unnecessary store types and implementations such as `CacheKVStore`. +* Simplify the branching logic. +* Ensure the `RootStore` interface remains as lightweight as possible. +* Allow application developers to easily swap out SS and SC backends. -Furthermore, we will keep the IAVL is the backing [commitment](https://cryptography.fandom.com/wiki/Commitment_scheme) -store for the time being. While we might not fully settle on the use of IAVL in +Furthermore, we will keep IAVL as the default [SC](https://cryptography.fandom.com/wiki/Commitment_scheme) +backend for the time being. While we might not fully settle on the use of IAVL in the long term, we do not have strong empirical evidence to suggest a better alternative. Given that the SDK provides interfaces for stores, it should be sufficient to change the backing commitment store in the future should evidence arise to warrant a better alternative. However there is promising work being done to IAVL that should result in significant performance improvement [1,2]. +Note, we will provide applications with the ability to use IAVL v1 and IAVL v2 as +either SC backend, with the latter showing extremely promising performance improvements +over IAVL v0 and v1, at the cost of a state migration. + ### Separating SS and SC By separating SS and SC, it will allow for us to optimize against primary use cases and access patterns to state. Specifically, The SS layer will be responsible for -direct access to data in the form of (key, value) pairs, whereas the SC layer (IAVL) +direct access to data in the form of (key, value) pairs, whereas the SC layer (e.g. IAVL) will be responsible for committing to data and providing Merkle proofs. -Note, the underlying physical storage database will be the same between both the -SS and SC layers. So to avoid collisions between (key, value) pairs, both layers -will be namespaced. - #### State Commitment (SC) -Given that the existing solution today acts as both SS and SC, we can simply -repurpose it to act solely as the SC layer without any significant changes to -access patterns or behavior. In other words, the entire collection of existing -IAVL-backed module `KVStore`s will act as the SC layer. +A foremost design goal is that SC backends should be easily swappable, i.e. not +necessarily IAVL. To this end, the scope of SC has been reduced, it must only: + +* Provide a stateful root app hash for height h resulting from applying a batch + of key-value set/deletes to height h-1. +* Fulfill (though not necessarily provide) historical proofs for all heights < h. +* Provide an API for snapshot create/restore to fulfill state sync requests. -However, in order for the SC layer to remain lightweight and not duplicate a -majority of the data held in the SS layer, we encourage node operators to keep -tight pruning strategies. +An SC implementation may choose not to provide historical proofs past height h - n (n can be 0) +due to the time and space constraints, but since store v2 defines an API for historical +proofs there should be at least one configuration of a given SC backend which +supports this. #### State Storage (SS) -In the RMS, we will expose a *single* `KVStore` backed by the same physical -database that backs the SC layer. This `KVStore` will be explicitly namespaced -to avoid collisions and will act as the primary storage for (key, value) pairs. - -While we most likely will continue the use of `cosmos-db`, or some local interface, -to allow for flexibility and iteration over preferred physical storage backends -as research and benchmarking continues. However, we propose to hardcode the use -of RocksDB as the primary physical storage backend. - -Since the SS layer will be implemented as a `KVStore`, it will support the -following functionality: - -* Range queries -* CRUD operations -* Historical queries and versioning -* Pruning - -The RMS will keep track of all buffered writes using a dedicated and internal -`MemoryListener` for each `StoreKey`. For each block height, upon `Commit`, the -SS layer will write all buffered (key, value) pairs under a [RocksDB user-defined timestamp](https://github.com/facebook/rocksdb/wiki/User-defined-Timestamp-%28Experimental%29) column -family using the block height as the timestamp, which is an unsigned integer. -This will allow a client to fetch (key, value) pairs at historical and current -heights along with making iteration and range queries relatively performant as -the timestamp is the key suffix. - -Note, we choose not to use a more general approach of allowing any embedded key/value -database, such as LevelDB or PebbleDB, using height key-prefixed keys to -effectively version state because most of these databases use variable length -keys which would effectively make actions likes iteration and range queries less -performant. +The goal of SS is to provide a modular storage backend, i.e. multiple implementations, +to facilitate storing versioned raw key/value pairs in a fast embedded database. +The responsibility and functions of SS include the following: + +* Provided fast and efficient queries for versioned raw key/value pairs +* Provide versioned CRUD operations +* Provide versioned batching functionality +* Provide versioned iteration (forward and reverse) functionality +* Provide pruning functionality + +All of the functionality provided by an SS backend should work under a versioned +scheme, i.e. a user should be able to get, store, and iterate over keys for the latest +and historical versions efficiently and a store key, which is used for name-spacing +purposes. + +We propose to have three defaulting SS backends for applications to choose from: + +* RocksDB + * CGO based + * Usage of User-Defined Timestamps as a built-in versioning mechanism +* PebbleDB + * Native + * Manual implementation of MVCC keys for versioning +* SQLite + * CGO based + * Single table for all state Since operators might want pruning strategies to differ in SS compared to SC, e.g. having a very tight pruning strategy in SC while having a looser pruning @@ -165,58 +166,61 @@ otherwise, a snapshot could be triggered on a height that is not available in SC The state sync process should be largely unaffected by the separation of the SC and SS layers. However, if a node syncs via state sync, the SS layer of the node will not have the state synced height available, since the IAVL import process is -not setup in way to easily allow direct key/value insertion. A modification of -the IAVL import process would be necessary to facilitate having the state sync -height available. +not setup in way to easily allow direct key/value insertion. + +We propose a simple `SnapshotManager` that consumes and produces snapshots. SC +backends will be responsible for providing a snapshot of the state at a given +height and both SS and SC consume snapshots to restore state. + +#### RootStore -Note, this is not problematic for the state machine itself because when a query -is made, the RMS will automatically direct the query correctly (see [Queries](#queries)). +We will define a `RootStore` interface and default implementation that will be +the primary interface for the application to interact with. The `RootStore` will +be responsible for housing SS and SC backends. Specifically, a `RootStore` will +provide the following functionality: -#### Queries +* Manage commitment of state (both SS and SC) +* Provide modules access to state +* Query delegation (i.e. get a value for a tuple) +* Providing commitment proofs -To consolidate the query routing between both the SC and SS layers, we propose to -have a notion of a "query router" that is constructed in the RMS. This query router -will be supplied to each `KVStore` implementation. The query router will route -queries to either the SC layer or the SS layer based on a few parameters. If -`prove: true`, then the query must be routed to the SC layer. Otherwise, if the -query height is available in the SS layer, the query will be served from the SS -layer. Otherwise, we fall back on the SC layer. +#### Store Keys -If no height is provided, the SS layer will assume the latest height. The SS -layer will store a reverse index to lookup `LatestVersion -> timestamp(version)` -which is set on `Commit`. +Naturally, if a single SC tree is used in all RootStore implementations, then the +notion of a store key becomes entirely useless. However, we cannot dictate or +predicate how all applications will implement their RooStore (if they choose to). + +Since an app can choose to have multiple SC trees, we need to keep the notion of +store keys. Unlike store v1, we represent store keys as simple strings as opposed +to concrete types to provide OCAP functionality. The store key strings act to +solely provide key prefixing/namespacing functionality for modules. #### Proofs Since the SS layer is naturally a storage layer only, without any commitments to (key, value) pairs, it cannot provide Merkle proofs to clients during queries. -Since the pruning strategy against the SC layer is configured by the operator, -we can therefore have the RMS route the query SC layer if the version exists and -`prove: true`. Otherwise, the query will fall back to the SS layer without a proof. - -We could explore the idea of using state snapshots to rebuild an in-memory IAVL -tree in real time against a version closest to the one provided in the query. -However, it is not clear what the performance implications will be of this approach. - -### Atomic Commitment +So providing inclusion and exclusion proofs, via a `CommitmentOp` type, will be +the responsibility of the SC backend. Retrieving proofs will be done through the +a `RootStore`, which will internally route the request to the SC backend. -We propose to modify the existing IAVL APIs to accept a batch DB object instead -of relying on an internal batch object in `nodeDB`. Since each underlying IAVL -`KVStore` shares the same DB in the SC layer, this will allow commits to be -atomic. +#### Commitment -Specifically, we propose to: +Before ABCI 2.0, specifically before `FinalizeBlock` was introduced, the flow of state +commitment in BaseApp was defined by writes being written to the `RootMultiStore` +and then a single Commit call on the `RootMultiStore` during the ABCI Commit method. -* Remove the `dbm.Batch` field from `nodeDB` -* Update the `SaveVersion` method of the `MutableTree` IAVL type to accept a batch object -* Update the `Commit` method of the `CommitKVStore` interface to accept a batch object -* Create a batch object in the RMS during `Commit` and pass this object to each - `KVStore` -* Write the database batch after all stores have committed successfully +With the advent of ABCI 2.0, the commitment flow has now changed to `WorkingHash` being +called during `FinalizeBlock` and then Commit being called on ABCI Commit. Note, +`WorkingHash` does not actually commit state to disk, but rather computes an +uncommitted work-in-progress hash, which is returned in `FinalizeBlock`. Then, +during the ABCI Commit phase, the state is finally flushed to disk. -Note, this will require IAVL to be updated to not rely or assume on any batch -being present during `SaveVersion`. +In store v2, we must respect this flow. Thus, a caller is expected to call `WorkingHash` +during `FinalizeBlock`, which takes the latest changeset in the `RootStore`, +writes that to the SC tree in a single batch and returns a hash. Finally, during +the ABCI Commit phase, we call `Commit` on the `RootStore` which commits the SC +tree and flushes the changeset to the SS backend. ## Consequences @@ -252,6 +256,11 @@ be broken or modified. ### Neutral +* Removal of OCAP-based store keys in favor of simple strings for state retrieval + and name-spacing. We consider this neutral as removal of OCAP functionality can + be seen as a negative, however, we're simply moving the OCAP functionality upstream + to the KVStore service. The SS and SC layers shouldn't have to concern themselves + with OCAP responsibilities. * Keeping IAVL as the primary commitment data structure, although drastic performance improvements are being made @@ -275,16 +284,9 @@ commitment proofs for historical state. While solutions can be devised such as rebuilding trees on the fly based on state snapshots, it is not clear what the performance implications are for such solutions. -### Physical DB Backends - -This ADR proposes usage of RocksDB to utilize user-defined timestamps as a -versioning mechanism. However, other physical DB backends are available that may -offer alternative ways to implement versioning while also providing performance -improvements over RocksDB. E.g. PebbleDB supports MVCC timestamps as well, but -we'll need to explore how PebbleDB handles compaction and state growth over time. - ## References * [1] https://github.com/cosmos/iavl/pull/676 * [2] https://github.com/cosmos/iavl/pull/664 * [3] https://github.com/cosmos/cosmos-sdk/issues/14990 +* [4] https://docs.google.com/document/d/e/2PACX-1vSCFfXZm2vsRsACOPoxGqysMaUg7jY833LwR3YyjA1S3FNHfXRiJor-qLjzx833TavLXLPSIcFZJhyh/pub diff --git a/docs/architecture/adr-069-gov-improvements.md b/docs/architecture/adr-069-gov-improvements.md index 70ddcc4bd5c4..6e6560df7176 100644 --- a/docs/architecture/adr-069-gov-improvements.md +++ b/docs/architecture/adr-069-gov-improvements.md @@ -87,7 +87,7 @@ Submitting a new multiple choice proposal will use a different message than the ```protobuf message MsgSubmitMultipleChoiceProposal { - repeated cosmos.base.v1beta1.Coin initial_deposit = 1 + repeated cosmos.base.v1beta1.Coin initial_deposit = 1; string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; string metadata = 3; string title = 4; diff --git a/docs/architecture/adr-070-unordered-account.md b/docs/architecture/adr-070-unordered-account.md index 814193cef668..c2d6e382f13b 100644 --- a/docs/architecture/adr-070-unordered-account.md +++ b/docs/architecture/adr-070-unordered-account.md @@ -2,7 +2,7 @@ ## Changelog -* Dec 4, 2023: Initial Draft +* Dec 4, 2023: Initial Draft (@yihuang, @tac0turtle, @alexanderbez) ## Status @@ -53,79 +53,140 @@ message TxBody { } ``` -### `DedupTxHashManager` +### Replay Protection + +In order to provide replay protection, a user should ensure that the transaction's +TTL value is relatively short-lived but long enough to provide enough time to be +included in a block, e.g. ~H+50. + +We facilitate this by storing the transaction's hash in a durable map, `UnorderedTxManager`, +to prevent duplicates, i.e. replay attacks. Upon transaction ingress during `CheckTx`, +we check if the transaction's hash exists in this map or if the TTL value is stale, +i.e. before the current block. If so, we reject it. Upon inclusion in a block +during `DeliverTx`, the transaction's hash is set in the map along with it's TTL +value. + +This map is evaluated at the end of each block, e.g. ABCI `Commit`, and all stale +transactions, i.e. transactions's TTL value who's now beyond the committed block, +are purged from the map. + +An important point to note is that in theory, it may be possible to submit an unordered +transaction twice, or multiple times, before the transaction is included in a block. +However, we'll note a few important layers of protection and mitigation: + +* Assuming CometBFT is used as the underlying consensus engine and a non-noop mempool + is used, CometBFT will reject the duplicate for you. +* For applications that leverage ABCI++, `ProcessProposal` should evaluate and reject + malicious proposals with duplicate transactions. +* For applications that leverage their own application mempool, their mempool should + reject the duplicate for you. +* Finally, worst case if the duplicate transaction is somehow selected for a block + proposal, 2nd and all further attempts to evaluate it, will fail during `DeliverTx`, + so worst case you just end up filling up block space with a duplicate transaction. ```golang +type TxHash [32]byte + const PurgeLoopSleepMS = 500 -// DedupTxHashManager contains the tx hash dictionary for duplicates checking, -// and expire them when block number progresses. -type DedupTxHashManager struct { - mutex sync.RWMutex - // tx hash -> expire block number - // for duplicates checking and expiration - hashes map[TxHash]uint64 - // channel to receive latest block numbers +// UnorderedTxManager contains the tx hash dictionary for duplicates checking, +// and expire them when block production progresses. +type UnorderedTxManager struct { + // blockCh defines a channel to receive newly committed block heights blockCh chan uint64 + + mu sync.RWMutex + // txHashes defines a map from tx hash -> TTL value, which is used for duplicate + // checking and replay protection, as well as purging the map when the TTL is + // expired. + txHashes map[TxHash]uint64 } -func NewDedupTxHashManager() *DedupTxHashManager { - m := &DedupTxHashManager{ - hashes: make(map[TxHash]uint64), - blockCh: make(ch *uint64, 16), +func NewUnorderedTxManager() *UnorderedTxManager { + m := &UnorderedTxManager{ + blockCh: make(chan uint64, 16), + txHashes: make(map[TxHash]uint64), } + + return m +} + +func (m *UnorderedTxManager) Start() { go m.purgeLoop() - return m } -func (dtm *DedupTxHashManager) Close() error { - close(dtm.blockCh) - dtm.blockCh = nil +func (m *UnorderedTxManager) Close() error { + close(m.blockCh) + m.blockCh = nil return nil } -func (dtm *DedupTxHashManager) Contains(hash TxHash) (ok bool) { - dtm.mutex.RLock() - defer dtm.mutex.RUnlock() +func (m *UnorderedTxManager) Contains(hash TxHash) bool{ + m.mu.RLock() + defer m.mu.RUnlock() + + _, ok := m.txHashes[hash] + return ok +} + +func (m *UnorderedTxManager) Size() int { + m.mu.RLock() + defer m.mu.RUnlock() - _, ok = dtm.hashes[hash] - return + return len(m.txHashes) } -func (dtm *DedupTxHashManager) Size() int { - dtm.mutex.RLock() - defer dtm.mutex.RUnlock() +func (m *UnorderedTxManager) Add(hash TxHash, expire uint64) { + m.mu.Lock() + defer m.mu.Unlock() - return len(dtm.hashes) + m.txHashes[hash] = expire } -func (dtm *DedupTxHashManager) Add(hash TxHash, expire uint64) (ok bool) { - dtm.mutex.Lock() - defer dtm.mutex.Unlock() +// OnNewBlock send the latest block number to the background purge loop, which +// should be called in ABCI Commit event. +func (m *UnorderedTxManager) OnNewBlock(blockHeight uint64) { + m.blockCh <- blockHeight +} + +// expiredTxs returns expired tx hashes based on the provided block height. +func (m *UnorderedTxManager) expiredTxs(blockHeight uint64) []TxHash { + m.mu.RLock() + defer m.mu.RUnlock() + + var result []TxHash + for txHash, expire := range m.txHashes { + if blockHeight > expire { + result = append(result, txHash) + } + } - dtm.hashes[hash] = expire - return + return result } -// OnNewBlock send the latest block number to the background purge loop, -// it should be called in abci commit event. -func (dtm *DedupTxHashManager) OnNewBlock(blockNumber uint64) { - dtm.blockCh <- &blockNumber +func (m *UnorderedTxManager) purge(txHashes []TxHash) { + m.mu.Lock() + defer m.mu.Unlock() + + for _, txHash := range txHashes { + delete(m.txHashes, txHash) + } } -// purgeLoop removes expired tx hashes at background -func (dtm *DedupTxHashManager) purgeLoop() error { + +// purgeLoop removes expired tx hashes in the background +func (m *UnorderedTxManager) purgeLoop() error { for { - blocks := channelBatchRecv(dtm.blockCh) + blocks := channelBatchRecv(m.blockCh) if len(blocks) == 0 { // channel closed break } latest := *blocks[len(blocks)-1] - hashes := dtm.expired(latest) + hashes := m.expired(latest) if len(hashes) > 0 { - dtm.purge(hashes) + m.purge(hashes) } // avoid burning cpu in catching up phase @@ -133,28 +194,6 @@ func (dtm *DedupTxHashManager) purgeLoop() error { } } -// expired find out expired tx hashes based on latest block number -func (dtm *DedupTxHashManager) expired(block uint64) []TxHash { - dtm.mutex.RLock() - defer dtm.mutex.RUnlock() - - var result []TxHash - for h, expire := range dtm.hashes { - if block > expire { - result = append(result, h) - } - } - return result -} - -func (dtm *DedupTxHashManager) purge(hashes []TxHash) { - dtm.mutex.Lock() - defer dtm.mutex.Unlock() - - for _, hash := range hashes { - delete(dtm.hashes, hash) - } -} // channelBatchRecv try to exhaust the channel buffer when it's not empty, // and block when it's empty. @@ -176,9 +215,11 @@ func channelBatchRecv[T any](ch <-chan *T) []*T { } ``` -### Ante Handlers +### AnteHandler Decorator -Bypass the nonce decorator for un-ordered transactions. +In order to facilitate bypassing nonce verification, we have to modify the existing +`IncrementSequenceDecorator` AnteHandler decorator to skip the nonce verification +when the transaction is marked as un-ordered. ```golang func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { @@ -186,25 +227,26 @@ func (isd IncrementSequenceDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim return next(ctx, tx, simulate) } - // the previous logic + // ... } ``` -A decorator for the new logic. +In addition, we need to introduce a new decorator to perform the un-ordered transaction +verification and map lookup. ```golang -type TxHash [32]byte - const ( - // MaxUnOrderedTTL defines the maximum ttl an un-order tx can set - MaxUnOrderedTTL = 1024 + // DefaultMaxUnOrderedTTL defines the default maximum TTL an un-ordered transaction + // can set. + DefaultMaxUnOrderedTTL = 1024 ) type DedupTxDecorator struct { - m *DedupTxHashManager + m *UnorderedTxManager + maxUnOrderedTTL uint64 } -func (dtd *DedupTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { +func (d *DedupTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { // only apply to un-ordered transactions if !tx.UnOrdered() { return next(ctx, tx, simulate) @@ -214,18 +256,18 @@ func (dtd *DedupTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate boo return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "unordered tx must set timeout-height") } - if tx.TimeoutHeight() > ctx.BlockHeight() + MaxUnOrderedTTL { - return nil, errorsmod.Wrapf(sdkerrors.ErrLogic, "unordered tx ttl exceeds %d", MaxUnOrderedTTL) + if tx.TimeoutHeight() > ctx.BlockHeight() + d.maxUnOrderedTTL { + return nil, errorsmod.Wrapf(sdkerrors.ErrLogic, "unordered tx ttl exceeds %d", d.maxUnOrderedTTL) } // check for duplicates - if dtd.m.Contains(tx.Hash()) { + if d.m.Contains(tx.Hash()) { return nil, errorsmod.Wrap(sdkerrors.ErrLogic, "tx is duplicated") } if !ctx.IsCheckTx() { - // a new tx included in the block, add the hash to the dictionary - dtd.m.Add(tx.Hash(), tx.TimeoutHeight()) + // a new tx included in the block, add the hash to the unordered tx manager + d.m.Add(tx.Hash(), tx.TimeoutHeight()) } return next(ctx, tx, simulate) @@ -234,16 +276,24 @@ func (dtd *DedupTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate boo ### `OnNewBlock` -Wire the `OnNewBlock` method of `DedupTxHashManager` into the BaseApp's ABCI Commit event. +Wire the `OnNewBlock` method of `UnorderedTxManager` into the BaseApp's ABCI `Commit` event. + +### State Management + +On start up, the node needs to ensure the TxManager's state contains all un-expired +transactions that have been committed to the chain. This is critical since if the +state is not properly initialized, the node will not reject duplicate transactions +and thus will not provide replay protection, and will likely get an app hash mismatch error. -### Start Up +We propose to write all un-expired unordered transactions from the TxManager's to +file on disk. On start up, the node will read this file and re-populate the TxManager's +map. The write to file will happen when the node gracefully shuts down on `Close()`. -On start up, the node needs to re-fill the tx hash dictionary of `DedupTxHashManager` -by scanning `MaxUnOrderedTTL` number of historical blocks for existing un-expired -un-ordered transactions. +Note, this is not a perfect solution, in the context of store v1. With store v2, +we can omit explicit file handling altogether and simply write the all the transactions +to non-consensus state, i.e State Storage (SS). -An alternative design is to store the tx hash dictionary in kv store, then no need -to warm up on start up. +Alternatively, we can write all the transactions to consensus state. ## Consequences diff --git a/docs/learn/beginner/01-tx-lifecycle.md b/docs/learn/beginner/01-tx-lifecycle.md index 8c8118fa384d..52fb720cb1a9 100644 --- a/docs/learn/beginner/01-tx-lifecycle.md +++ b/docs/learn/beginner/01-tx-lifecycle.md @@ -164,44 +164,44 @@ 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 + -------------------------- + | Receive Block Proposal | + -------------------------- + | + v ------------------------- - | FinalizeBlock | - | - v - ------------------- - | BeginBlock | - ------------------- - | - v + | FinalizeBlock | + ------------------------- + | + v + ------------------- + | BeginBlock | + ------------------- + | + v -------------------- | ExecuteTx(tx0) | | ExecuteTx(tx1) | | ExecuteTx(tx2) | | ExecuteTx(tx3) | - | . | - | . | - | . | + | . | + | . | + | . | ------------------- - | - v + | + v -------------------- - | EndBlock | + | EndBlock | -------------------- - ------------------------- - | - v + | + v ----------------------- - | Consensus | + | Consensus | ----------------------- | - v + v ----------------------- - | Commit | + | Commit | ----------------------- ``` diff --git a/docs/learn/beginner/02-query-lifecycle.md b/docs/learn/beginner/02-query-lifecycle.md index 04e4fc9ed644..d4f2fed521f4 100644 --- a/docs/learn/beginner/02-query-lifecycle.md +++ b/docs/learn/beginner/02-query-lifecycle.md @@ -76,7 +76,7 @@ The first thing that is created in the execution of a CLI command is a `client.C * **Codec**: The [encoder/decoder](../advanced/05-encoding.md) used by the application, used to marshal the parameters and query before making the CometBFT RPC request and unmarshal the returned response into a JSON object. The default codec used by the CLI is Protobuf. * **Account Decoder**: The account decoder from the [`auth`](../../build/modules/auth/README.md) module, which translates `[]byte`s into accounts. * **RPC Client**: The CometBFT RPC Client, or node, to which requests are relayed. -* **Keyring**: A [Key Manager]../beginner/03-accounts.md#keyring) used to sign transactions and handle other operations with keys. +* **Keyring**: A [Key Manager](../beginner/03-accounts.md#keyring) used to sign transactions and handle other operations with keys. * **Output Writer**: A [Writer](https://pkg.go.dev/io/#Writer) used to output the response. * **Configurations**: The flags configured by the user for this command, including `--height`, specifying the height of the blockchain to query, and `--indent`, which indicates to add an indent to the JSON response. @@ -134,7 +134,7 @@ Once a result is received from the querier, `baseapp` begins the process of retu ## Response -Since `Query()` is an ABCI function, `baseapp` returns the response as an [`abci.ResponseQuery`](https://docs.cometbft.com/master/spec/abci/abci.html#query-2) type. The `client.Context` `Query()` routine receives the response and. +Since `Query()` is an ABCI function, `baseapp` returns the response as an [`abci.ResponseQuery`](https://docs.cometbft.com/master/spec/abci/abci.html#query-2) type. The `client.Context` `Query()` routine receives the response. ### CLI Response diff --git a/errors/CHANGELOG.md b/errors/CHANGELOG.md index f49d3c8e6d3e..9330f2fe19b0 100644 --- a/errors/CHANGELOG.md +++ b/errors/CHANGELOG.md @@ -31,6 +31,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* [#18918](https://github.com/cosmos/cosmos-sdk/pull/18918) Improve `IsOf` by returning earlier when the checked error is nil. + ## [v1.0.0](https://github.com/cosmos/cosmos-sdk/releases/tag/errors%2Fv1.0.0) ### Features diff --git a/errors/errors.go b/errors/errors.go index 2e5140d72828..16f10f36a6ee 100644 --- a/errors/errors.go +++ b/errors/errors.go @@ -284,6 +284,9 @@ func WithType(err error, obj interface{}) error { // IsOf checks if a received error is caused by one of the target errors. // It extends the errors.Is functionality to a list of errors. func IsOf(received error, targets ...error) bool { + if received == nil { + return false + } for _, t := range targets { if errors.Is(received, t) { return true diff --git a/errors/errors_test.go b/errors/errors_test.go index 48a978c8f3b7..54a33e1842b1 100644 --- a/errors/errors_test.go +++ b/errors/errors_test.go @@ -118,6 +118,8 @@ func (s *errorsTestSuite) TestIsOf() { err := ErrInvalidAddress errW := Wrap(ErrLogic, "more info") + require.False(IsOf(nil), "nil should always have no causer") + require.False(IsOf(nil, err), "nil should always have no causer") require.False(IsOf(errNil), "nil error should always have no causer") require.False(IsOf(errNil, err), "nil error should always have no causer") diff --git a/errors/go.mod b/errors/go.mod index 19174d89ac5c..4cd77e03e972 100644 --- a/errors/go.mod +++ b/errors/go.mod @@ -17,7 +17,7 @@ require ( golang.org/x/net v0.19.0 // indirect golang.org/x/sys v0.15.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect gopkg.in/yaml.v3 v3.0.1 // indirect ) diff --git a/errors/go.sum b/errors/go.sum index 026220af1b74..eb14e8430e8d 100644 --- a/errors/go.sum +++ b/errors/go.sum @@ -36,8 +36,8 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= diff --git a/go.mod b/go.mod index 3e5ad4216387..dba471f0bca0 100644 --- a/go.mod +++ b/go.mod @@ -44,7 +44,7 @@ require ( github.com/mattn/go-isatty v0.0.20 github.com/mdp/qrterminal/v3 v3.2.0 github.com/muesli/termenv v0.15.2 - github.com/prometheus/client_golang v1.17.0 + github.com/prometheus/client_golang v1.18.0 github.com/prometheus/common v0.45.0 github.com/rs/zerolog v1.31.0 github.com/spf13/cast v1.6.0 @@ -55,11 +55,11 @@ require ( github.com/tendermint/go-amino v0.16.0 gitlab.com/yawning/secp256k1-voi v0.0.0-20230925100816-f2616030848b golang.org/x/crypto v0.17.0 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 - golang.org/x/sync v0.5.0 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b + golang.org/x/sync v0.6.0 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 sigs.k8s.io/yaml v1.4.0 @@ -79,9 +79,8 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/iavl v1.0.0 // indirect github.com/cosmos/ics23/go v0.10.0 // indirect @@ -118,7 +117,7 @@ require ( github.com/iancoleman/strcase v0.3.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -143,7 +142,7 @@ require ( github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect github.com/sagikazarmark/slog-shim v0.1.0 // indirect diff --git a/go.sum b/go.sum index cdf622b1b85a..50930a951c89 100644 --- a/go.sum +++ b/go.sum @@ -112,20 +112,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -433,8 +429,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= @@ -593,8 +589,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -628,8 +624,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -777,8 +773,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -843,8 +839,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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -1009,8 +1005,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/log/CHANGELOG.md b/log/CHANGELOG.md index 21c93c7015e7..ffea96df0fc4 100644 --- a/log/CHANGELOG.md +++ b/log/CHANGELOG.md @@ -22,7 +22,9 @@ Each entry must include the Github issue reference in the following format: ## [Unreleased] +* [#18916](https://github.com/cosmos/cosmos-sdk/pull/18916) Introduce an option for setting hooks. * [#18429](https://github.com/cosmos/cosmos-sdk/pull/18429) Support customization of log json marshal. +* [#18898](https://github.com/cosmos/cosmos-sdk/pull/18898) Add `WARN` level. ## [v1.2.1](https://github.com/cosmos/cosmos-sdk/releases/tag/log/v1.2.1) - 2023-08-25 diff --git a/log/logger.go b/log/logger.go index 64b985b90ec1..4fbb9b296b0c 100644 --- a/log/logger.go +++ b/log/logger.go @@ -40,6 +40,10 @@ type Logger interface { // The key of the tuple must be a string. Info(msg string, keyVals ...any) + // Warn takes a message and a set of key/value pairs and logs with level WARN. + // The key of the tuple must be a string. + Warn(msg string, keyVals ...any) + // Error takes a message and a set of key/value pairs and logs with level ERR. // The key of the tuple must be a string. Error(msg string, keyVals ...any) @@ -121,6 +125,11 @@ func NewLogger(dst io.Writer, options ...Option) Logger { logger = logger.Level(logCfg.Level) } + // TODO: when https://github.com/rs/zerolog/pull/629 is tagged, replace it to use logger.Hooks() + for i := range logCfg.Hooks { + logger = logger.Hook(logCfg.Hooks[i]) + } + return zeroLogWrapper{&logger} } @@ -135,6 +144,12 @@ func (l zeroLogWrapper) Info(msg string, keyVals ...interface{}) { l.Logger.Info().Fields(keyVals).Msg(msg) } +// Info takes a message and a set of key/value pairs and logs with level INFO. +// The key of the tuple must be a string. +func (l zeroLogWrapper) Warn(msg string, keyVals ...interface{}) { + l.Logger.Warn().Fields(keyVals).Msg(msg) +} + // Error takes a message and a set of key/value pairs and logs with level DEBUG. // The key of the tuple must be a string. func (l zeroLogWrapper) Error(msg string, keyVals ...interface{}) { @@ -171,6 +186,7 @@ func NewNopLogger() Logger { type nopLogger struct{} func (nopLogger) Info(string, ...any) {} +func (nopLogger) Warn(string, ...any) {} func (nopLogger) Error(string, ...any) {} func (nopLogger) Debug(string, ...any) {} func (nopLogger) With(...any) Logger { return nopLogger{} } diff --git a/log/logger_test.go b/log/logger_test.go index 95f3fb76f894..9c877a0ca4ef 100644 --- a/log/logger_test.go +++ b/log/logger_test.go @@ -7,6 +7,8 @@ import ( "testing" "cosmossdk.io/log" + "github.com/rs/zerolog" + "gotest.tools/v3/assert" ) func TestLoggerOptionStackTrace(t *testing.T) { @@ -30,3 +32,26 @@ func TestLoggerOptionStackTrace(t *testing.T) { func inner() error { return errors.New("seems we have an error here") } + +type _MockHook string + +func (h _MockHook) Run(e *zerolog.Event, l zerolog.Level, msg string) { + e.Bool(string(h), true) +} + +func TestLoggerOptionHooks(t *testing.T) { + buf := new(bytes.Buffer) + var ( + mockHook1 _MockHook = "mock_message1" + mockHook2 _MockHook = "mock_message2" + ) + logger := log.NewLogger(buf, log.HooksOption(mockHook1, mockHook2), log.ColorOption(false)) + logger.Info("hello world") + assert.Assert(t, strings.Contains(buf.String(), "mock_message1=true")) + assert.Assert(t, strings.Contains(buf.String(), "mock_message2=true")) + + buf.Reset() + logger = log.NewLogger(buf, log.HooksOption(), log.ColorOption(false)) + logger.Info("hello world") + assert.Assert(t, strings.Contains(buf.String(), "hello world")) +} diff --git a/log/options.go b/log/options.go index 22a1eb22841f..28cfefee2e80 100644 --- a/log/options.go +++ b/log/options.go @@ -14,6 +14,7 @@ var defaultConfig = Config{ Color: true, StackTrace: false, TimeFormat: time.Kitchen, + Hooks: nil, } // Config defines configuration for the logger. @@ -24,6 +25,7 @@ type Config struct { Color bool StackTrace bool TimeFormat string + Hooks []zerolog.Hook } type Option func(*Config) @@ -87,3 +89,10 @@ func TraceOption(val bool) Option { cfg.StackTrace = val } } + +// HooksOption append hooks to the Logger hooks +func HooksOption(hooks ...zerolog.Hook) Option { + return func(cfg *Config) { + cfg.Hooks = append(cfg.Hooks, hooks...) + } +} diff --git a/math/CHANGELOG.md b/math/CHANGELOG.md index 2f512456c3df..d246eda970a8 100644 --- a/math/CHANGELOG.md +++ b/math/CHANGELOG.md @@ -41,6 +41,8 @@ Ref: https://github.com/commitizen/conventional-commit-types/blob/v3.0.0/index.j * [#18421](https://github.com/cosmos/cosmos-sdk/pull/18421) Add mutative api for `LegacyDec.BigInt()`. +* [#18874](https://github.com/cosmos/cosmos-sdk/pull/18874) Speedup `math.Int.Mul` by removing a duplicate overflow check + ### Bug Fixes * [#18519](https://github.com/cosmos/cosmos-sdk/pull/18519) Prevent Overflow in `Dec.Ceil()`. diff --git a/math/int.go b/math/int.go index 54ee8f4f2342..5b4bb7fa8d29 100644 --- a/math/int.go +++ b/math/int.go @@ -333,12 +333,8 @@ func (i Int) MulRaw(i2 int64) Int { // SafeMul multiples Int from another and returns an error if overflow func (i Int) SafeMul(i2 Int) (res Int, err error) { - // Check overflow - if i.i.BitLen()+i2.i.BitLen()-1 > MaxBitLen { - return Int{}, ErrIntOverflow - } res = Int{mul(i.i, i2.i)} - // Check overflow if sign of both are same + // Check overflow if res.i.BitLen() > MaxBitLen { return Int{}, ErrIntOverflow } diff --git a/orm/go.mod b/orm/go.mod index d1440b350cf5..a1180672a98c 100644 --- a/orm/go.mod +++ b/orm/go.mod @@ -14,9 +14,9 @@ require ( github.com/iancoleman/strcase v0.3.0 github.com/regen-network/gocuke v1.0.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) @@ -29,7 +29,7 @@ require ( github.com/cockroachdb/apd/v3 v3.2.1 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b // indirect + github.com/cockroachdb/pebble v1.0.0 // indirect github.com/cockroachdb/redact v1.1.5 // indirect github.com/cosmos/gogoproto v1.4.11 // indirect github.com/cucumber/common/messages/go/v19 v19.1.2 // indirect @@ -38,13 +38,13 @@ require ( github.com/cucumber/tag-expressions/go/v5 v5.0.6 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/fsnotify/fsnotify v1.6.0 // indirect - github.com/getsentry/sentry-go v0.23.0 // indirect + github.com/getsentry/sentry-go v0.25.0 // indirect github.com/gofrs/uuid v4.4.0+incompatible // indirect github.com/gogo/protobuf v1.3.2 // indirect github.com/golang/protobuf v1.5.3 // indirect github.com/golang/snappy v0.0.4 // indirect github.com/google/btree v1.1.2 // indirect - github.com/klauspost/compress v1.16.5 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/linxGnu/grocksdb v1.8.10 // indirect @@ -52,11 +52,11 @@ require ( github.com/onsi/gomega v1.20.0 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect - github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect + github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect - github.com/prometheus/procfs v0.11.1 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/prometheus/procfs v0.12.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/spf13/cast v1.5.1 // indirect github.com/syndtr/goleveldb v1.0.1-0.20220721030215-126854af5e6d // indirect golang.org/x/net v0.19.0 // indirect diff --git a/orm/go.sum b/orm/go.sum index 09807dd2bd7a..75818fe95b1a 100644 --- a/orm/go.sum +++ b/orm/go.sum @@ -19,14 +19,14 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/cockroachdb/apd/v3 v3.2.1 h1:U+8j7t0axsIgvQUqthuNm82HIrYXodOV2iWLWtEaIwg= github.com/cockroachdb/apd/v3 v3.2.1/go.mod h1:klXJcjp+FffLTHlhIG69tezTDvdP065naDsHzKhYSqc= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b h1:LCs8gDhg6vt8A3dN7AEJxmCoETZ4qkySoVJVm3rcSJk= -github.com/cockroachdb/pebble v0.0.0-20230525220056-bb4fc9527b3b/go.mod h1:TkdVsGYRqtULUppt2RbC+YaKtTHnHoWa2apfFrSKABw= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZZ2lK+dpvRg= github.com/cosmos/cosmos-db v1.0.0 h1:EVcQZ+qYag7W6uorBKFPvX6gRjw6Uq2hIh4hCWjuQ0E= @@ -54,8 +54,8 @@ github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4 github.com/fsnotify/fsnotify v1.5.4/go.mod h1:OVB6XrOHzAwXMpEM7uPOzcehqUV2UqJxmVXmkdnm1bU= github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY= github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw= -github.com/getsentry/sentry-go v0.23.0 h1:dn+QRCeJv4pPt9OjVXiMcGIBIefaTJPw/h0bZWO05nE= -github.com/getsentry/sentry-go v0.23.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= +github.com/getsentry/sentry-go v0.25.0 h1:q6Eo+hS+yoJlTO3uu/azhQadsD8V+jQn2D8VvX1eOyI= +github.com/getsentry/sentry-go v0.25.0/go.mod h1:lc76E2QywIyW8WuBnwl8Lc4bkmQH4+w1gwTf25trprY= github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA= github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og= github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= @@ -95,8 +95,8 @@ github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47 github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.16.5 h1:IFV2oUNUzZaz+XyusxpLzpzS8Pt5rh0Z16For/djlyI= -github.com/klauspost/compress v1.16.5/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= 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= @@ -129,19 +129,19 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/prometheus/client_golang v1.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16 h1:v7DLqVdK4VrYkVD5diGdl4sxJurKJEMnODWRJlxV9oM= -github.com/prometheus/client_model v0.4.1-0.20230718164431-9a2bf3000d16/go.mod h1:oMQmHW1/JoDwqLtg57MGgP/Fb1CJEYF2imWWhWtMkYU= +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.5.0 h1:VQw1hfvPvk3Uv6Qf29VrPF32JB6rtbgI6cYPYQjL0Qw= +github.com/prometheus/client_model v0.5.0/go.mod h1:dTiFglRmd66nLR9Pv9f0mZi7B7fk5Pm3gvsjB5tr+kI= github.com/prometheus/common v0.45.0 h1:2BGz0eBc2hdMDLnO/8n0jeB3oPrt2D08CekT0lneoxM= github.com/prometheus/common v0.45.0/go.mod h1:YJmSTw9BoKxJplESWWxlbyttQR4uaEcGyv9MZjVOJsY= -github.com/prometheus/procfs v0.11.1 h1:xRC8Iq1yyca5ypa9n1EZnWZkt7dwcoRPQwX/5gwaUuI= -github.com/prometheus/procfs v0.11.1/go.mod h1:eesXgaPo1q7lBpVMoMy0ZOFTth9hBn4W/y0/p/ScXhY= +github.com/prometheus/procfs v0.12.0 h1:jluTpSng7V9hY0O2R9DzzJHYb2xULk9VTR1V1R/k6Bo= +github.com/prometheus/procfs v0.12.0/go.mod h1:pcuDEFsWDnvcgNzo4EEweacyhjeA9Zk3cnaOZAZEfOo= github.com/regen-network/gocuke v1.0.0 h1:bF1j15yt+SN7spYt/bN0aRoSUvLWBWczwYqZBfEMbu8= github.com/regen-network/gocuke v1.0.0/go.mod h1:nVBO9DEnZNUB/GjmJgAIojKxcEu9a0EZwry0qKW24Mk= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/spf13/cast v1.5.1 h1:R+kOtfhWQE6TVQzY+4D7wJLBgkdVasCEFxSUBYBYIlA= github.com/spf13/cast v1.5.1/go.mod h1:b9PdjNptOpzXr7Rq1q9gJML/2cdGQAo69NKzQ10KN48= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= @@ -160,8 +160,8 @@ github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1 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/exp v0.0.0-20230817173708-d852ddb80c63 h1:m64FZMko/V45gv0bNmrNYoDEq8U5YUhetc9cBWKS1TQ= -golang.org/x/exp v0.0.0-20230817173708-d852ddb80c63/go.mod h1:0v4NqG35kSWCMzLaMeX+IQrlSnVE/bqGSyC2cz/9Le8= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -240,8 +240,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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/orm/internal/testkv/db.go b/orm/internal/testkv/db.go index 38d456d9484a..c5fc19b132cc 100644 --- a/orm/internal/testkv/db.go +++ b/orm/internal/testkv/db.go @@ -116,7 +116,7 @@ func (iw IteratorWrapper) Error() error { return iw.itr.Error() } -// Close closes the iterator, relasing any allocated resources. +// Close closes the iterator, releasing any allocated resources. func (iw IteratorWrapper) Close() error { return iw.itr.Close() } diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 4d8b290bddd7..6cbf6a0cdc50 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -105,13 +105,29 @@ message TxBody { // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + // but should be called `note` instead (see + // https://github.com/cosmos/cosmos-sdk/issues/9122). string memo = 2; - // timeout is the block height after which this transaction will not - // be processed by the chain + // timeout_height is the block height after which this transaction will not + // be processed by the chain. + // + // Note, if unordered=true this value MUST be set + // and will act as a short-lived TTL in which the transaction is deemed valid + // and kept in memory to prevent duplicates. uint64 timeout_height = 3; + // unordered, when set to true, indicates that the transaction signer(s) + // intend for the transaction to be evaluated and executed in an un-ordered + // fashion. Specifically, the account's nonce will NOT be checked or + // incremented, which allows for fire-and-forget as well as concurrent + // transaction execution. + // + // Note, when set to true, the existing 'timeout_height' value must be set and + // will be used to correspond to a height in which the transaction is deemed + // valid. + bool unordered = 4; + // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected @@ -211,14 +227,16 @@ message Fee { // before an out of gas error occurs uint64 gas_limit = 2; - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. + // if unset, the first signer is responsible for paying the fees. If set, the + // specified account must pay the fees. the payer must be a tx signer (and + // thus have signed this field in AuthInfo). setting this field does *not* + // change the ordering of required signers for the transaction. string payer = 3 [(cosmos_proto.scalar) = "cosmos.AddressString"]; - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail + // if set, the fee payer (either the first signer or the value of the payer + // field) requests that a fee grant be used to pay fees instead of the fee + // payer's own balance. If an appropriate fee grant does not exist or the + // chain does not support fee grants, this will fail string granter = 4 [(cosmos_proto.scalar) = "cosmos.AddressString"]; } diff --git a/server/grpc/reflection/v2alpha1/reflection.go b/server/grpc/reflection/v2alpha1/reflection.go index 73290c2961f8..2e2fd1a45e6a 100644 --- a/server/grpc/reflection/v2alpha1/reflection.go +++ b/server/grpc/reflection/v2alpha1/reflection.go @@ -2,6 +2,7 @@ package v2alpha1 import ( "context" + "errors" "fmt" "github.com/cosmos/gogoproto/proto" @@ -15,7 +16,6 @@ import ( type Config struct { SigningModes map[string]int32 ChainID string - SdkConfig *sdk.Config InterfaceRegistry codectypes.InterfaceRegistry } @@ -47,7 +47,7 @@ func (r reflectionServiceServer) GetCodecDescriptor(_ context.Context, _ *GetCod } func (r reflectionServiceServer) GetConfigurationDescriptor(_ context.Context, _ *GetConfigurationDescriptorRequest) (*GetConfigurationDescriptorResponse, error) { - return &GetConfigurationDescriptorResponse{Config: r.desc.Configuration}, nil + return nil, errors.New("this endpoint has been deprecated, please see auth/Bech32Prefix for the data you are seeking") } func (r reflectionServiceServer) GetQueryServicesDescriptor(_ context.Context, _ *GetQueryServicesDescriptorRequest) (*GetQueryServicesDescriptorResponse, error) { @@ -61,10 +61,7 @@ func (r reflectionServiceServer) GetTxDescriptor(_ context.Context, _ *GetTxDesc func newReflectionServiceServer(grpcSrv *grpc.Server, conf Config) (reflectionServiceServer, error) { // set chain descriptor chainDescriptor := &ChainDescriptor{Id: conf.ChainID} - // set configuration descriptor - configurationDescriptor := &ConfigurationDescriptor{ - Bech32AccountAddressPrefix: conf.SdkConfig.GetBech32AccountAddrPrefix(), - } + // set codec descriptor codecDescriptor, err := newCodecDescriptor(conf.InterfaceRegistry) if err != nil { @@ -82,7 +79,6 @@ func newReflectionServiceServer(grpcSrv *grpc.Server, conf Config) (reflectionSe Authn: authnDescriptor, Chain: chainDescriptor, Codec: codecDescriptor, - Configuration: configurationDescriptor, QueryServices: queryServiceDescriptor, Tx: txDescriptor, } diff --git a/server/grpc/server.go b/server/grpc/server.go index 51bcf3f445b9..f04b7cd20e5b 100644 --- a/server/grpc/server.go +++ b/server/grpc/server.go @@ -15,7 +15,6 @@ import ( "github.com/cosmos/cosmos-sdk/server/grpc/gogoreflection" reflection "github.com/cosmos/cosmos-sdk/server/grpc/reflection/v2alpha1" "github.com/cosmos/cosmos-sdk/server/types" - sdk "github.com/cosmos/cosmos-sdk/types" _ "github.com/cosmos/cosmos-sdk/types/tx/amino" // Import amino.proto file for reflection ) @@ -54,7 +53,6 @@ func NewGRPCServer(clientCtx client.Context, app types.Application, cfg config.G return modes }(), ChainID: clientCtx.ChainID, - SdkConfig: sdk.GetConfig(), InterfaceRegistry: clientCtx.InterfaceRegistry, }) if err != nil { diff --git a/simapp/ante.go b/simapp/ante.go index 451ab036488a..125057225213 100644 --- a/simapp/ante.go +++ b/simapp/ante.go @@ -4,6 +4,7 @@ import ( "errors" "cosmossdk.io/x/auth/ante" + "cosmossdk.io/x/auth/ante/unorderedtx" circuitante "cosmossdk.io/x/circuit/ante" sdk "github.com/cosmos/cosmos-sdk/types" @@ -13,6 +14,7 @@ import ( type HandlerOptions struct { ante.HandlerOptions CircuitKeeper circuitante.CircuitBreaker + TxManager *unorderedtx.Manager } // NewAnteHandler returns an AnteHandler that checks and increments sequence @@ -37,6 +39,7 @@ func NewAnteHandler(options HandlerOptions) (sdk.AnteHandler, error) { ante.NewExtensionOptionsDecorator(options.ExtensionOptionChecker), ante.NewValidateBasicDecorator(), ante.NewTxTimeoutHeightDecorator(), + ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, options.TxManager), ante.NewValidateMemoDecorator(options.AccountKeeper), ante.NewConsumeGasForTxSizeDecorator(options.AccountKeeper), ante.NewDeductFeeDecorator(options.AccountKeeper, options.BankKeeper, options.FeegrantKeeper, options.TxFeeChecker), diff --git a/simapp/app.go b/simapp/app.go index 4bffaaa09a7a..7007d9a62efe 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -26,6 +26,7 @@ import ( "cosmossdk.io/x/accounts/testing/counter" "cosmossdk.io/x/auth" "cosmossdk.io/x/auth/ante" + "cosmossdk.io/x/auth/ante/unorderedtx" authcodec "cosmossdk.io/x/auth/codec" authkeeper "cosmossdk.io/x/auth/keeper" "cosmossdk.io/x/auth/posthandler" @@ -169,6 +170,8 @@ type SimApp struct { ModuleManager *module.Manager BasicModuleManager module.BasicManager + UnorderedTxManager *unorderedtx.Manager + // simulation manager sm *module.SimulationManager @@ -519,6 +522,25 @@ func NewSimApp( } app.sm = module.NewSimulationManagerFromAppModules(app.ModuleManager.Modules, overrideModules) + // create, start, and load the unordered tx manager + utxDataDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data") + app.UnorderedTxManager = unorderedtx.NewManager(utxDataDir) + app.UnorderedTxManager.Start() + + if err := app.UnorderedTxManager.OnInit(); err != nil { + panic(fmt.Errorf("failed to initialize unordered tx manager: %w", err)) + } + + // register custom snapshot extensions (if any) + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions( + unorderedtx.NewSnapshotter(app.UnorderedTxManager), + ) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + app.sm.RegisterStoreDecoders() // initialize stores @@ -579,6 +601,7 @@ func (app *SimApp) setAnteHandler(txConfig client.TxConfig) { SigGasConsumer: ante.DefaultSigVerificationGasConsumer, }, &app.CircuitKeeper, + app.UnorderedTxManager, }, ) if err != nil { @@ -600,6 +623,12 @@ func (app *SimApp) setPostHandler() { app.SetPostHandler(postHandler) } +// Close implements the Application interface and closes all necessary application +// resources. +func (app *SimApp) Close() error { + return app.UnorderedTxManager.Close() +} + // Name returns the name of the App func (app *SimApp) Name() string { return app.BaseApp.Name() } diff --git a/simapp/app_v2.go b/simapp/app_v2.go index 172e6e7af408..0c4ea6f63ac8 100644 --- a/simapp/app_v2.go +++ b/simapp/app_v2.go @@ -3,16 +3,19 @@ package simapp import ( + "fmt" "io" "os" "path/filepath" dbm "github.com/cosmos/cosmos-db" + "github.com/spf13/cast" "cosmossdk.io/depinject" "cosmossdk.io/log" storetypes "cosmossdk.io/store/types" "cosmossdk.io/x/auth" + "cosmossdk.io/x/auth/ante/unorderedtx" authkeeper "cosmossdk.io/x/auth/keeper" authsims "cosmossdk.io/x/auth/simulation" authtypes "cosmossdk.io/x/auth/types" @@ -34,6 +37,7 @@ import ( "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/codec" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/runtime" @@ -64,6 +68,8 @@ type SimApp struct { txConfig client.TxConfig interfaceRegistry codectypes.InterfaceRegistry + UnorderedTxManager *unorderedtx.Manager + // keepers AuthKeeper authkeeper.AccountKeeper BankKeeper bankkeeper.Keeper @@ -256,6 +262,25 @@ func NewSimApp( // return app.App.InitChainer(ctx, req) // }) + // create, start, and load the unordered tx manager + utxDataDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data") + app.UnorderedTxManager = unorderedtx.NewManager(utxDataDir) + app.UnorderedTxManager.Start() + + if err := app.UnorderedTxManager.OnInit(); err != nil { + panic(fmt.Errorf("failed to initialize unordered tx manager: %w", err)) + } + + // register custom snapshot extensions (if any) + if manager := app.SnapshotManager(); manager != nil { + err := manager.RegisterExtensions( + unorderedtx.NewSnapshotter(app.UnorderedTxManager), + ) + if err != nil { + panic(fmt.Errorf("failed to register snapshot extension: %s", err)) + } + } + if err := app.Load(loadLatest); err != nil { panic(err) } @@ -263,6 +288,12 @@ func NewSimApp( return app } +// Close implements the Application interface and closes all necessary application +// resources. +func (app *SimApp) Close() error { + return app.UnorderedTxManager.Close() +} + // LegacyAmino returns SimApp's amino codec. // // NOTE: This is solely to be used for testing purposes as it may be desirable diff --git a/simapp/go.mod b/simapp/go.mod index 3849d117e027..cf2c868ed1e4 100644 --- a/simapp/go.mod +++ b/simapp/go.mod @@ -30,10 +30,10 @@ require ( github.com/spf13/pflag v1.0.5 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) -require cosmossdk.io/x/accounts v0.0.0-20231013072015-ec9bcc41ef9c +require cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130 require ( cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 @@ -74,9 +74,8 @@ require ( github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-proto v1.0.0-beta.3 // indirect @@ -142,7 +141,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -168,13 +167,13 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect github.com/rivo/uniseg v0.2.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -195,11 +194,11 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/simapp/go.sum b/simapp/go.sum index 4014671cb378..63c247c3ec8d 100644 --- a/simapp/go.sum +++ b/simapp/go.sum @@ -313,20 +313,16 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -723,8 +719,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= @@ -887,8 +883,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -922,8 +918,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1093,8 +1089,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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -1230,8 +1226,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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -1671,8 +1667,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/simapp/gomod2nix.toml b/simapp/gomod2nix.toml index 93e168f8f8ea..249f2d76444a 100644 --- a/simapp/gomod2nix.toml +++ b/simapp/gomod2nix.toml @@ -102,14 +102,11 @@ schema = 3 version = "v0.0.0-20230118201751-21c54148d20b" hash = "sha256-7dQH6j1o99fuxHKkw0RhNC5wJKkvRLMDJpUiVnDx6h8=" [mod."github.com/cockroachdb/pebble"] - version = "v0.0.0-20231129003907-ce7560a81fb6" - hash = "sha256-p0WGkwz6B4N6HIWlPciAYBnET01pSHFrVhbamtOWebo=" + version = "v1.0.0" + hash = "sha256-oIMajhqta96d74XxTvMizFmtlPQ/QGIKg+cUzH/1ycU=" [mod."github.com/cockroachdb/redact"] version = "v1.1.5" hash = "sha256-0rtT7LRO0wxf9XovOK8GXRrhmx8OcbdPK/mXOKbJdog=" - [mod."github.com/cockroachdb/tokenbucket"] - version = "v0.0.0-20230807174530-cc333fc44b06" - hash = "sha256-yZdBXkTVzPxRYntI9I2Gu4gkI11m52Nwl8RNNdlXSrA=" [mod."github.com/cometbft/cometbft"] version = "v0.38.2" hash = "sha256-mCfJ/1W2ugD9d7JOjMlmkZpiljmFL/pU8hYtU6KYpGM=" @@ -318,8 +315,8 @@ schema = 3 version = "v1.0.0" hash = "sha256-xEd0mDBeq3eR/GYeXjoTVb2sPs8sTCosn5ayWkcgENI=" [mod."github.com/klauspost/compress"] - version = "v1.17.3" - hash = "sha256-qB+Js8Ydc/ldSAV4BsKsqWzfI7H3E4PFD5eYPgDewk8=" + version = "v1.17.4" + hash = "sha256-5E7dDtDKfL3jy7zJxHBMV57WlHZrP/OoEX5e6cOPba0=" [mod."github.com/kr/pretty"] version = "v0.3.1" hash = "sha256-DlER7XM+xiaLjvebcIPiB12oVNjyZHuJHoRGITzzpKU=" @@ -396,8 +393,8 @@ schema = 3 version = "v1.0.1-0.20181226105442-5d4384ee4fb2" hash = "sha256-XA4Oj1gdmdV/F/+8kMI+DBxKPthZ768hbKsO3d9Gx90=" [mod."github.com/prometheus/client_golang"] - version = "v1.17.0" - hash = "sha256-FIIzCuNqHdVzpbyH7yAp7Tcu+1tPxEMS5g6KfsGQBGE=" + version = "v1.18.0" + hash = "sha256-kuC6WUg2j7A+9qnSp5VZSYo+oltgLvj/70TpqlCJIdE=" [mod."github.com/prometheus/client_model"] version = "v0.5.0" hash = "sha256-/sXlngf8AoEIeLIiaLg6Y7uYPVq7tI0qnLt0mUyKid4=" @@ -414,8 +411,8 @@ schema = 3 version = "v0.2.0" hash = "sha256-GLj0jiGrT03Ept4V6FXCN1yeZ/b6PpS3MEXK6rYQ8Eg=" [mod."github.com/rogpeppe/go-internal"] - version = "v1.11.0" - hash = "sha256-BucSndJVnqX9e6p5PfA6Z8N2bGfIeRfxAxYLUDXTbIo=" + version = "v1.12.0" + hash = "sha256-qvDNCe3l84/LgrA8X4O15e1FeDcazyX91m9LmXGXX6M=" [mod."github.com/rs/cors"] version = "v1.8.3" hash = "sha256-VgVB4HKAhPSjNg96mIEUN1bt5ZQng8Fi3ZABy3CDWQE=" @@ -493,7 +490,7 @@ schema = 3 version = "v0.17.0" hash = "sha256-/vzBaeD/Ymyc7cpjBvSfJfuZ57zWa9LOaZM7b33eIx0=" [mod."golang.org/x/exp"] - version = "v0.0.0-20231214170342-aacd6d4b4611" + version = "v0.0.0-20231226003508-02704c960a9b" hash = "sha256-K35MT3O16IlvqhDZBVBF4lJZIM7T/15PxOmeyGYv01A=" [mod."golang.org/x/mod"] version = "v0.14.0" @@ -505,8 +502,8 @@ schema = 3 version = "v0.15.0" hash = "sha256-exA/abu6WOR7Cwqa41LpnTD2xQNRZMYU5CnBKvXHx8Y=" [mod."golang.org/x/sync"] - version = "v0.5.0" - hash = "sha256-EAKeODSsct5HhXPmpWJfulKSCkuUu6kkDttnjyZMNcI=" + version = "v0.6.0" + hash = "sha256-LLims/wjDZtIqlYCVHREewcUOX4hwRwplEuZKPOJ/HI=" [mod."golang.org/x/sys"] version = "v0.15.0" hash = "sha256-n7TlABF6179RzGq3gctPDKDPRtDfnwPdjNCMm8ps2KY=" @@ -544,8 +541,8 @@ schema = 3 version = "v1.60.1" hash = "sha256-JJ3X6DTUZWYtM8i8izWTH9nDvCydzea31iZt6ULDvsw=" [mod."google.golang.org/protobuf"] - version = "v1.31.0" - hash = "sha256-UdIk+xRaMfdhVICvKRk1THe3R1VU+lWD8hqoW/y8jT0=" + version = "v1.32.0" + hash = "sha256-GJuTkMGHCzHbyK4yD5kY4oMn8wQWqgkeBK//yVDqHJk=" [mod."gopkg.in/ini.v1"] version = "v1.67.0" hash = "sha256-V10ahGNGT+NLRdKUyRg1dos5RxLBXBk1xutcnquc/+4=" diff --git a/store/commit_info.go b/store/commit_info.go index 1bfad27e3eef..4900c2f501de 100644 --- a/store/commit_info.go +++ b/store/commit_info.go @@ -2,9 +2,8 @@ package store import ( "fmt" + "sort" "time" - - "cosmossdk.io/store/v2/internal/maps" ) type ( @@ -14,6 +13,7 @@ type ( Version uint64 StoreInfos []StoreInfo Timestamp time.Time + CommitHash []byte } // StoreInfo defines store-specific commit information. It contains a reference @@ -37,25 +37,44 @@ func (si StoreInfo) GetHash() []byte { // Hash returns the root hash of all committed stores represented by CommitInfo, // sorted by store name/key. -func (ci CommitInfo) Hash() []byte { +func (ci *CommitInfo) Hash() []byte { if len(ci.StoreInfos) == 0 { return nil } - rootHash, _, _ := maps.ProofsFromMap(ci.toMap()) + if len(ci.CommitHash) != 0 { + return ci.CommitHash + } + + rootHash, _, _ := ci.GetStoreProof("") return rootHash } -func (ci CommitInfo) toMap() map[string][]byte { - m := make(map[string][]byte, len(ci.StoreInfos)) - for _, storeInfo := range ci.StoreInfos { - m[storeInfo.Name] = storeInfo.GetHash() +func (ci *CommitInfo) GetStoreProof(storeKey string) ([]byte, *CommitmentOp, error) { + sort.Slice(ci.StoreInfos, func(i, j int) bool { + return ci.StoreInfos[i].Name < ci.StoreInfos[j].Name + }) + + index := 0 + leaves := make([][]byte, len(ci.StoreInfos)) + for i, si := range ci.StoreInfos { + var err error + leaves[i], err = LeafHash([]byte(si.Name), si.GetHash()) + if err != nil { + return nil, nil, err + } + if si.Name == storeKey { + index = i + } } - return m + rootHash, inners := ProofFromByteSlices(leaves, index) + commitmentOp := ConvertCommitmentOp(inners, []byte(storeKey), ci.StoreInfos[index].GetHash()) + + return rootHash, &commitmentOp, nil } -func (ci CommitInfo) CommitID() CommitID { +func (ci *CommitInfo) CommitID() CommitID { return CommitID{ Version: ci.Version, Hash: ci.Hash(), diff --git a/store/gas.go b/store/gas.go deleted file mode 100644 index 9bd142e506fa..000000000000 --- a/store/gas.go +++ /dev/null @@ -1,261 +0,0 @@ -package store - -import ( - "fmt" - "math" -) - -// Gas defines type alias of uint64 for gas consumption. Gas is measured by the -// SDK for store operations such as Get and Set calls. In addition, callers have -// the ability to explicitly charge gas for costly operations such as signature -// verification. -type Gas = uint64 - -// Gas consumption descriptors. -const ( - GasDescIterNextCostFlat = "IterNextFlat" - GasDescValuePerByte = "ValuePerByte" - GasDescWritePerByte = "WritePerByte" - GasDescReadPerByte = "ReadPerByte" - GasDescWriteCostFlat = "WriteFlat" - GasDescReadCostFlat = "ReadFlat" - GasDescHas = "Has" - GasDescDelete = "Delete" -) - -type ( - // ErrorNegativeGasConsumed defines an error thrown when the amount of gas refunded - // results in a negative gas consumed amount. - ErrorNegativeGasConsumed struct { - Descriptor string - } - - // ErrorOutOfGas defines an error thrown when an action results in out of gas. - ErrorOutOfGas struct { - Descriptor string - } - - // ErrorGasOverflow defines an error thrown when an action results gas consumption - // unsigned integer overflow. - ErrorGasOverflow struct { - Descriptor string - } -) - -func (e ErrorNegativeGasConsumed) Error() string { - return fmt.Sprintf("negative gas consumed: %s", e.Descriptor) -} - -func (e ErrorOutOfGas) Error() string { - return fmt.Sprintf("out of gas: %s", e.Descriptor) -} - -func (e ErrorGasOverflow) Error() string { - return fmt.Sprintf("gas overflow: %s", e.Descriptor) -} - -// GasMeter defines an interface for gas consumption tracking. -type GasMeter interface { - // GasConsumed returns the amount of gas consumed so far. - GasConsumed() Gas - // GasConsumedToLimit returns the gas limit if gas consumed is past the limit, - // otherwise it returns the consumed gas so far. - GasConsumedToLimit() Gas - // GasRemaining returns the gas left in the GasMeter. - GasRemaining() Gas - // Limit returns the gas limit (if any). - Limit() Gas - // ConsumeGas adds the given amount of gas to the gas consumed and should panic - // if it overflows the gas limit (if any). - ConsumeGas(amount Gas, descriptor string) - // RefundGas will deduct the given amount from the gas consumed so far. If the - // amount is greater than the gas consumed, the function should panic. - RefundGas(amount Gas, descriptor string) - // IsPastLimit returns if the gas consumed so far is past the limit (if any), - // otherwise it returns . - IsPastLimit() bool - // IsOutOfGas returns if the gas consumed so far is greater than or equal - // to gas limit (if any), otherwise it returns . - IsOutOfGas() bool - - fmt.Stringer -} - -// GasConfig defines gas cost for each operation on a KVStore. -type GasConfig struct { - // HasCost should reflect a fixed cost for a Has() call on a store. - HasCost Gas - // DeleteCost should reflect a fixed cost for a Delete() call on a store. - DeleteCost Gas - // ReadCostFlat should reflect a fixed cost for a Get() call on a store. - ReadCostFlat Gas - // ReadCostPerByte should reflect a fixed cost, per-byte on the key and value, - // for a Get() call on a store. Note, this cost can also be used on iteration - // seeks. - ReadCostPerByte Gas - // WriteCostFlat should reflect a fixed cost for a Set() call on a store. - WriteCostFlat Gas - // WriteCostPerByte should reflect a fixed cost, per-byte on the key and value, - // for a Set() call on a store. - WriteCostPerByte Gas - // IterNextCostFlat should reflect a fixed cost for each call to Next() on an - // iterator. - IterNextCostFlat Gas -} - -// DefaultGasConfig returns a default GasConfig for gas metering. -// -// Note, these values are essentially arbitrary. They are not based on any specific -// computation or measurements, but mainly reflect relative costs, i.e. writes -// should be more expensive than reads. -func DefaultGasConfig() GasConfig { - return GasConfig{ - HasCost: 1000, - ReadCostFlat: 1000, - ReadCostPerByte: 3, - DeleteCost: 1500, - WriteCostFlat: 2000, - WriteCostPerByte: 30, - IterNextCostFlat: 30, - } -} - -// defaultGasMeter defines a default implementation of a GasMeter. -type defaultGasMeter struct { - limit Gas - consumed Gas -} - -// NewGasMeter returns a reference to a GasMeter with the provided limit. -func NewGasMeter(limit Gas) GasMeter { - return &defaultGasMeter{ - limit: limit, - } -} - -func (gm *defaultGasMeter) GasConsumed() Gas { - return gm.consumed -} - -// NOTE: This behavior should only be called when recovering from a panic when -// BlockGasMeter consumes gas past the gas limit. -func (gm *defaultGasMeter) GasConsumedToLimit() Gas { - if gm.IsPastLimit() { - return gm.limit - } - - return gm.consumed -} - -func (gm *defaultGasMeter) GasRemaining() Gas { - if gm.IsPastLimit() { - return 0 - } - - return gm.limit - gm.consumed -} - -func (gm *defaultGasMeter) Limit() Gas { - return gm.limit -} - -func (gm *defaultGasMeter) ConsumeGas(amount Gas, descriptor string) { - newConsumed, overflow := addGasOverflow(gm.consumed, amount) - if overflow { - panic(ErrorGasOverflow{descriptor}) - } - - if newConsumed > gm.limit { - gm.consumed = math.MaxUint64 - panic(ErrorOutOfGas{descriptor}) - } - - gm.consumed = newConsumed -} - -func (gm *defaultGasMeter) RefundGas(amount Gas, descriptor string) { - if gm.consumed < amount { - panic(ErrorNegativeGasConsumed{Descriptor: descriptor}) - } - - gm.consumed -= amount -} - -func (gm *defaultGasMeter) IsPastLimit() bool { - return gm.consumed > gm.limit -} - -func (gm *defaultGasMeter) IsOutOfGas() bool { - return gm.consumed >= gm.limit -} - -func (gm *defaultGasMeter) String() string { - return fmt.Sprintf("%T{limit: %d, consumed: %d}", gm, gm.limit, gm.consumed) -} - -// infiniteGasMeter defines a GasMeter with an infinite gas limit. -type infiniteGasMeter struct { - consumed Gas -} - -// NewInfiniteGasMeter returns a reference to a GasMeter with an infinite gas limit. -func NewInfiniteGasMeter() GasMeter { - return &infiniteGasMeter{ - consumed: 0, - } -} - -func (gm *infiniteGasMeter) GasConsumed() Gas { - return gm.consumed -} - -func (gm *infiniteGasMeter) GasConsumedToLimit() Gas { - return gm.consumed -} - -func (*infiniteGasMeter) GasRemaining() Gas { - return math.MaxUint64 -} - -func (*infiniteGasMeter) Limit() Gas { - return math.MaxUint64 -} - -func (gm *infiniteGasMeter) ConsumeGas(amount Gas, descriptor string) { - var overflow bool - - gm.consumed, overflow = addGasOverflow(gm.consumed, amount) - if overflow { - panic(ErrorGasOverflow{descriptor}) - } -} - -func (gm *infiniteGasMeter) RefundGas(amount Gas, descriptor string) { - if gm.consumed < amount { - panic(ErrorNegativeGasConsumed{Descriptor: descriptor}) - } - - gm.consumed -= amount -} - -func (*infiniteGasMeter) IsPastLimit() bool { - return false -} - -func (*infiniteGasMeter) IsOutOfGas() bool { - return false -} - -func (gm *infiniteGasMeter) String() string { - return fmt.Sprintf("%T{consumed: %d}", gm, gm.consumed) -} - -// addGasOverflow performs the addition operation on two uint64 integers and -// returns a boolean on whether or not the result overflows. -func addGasOverflow(a, b Gas) (Gas, bool) { - if math.MaxUint64-a < b { - return 0, true - } - - return a + b, false -} diff --git a/store/go.mod b/store/go.mod index b5097b215af7..1a1d22508ed0 100644 --- a/store/go.mod +++ b/store/go.mod @@ -6,9 +6,8 @@ require ( cosmossdk.io/core v0.12.0 cosmossdk.io/errors v1.0.0 cosmossdk.io/log v1.2.1 - cosmossdk.io/math v1.2.0 github.com/cockroachdb/errors v1.11.1 - github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb + github.com/cockroachdb/pebble v1.0.0 github.com/cometbft/cometbft v0.38.2 github.com/cosmos/cosmos-db v1.0.0 github.com/cosmos/gogoproto v1.4.11 @@ -19,7 +18,7 @@ require ( github.com/mattn/go-sqlite3 v1.14.19 github.com/stretchr/testify v1.8.4 github.com/tidwall/btree v1.7.0 - golang.org/x/exp v0.0.0-20231006140011-7918f672742d + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b ) require ( @@ -29,7 +28,6 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect github.com/cockroachdb/redact v1.1.5 // indirect - github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect github.com/emicklei/dot v1.6.0 // indirect @@ -41,7 +39,7 @@ require ( github.com/google/go-cmp v0.6.0 // indirect github.com/hashicorp/go-immutable-radix v1.0.0 // indirect github.com/hashicorp/golang-lru v0.5.0 // indirect - github.com/klauspost/compress v1.17.2 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/mattn/go-colorable v0.1.13 // indirect @@ -51,11 +49,11 @@ require ( github.com/petermattis/goid v0.0.0-20180202154549-b0b1615b78e5 // indirect github.com/pkg/errors v0.9.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sasha-s/go-deadlock v0.3.1 // indirect github.com/spf13/cast v1.5.1 // indirect @@ -66,7 +64,7 @@ require ( golang.org/x/text v0.14.0 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/grpc v1.60.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect gotest.tools/v3 v3.5.1 // indirect ) diff --git a/store/go.sum b/store/go.sum index 1969a5727467..f35dc6089c13 100644 --- a/store/go.sum +++ b/store/go.sum @@ -4,8 +4,6 @@ cosmossdk.io/errors v1.0.0 h1:nxF07lmlBbB8NKQhtJ+sJm6ef5uV1XkvPXG2bUntb04= cosmossdk.io/errors v1.0.0/go.mod h1:+hJZLuhdDE0pYN8HkOrVNwrIOYvUGnn6+4fjnJs/oV0= cosmossdk.io/log v1.2.1 h1:Xc1GgTCicniwmMiKwDxUjO4eLhPxoVdI9vtMW8Ti/uk= cosmossdk.io/log v1.2.1/go.mod h1:GNSCc/6+DhFIj1aLn/j7Id7PaO8DzNylUZoOYBL9+I4= -cosmossdk.io/math v1.2.0 h1:8gudhTkkD3NxOP2YyyJIYYmt6dQ55ZfJkDOaxXpy7Ig= -cosmossdk.io/math v1.2.0/go.mod h1:l2Gnda87F0su8a/7FEKJfFdJrM0JZRXQaohlgJeyQh0= 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= @@ -31,18 +29,16 @@ github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5P github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/circonus-labs/circonus-gometrics v2.3.1+incompatible/go.mod h1:nmEj6Dob7S7YxXgwXpfOuvO54S+tGdZdw9fuRZt25Ag= github.com/circonus-labs/circonusllhist v0.1.3/go.mod h1:kMXHVDlOchFAehlya5ePtbp5jckzBHf4XRpQvBOLI+I= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb h1:6Po+YYKT5B5ZXN0wd2rwFBaebM0LufPf8p4zxOd48Kg= -github.com/cockroachdb/pebble v0.0.0-20231102162011-844f0582c2eb/go.mod h1:acMRUGd/BK8AUmQNK3spUCCGzFLZU2bSST3NMXSq2Kc= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= @@ -129,8 +125,8 @@ github.com/json-iterator/go v1.1.9/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/u github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= -github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4= -github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= @@ -191,8 +187,8 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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= @@ -208,8 +204,8 @@ github.com/prometheus/procfs v0.0.8/go.mod h1:7Qr8sr6344vo1JqZ6HhLceV9o3AJ1Ff+Gx 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.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A= github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= @@ -241,8 +237,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.17.0 h1:r8bRNjWL3GshPW3gkd+RpvzWrZAwPS49OmTGZ/uhM4k= golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= -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/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= @@ -321,8 +317,8 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/store/internal/kv/helpers.go b/store/internal/kv/helpers.go deleted file mode 100644 index 5bccea122eb5..000000000000 --- a/store/internal/kv/helpers.go +++ /dev/null @@ -1,17 +0,0 @@ -package kv - -import "fmt" - -// AssertKeyAtLeastLength panics when store key length is less than the given length. -func AssertKeyAtLeastLength(bz []byte, length int) { - if len(bz) < length { - panic(fmt.Sprintf("expected key of length at least %d, got %d", length, len(bz))) - } -} - -// AssertKeyLength panics when store key length is not equal to the given length. -func AssertKeyLength(bz []byte, length int) { - if len(bz) != length { - panic(fmt.Sprintf("unexpected key length; got: %d, expected: %d", len(bz), length)) - } -} diff --git a/store/internal/kv/kv.go b/store/internal/kv/kv.go deleted file mode 100644 index de3bf5ca01c3..000000000000 --- a/store/internal/kv/kv.go +++ /dev/null @@ -1,39 +0,0 @@ -package kv - -import ( - "bytes" - "sort" -) - -type ( - Pair struct { - Key []byte - Value []byte - } - - Pairs struct { - Pairs []Pair - } -) - -func (kvs Pairs) Len() int { return len(kvs.Pairs) } -func (kvs Pairs) Less(i, j int) bool { - switch bytes.Compare(kvs.Pairs[i].Key, kvs.Pairs[j].Key) { - case -1: - return true - - case 0: - return bytes.Compare(kvs.Pairs[i].Value, kvs.Pairs[j].Value) < 0 - - case 1: - return false - - default: - panic("invalid comparison result") - } -} - -func (kvs Pairs) Swap(i, j int) { kvs.Pairs[i], kvs.Pairs[j] = kvs.Pairs[j], kvs.Pairs[i] } - -// Sort invokes sort.Sort on kvs. -func (kvs Pairs) Sort() { sort.Sort(kvs) } diff --git a/store/internal/maps/bench_test.go b/store/internal/maps/bench_test.go deleted file mode 100644 index 4d7f680c70c1..000000000000 --- a/store/internal/maps/bench_test.go +++ /dev/null @@ -1,13 +0,0 @@ -package maps - -import "testing" - -func BenchmarkKVPairBytes(b *testing.B) { - kvp := NewKVPair(make([]byte, 128), make([]byte, 1e6)) - b.ResetTimer() - b.ReportAllocs() - - for i := 0; i < b.N; i++ { - b.SetBytes(int64(len(kvp.Bytes()))) - } -} diff --git a/store/internal/maps/maps.go b/store/internal/maps/maps.go deleted file mode 100644 index 1d8d8f1a0767..000000000000 --- a/store/internal/maps/maps.go +++ /dev/null @@ -1,216 +0,0 @@ -package maps - -import ( - "encoding/binary" - - "github.com/cometbft/cometbft/crypto/merkle" - "github.com/cometbft/cometbft/crypto/tmhash" - cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - - "cosmossdk.io/store/v2/internal/kv" - "cosmossdk.io/store/v2/internal/tree" -) - -// merkleMap defines a merkle-ized tree from a map. Leave values are treated as -// hash(key) | hash(value). Leaves are sorted before Merkle hashing. -type merkleMap struct { - kvs kv.Pairs - sorted bool -} - -func newMerkleMap() *merkleMap { - return &merkleMap{ - kvs: kv.Pairs{}, - sorted: false, - } -} - -// Set creates a kv.Pair from the provided key and value. The value is hashed prior -// to creating a kv.Pair. The created kv.Pair is appended to the MerkleMap's slice -// of kv.Pairs. Whenever called, the MerkleMap must be resorted. -func (sm *merkleMap) set(key string, value []byte) { - byteKey := []byte(key) - assertValidKey(byteKey) - - sm.sorted = false - - // The value is hashed, so you can check for equality with a cached value (say) - // and make a determination to fetch or not. - vhash := tmhash.Sum(value) - - sm.kvs.Pairs = append(sm.kvs.Pairs, kv.Pair{ - Key: byteKey, - Value: vhash, - }) -} - -// Hash returns the merkle root of items sorted by key. Note, it is unstable. -func (sm *merkleMap) hash() []byte { - sm.sort() - return hashKVPairs(sm.kvs) -} - -func (sm *merkleMap) sort() { - if sm.sorted { - return - } - - sm.kvs.Sort() - sm.sorted = true -} - -// hashKVPairs hashes a kvPair and creates a merkle tree where the leaves are -// byte slices. -func hashKVPairs(kvs kv.Pairs) []byte { - kvsH := make([][]byte, len(kvs.Pairs)) - for i, kvp := range kvs.Pairs { - kvsH[i] = KVPair(kvp).Bytes() - } - - return tree.HashFromByteSlices(kvsH) -} - -// --------------------------------------------- - -// Merkle tree from a map. -// Leaves are `hash(key) | hash(value)`. -// Leaves are sorted before Merkle hashing. -type simpleMap struct { - Kvs kv.Pairs - sorted bool -} - -func newSimpleMap() *simpleMap { - return &simpleMap{ - Kvs: kv.Pairs{}, - sorted: false, - } -} - -// Set creates a kv pair of the key and the hash of the value, -// and then appends it to SimpleMap's kv pairs. -func (sm *simpleMap) Set(key string, value []byte) { - byteKey := []byte(key) - assertValidKey(byteKey) - sm.sorted = false - - // The value is hashed, so you can - // check for equality with a cached value (say) - // and make a determination to fetch or not. - vhash := tmhash.Sum(value) - - sm.Kvs.Pairs = append(sm.Kvs.Pairs, kv.Pair{ - Key: byteKey, - Value: vhash, - }) -} - -// Hash Merkle root hash of items sorted by key -// (UNSTABLE: and by value too if duplicate key). -func (sm *simpleMap) Hash() []byte { - sm.Sort() - return hashKVPairs(sm.Kvs) -} - -func (sm *simpleMap) Sort() { - if sm.sorted { - return - } - sm.Kvs.Sort() - sm.sorted = true -} - -// Returns a copy of sorted KVPairs. -// NOTE these contain the hashed key and value. -func (sm *simpleMap) KVPairs() kv.Pairs { - sm.Sort() - kvs := kv.Pairs{ - Pairs: make([]kv.Pair, len(sm.Kvs.Pairs)), - } - - copy(kvs.Pairs, sm.Kvs.Pairs) - return kvs -} - -//---------------------------------------- - -// A local extension to KVPair that can be hashed. -// Key and value are length prefixed and concatenated, -// then hashed. -type KVPair kv.Pair - -// NewKVPair takes in a key and value and creates a kv.Pair -// wrapped in the local extension KVPair -func NewKVPair(key, value []byte) KVPair { - return KVPair(kv.Pair{ - Key: key, - Value: value, - }) -} - -// Bytes returns key || value, with both the -// key and value length prefixed. -func (kv KVPair) Bytes() []byte { - // In the worst case: - // * 8 bytes to Uvarint encode the length of the key - // * 8 bytes to Uvarint encode the length of the value - // So preallocate for the worst case, which will in total - // be a maximum of 14 bytes wasted, if len(key)=1, len(value)=1, - // but that's going to rare. - buf := make([]byte, 8+len(kv.Key)+8+len(kv.Value)) - - // Encode the key, prefixed with its length. - nlk := binary.PutUvarint(buf, uint64(len(kv.Key))) - nk := copy(buf[nlk:], kv.Key) - - // Encode the value, prefixing with its length. - nlv := binary.PutUvarint(buf[nlk+nk:], uint64(len(kv.Value))) - nv := copy(buf[nlk+nk+nlv:], kv.Value) - - return buf[:nlk+nk+nlv+nv] -} - -// HashFromMap computes a merkle tree from sorted map and returns the merkle -// root. -func HashFromMap(m map[string][]byte) []byte { - mm := newMerkleMap() - for k, v := range m { - mm.set(k, v) - } - - return mm.hash() -} - -// ProofsFromMap generates proofs from a map. The keys/values of the map will be used as the keys/values -// in the underlying key-value pairs. -// The keys are sorted before the proofs are computed. -func ProofsFromMap(m map[string][]byte) ([]byte, map[string]*cmtprotocrypto.Proof, []string) { - sm := newSimpleMap() - for k, v := range m { - sm.Set(k, v) - } - - sm.Sort() - kvs := sm.Kvs - kvsBytes := make([][]byte, len(kvs.Pairs)) - for i, kvp := range kvs.Pairs { - kvsBytes[i] = KVPair(kvp).Bytes() - } - - rootHash, proofList := merkle.ProofsFromByteSlices(kvsBytes) - proofs := make(map[string]*cmtprotocrypto.Proof) - keys := make([]string, len(proofList)) - - for i, kvp := range kvs.Pairs { - proofs[string(kvp.Key)] = proofList[i].ToProto() - keys[i] = string(kvp.Key) - } - - return rootHash, proofs, keys -} - -func assertValidKey(key []byte) { - if len(key) == 0 { - panic("key is nil") - } -} diff --git a/store/internal/maps/maps_test.go b/store/internal/maps/maps_test.go deleted file mode 100644 index ce7ad72e649d..000000000000 --- a/store/internal/maps/maps_test.go +++ /dev/null @@ -1,104 +0,0 @@ -package maps - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestEmptyKeyMerkleMap(t *testing.T) { - db := newMerkleMap() - require.Panics(t, func() { db.set("", []byte("value")) }, "setting an empty key should panic") -} - -func TestMerkleMap(t *testing.T) { - tests := []struct { - keys []string - values []string // each string gets converted to []byte in test - want string - }{ - {[]string{}, []string{}, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - {[]string{"key1"}, []string{"value1"}, "a44d3cc7daba1a4600b00a2434b30f8b970652169810d6dfa9fb1793a2189324"}, - {[]string{"key1"}, []string{"value2"}, "0638e99b3445caec9d95c05e1a3fc1487b4ddec6a952ff337080360b0dcc078c"}, - // swap order with 2 keys - { - []string{"key1", "key2"}, - []string{"value1", "value2"}, - "8fd19b19e7bb3f2b3ee0574027d8a5a4cec370464ea2db2fbfa5c7d35bb0cff3", - }, - { - []string{"key2", "key1"}, - []string{"value2", "value1"}, - "8fd19b19e7bb3f2b3ee0574027d8a5a4cec370464ea2db2fbfa5c7d35bb0cff3", - }, - // swap order with 3 keys - { - []string{"key1", "key2", "key3"}, - []string{"value1", "value2", "value3"}, - "1dd674ec6782a0d586a903c9c63326a41cbe56b3bba33ed6ff5b527af6efb3dc", - }, - { - []string{"key1", "key3", "key2"}, - []string{"value1", "value3", "value2"}, - "1dd674ec6782a0d586a903c9c63326a41cbe56b3bba33ed6ff5b527af6efb3dc", - }, - } - for i, tc := range tests { - db := newMerkleMap() - for i := 0; i < len(tc.keys); i++ { - db.set(tc.keys[i], []byte(tc.values[i])) - } - - got := db.hash() - assert.Equal(t, tc.want, fmt.Sprintf("%x", got), "Hash didn't match on tc %d", i) - } -} - -func TestEmptyKeySimpleMap(t *testing.T) { - db := newSimpleMap() - require.Panics(t, func() { db.Set("", []byte("value")) }, "setting an empty key should panic") -} - -func TestSimpleMap(t *testing.T) { - tests := []struct { - keys []string - values []string // each string gets converted to []byte in test - want string - }{ - {[]string{}, []string{}, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, - {[]string{"key1"}, []string{"value1"}, "a44d3cc7daba1a4600b00a2434b30f8b970652169810d6dfa9fb1793a2189324"}, - {[]string{"key1"}, []string{"value2"}, "0638e99b3445caec9d95c05e1a3fc1487b4ddec6a952ff337080360b0dcc078c"}, - // swap order with 2 keys - { - []string{"key1", "key2"}, - []string{"value1", "value2"}, - "8fd19b19e7bb3f2b3ee0574027d8a5a4cec370464ea2db2fbfa5c7d35bb0cff3", - }, - { - []string{"key2", "key1"}, - []string{"value2", "value1"}, - "8fd19b19e7bb3f2b3ee0574027d8a5a4cec370464ea2db2fbfa5c7d35bb0cff3", - }, - // swap order with 3 keys - { - []string{"key1", "key2", "key3"}, - []string{"value1", "value2", "value3"}, - "1dd674ec6782a0d586a903c9c63326a41cbe56b3bba33ed6ff5b527af6efb3dc", - }, - { - []string{"key1", "key3", "key2"}, - []string{"value1", "value3", "value2"}, - "1dd674ec6782a0d586a903c9c63326a41cbe56b3bba33ed6ff5b527af6efb3dc", - }, - } - for i, tc := range tests { - db := newSimpleMap() - for i := 0; i < len(tc.keys); i++ { - db.Set(tc.keys[i], []byte(tc.values[i])) - } - got := db.Hash() - assert.Equal(t, tc.want, fmt.Sprintf("%x", got), "Hash didn't match on tc %d", i) - } -} diff --git a/store/internal/proofs/convert.go b/store/internal/proofs/convert.go deleted file mode 100644 index 05cd60434168..000000000000 --- a/store/internal/proofs/convert.go +++ /dev/null @@ -1,98 +0,0 @@ -package proofs - -import ( - "fmt" - "math/bits" - - cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - ics23 "github.com/cosmos/ics23/go" -) - -// ConvertExistenceProof will convert the given proof into a valid -// existence proof, if that's what it is. -// -// This is the simplest case of the range proof and we will focus on -// demoing compatibility here -func ConvertExistenceProof(p *cmtprotocrypto.Proof, key, value []byte) (*ics23.ExistenceProof, error) { - path, err := convertInnerOps(p) - if err != nil { - return nil, err - } - - proof := &ics23.ExistenceProof{ - Key: key, - Value: value, - Leaf: convertLeafOp(), - Path: path, - } - return proof, nil -} - -// this is adapted from merkle/hash.go:leafHash() -// and merkle/simple_map.go:KVPair.Bytes() -func convertLeafOp() *ics23.LeafOp { - prefix := []byte{0} - - return &ics23.LeafOp{ - Hash: ics23.HashOp_SHA256, - PrehashKey: ics23.HashOp_NO_HASH, - PrehashValue: ics23.HashOp_SHA256, - Length: ics23.LengthOp_VAR_PROTO, - Prefix: prefix, - } -} - -func convertInnerOps(p *cmtprotocrypto.Proof) ([]*ics23.InnerOp, error) { - inners := make([]*ics23.InnerOp, 0, len(p.Aunts)) - path := buildPath(p.Index, p.Total) - - if len(p.Aunts) != len(path) { - return nil, fmt.Errorf("calculated a path different length (%d) than provided by SimpleProof (%d)", len(path), len(p.Aunts)) - } - - for i, aunt := range p.Aunts { - auntRight := path[i] - - // combine with: 0x01 || lefthash || righthash - inner := &ics23.InnerOp{Hash: ics23.HashOp_SHA256} - if auntRight { - inner.Prefix = []byte{1} - inner.Suffix = aunt - } else { - inner.Prefix = append([]byte{1}, aunt...) - } - inners = append(inners, inner) - } - return inners, nil -} - -// buildPath returns a list of steps from leaf to root -// in each step, true means index is left side, false index is right side -// code adapted from merkle/simple_proof.go:computeHashFromAunts -func buildPath(idx, total int64) []bool { - if total < 2 { - return nil - } - numLeft := getSplitPoint(total) - goLeft := idx < numLeft - - // we put goLeft at the end of the array, as we recurse from top to bottom, - // and want the leaf to be first in array, root last - if goLeft { - return append(buildPath(idx, numLeft), goLeft) - } - return append(buildPath(idx-numLeft, total-numLeft), goLeft) -} - -func getSplitPoint(length int64) int64 { - if length < 1 { - panic("Trying to split a tree with size < 1") - } - uLength := uint(length) - bitlen := bits.Len(uLength) - k := int64(1 << uint(bitlen-1)) - if k == length { - k >>= 1 - } - return k -} diff --git a/store/internal/proofs/convert_test.go b/store/internal/proofs/convert_test.go deleted file mode 100644 index 19c5a6761507..000000000000 --- a/store/internal/proofs/convert_test.go +++ /dev/null @@ -1,105 +0,0 @@ -package proofs - -import ( - "bytes" - "fmt" - "testing" -) - -func TestLeafOp(t *testing.T) { - proof := GenerateRangeProof(20, Middle) - - converted, err := ConvertExistenceProof(proof.Proof, proof.Key, proof.Value) - if err != nil { - t.Fatal(err) - } - - leaf := converted.GetLeaf() - if leaf == nil { - t.Fatalf("Missing leaf node") - } - - hash, err := leaf.Apply(converted.Key, converted.Value) - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(hash, proof.Proof.LeafHash) { - t.Errorf("Calculated: %X\nExpected: %X", hash, proof.Proof.LeafHash) - } -} - -func TestBuildPath(t *testing.T) { - cases := map[string]struct { - idx int64 - total int64 - expected []bool - }{ - "pair left": { - idx: 0, - total: 2, - expected: []bool{true}, - }, - "pair right": { - idx: 1, - total: 2, - expected: []bool{false}, - }, - "power of 2": { - idx: 3, - total: 8, - expected: []bool{false, false, true}, - }, - "size of 7 right most": { - idx: 6, - total: 7, - expected: []bool{false, false}, - }, - "size of 6 right-left (from top)": { - idx: 4, - total: 6, - expected: []bool{true, false}, - }, - "size of 6 left-right-left (from top)": { - idx: 2, - total: 7, - expected: []bool{true, false, true}, - }, - } - - for name, tc := range cases { - t.Run(name, func(t *testing.T) { - path := buildPath(tc.idx, tc.total) - if len(path) != len(tc.expected) { - t.Fatalf("Got %v\nExpected %v", path, tc.expected) - } - for i := range path { - if path[i] != tc.expected[i] { - t.Fatalf("Differ at %d\nGot %v\nExpected %v", i, path, tc.expected) - } - } - }) - } -} - -func TestConvertProof(t *testing.T) { - for i := 0; i < 100; i++ { - t.Run(fmt.Sprintf("Run %d", i), func(t *testing.T) { - proof := GenerateRangeProof(57, Left) - - converted, err := ConvertExistenceProof(proof.Proof, proof.Key, proof.Value) - if err != nil { - t.Fatal(err) - } - - calc, err := converted.Calculate() - if err != nil { - t.Fatal(err) - } - - if !bytes.Equal(calc, proof.RootHash) { - t.Errorf("Calculated: %X\nExpected: %X", calc, proof.RootHash) - } - }) - } -} diff --git a/store/internal/proofs/create.go b/store/internal/proofs/create.go deleted file mode 100644 index 47e55e97854e..000000000000 --- a/store/internal/proofs/create.go +++ /dev/null @@ -1,103 +0,0 @@ -package proofs - -import ( - "errors" - "sort" - - ics23 "github.com/cosmos/ics23/go" - - "cosmossdk.io/store/v2/internal/maps" -) - -var ( - ErrEmptyKey = errors.New("key is empty") - ErrEmptyKeyInData = errors.New("data contains empty key") -) - -/* -CreateMembershipProof will produce a CommitmentProof that the given key (and queries value) exists in the map. -If the key doesn't exist in the tree, this will return an error. -*/ -func CreateMembershipProof(data map[string][]byte, key []byte) (*ics23.CommitmentProof, error) { - if len(key) == 0 { - return nil, ErrEmptyKey - } - exist, err := createExistenceProof(data, key) - if err != nil { - return nil, err - } - proof := &ics23.CommitmentProof{ - Proof: &ics23.CommitmentProof_Exist{ - Exist: exist, - }, - } - return proof, nil -} - -/* -CreateNonMembershipProof will produce a CommitmentProof that the given key doesn't exist in the map. -If the key exists in the tree, this will return an error. -*/ -func CreateNonMembershipProof(data map[string][]byte, key []byte) (*ics23.CommitmentProof, error) { - if len(key) == 0 { - return nil, ErrEmptyKey - } - // ensure this key is not in the store - if _, ok := data[string(key)]; ok { - return nil, errors.New("cannot create non-membership proof if key is in map") - } - - keys := SortedKeys(data) - rightidx := sort.SearchStrings(keys, string(key)) - - var err error - nonexist := &ics23.NonExistenceProof{ - Key: key, - } - - // include left proof unless key is left of entire map - if rightidx >= 1 { - leftkey := keys[rightidx-1] - nonexist.Left, err = createExistenceProof(data, []byte(leftkey)) - if err != nil { - return nil, err - } - } - - // include right proof unless key is right of entire map - if rightidx < len(keys) { - rightkey := keys[rightidx] - nonexist.Right, err = createExistenceProof(data, []byte(rightkey)) - if err != nil { - return nil, err - } - - } - - proof := &ics23.CommitmentProof{ - Proof: &ics23.CommitmentProof_Nonexist{ - Nonexist: nonexist, - }, - } - return proof, nil -} - -func createExistenceProof(data map[string][]byte, key []byte) (*ics23.ExistenceProof, error) { - for k := range data { - if k == "" { - return nil, ErrEmptyKeyInData - } - } - value, ok := data[string(key)] - if !ok { - return nil, errors.New("cannot make existence proof if key is not in map") - } - - _, proofs, _ := maps.ProofsFromMap(data) - proof := proofs[string(key)] - if proof == nil { - return nil, errors.New("returned no proof for key") - } - - return ConvertExistenceProof(proof, key, value) -} diff --git a/store/internal/proofs/create_test.go b/store/internal/proofs/create_test.go deleted file mode 100644 index 16818e657a81..000000000000 --- a/store/internal/proofs/create_test.go +++ /dev/null @@ -1,125 +0,0 @@ -package proofs - -import ( - "errors" - "testing" - - ics23 "github.com/cosmos/ics23/go" - "github.com/stretchr/testify/assert" -) - -func TestCreateMembership(t *testing.T) { - cases := map[string]struct { - size int - loc Where - }{ - "small left": {size: 100, loc: Left}, - "small middle": {size: 100, loc: Middle}, - "small right": {size: 100, loc: Right}, - "big left": {size: 5431, loc: Left}, - "big middle": {size: 5431, loc: Middle}, - "big right": {size: 5431, loc: Right}, - } - - for name, tc := range cases { - t.Run(name, func(t *testing.T) { - data := BuildMap(tc.size) - allkeys := SortedKeys(data) - key := GetKey(allkeys, tc.loc) - nonKey := GetNonKey(allkeys, tc.loc) - - // error if the key does not exist - proof, err := CreateMembershipProof(data, []byte(nonKey)) - assert.EqualError(t, err, "cannot make existence proof if key is not in map") - assert.Nil(t, proof) - - val := data[key] - proof, err = CreateMembershipProof(data, []byte(key)) - if err != nil { - t.Fatalf("Creating Proof: %+v", err) - } - if proof.GetExist() == nil { - t.Fatal("Unexpected proof format") - } - - root := CalcRoot(data) - err = proof.GetExist().Verify(ics23.TendermintSpec, root, []byte(key), val) - if err != nil { - t.Fatalf("Verifying Proof: %+v", err) - } - - valid := ics23.VerifyMembership(ics23.TendermintSpec, root, proof, []byte(key), val) - if !valid { - t.Fatalf("Membership Proof Invalid") - } - }) - } -} - -func TestCreateNonMembership(t *testing.T) { - cases := map[string]struct { - size int - loc Where - }{ - "small left": {size: 100, loc: Left}, - "small middle": {size: 100, loc: Middle}, - "small right": {size: 100, loc: Right}, - "big left": {size: 5431, loc: Left}, - "big middle": {size: 5431, loc: Middle}, - "big right": {size: 5431, loc: Right}, - } - - for name, tc := range cases { - t.Run(name, func(t *testing.T) { - data := BuildMap(tc.size) - allkeys := SortedKeys(data) - nonKey := GetNonKey(allkeys, tc.loc) - key := GetKey(allkeys, tc.loc) - - // error if the key exists - proof, err := CreateNonMembershipProof(data, []byte(key)) - assert.EqualError(t, err, "cannot create non-membership proof if key is in map") - assert.Nil(t, proof) - - proof, err = CreateNonMembershipProof(data, []byte(nonKey)) - if err != nil { - t.Fatalf("Creating Proof: %+v", err) - } - if proof.GetNonexist() == nil { - t.Fatal("Unexpected proof format") - } - - root := CalcRoot(data) - err = proof.GetNonexist().Verify(ics23.TendermintSpec, root, []byte(nonKey)) - if err != nil { - t.Fatalf("Verifying Proof: %+v", err) - } - - valid := ics23.VerifyNonMembership(ics23.TendermintSpec, root, proof, []byte(nonKey)) - if !valid { - t.Fatalf("Non Membership Proof Invalid") - } - }) - } -} - -func TestInvalidKey(t *testing.T) { - tests := []struct { - name string - f func(data map[string][]byte, key []byte) (*ics23.CommitmentProof, error) - data map[string][]byte - key []byte - err error - }{ - {"CreateMembershipProof empty key", CreateMembershipProof, map[string][]byte{"": nil}, []byte(""), ErrEmptyKey}, - {"CreateMembershipProof empty key in data", CreateMembershipProof, map[string][]byte{"": nil, " ": nil}, []byte(" "), ErrEmptyKeyInData}, - {"CreateNonMembershipProof empty key", CreateNonMembershipProof, map[string][]byte{" ": nil}, []byte(""), ErrEmptyKey}, - {"CreateNonMembershipProof empty key in data", CreateNonMembershipProof, map[string][]byte{"": nil}, []byte(" "), ErrEmptyKeyInData}, - } - for _, tc := range tests { - t.Run(tc.name, func(t *testing.T) { - _, err := tc.f(tc.data, tc.key) - assert.True(t, errors.Is(err, tc.err)) - }) - } -} diff --git a/store/internal/proofs/helpers.go b/store/internal/proofs/helpers.go deleted file mode 100644 index 1a7d8a36aac2..000000000000 --- a/store/internal/proofs/helpers.go +++ /dev/null @@ -1,101 +0,0 @@ -package proofs - -import ( - "sort" - - cmtprotocrypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - "golang.org/x/exp/maps" - - "cosmossdk.io/math/unsafe" - internalmaps "cosmossdk.io/store/v2/internal/maps" -) - -// SimpleResult contains a merkle.SimpleProof along with all data needed to build the confio/proof -type SimpleResult struct { - Key []byte - Value []byte - Proof *cmtprotocrypto.Proof - RootHash []byte -} - -// GenerateRangeProof makes a tree of size and returns a range proof for one random element -// -// returns a range proof and the root hash of the tree -func GenerateRangeProof(size int, loc Where) *SimpleResult { - data := BuildMap(size) - root, proofs, allkeys := internalmaps.ProofsFromMap(data) - - key := GetKey(allkeys, loc) - proof := proofs[key] - - res := &SimpleResult{ - Key: []byte(key), - Value: toValue(key), - Proof: proof, - RootHash: root, - } - return res -} - -// Where selects a location for a key - Left, Right, or Middle -type Where int - -const ( - Left Where = iota - Right - Middle -) - -func SortedKeys(data map[string][]byte) []string { - keys := maps.Keys(data) - sort.Strings(keys) - return keys -} - -func CalcRoot(data map[string][]byte) []byte { - root, _, _ := internalmaps.ProofsFromMap(data) - return root -} - -// GetKey this returns a key, on Left/Right/Middle -func GetKey(allkeys []string, loc Where) string { - if loc == Left { - return allkeys[0] - } - if loc == Right { - return allkeys[len(allkeys)-1] - } - // select a random index between 1 and allkeys-2 - idx := unsafe.NewRand().Int()%(len(allkeys)-2) + 1 - return allkeys[idx] -} - -// GetNonKey returns a missing key - Left of all, Right of all, or in the Middle -func GetNonKey(allkeys []string, loc Where) string { - if loc == Left { - return string([]byte{1, 1, 1, 1}) - } - if loc == Right { - return string([]byte{0xff, 0xff, 0xff, 0xff}) - } - // otherwise, next to an existing key (copy before mod) - key := GetKey(allkeys, loc) - key = key[:len(key)-2] + string([]byte{255, 255}) - return key -} - -func toValue(key string) []byte { - return []byte("value_for_" + key) -} - -// BuildMap creates random key/values and stores in a map, -// returns a list of all keys in sorted order -func BuildMap(size int) map[string][]byte { - data := make(map[string][]byte) - // insert lots of info and store the bytes - for i := 0; i < size; i++ { - key := unsafe.Str(20) - data[key] = toValue(key) - } - return data -} diff --git a/store/internal/tree/hash.go b/store/internal/tree/hash.go deleted file mode 100644 index a4facd93e9b6..000000000000 --- a/store/internal/tree/hash.go +++ /dev/null @@ -1,68 +0,0 @@ -package tree - -import ( - "crypto/sha256" - "hash" - "math/bits" -) - -var ( - leafPrefix = []byte{0} - innerPrefix = []byte{1} -) - -// HashFromByteSlices computes a Merkle tree where the leaves are the byte slice, -// in the provided order. It follows RFC-6962. -func HashFromByteSlices(items [][]byte) []byte { - return hashFromByteSlices(sha256.New(), items) -} - -func hashFromByteSlices(sha hash.Hash, items [][]byte) []byte { - switch len(items) { - case 0: - return emptyHash() - case 1: - return leafHashOpt(sha, items[0]) - default: - k := getSplitPoint(int64(len(items))) - left := hashFromByteSlices(sha, items[:k]) - right := hashFromByteSlices(sha, items[k:]) - return innerHashOpt(sha, left, right) - } -} - -// returns tmhash(0x00 || leaf) -func leafHashOpt(s hash.Hash, leaf []byte) []byte { - s.Reset() - s.Write(leafPrefix) - s.Write(leaf) - return s.Sum(nil) -} - -func innerHashOpt(s hash.Hash, left, right []byte) []byte { - s.Reset() - s.Write(innerPrefix) - s.Write(left) - s.Write(right) - return s.Sum(nil) -} - -// returns tmhash() -func emptyHash() []byte { - h := sha256.Sum256([]byte{}) - return h[:] -} - -// getSplitPoint returns the largest power of 2 less than length -func getSplitPoint(length int64) int64 { - if length < 1 { - panic("Trying to split a tree with size < 1") - } - uLength := uint(length) - bitlen := bits.Len(uLength) - k := int64(1 << uint(bitlen-1)) - if k == length { - k >>= 1 - } - return k -} diff --git a/store/kv/gas/iterator.go b/store/kv/gas/iterator.go deleted file mode 100644 index a8043863a614..000000000000 --- a/store/kv/gas/iterator.go +++ /dev/null @@ -1,63 +0,0 @@ -package gas - -import "cosmossdk.io/store/v2" - -var _ store.Iterator = (*iterator)(nil) - -type iterator struct { - gasMeter store.GasMeter - gasConfig store.GasConfig - parent store.Iterator -} - -func newIterator(parent store.Iterator, gm store.GasMeter, gc store.GasConfig) store.Iterator { - return &iterator{ - parent: parent, - gasConfig: gc, - gasMeter: gm, - } -} - -func (itr *iterator) Domain() ([]byte, []byte) { - return itr.parent.Domain() -} - -func (itr *iterator) Valid() bool { - return itr.parent.Valid() -} - -func (itr *iterator) Key() []byte { - return itr.parent.Key() -} - -func (itr *iterator) Value() []byte { - return itr.parent.Value() -} - -func (itr *iterator) Next() bool { - itr.consumeGasSeek() - return itr.parent.Next() -} - -func (itr *iterator) Close() { - itr.parent.Close() -} - -func (itr *iterator) Error() error { - return itr.parent.Error() -} - -// consumeGasSeek consumes a fixed amount of gas for each iteration step and a -// variable gas cost based on the current key and value's length. This is called -// prior to the iterator's Next() call. -func (itr *iterator) consumeGasSeek() { - if itr.Valid() { - key := itr.Key() - value := itr.Value() - - itr.gasMeter.ConsumeGas(itr.gasConfig.ReadCostPerByte*store.Gas(len(key)), store.GasDescValuePerByte) - itr.gasMeter.ConsumeGas(itr.gasConfig.ReadCostPerByte*store.Gas(len(value)), store.GasDescValuePerByte) - } - - itr.gasMeter.ConsumeGas(itr.gasConfig.IterNextCostFlat, store.GasDescIterNextCostFlat) -} diff --git a/store/kv/gas/store.go b/store/kv/gas/store.go deleted file mode 100644 index ef362f74dbd4..000000000000 --- a/store/kv/gas/store.go +++ /dev/null @@ -1,89 +0,0 @@ -package gas - -import ( - "fmt" - "io" - - "cosmossdk.io/store/v2" -) - -var _ store.BranchedKVStore = (*Store)(nil) - -type Store struct { - parent store.KVStore - gasMeter store.GasMeter - gasConfig store.GasConfig -} - -func New(p store.KVStore, gm store.GasMeter, gc store.GasConfig) store.BranchedKVStore { - return &Store{ - parent: p, - gasMeter: gm, - gasConfig: gc, - } -} - -func (s *Store) GetStoreKey() string { - return s.parent.GetStoreKey() -} - -func (s *Store) GetStoreType() store.StoreType { - return s.parent.GetStoreType() -} - -func (s *Store) Get(key []byte) []byte { - s.gasMeter.ConsumeGas(s.gasConfig.ReadCostFlat, store.GasDescReadCostFlat) - - value := s.parent.Get(key) - s.gasMeter.ConsumeGas(s.gasConfig.ReadCostPerByte*store.Gas(len(key)), store.GasDescReadPerByte) - s.gasMeter.ConsumeGas(s.gasConfig.ReadCostPerByte*store.Gas(len(value)), store.GasDescReadPerByte) - - return value -} - -func (s *Store) Has(key []byte) bool { - s.gasMeter.ConsumeGas(s.gasConfig.HasCost, store.GasDescHas) - return s.parent.Has(key) -} - -func (s *Store) Set(key, value []byte) { - s.gasMeter.ConsumeGas(s.gasConfig.WriteCostFlat, store.GasDescWriteCostFlat) - s.gasMeter.ConsumeGas(s.gasConfig.WriteCostPerByte*store.Gas(len(key)), store.GasDescWritePerByte) - s.gasMeter.ConsumeGas(s.gasConfig.WriteCostPerByte*store.Gas(len(value)), store.GasDescWritePerByte) - s.parent.Set(key, value) -} - -func (s *Store) Delete(key []byte) { - s.gasMeter.ConsumeGas(s.gasConfig.DeleteCost, store.GasDescDelete) - s.parent.Delete(key) -} - -func (s *Store) GetChangeset() *store.Changeset { - return s.parent.GetChangeset() -} - -func (s *Store) Reset(toVersion uint64) error { - return s.parent.Reset(toVersion) -} - -func (s *Store) Write() { - if b, ok := s.parent.(store.BranchedKVStore); ok { - b.Write() - } -} - -func (s *Store) Branch() store.BranchedKVStore { - panic(fmt.Sprintf("cannot call Branch() on %T", s)) -} - -func (s *Store) BranchWithTrace(_ io.Writer, _ store.TraceContext) store.BranchedKVStore { - panic(fmt.Sprintf("cannot call BranchWithTrace() on %T", s)) -} - -func (s *Store) Iterator(start, end []byte) store.Iterator { - return newIterator(s.parent.Iterator(start, end), s.gasMeter, s.gasConfig) -} - -func (s *Store) ReverseIterator(start, end []byte) store.Iterator { - return newIterator(s.parent.ReverseIterator(start, end), s.gasMeter, s.gasConfig) -} diff --git a/store/kv/gas/store_test.go b/store/kv/gas/store_test.go deleted file mode 100644 index 1ea8efd5e742..000000000000 --- a/store/kv/gas/store_test.go +++ /dev/null @@ -1,111 +0,0 @@ -package gas_test - -import ( - "fmt" - "testing" - - "github.com/stretchr/testify/suite" - - "cosmossdk.io/store/v2" - "cosmossdk.io/store/v2/kv/gas" - "cosmossdk.io/store/v2/kv/mem" -) - -const ( - storeKey = "storeKey" - gasLimit = store.Gas(1_000_000) -) - -type StoreTestSuite struct { - suite.Suite - - parent store.KVStore - gasKVStore store.BranchedKVStore - gasMeter store.GasMeter -} - -func TestStorageTestSuite(t *testing.T) { - suite.Run(t, &StoreTestSuite{}) -} - -func (s *StoreTestSuite) SetupTest() { - s.parent = mem.New(storeKey) - s.gasMeter = store.NewGasMeter(gasLimit) - s.gasKVStore = gas.New(s.parent, s.gasMeter, store.DefaultGasConfig()) -} - -func (s *StoreTestSuite) TearDownTest() { - err := s.gasKVStore.Reset(1) - s.Require().NoError(err) -} - -func (s *StoreTestSuite) TestGetStoreKey() { - s.Require().Equal(s.parent.GetStoreKey(), s.gasKVStore.GetStoreKey()) -} - -func (s *StoreTestSuite) TestGetStoreType() { - s.Require().Equal(s.parent.GetStoreType(), s.gasKVStore.GetStoreType()) -} - -func (s *StoreTestSuite) TestGet() { - key, value := []byte("key"), []byte("value") - s.parent.Set(key, value) - - s.Require().Equal(value, s.gasKVStore.Get(key)) - s.Require().Equal(store.Gas(1024), s.gasMeter.GasConsumed()) -} - -func (s *StoreTestSuite) TestHas() { - key, value := []byte("key"), []byte("value") - s.parent.Set(key, value) - - s.Require().True(s.gasKVStore.Has(key)) - s.Require().Equal(store.Gas(1000), s.gasMeter.GasConsumed()) -} - -func (s *StoreTestSuite) TestSet() { - s.gasKVStore.Set([]byte("key"), []byte("value")) - s.Require().Equal(store.Gas(2240), s.gasMeter.GasConsumed()) -} - -func (s *StoreTestSuite) TestDelete() { - key, value := []byte("key"), []byte("value") - s.parent.Set(key, value) - - s.gasKVStore.Delete(key) - s.Require().Equal(store.Gas(1500), s.gasMeter.GasConsumed()) -} - -func (s *StoreTestSuite) TestIterator() { - for i := 0; i < 100; i++ { - key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 - val := fmt.Sprintf("val%03d", i) // val000, val001, ..., val099 - s.parent.Set([]byte(key), []byte(val)) - } - - itr := s.gasKVStore.Iterator(nil, nil) - defer itr.Close() - - for ; itr.Valid(); itr.Next() { - _ = itr.Key() - _ = itr.Value() - } - s.Require().Equal(store.Gas(6600), s.gasMeter.GasConsumed()) -} - -func (s *StoreTestSuite) TestReverseIterator() { - for i := 0; i < 100; i++ { - key := fmt.Sprintf("key%03d", i) // key000, key001, ..., key099 - val := fmt.Sprintf("val%03d", i) // val000, val001, ..., val099 - s.parent.Set([]byte(key), []byte(val)) - } - - itr := s.gasKVStore.ReverseIterator(nil, nil) - defer itr.Close() - - for ; itr.Valid(); itr.Next() { - _ = itr.Key() - _ = itr.Value() - } - s.Require().Equal(store.Gas(6600), s.gasMeter.GasConsumed()) -} diff --git a/store/proof.go b/store/proof.go index 16a959ac9075..de46f5f317e7 100644 --- a/store/proof.go +++ b/store/proof.go @@ -1,6 +1,8 @@ package store import ( + "crypto/sha256" + ics23 "github.com/cosmos/ics23/go" errorsmod "cosmossdk.io/errors" @@ -13,6 +15,29 @@ const ( ProofOpSMTCommitment = "ics23:smt" ) +var ( + leafPrefix = []byte{0} + innerPrefix = []byte{1} + + // SimpleMerkleSpec is the ics23 proof spec for simple merkle proofs. + SimpleMerkleSpec = &ics23.ProofSpec{ + LeafSpec: &ics23.LeafOp{ + Prefix: leafPrefix, + PrehashKey: ics23.HashOp_NO_HASH, + PrehashValue: ics23.HashOp_NO_HASH, + Hash: ics23.HashOp_SHA256, + Length: ics23.LengthOp_VAR_PROTO, + }, + InnerSpec: &ics23.InnerSpec{ + ChildOrder: []int32{0, 1}, + MinPrefixLength: 1, + MaxPrefixLength: 1, + ChildSize: 32, + Hash: ics23.HashOp_SHA256, + }, + } +) + // CommitmentOp implements merkle.ProofOperator by wrapping an ics23 CommitmentProof. // It also contains a Key field to determine which key the proof is proving. // NOTE: CommitmentProof currently can either be ExistenceProof or NonexistenceProof @@ -39,7 +64,7 @@ func NewIAVLCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp func NewSimpleMerkleCommitmentOp(key []byte, proof *ics23.CommitmentProof) CommitmentOp { return CommitmentOp{ Type: ProofOpSimpleMerkleCommitment, - Spec: ics23.TendermintSpec, + Spec: SimpleMerkleSpec, Key: key, Proof: proof, } @@ -96,3 +121,69 @@ func (op CommitmentOp) Run(args [][]byte) ([][]byte, error) { return [][]byte{root}, nil } + +// ProofFromByteSlices computes the proof from the given leaves. +func ProofFromByteSlices(leaves [][]byte, index int) (rootHash []byte, inners []*ics23.InnerOp) { + if len(leaves) == 0 { + return emptyHash(), nil + } + + n := len(leaves) + for n > 1 { + if index < n-1 || index&1 == 1 { + inner := &ics23.InnerOp{Hash: ics23.HashOp_SHA256} + if index&1 == 0 { + inner.Prefix = innerPrefix + inner.Suffix = leaves[index^1] + } else { + inner.Prefix = append(innerPrefix, leaves[index^1]...) + } + inners = append(inners, inner) + } + for i := 0; i < n/2; i++ { + leaves[i] = InnerHash(leaves[2*i], leaves[2*i+1]) + } + if n&1 == 1 { + leaves[n/2] = leaves[n-1] + } + n = (n + 1) / 2 + index /= 2 + } + + rootHash = leaves[0] + return +} + +// ConvertCommitmentOp converts the given merkle proof into an CommitmentOp. +func ConvertCommitmentOp(inners []*ics23.InnerOp, key, value []byte) CommitmentOp { + return NewSimpleMerkleCommitmentOp(key, &ics23.CommitmentProof{ + Proof: &ics23.CommitmentProof_Exist{ + Exist: &ics23.ExistenceProof{ + Key: key, + Value: value, + Leaf: SimpleMerkleSpec.LeafSpec, + Path: inners, + }, + }, + }) +} + +func emptyHash() []byte { + h := sha256.Sum256([]byte{}) + return h[:] +} + +// LeafHash computes the hash of a leaf node. +func LeafHash(key, value []byte) ([]byte, error) { + return SimpleMerkleSpec.LeafSpec.Apply(key, value) +} + +// InnerHash computes the hash of an inner node. +func InnerHash(left, right []byte) []byte { + data := make([]byte, len(innerPrefix)+len(left)+len(right)) + n := copy(data, innerPrefix) + n += copy(data[n:], left) + copy(data[n:], right) + h := sha256.Sum256(data) + return h[:] +} diff --git a/store/proof_test.go b/store/proof_test.go new file mode 100644 index 000000000000..b7a7d4019310 --- /dev/null +++ b/store/proof_test.go @@ -0,0 +1,61 @@ +package store + +import ( + "fmt" + "testing" + + "github.com/stretchr/testify/require" +) + +func TestProofFromBytesSlices(t *testing.T) { + tests := []struct { + keys []string + values []string + want string + }{ + {[]string{}, []string{}, "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"}, + {[]string{"key1"}, []string{"value1"}, "09c468a07fe9bc1f14e754cff0acbad4faf9449449288be8e1d5d1199a247034"}, + {[]string{"key1"}, []string{"value2"}, "2131d85de3a8ded5d3a72bfc657f7324138540c520de7401ac8594785a3082fb"}, + // swap order with 2 keys + { + []string{"key1", "key2"}, + []string{"value1", "value2"}, + "017788f37362dd0687beb59c0b3bfcc17a955120a4cb63dbdd4a0fdf9e07730e", + }, + { + []string{"key2", "key1"}, + []string{"value2", "value1"}, + "ad2b0c23dbd3376440a5347fba02ff35cfad7930daa5e733930315b6fbb03b26", + }, + // swap order with 3 keys + { + []string{"key1", "key2", "key3"}, + []string{"value1", "value2", "value3"}, + "68f41a8a3508cb5f8eb3f1c7534a86fea9f59aa4898a5aac2f1bb92834ae2a36", + }, + { + []string{"key1", "key3", "key2"}, + []string{"value1", "value3", "value2"}, + "92cd50420c22d0c79f64dd1b04bfd5f5d73265f7ac37e65cf622f3cf8b963805", + }, + } + for i, tc := range tests { + var err error + leaves := make([][]byte, len(tc.keys)) + for j, key := range tc.keys { + leaves[j], err = LeafHash([]byte(key), []byte(tc.values[j])) + require.NoError(t, err) + } + for j := range leaves { + buf := make([][]byte, len(leaves)) + copy(buf, leaves) + rootHash, inners := ProofFromByteSlices(buf, j) + require.Equal(t, tc.want, fmt.Sprintf("%x", rootHash), "test case %d", i) + commitmentOp := ConvertCommitmentOp(inners, []byte(tc.keys[j]), []byte(tc.values[j])) + expRoots, err := commitmentOp.Run([][]byte{[]byte(tc.values[j])}) + require.NoError(t, err) + require.Equal(t, tc.want, fmt.Sprintf("%x", expRoots[0]), "test case %d", i) + } + + } +} diff --git a/store/root/store.go b/store/root/store.go index 17397af684fd..4904184f23a7 100644 --- a/store/root/store.go +++ b/store/root/store.go @@ -420,10 +420,10 @@ func (s *Store) commitSC() error { return fmt.Errorf("failed to commit SC store: %w", err) } - commitHash := store.CommitInfo{ + commitHash := (&store.CommitInfo{ Version: s.lastCommitInfo.Version, StoreInfos: commitStoreInfos, - }.Hash() + }).Hash() workingHash, err := s.WorkingHash() if err != nil { diff --git a/store/storage/pebbledb/db.go b/store/storage/pebbledb/db.go index 42b9a2812ca4..449656bf5305 100644 --- a/store/storage/pebbledb/db.go +++ b/store/storage/pebbledb/db.go @@ -194,10 +194,7 @@ func (db *Database) Get(storeKey string, targetVersion uint64, key []byte) ([]by // // See: https://github.com/cockroachdb/cockroach/blob/33623e3ee420174a4fd3226d1284b03f0e3caaac/pkg/storage/mvcc.go#L3182 func (db *Database) Prune(version uint64) error { - itr, err := db.storage.NewIter(&pebble.IterOptions{LowerBound: []byte("s/k:")}) - if err != nil { - return err - } + itr := db.storage.NewIter(&pebble.IterOptions{LowerBound: []byte("s/k:")}) defer itr.Close() batch := db.storage.NewBatch() @@ -281,10 +278,7 @@ func (db *Database) Iterator(storeKey string, version uint64, start, end []byte) upperBound = MVCCEncode(prependStoreKey(storeKey, end), 0) } - itr, err := db.storage.NewIter(&pebble.IterOptions{LowerBound: lowerBound, UpperBound: upperBound}) - if err != nil { - return nil, fmt.Errorf("failed to create PebbleDB iterator: %w", err) - } + itr := db.storage.NewIter(&pebble.IterOptions{LowerBound: lowerBound, UpperBound: upperBound}) return newPebbleDBIterator(itr, storePrefix(storeKey), start, end, version, db.earliestVersion, false), nil } @@ -305,10 +299,7 @@ func (db *Database) ReverseIterator(storeKey string, version uint64, start, end upperBound = MVCCEncode(prependStoreKey(storeKey, end), 0) } - itr, err := db.storage.NewIter(&pebble.IterOptions{LowerBound: lowerBound, UpperBound: upperBound}) - if err != nil { - return nil, fmt.Errorf("failed to create PebbleDB iterator: %w", err) - } + itr := db.storage.NewIter(&pebble.IterOptions{LowerBound: lowerBound, UpperBound: upperBound}) return newPebbleDBIterator(itr, storePrefix(storeKey), start, end, version, db.earliestVersion, true), nil } @@ -366,16 +357,11 @@ func getMVCCSlice(db *pebble.DB, storeKey string, key []byte, version uint64) ([ version++ } - itr, err := db.NewIter(&pebble.IterOptions{ + itr := db.NewIter(&pebble.IterOptions{ LowerBound: MVCCEncode(prependStoreKey(storeKey, key), 0), UpperBound: MVCCEncode(prependStoreKey(storeKey, key), version), }) - if err != nil { - return nil, fmt.Errorf("failed to create PebbleDB iterator: %w", err) - } - defer func() { - err = errors.Join(err, itr.Close()) - }() + defer itr.Close() if !itr.Last() { return nil, store.ErrRecordNotFound diff --git a/telemetry/metrics.go b/telemetry/metrics.go index 812ff0abdbd2..c15720897972 100644 --- a/telemetry/metrics.go +++ b/telemetry/metrics.go @@ -65,7 +65,7 @@ type Config struct { GlobalLabels [][]string `mapstructure:"global-labels"` // MetricsSink defines the type of metrics backend to use. - MetricsSink string `mapstructure:"type" default:"mem"` + MetricsSink string `mapstructure:"metrics-sink" default:"mem"` // StatsdAddr defines the address of a statsd server to send metrics to. // Only utilized if MetricsSink is set to "statsd" or "dogstatsd". diff --git a/tests/e2e/accounts/account_abstraction_test.go b/tests/e2e/accounts/account_abstraction_test.go index b5772b9b52dd..5ddf5043ad61 100644 --- a/tests/e2e/accounts/account_abstraction_test.go +++ b/tests/e2e/accounts/account_abstraction_test.go @@ -59,13 +59,28 @@ func TestAccountAbstraction(t *testing.T) { aliceAddrStr, err := app.AuthKeeper.AddressCodec().BytesToString(aliceAddr) require.NoError(t, err) + t.Run("fail - tx compat in bundle is not allowed", func(t *testing.T) { + resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ + Sender: aaAddrStr, + AuthenticationMethod: "secp256k1", + AuthenticationData: mockSignature, + ExecutionMessages: intoAny(t, &banktypes.MsgSend{ + FromAddress: aaAddrStr, + ToAddress: bundlerAddrStr, + Amount: coins(t, "1stake"), // the sender is the AA, so it has the coins and wants to pay the bundler for the gas + }), + TxCompat: &accountsv1.TxCompat{}, + }) + require.Contains(t, resp.Error, accounts.ErrDisallowedTxCompatInBundle.Error()) + }) + t.Run("ok - pay bundler and exec not implemented", func(t *testing.T) { // we simulate executing an user operation in an abstracted account // which only implements the authentication. resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -78,7 +93,7 @@ func TestAccountAbstraction(t *testing.T) { ToAddress: aliceAddrStr, Amount: coins(t, "2000stake"), // as the real action the sender wants to send coins to alice }), - ExecutionGasLimit: 36000, + ExecutionGasLimit: 38000, }) require.Empty(t, resp.Error) // no error require.Len(t, resp.BundlerPaymentResponses, 1) @@ -97,7 +112,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: bundlerAddrStr, // abstracted account tries to send money from bundler to itself. @@ -124,7 +139,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -153,7 +168,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "invalid", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -183,7 +198,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -212,7 +227,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaAddrStr, @@ -241,7 +256,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaFullAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &banktypes.MsgSend{ FromAddress: aaFullAddrStr, @@ -265,7 +280,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaFullAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: nil, BundlerPaymentGasLimit: 50000, @@ -294,7 +309,7 @@ func TestAccountAbstraction(t *testing.T) { resp := ak.ExecuteUserOperation(ctx, bundlerAddrStr, &accountsv1.UserOperation{ Sender: aaFullAddrStr, AuthenticationMethod: "secp256k1", - AuthenticationData: []byte("signature"), + AuthenticationData: mockSignature, AuthenticationGasLimit: 10000, BundlerPaymentMessages: intoAny(t, &nft.MsgSend{ ClassId: "omega-rare", @@ -308,7 +323,7 @@ func TestAccountAbstraction(t *testing.T) { ToAddress: aliceAddrStr, Amount: coins(t, "2000stake"), }), - ExecutionGasLimit: 36000, + ExecutionGasLimit: 38000, }) require.Empty(t, resp.Error) // no error }) @@ -336,3 +351,11 @@ func balanceIs(t *testing.T, ctx context.Context, app *simapp.SimApp, addr sdk.A balance := app.BankKeeper.GetAllBalances(ctx, addr) require.Equal(t, s, balance.String()) } + +var mockSignature = &codectypes.Any{TypeUrl: "signature", Value: []byte("signature")} + +func setupApp(t *testing.T) *simapp.SimApp { + t.Helper() + app := simapp.Setup(t, false) + return app +} diff --git a/tests/go.mod b/tests/go.mod index 70001f370921..f56175e45015 100644 --- a/tests/go.mod +++ b/tests/go.mod @@ -28,13 +28,13 @@ require ( github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 ) require ( - cosmossdk.io/x/accounts v0.0.0-20231013072015-ec9bcc41ef9c + cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130 cosmossdk.io/x/auth v0.0.0-00010101000000-000000000000 cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 cosmossdk.io/x/bank v0.0.0-00010101000000-000000000000 @@ -76,9 +76,8 @@ require ( github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect @@ -140,7 +139,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -162,12 +161,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -191,11 +190,11 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/tests/go.sum b/tests/go.sum index cbe2e7b907f2..5dc3eec9cfcb 100644 --- a/tests/go.sum +++ b/tests/go.sum @@ -311,20 +311,16 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -720,8 +716,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= @@ -880,8 +876,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -913,8 +909,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1084,8 +1080,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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -1221,8 +1217,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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -1662,8 +1658,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 h1:fk72uXZyuZiTtW5tgd63jyVK6582lF61nRC/kGv6vCA= -google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tests/integration/staking/keeper/unbonding_test.go b/tests/integration/staking/keeper/unbonding_test.go index 26309b4417c6..f0ce867d8acf 100644 --- a/tests/integration/staking/keeper/unbonding_test.go +++ b/tests/integration/staking/keeper/unbonding_test.go @@ -44,6 +44,7 @@ func SetupUnbondingTests(t *testing.T, f *fixture, hookCalled *bool, ubdeID *uin mockStackingHooks.EXPECT().BeforeDelegationSharesModified(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() mockStackingHooks.EXPECT().BeforeValidatorModified(gomock.Any(), gomock.Any()).Return(nil).AnyTimes() mockStackingHooks.EXPECT().BeforeValidatorSlashed(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + mockStackingHooks.EXPECT().AfterConsensusPubKeyUpdate(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() f.stakingKeeper.SetHooks(types.NewMultiStakingHooks(mockStackingHooks)) addrDels = simtestutil.AddTestAddrsIncremental(f.bankKeeper, f.stakingKeeper, f.sdkCtx, 2, math.NewInt(10000)) diff --git a/tests/starship/tests/config.go b/tests/starship/tests/config.go index 85d72dbd7ad4..dfd2088c67ac 100644 --- a/tests/starship/tests/config.go +++ b/tests/starship/tests/config.go @@ -29,7 +29,7 @@ func (c *Chain) GetFaucetAddr() interface{} { } type Upgrade struct { - Enabled bool `name:"eanbled" json:"enabled" yaml:"enabled"` + Enabled bool `name:"enabled" json:"enabled" yaml:"enabled"` Type string `name:"type" json:"type" yaml:"type"` Genesis string `name:"genesis" json:"genesis" yaml:"genesis"` Upgrades []struct { diff --git a/tests/starship/tests/go.mod b/tests/starship/tests/go.mod index 5237f4548e8c..cb3164048fdf 100644 --- a/tests/starship/tests/go.mod +++ b/tests/starship/tests/go.mod @@ -59,7 +59,7 @@ require ( cosmossdk.io/depinject v1.0.0-alpha.4 // indirect cosmossdk.io/errors v1.0.0 // indirect cosmossdk.io/store v1.0.1 // indirect - cosmossdk.io/x/accounts v0.0.0-20231013072015-ec9bcc41ef9c // indirect + cosmossdk.io/x/accounts v0.0.0-20240104091155-b729e981f130 // indirect cosmossdk.io/x/authz v0.0.0-00010101000000-000000000000 // indirect cosmossdk.io/x/circuit v0.0.0-20230613133644-0a778132a60f // indirect cosmossdk.io/x/distribution v0.0.0-20230925135524-a1bc045b3190 // indirect @@ -93,9 +93,8 @@ require ( github.com/cockroachdb/apd/v2 v2.0.2 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -162,7 +161,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -187,12 +186,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -217,11 +216,11 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -233,7 +232,7 @@ require ( 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 - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // indirect gopkg.in/ini.v1 v1.67.0 // indirect gotest.tools/v3 v3.5.1 // indirect nhooyr.io/websocket v1.8.6 // indirect diff --git a/tests/starship/tests/go.sum b/tests/starship/tests/go.sum index 85d472045c72..af972af11bd5 100644 --- a/tests/starship/tests/go.sum +++ b/tests/starship/tests/go.sum @@ -307,20 +307,16 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -724,8 +720,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -886,8 +882,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -919,8 +915,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1089,8 +1085,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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -1222,8 +1218,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -1657,8 +1653,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/testutil/mock/logger.go b/testutil/mock/logger.go index b17f076d0255..800210aa241e 100644 --- a/testutil/mock/logger.go +++ b/testutil/mock/logger.go @@ -99,6 +99,23 @@ func (mr *MockLoggerMockRecorder) Info(arg0 interface{}, arg1 ...interface{}) *g return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Info", reflect.TypeOf((*MockLogger)(nil).Info), varargs...) } +// Warn mocks base method. +func (m *MockLogger) Warn(arg0 string, arg1 ...interface{}) { + m.ctrl.T.Helper() + varargs := []interface{}{arg0} + for _, a := range arg1 { + varargs = append(varargs, a) + } + m.ctrl.Call(m, "Warn", varargs...) +} + +// Warn indicates an expected call of Warn. +func (mr *MockLoggerMockRecorder) Warn(arg0 interface{}, arg1 ...interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + varargs := append([]interface{}{arg0}, arg1...) + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "Warn", reflect.TypeOf((*MockLogger)(nil).Warn), varargs...) +} + // With mocks base method. func (m *MockLogger) With(arg0 ...interface{}) log.Logger { m.ctrl.T.Helper() diff --git a/testutil/network/network.go b/testutil/network/network.go index 12e2bb8c0bb3..d7342d79cb66 100644 --- a/testutil/network/network.go +++ b/testutil/network/network.go @@ -557,7 +557,8 @@ func New(l Logger, baseDir string, cfg Config) (NetworkI, error) { WithAccountRetriever(cfg.AccountRetriever). WithAddressCodec(cfg.AddressCodec). WithValidatorAddressCodec(cfg.ValidatorAddressCodec). - WithConsensusAddressCodec(cfg.ValidatorAddressCodec) + WithConsensusAddressCodec(cfg.ValidatorAddressCodec). + WithNodeURI(cmtCfg.RPC.ListenAddress) // Provide ChainID here since we can't modify it in the Comet config. ctx.Viper.Set(flags.FlagChainID, cfg.ChainID) diff --git a/testutil/testdata/testpb/unknonwnproto.proto b/testutil/testdata/testpb/unknonwnproto.proto index ac91b9e2a662..94037635ec17 100644 --- a/testutil/testdata/testpb/unknonwnproto.proto +++ b/testutil/testdata/testpb/unknonwnproto.proto @@ -290,7 +290,7 @@ message TestUpdatedTxBody { repeated google.protobuf.Any messages = 1; string memo = 2; int64 timeout_height = 3; - uint64 some_new_field = 4; + uint64 some_new_field = 5; string some_new_field_non_critical_field = 1050; repeated google.protobuf.Any extension_options = 1023; repeated google.protobuf.Any non_critical_extension_options = 2047; diff --git a/testutil/testdata/testpb/unknonwnproto.pulsar.go b/testutil/testdata/testpb/unknonwnproto.pulsar.go index 84dbe6fbdb53..e8a5d52c8529 100644 --- a/testutil/testdata/testpb/unknonwnproto.pulsar.go +++ b/testutil/testdata/testpb/unknonwnproto.pulsar.go @@ -23036,7 +23036,7 @@ func (x *fastReflection_TestUpdatedTxBody) ProtoMethods() *protoiface.Methods { if x.SomeNewField != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.SomeNewField)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if x.TimeoutHeight != 0 { i = runtime.EncodeVarint(dAtA, i, uint64(x.TimeoutHeight)) @@ -23200,7 +23200,7 @@ func (x *fastReflection_TestUpdatedTxBody) ProtoMethods() *protoiface.Methods { break } } - case 4: + case 5: if wireType != 0 { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field SomeNewField", wireType) } @@ -26508,7 +26508,7 @@ type TestUpdatedTxBody struct { Messages []*anypb.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` - SomeNewField uint64 `protobuf:"varint,4,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` + SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` ExtensionOptions []*anypb.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` NonCriticalExtensionOptions []*anypb.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` @@ -27410,7 +27410,7 @@ var file_testpb_unknonwnproto_proto_rawDesc = []byte{ 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x24, 0x0a, 0x0e, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x66, 0x69, - 0x65, 0x6c, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x6f, 0x6d, 0x65, 0x4e, + 0x65, 0x6c, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0c, 0x73, 0x6f, 0x6d, 0x65, 0x4e, 0x65, 0x77, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x12, 0x48, 0x0a, 0x21, 0x73, 0x6f, 0x6d, 0x65, 0x5f, 0x6e, 0x65, 0x77, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6e, 0x6f, 0x6e, 0x5f, 0x63, 0x72, 0x69, 0x74, 0x69, 0x63, 0x61, 0x6c, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x18, 0x9a, 0x08, 0x20, diff --git a/testutil/testdata/unknonwnproto.pb.go b/testutil/testdata/unknonwnproto.pb.go index 3522a7253598..406d624a3c24 100644 --- a/testutil/testdata/unknonwnproto.pb.go +++ b/testutil/testdata/unknonwnproto.pb.go @@ -2578,7 +2578,7 @@ type TestUpdatedTxBody struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` TimeoutHeight int64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` - SomeNewField uint64 `protobuf:"varint,4,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` + SomeNewField uint64 `protobuf:"varint,5,opt,name=some_new_field,json=someNewField,proto3" json:"some_new_field,omitempty"` SomeNewFieldNonCriticalField string `protobuf:"bytes,1050,opt,name=some_new_field_non_critical_field,json=someNewFieldNonCriticalField,proto3" json:"some_new_field_non_critical_field,omitempty"` ExtensionOptions []*types.Any `protobuf:"bytes,1023,rep,name=extension_options,json=extensionOptions,proto3" json:"extension_options,omitempty"` NonCriticalExtensionOptions []*types.Any `protobuf:"bytes,2047,rep,name=non_critical_extension_options,json=nonCriticalExtensionOptions,proto3" json:"non_critical_extension_options,omitempty"` @@ -2906,7 +2906,7 @@ var fileDescriptor_fe4560133be9209a = []byte{ 0x1a, 0x5f, 0x6a, 0x70, 0x6d, 0xc5, 0x85, 0x3e, 0x73, 0x17, 0xf8, 0x0e, 0x14, 0x66, 0x84, 0x73, 0x7b, 0xac, 0x3c, 0xd0, 0x36, 0xa6, 0x56, 0x82, 0x92, 0xd5, 0x3c, 0x23, 0x33, 0x16, 0x57, 0xb3, 0x1c, 0x4b, 0x13, 0x84, 0x37, 0x23, 0x2c, 0x10, 0x83, 0x09, 0xf1, 0xc6, 0x13, 0x11, 0xf1, 0x78, - 0x25, 0x92, 0x1e, 0x2a, 0x21, 0x7e, 0x1f, 0xca, 0x9c, 0xcd, 0xc8, 0x60, 0x79, 0x6d, 0xca, 0xaa, + 0x25, 0x92, 0x1e, 0x2a, 0x21, 0x7e, 0x1f, 0xca, 0x9c, 0xcd, 0xc8, 0x60, 0x79, 0x6d, 0xca, 0xa9, 0x6b, 0x53, 0x49, 0x4a, 0x8f, 0x22, 0x63, 0xf1, 0x21, 0xfc, 0x60, 0x15, 0x35, 0x58, 0xd3, 0x82, 0x7f, 0x17, 0xb6, 0xe0, 0xf7, 0xd2, 0x3b, 0x8f, 0x5e, 0x6f, 0xc7, 0x7d, 0xb8, 0x46, 0xe6, 0x82, 0x50, 0x99, 0x23, 0x03, 0xa6, 0x3e, 0xe5, 0x72, 0xfd, 0xdf, 0xbb, 0xe7, 0xb8, 0x59, 0x49, 0xf0, @@ -2921,7 +2921,7 @@ var fileDescriptor_fe4560133be9209a = []byte{ 0x3c, 0x7f, 0x55, 0xdb, 0xf9, 0xeb, 0xab, 0xda, 0xce, 0x67, 0xcd, 0xb1, 0x27, 0x26, 0xc1, 0xb0, 0xe9, 0xb0, 0x59, 0x2b, 0xfa, 0xc8, 0x1f, 0xfe, 0xdd, 0xe6, 0xee, 0x71, 0x4b, 0x56, 0x7d, 0x20, 0xbc, 0xa9, 0x1a, 0xb8, 0xb6, 0xb0, 0x87, 0x79, 0x45, 0x74, 0xe7, 0x3f, 0x01, 0x00, 0x00, 0xff, - 0xff, 0x3a, 0xea, 0x0d, 0xa7, 0x67, 0x18, 0x00, 0x00, + 0xff, 0x33, 0x3d, 0xcf, 0x3a, 0x67, 0x18, 0x00, 0x00, } func (m *Customer1) Marshal() (dAtA []byte, err error) { @@ -5261,7 +5261,7 @@ func (m *TestUpdatedTxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { if m.SomeNewField != 0 { i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.SomeNewField)) i-- - dAtA[i] = 0x20 + dAtA[i] = 0x28 } if m.TimeoutHeight != 0 { i = encodeVarintUnknonwnproto(dAtA, i, uint64(m.TimeoutHeight)) @@ -12602,7 +12602,7 @@ func (m *TestUpdatedTxBody) Unmarshal(dAtA []byte) error { break } } - case 4: + case 5: if wireType != 0 { return fmt.Errorf("proto: wrong wireType = %d for field SomeNewField", wireType) } diff --git a/tools/confix/go.mod b/tools/confix/go.mod index fc55c5dd1605..fccee1332449 100644 --- a/tools/confix/go.mod +++ b/tools/confix/go.mod @@ -9,7 +9,7 @@ require ( github.com/pelletier/go-toml/v2 v2.1.1 github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b gotest.tools/v3 v3.5.1 ) @@ -36,9 +36,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -96,7 +95,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -115,12 +114,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -141,7 +140,7 @@ require ( go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -149,7 +148,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/grpc v1.60.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/tools/confix/go.sum b/tools/confix/go.sum index 8237944ad487..fcae0d00c1c3 100644 --- a/tools/confix/go.sum +++ b/tools/confix/go.sum @@ -113,20 +113,16 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -444,8 +440,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -599,8 +595,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -632,8 +628,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -768,8 +764,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -826,8 +822,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -981,8 +977,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/cosmovisor/README.md b/tools/cosmovisor/README.md index b7b7977433f2..0cca9eb192bf 100644 --- a/tools/cosmovisor/README.md +++ b/tools/cosmovisor/README.md @@ -347,7 +347,7 @@ Update app to the latest version (e.g. v0.50.0). :::note -Migration plans are defined using the `x/upgrade` module and described in [In-Place Store Migrations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/docs/core/15-upgrade.md). Migrations can perform any deterministic state change. +Migration plans are defined using the `x/upgrade` module and described in [In-Place Store Migrations](https://github.com/cosmos/cosmos-sdk/blob/main/docs/learn/advanced/15-upgrade.md). Migrations can perform any deterministic state change. The migration plan to upgrade the simapp from v0.47 to v0.50 is defined in `simapp/upgrade.go`. diff --git a/tools/cosmovisor/go.mod b/tools/cosmovisor/go.mod index 2c338a221d92..d8aeb32c8d6d 100644 --- a/tools/cosmovisor/go.mod +++ b/tools/cosmovisor/go.mod @@ -126,7 +126,7 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect @@ -156,7 +156,7 @@ require ( golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect @@ -168,7 +168,7 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect google.golang.org/grpc v1.60.1 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/cosmovisor/go.sum b/tools/cosmovisor/go.sum index 8c7fe4176cce..df3b5751f78d 100644 --- a/tools/cosmovisor/go.sum +++ b/tools/cosmovisor/go.sum @@ -852,8 +852,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -1174,8 +1174,8 @@ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20220601150217-0de741cfad7f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220929204114-8fcdb60fdcc0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -1601,8 +1601,8 @@ google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/hubl/go.mod b/tools/hubl/go.mod index 37e9b76b1340..4bb33ec4785f 100644 --- a/tools/hubl/go.mod +++ b/tools/hubl/go.mod @@ -13,7 +13,7 @@ require ( github.com/pelletier/go-toml/v2 v2.1.1 github.com/spf13/cobra v1.8.0 google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( @@ -35,9 +35,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/chzyer/readline v1.5.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -94,7 +93,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -113,12 +112,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.10.0 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -139,9 +138,9 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/tools/hubl/go.sum b/tools/hubl/go.sum index e78cc87a1aed..69a150d2c779 100644 --- a/tools/hubl/go.sum +++ b/tools/hubl/go.sum @@ -117,20 +117,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -444,8 +440,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -599,8 +595,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -632,8 +628,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.10.0 h1:62NOS1h+r8p1mW6FM0FSB0exioXLhd/sh15KpjWBZ+8= github.com/rs/cors v1.10.0/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -767,8 +763,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -823,8 +819,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -977,8 +973,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/hubl/internal/load.go b/tools/hubl/internal/load.go index 3750d6a95164..eea3f62b0717 100644 --- a/tools/hubl/internal/load.go +++ b/tools/hubl/internal/load.go @@ -17,8 +17,8 @@ import ( "google.golang.org/protobuf/reflect/protoregistry" "google.golang.org/protobuf/types/descriptorpb" + authv1betav1 "cosmossdk.io/api/cosmos/auth/v1beta1" autocliv1 "cosmossdk.io/api/cosmos/autocli/v1" - reflectionv2alpha1 "cosmossdk.io/api/cosmos/base/reflection/v2alpha1" reflectionv1 "cosmossdk.io/api/cosmos/reflection/v1" "cosmossdk.io/tools/hubl/internal/config" ) @@ -188,15 +188,15 @@ func (c *ChainInfo) OpenClient() (*grpc.ClientConn, error) { // getAddressPrefix returns the address prefix of the chain. func getAddressPrefix(ctx context.Context, conn grpc.ClientConnInterface) (string, error) { - reflectionClient := reflectionv2alpha1.NewReflectionServiceClient(conn) - resp, err := reflectionClient.GetConfigurationDescriptor(ctx, &reflectionv2alpha1.GetConfigurationDescriptorRequest{}) + authClient := authv1betav1.NewQueryClient(conn) + resp, err := authClient.Bech32Prefix(ctx, &authv1betav1.Bech32PrefixRequest{}) if err != nil { return "", err } - if resp == nil || resp.Config == nil || resp.Config.Bech32AccountAddressPrefix == "" { + if resp == nil || resp.Bech32Prefix == "" { return "", cockroachdberrors.New("bech32 account address prefix is not set") } - return resp.Config.Bech32AccountAddressPrefix, nil + return resp.Bech32Prefix, nil } diff --git a/types/coin.go b/types/coin.go index 1ca5eeb44ca7..4b47401a096c 100644 --- a/types/coin.go +++ b/types/coin.go @@ -823,7 +823,12 @@ var _ sort.Interface = Coins{} // Sort is a helper function to sort the set of coins in-place func (coins Coins) Sort() Coins { - sort.Sort(coins) + // sort.Sort(coins) does a costly runtime copy as part of `runtime.convTSlice` + // So we avoid this heap allocation if len(coins) <= 1. In the future, we should hopefully find + // a strategy to always avoid this. + if len(coins) > 1 { + sort.Sort(coins) + } return coins } diff --git a/types/context.go b/types/context.go index e323aa7534bb..21eb4f591782 100644 --- a/types/context.go +++ b/types/context.go @@ -26,6 +26,7 @@ const ( ExecModePrepareProposal ExecModeProcessProposal ExecModeVoteExtension + ExecModeVerifyVoteExtension ExecModeFinalize ) diff --git a/types/dec_coin.go b/types/dec_coin.go index b844301f8c84..c1bbcc6a8ecf 100644 --- a/types/dec_coin.go +++ b/types/dec_coin.go @@ -615,7 +615,12 @@ func (coins DecCoins) Swap(i, j int) { coins[i], coins[j] = coins[j], coins[i] } // Sort is a helper function to sort the set of decimal coins in-place. func (coins DecCoins) Sort() DecCoins { - sort.Sort(coins) + // sort.Sort(coins) does a costly runtime copy as part of `runtime.convTSlice` + // So we avoid this heap allocation if len(coins) <= 1. In the future, we should hopefully find + // a strategy to always avoid this. + if len(coins) > 1 { + sort.Sort(coins) + } return coins } diff --git a/types/handler.go b/types/handler.go index 456c3904e43c..42774086c2e0 100644 --- a/types/handler.go +++ b/types/handler.go @@ -1,7 +1,14 @@ package types -// AnteHandler authenticates transactions, before their internal messages are handled. -// If newCtx.IsZero(), ctx is used instead. +// AnteHandler authenticates transactions, before their internal messages are +// executed. The provided ctx is expected to contain all relevant information +// needed to process the transaction, e.g. fee payment information. If new data +// is required for the remainder of the AnteHandler execution, a new Context should +// be created off of the provided Context and returned as . +// +// The simulate argument is provided to indicate if the AnteHandler is being executed +// in simulation mode, which attempts to estimate a gas cost for the tx. Any state +// modifications made will be discarded if simulate is true. type AnteHandler func(ctx Context, tx Tx, simulate bool) (newCtx Context, err error) // PostHandler like AnteHandler but it executes after RunMsgs. Runs on success diff --git a/types/result.go b/types/result.go index 4463bf8da058..1c62d05ab688 100644 --- a/types/result.go +++ b/types/result.go @@ -45,8 +45,7 @@ func NewABCIMessageLog(i uint32, log string, events Events) ABCIMessageLog { // String implements the fmt.Stringer interface for the ABCIMessageLogs type. func (logs ABCIMessageLogs) String() (str string) { if logs != nil { - cdc := codec.NewLegacyAmino() - raw, err := cdc.MarshalJSON(logs) + raw, err := json.Marshal(logs) if err == nil { str = string(raw) } diff --git a/types/result_test.go b/types/result_test.go index 19e43cd5e298..69fc5eba747f 100644 --- a/types/result_test.go +++ b/types/result_test.go @@ -2,6 +2,7 @@ package types_test import ( "encoding/hex" + "encoding/json" "strings" "testing" "time" @@ -12,7 +13,6 @@ import ( cmt "github.com/cometbft/cometbft/types" "github.com/stretchr/testify/suite" - "github.com/cosmos/cosmos-sdk/codec" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -39,14 +39,13 @@ func (s *resultTestSuite) TestParseABCILog() { } func (s *resultTestSuite) TestABCIMessageLog() { - cdc := codec.NewLegacyAmino() events := sdk.Events{ sdk.NewEvent("transfer", sdk.NewAttribute("sender", "foo")), sdk.NewEvent("transfer", sdk.NewAttribute("sender", "bar")), } msgLog := sdk.NewABCIMessageLog(0, "", events) msgLogs := sdk.ABCIMessageLogs{msgLog} - bz, err := cdc.MarshalJSON(msgLogs) + bz, err := json.Marshal(msgLogs) s.Require().NoError(err) s.Require().Equal(string(bz), msgLogs.String()) diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index c6fbf063309e..e76864156971 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -356,11 +356,26 @@ type TxBody struct { Messages []*types.Any `protobuf:"bytes,1,rep,name=messages,proto3" json:"messages,omitempty"` // memo is any arbitrary note/comment to be added to the transaction. // WARNING: in clients, any publicly exposed text should not be called memo, - // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). + // but should be called `note` instead (see + // https://github.com/cosmos/cosmos-sdk/issues/9122). Memo string `protobuf:"bytes,2,opt,name=memo,proto3" json:"memo,omitempty"` - // timeout is the block height after which this transaction will not - // be processed by the chain + // timeout_height is the block height after which this transaction will not + // be processed by the chain. + // + // Note, if unordered=true this value MUST be set + // and will act as a short-lived TTL in which the transaction is deemed valid + // and kept in memory to prevent duplicates. TimeoutHeight uint64 `protobuf:"varint,3,opt,name=timeout_height,json=timeoutHeight,proto3" json:"timeout_height,omitempty"` + // unordered, when set to true, indicates that the transaction signer(s) + // intend for the transaction to be evaluated and executed in an un-ordered + // fashion. Specifically, the account's nonce will NOT be checked or + // incremented, which allows for fire-and-forget as well as concurrent + // transaction execution. + // + // Note, when set to true, the existing 'timeout_height' value must be set and + // will be used to correspond to a height in which the transaction is deemed + // valid. + Unordered bool `protobuf:"varint,4,opt,name=unordered,proto3" json:"unordered,omitempty"` // extension_options are arbitrary options that can be added by chains // when the default options are not sufficient. If any of these are present // and can't be handled, the transaction will be rejected @@ -425,6 +440,13 @@ func (m *TxBody) GetTimeoutHeight() uint64 { return 0 } +func (m *TxBody) GetUnordered() bool { + if m != nil { + return m.Unordered + } + return false +} + func (m *TxBody) GetExtensionOptions() []*types.Any { if m != nil { return m.ExtensionOptions @@ -789,13 +811,15 @@ type Fee struct { // gas_limit is the maximum gas that can be used in transaction processing // before an out of gas error occurs GasLimit uint64 `protobuf:"varint,2,opt,name=gas_limit,json=gasLimit,proto3" json:"gas_limit,omitempty"` - // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - // the payer must be a tx signer (and thus have signed this field in AuthInfo). - // setting this field does *not* change the ordering of required signers for the transaction. + // if unset, the first signer is responsible for paying the fees. If set, the + // specified account must pay the fees. the payer must be a tx signer (and + // thus have signed this field in AuthInfo). setting this field does *not* + // change the ordering of required signers for the transaction. Payer string `protobuf:"bytes,3,opt,name=payer,proto3" json:"payer,omitempty"` - // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - // not support fee grants, this will fail + // if set, the fee payer (either the first signer or the value of the payer + // field) requests that a fee grant be used to pay fees instead of the fee + // payer's own balance. If an appropriate fee grant does not exist or the + // chain does not support fee grants, this will fail Granter string `protobuf:"bytes,4,opt,name=granter,proto3" json:"granter,omitempty"` } @@ -1020,74 +1044,75 @@ func init() { func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) } var fileDescriptor_96d1575ffde80842 = []byte{ - // 1059 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x41, 0x6f, 0x1b, 0x45, - 0x14, 0xf6, 0x7a, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x64, 0x14, 0x21, 0xc7, 0x51, 0xdd, 0xe0, 0xaa, - 0x60, 0x55, 0x64, 0xb7, 0x4d, 0x0f, 0x94, 0x0a, 0x01, 0x76, 0x43, 0x94, 0xaa, 0x14, 0xa4, 0x4d, - 0x4e, 0xbd, 0xac, 0xc6, 0xeb, 0xc9, 0x7a, 0x54, 0xef, 0xcc, 0xb2, 0x33, 0x0b, 0xde, 0x23, 0x3f, - 0x00, 0xa9, 0x42, 0x42, 0x48, 0x9c, 0x39, 0x20, 0x4e, 0x3d, 0x20, 0x7e, 0x43, 0x4f, 0xa8, 0xe2, - 0xc4, 0x09, 0xaa, 0xe4, 0xd0, 0x3b, 0x7f, 0x00, 0x34, 0xb3, 0xb3, 0x9b, 0xb4, 0xa4, 0x4e, 0x11, - 0x48, 0x5c, 0xec, 0x99, 0xb7, 0xdf, 0x7b, 0xf3, 0xbd, 0x37, 0xdf, 0xbc, 0x07, 0x9d, 0x80, 0x8b, - 0x88, 0x0b, 0x57, 0xce, 0xdc, 0xcf, 0xae, 0x8f, 0x88, 0xc4, 0xd7, 0x5d, 0x39, 0x73, 0xe2, 0x84, - 0x4b, 0x8e, 0x56, 0xf2, 0x6f, 0x8e, 0x9c, 0x39, 0xe6, 0x5b, 0x67, 0x05, 0x47, 0x94, 0x71, 0x57, - 0xff, 0xe6, 0xa8, 0xce, 0x6a, 0xc8, 0x43, 0xae, 0x97, 0xae, 0x5a, 0x19, 0xeb, 0xa6, 0x89, 0x1b, - 0x24, 0x59, 0x2c, 0xb9, 0x1b, 0xa5, 0x53, 0x49, 0x05, 0x0d, 0xcb, 0x43, 0x0a, 0x83, 0x81, 0x77, - 0x0d, 0x7c, 0x84, 0x05, 0x29, 0x31, 0x01, 0xa7, 0xcc, 0x7c, 0x7f, 0xf3, 0x98, 0xa6, 0xa0, 0x21, - 0xa3, 0xec, 0x38, 0x92, 0xd9, 0x1b, 0xe0, 0x5a, 0xc8, 0x79, 0x38, 0x25, 0xae, 0xde, 0x8d, 0xd2, - 0x03, 0x17, 0xb3, 0xac, 0xf8, 0x94, 0xc7, 0xf0, 0x73, 0xae, 0x26, 0x37, 0xbd, 0xe9, 0x7d, 0x69, - 0x41, 0x75, 0x7f, 0x86, 0x36, 0xa1, 0x36, 0xe2, 0xe3, 0xac, 0x6d, 0x6d, 0x58, 0xfd, 0x73, 0x5b, - 0x6b, 0xce, 0xdf, 0xf2, 0x77, 0xf6, 0x67, 0x43, 0x3e, 0xce, 0x3c, 0x0d, 0x43, 0x37, 0xa1, 0x85, - 0x53, 0x39, 0xf1, 0x29, 0x3b, 0xe0, 0xed, 0xaa, 0xf6, 0x59, 0x3f, 0xc5, 0x67, 0x90, 0xca, 0xc9, - 0x1d, 0x76, 0xc0, 0xbd, 0x26, 0x36, 0x2b, 0xd4, 0x05, 0x50, 0xb4, 0xb1, 0x4c, 0x13, 0x22, 0xda, - 0xf6, 0x86, 0xdd, 0x5f, 0xf4, 0x4e, 0x58, 0x7a, 0x0c, 0xea, 0xfb, 0x33, 0x0f, 0x7f, 0x8e, 0x2e, - 0x02, 0xa8, 0xa3, 0xfc, 0x51, 0x26, 0x89, 0xd0, 0xbc, 0x16, 0xbd, 0x96, 0xb2, 0x0c, 0x95, 0x01, - 0xbd, 0x01, 0x17, 0x4a, 0x06, 0x06, 0x53, 0xd5, 0x98, 0xa5, 0xe2, 0xa8, 0x1c, 0x77, 0xd6, 0x79, - 0x5f, 0x59, 0xb0, 0xb0, 0x47, 0x43, 0xb6, 0xcd, 0x83, 0xff, 0xea, 0xc8, 0x35, 0x68, 0x06, 0x13, - 0x4c, 0x99, 0x4f, 0xc7, 0x6d, 0x7b, 0xc3, 0xea, 0xb7, 0xbc, 0x05, 0xbd, 0xbf, 0x33, 0x46, 0x57, - 0xe0, 0x3c, 0x0e, 0x02, 0x9e, 0x32, 0xe9, 0xb3, 0x34, 0x1a, 0x91, 0xa4, 0x5d, 0xdb, 0xb0, 0xfa, - 0x35, 0x6f, 0xc9, 0x58, 0x3f, 0xd6, 0xc6, 0xde, 0x1f, 0x16, 0x2c, 0x1b, 0x52, 0xdb, 0x34, 0x21, - 0x81, 0x1c, 0xa4, 0xb3, 0xb3, 0xd8, 0xdd, 0x00, 0x88, 0xd3, 0xd1, 0x94, 0x06, 0xfe, 0x03, 0x92, - 0x99, 0x3b, 0x59, 0x75, 0x72, 0x4d, 0x38, 0x85, 0x26, 0x9c, 0x01, 0xcb, 0xbc, 0x56, 0x8e, 0xbb, - 0x4b, 0xb2, 0x7f, 0x4f, 0x15, 0x75, 0xa0, 0x29, 0xc8, 0xa7, 0x29, 0x61, 0x01, 0x69, 0xd7, 0x35, - 0xa0, 0xdc, 0xa3, 0xb7, 0xc0, 0x96, 0x34, 0x6e, 0x37, 0x34, 0x97, 0xd7, 0x4e, 0xd3, 0x14, 0x8d, - 0x87, 0xd5, 0xb6, 0xe5, 0x29, 0x58, 0xef, 0xeb, 0x2a, 0x34, 0x72, 0x91, 0xa1, 0x6b, 0xd0, 0x8c, - 0x88, 0x10, 0x38, 0xd4, 0x89, 0xda, 0x2f, 0xcd, 0xa4, 0x44, 0x21, 0x04, 0xb5, 0x88, 0x44, 0xb9, - 0x16, 0x5b, 0x9e, 0x5e, 0xab, 0x0c, 0x24, 0x8d, 0x08, 0x4f, 0xa5, 0x3f, 0x21, 0x34, 0x9c, 0x48, - 0x9d, 0x62, 0xcd, 0x5b, 0x32, 0xd6, 0x5d, 0x6d, 0x44, 0x43, 0x58, 0x21, 0x33, 0x49, 0x98, 0xa0, - 0x9c, 0xf9, 0x3c, 0x96, 0x94, 0x33, 0xd1, 0xfe, 0x73, 0x61, 0xce, 0xb1, 0xcb, 0x25, 0xfe, 0x93, - 0x1c, 0x8e, 0xee, 0x43, 0x97, 0x71, 0xe6, 0x07, 0x09, 0x95, 0x34, 0xc0, 0x53, 0xff, 0x94, 0x80, - 0x17, 0xe6, 0x04, 0x5c, 0x67, 0x9c, 0xdd, 0x36, 0xbe, 0x1f, 0xbe, 0x10, 0xbb, 0xf7, 0x9d, 0x05, - 0xcd, 0xe2, 0x21, 0xa1, 0x0f, 0x60, 0x51, 0x89, 0x97, 0x24, 0x5a, 0x85, 0x45, 0x75, 0x2e, 0x9e, - 0x52, 0xdb, 0x3d, 0x0d, 0xd3, 0xaf, 0xef, 0x9c, 0x28, 0xd7, 0x02, 0xf5, 0xc1, 0x3e, 0x20, 0xc4, - 0x08, 0xe4, 0xb4, 0x4b, 0xd9, 0x21, 0xc4, 0x53, 0x90, 0xe2, 0xfa, 0xec, 0x57, 0xbb, 0xbe, 0x6f, - 0x2c, 0x80, 0xe3, 0x33, 0x5f, 0x90, 0xa3, 0xf5, 0x6a, 0x72, 0xbc, 0x09, 0xad, 0x88, 0x8f, 0xc9, - 0x59, 0x6d, 0xe5, 0x1e, 0x1f, 0x93, 0xbc, 0xad, 0x44, 0x66, 0xf5, 0x9c, 0x0c, 0xed, 0xe7, 0x65, - 0xd8, 0x7b, 0x5a, 0x85, 0x66, 0xe1, 0x82, 0xde, 0x85, 0x86, 0xa0, 0x2c, 0x9c, 0x12, 0xc3, 0xa9, - 0x37, 0x27, 0xbe, 0xb3, 0xa7, 0x91, 0xbb, 0x15, 0xcf, 0xf8, 0xa0, 0x77, 0xa0, 0xae, 0xdb, 0xb7, - 0x21, 0xf7, 0xfa, 0x3c, 0xe7, 0x7b, 0x0a, 0xb8, 0x5b, 0xf1, 0x72, 0x8f, 0xce, 0x00, 0x1a, 0x79, - 0x38, 0xf4, 0x36, 0xd4, 0x14, 0x6f, 0x4d, 0xe0, 0xfc, 0xd6, 0xe5, 0x13, 0x31, 0x8a, 0x86, 0x7e, - 0xf2, 0x0e, 0x55, 0x3c, 0x4f, 0x3b, 0x74, 0x1e, 0x5a, 0x50, 0xd7, 0x51, 0xd1, 0x5d, 0x68, 0x8e, - 0xa8, 0xc4, 0x49, 0x82, 0x8b, 0xda, 0xba, 0x45, 0x98, 0x7c, 0xec, 0x38, 0xe5, 0x94, 0x29, 0x62, - 0xdd, 0xe6, 0x51, 0x8c, 0x03, 0x39, 0xa4, 0x72, 0xa0, 0xdc, 0xbc, 0x32, 0x00, 0xba, 0x05, 0x50, - 0x56, 0x5d, 0xb5, 0x34, 0xfb, 0xac, 0xb2, 0xb7, 0x8a, 0xb2, 0x8b, 0x61, 0x1d, 0x6c, 0x91, 0x46, - 0xbd, 0x2f, 0xaa, 0x60, 0xef, 0x10, 0x82, 0x32, 0x68, 0xe0, 0x48, 0x75, 0x07, 0x23, 0xcc, 0x72, - 0x90, 0xa8, 0xe9, 0x76, 0x82, 0x0a, 0x65, 0xc3, 0x9d, 0xc7, 0xbf, 0x5d, 0xaa, 0xfc, 0xf0, 0xfb, - 0xa5, 0x7e, 0x48, 0xe5, 0x24, 0x1d, 0x39, 0x01, 0x8f, 0xdc, 0x62, 0x72, 0xea, 0xbf, 0x4d, 0x31, - 0x7e, 0xe0, 0xca, 0x2c, 0x26, 0x42, 0x3b, 0x88, 0x6f, 0x9f, 0x3d, 0xba, 0xba, 0x38, 0x25, 0x21, - 0x0e, 0x32, 0x5f, 0xcd, 0x47, 0xf1, 0xfd, 0xb3, 0x47, 0x57, 0x2d, 0xcf, 0x1c, 0x88, 0xd6, 0xa1, - 0x15, 0x62, 0xe1, 0x4f, 0x69, 0x44, 0xa5, 0xbe, 0x9e, 0x9a, 0xd7, 0x0c, 0xb1, 0xf8, 0x48, 0xed, - 0x91, 0x03, 0xf5, 0x18, 0x67, 0x24, 0xc9, 0x9b, 0xdc, 0xb0, 0xfd, 0xcb, 0x8f, 0x9b, 0xab, 0x86, - 0xd9, 0x60, 0x3c, 0x4e, 0x88, 0x10, 0x7b, 0x32, 0xa1, 0x2c, 0xf4, 0x72, 0x18, 0xda, 0x82, 0x85, - 0x30, 0xc1, 0x4c, 0x9a, 0xae, 0x37, 0xcf, 0xa3, 0x00, 0xf6, 0x7e, 0xb2, 0xc0, 0xde, 0xa7, 0xf1, - 0xff, 0x59, 0x83, 0x6b, 0xd0, 0x90, 0x34, 0x8e, 0x49, 0x92, 0xf7, 0xc1, 0x39, 0xac, 0x0d, 0xee, - 0x56, 0xb5, 0x6d, 0xf5, 0x7e, 0xb6, 0x60, 0x69, 0x90, 0xce, 0xf2, 0xc7, 0xbb, 0x8d, 0x25, 0x56, - 0xe9, 0xe3, 0x1c, 0xae, 0xd5, 0x35, 0x37, 0x7d, 0x03, 0x44, 0xef, 0x41, 0x53, 0xc9, 0xd7, 0x1f, - 0xf3, 0xc0, 0xbc, 0x8e, 0xcb, 0x2f, 0xe9, 0x4a, 0x27, 0xa7, 0x9a, 0xb7, 0x20, 0xcc, 0xf0, 0x2d, - 0x5e, 0x85, 0xfd, 0x0f, 0x5f, 0x05, 0x5a, 0x06, 0x5b, 0xd0, 0x50, 0xdf, 0xd3, 0xa2, 0xa7, 0x96, - 0xc3, 0xf7, 0x1f, 0x1f, 0x76, 0xad, 0x27, 0x87, 0x5d, 0xeb, 0xe9, 0x61, 0xd7, 0x7a, 0x78, 0xd4, - 0xad, 0x3c, 0x39, 0xea, 0x56, 0x7e, 0x3d, 0xea, 0x56, 0xee, 0x5f, 0x39, 0xbb, 0xd0, 0xae, 0x9c, - 0x8d, 0x1a, 0xba, 0x41, 0xdd, 0xf8, 0x2b, 0x00, 0x00, 0xff, 0xff, 0x24, 0x52, 0x64, 0xe6, 0x23, - 0x0a, 0x00, 0x00, + // 1076 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x55, 0x41, 0x6f, 0x1b, 0xc5, + 0x17, 0xf7, 0x7a, 0x6d, 0xc7, 0x7e, 0x4d, 0xda, 0x64, 0x14, 0xfd, 0xe5, 0x38, 0xff, 0xba, 0xc1, + 0x55, 0xc1, 0xaa, 0xc8, 0x6e, 0x9b, 0x1e, 0x28, 0x15, 0x02, 0xec, 0x86, 0x28, 0x55, 0x29, 0x48, + 0x93, 0x9c, 0x7a, 0x59, 0x8d, 0x77, 0x27, 0xeb, 0x51, 0xbd, 0x33, 0xcb, 0xce, 0x2c, 0x78, 0x8f, + 0x7c, 0x00, 0xa4, 0x8a, 0x0b, 0x12, 0x67, 0x0e, 0x88, 0x53, 0x25, 0x10, 0x9f, 0xa1, 0x27, 0x54, + 0x71, 0xe2, 0x04, 0x55, 0x72, 0xe8, 0x9d, 0x2f, 0x00, 0xda, 0xd9, 0x59, 0x27, 0x2d, 0xa9, 0x53, + 0x04, 0x12, 0x17, 0x7b, 0xe6, 0xed, 0xef, 0xbd, 0xf9, 0xbd, 0x37, 0xbf, 0x79, 0x0f, 0x3a, 0xbe, + 0x90, 0x91, 0x90, 0xae, 0x9a, 0xba, 0x9f, 0x5e, 0x1f, 0x51, 0x45, 0xae, 0xbb, 0x6a, 0xea, 0xc4, + 0x89, 0x50, 0x02, 0xad, 0x14, 0xdf, 0x1c, 0x35, 0x75, 0xcc, 0xb7, 0xce, 0x0a, 0x89, 0x18, 0x17, + 0xae, 0xfe, 0x2d, 0x50, 0x9d, 0xd5, 0x50, 0x84, 0x42, 0x2f, 0xdd, 0x7c, 0x65, 0xac, 0x9b, 0x26, + 0xae, 0x9f, 0x64, 0xb1, 0x12, 0x6e, 0x94, 0x4e, 0x14, 0x93, 0x2c, 0x9c, 0x1d, 0x52, 0x1a, 0x0c, + 0xbc, 0x6b, 0xe0, 0x23, 0x22, 0xe9, 0x0c, 0xe3, 0x0b, 0xc6, 0xcd, 0xf7, 0x37, 0x8e, 0x69, 0x4a, + 0x16, 0x72, 0xc6, 0x8f, 0x23, 0x99, 0xbd, 0x01, 0xae, 0x85, 0x42, 0x84, 0x13, 0xea, 0xea, 0xdd, + 0x28, 0x3d, 0x70, 0x09, 0xcf, 0xca, 0x4f, 0x45, 0x0c, 0xaf, 0xe0, 0x6a, 0x72, 0xd3, 0x9b, 0xde, + 0x17, 0x16, 0x54, 0xf7, 0xa7, 0x68, 0x13, 0x6a, 0x23, 0x11, 0x64, 0x6d, 0x6b, 0xc3, 0xea, 0x9f, + 0xdb, 0x5a, 0x73, 0xfe, 0x92, 0xbf, 0xb3, 0x3f, 0x1d, 0x8a, 0x20, 0xc3, 0x1a, 0x86, 0x6e, 0x42, + 0x8b, 0xa4, 0x6a, 0xec, 0x31, 0x7e, 0x20, 0xda, 0x55, 0xed, 0xb3, 0x7e, 0x8a, 0xcf, 0x20, 0x55, + 0xe3, 0x3b, 0xfc, 0x40, 0xe0, 0x26, 0x31, 0x2b, 0xd4, 0x05, 0xc8, 0x69, 0x13, 0x95, 0x26, 0x54, + 0xb6, 0xed, 0x0d, 0xbb, 0xbf, 0x88, 0x4f, 0x58, 0x7a, 0x1c, 0xea, 0xfb, 0x53, 0x4c, 0x3e, 0x43, + 0x17, 0x01, 0xf2, 0xa3, 0xbc, 0x51, 0xa6, 0xa8, 0xd4, 0xbc, 0x16, 0x71, 0x2b, 0xb7, 0x0c, 0x73, + 0x03, 0x7a, 0x1d, 0x2e, 0xcc, 0x18, 0x18, 0x4c, 0x55, 0x63, 0x96, 0xca, 0xa3, 0x0a, 0xdc, 0x59, + 0xe7, 0x7d, 0x69, 0xc1, 0xc2, 0x1e, 0x0b, 0xf9, 0xb6, 0xf0, 0xff, 0xad, 0x23, 0xd7, 0xa0, 0xe9, + 0x8f, 0x09, 0xe3, 0x1e, 0x0b, 0xda, 0xf6, 0x86, 0xd5, 0x6f, 0xe1, 0x05, 0xbd, 0xbf, 0x13, 0xa0, + 0x2b, 0x70, 0x9e, 0xf8, 0xbe, 0x48, 0xb9, 0xf2, 0x78, 0x1a, 0x8d, 0x68, 0xd2, 0xae, 0x6d, 0x58, + 0xfd, 0x1a, 0x5e, 0x32, 0xd6, 0x8f, 0xb4, 0xb1, 0xf7, 0xbb, 0x05, 0xcb, 0x86, 0xd4, 0x36, 0x4b, + 0xa8, 0xaf, 0x06, 0xe9, 0xf4, 0x2c, 0x76, 0x37, 0x00, 0xe2, 0x74, 0x34, 0x61, 0xbe, 0xf7, 0x80, + 0x66, 0xe6, 0x4e, 0x56, 0x9d, 0x42, 0x13, 0x4e, 0xa9, 0x09, 0x67, 0xc0, 0x33, 0xdc, 0x2a, 0x70, + 0x77, 0x69, 0xf6, 0xcf, 0xa9, 0xa2, 0x0e, 0x34, 0x25, 0xfd, 0x24, 0xa5, 0xdc, 0xa7, 0xed, 0xba, + 0x06, 0xcc, 0xf6, 0xe8, 0x4d, 0xb0, 0x15, 0x8b, 0xdb, 0x0d, 0xcd, 0xe5, 0x7f, 0xa7, 0x69, 0x8a, + 0xc5, 0xc3, 0x6a, 0xdb, 0xc2, 0x39, 0xac, 0xf7, 0x7d, 0x15, 0x1a, 0x85, 0xc8, 0xd0, 0x35, 0x68, + 0x46, 0x54, 0x4a, 0x12, 0xea, 0x44, 0xed, 0x97, 0x66, 0x32, 0x43, 0x21, 0x04, 0xb5, 0x88, 0x46, + 0x85, 0x16, 0x5b, 0x58, 0xaf, 0xf3, 0x0c, 0x14, 0x8b, 0xa8, 0x48, 0x95, 0x37, 0xa6, 0x2c, 0x1c, + 0x2b, 0x9d, 0x62, 0x0d, 0x2f, 0x19, 0xeb, 0xae, 0x36, 0xa2, 0xff, 0x43, 0x2b, 0xe5, 0x22, 0x09, + 0x68, 0x42, 0x03, 0x9d, 0x63, 0x13, 0x1f, 0x1b, 0xd0, 0x10, 0x56, 0xe8, 0x54, 0x51, 0x2e, 0x99, + 0xe0, 0x9e, 0x88, 0x15, 0x13, 0x5c, 0xb6, 0xff, 0x58, 0x98, 0x43, 0x6a, 0x79, 0x86, 0xff, 0xb8, + 0x80, 0xa3, 0xfb, 0xd0, 0xe5, 0x82, 0x7b, 0x7e, 0xc2, 0x14, 0xf3, 0xc9, 0xc4, 0x3b, 0x25, 0xe0, + 0x85, 0x39, 0x01, 0xd7, 0xb9, 0xe0, 0xb7, 0x8d, 0xef, 0x07, 0x2f, 0xc4, 0xee, 0x7d, 0x63, 0x41, + 0xb3, 0x7c, 0x66, 0xe8, 0x7d, 0x58, 0xcc, 0xa5, 0x4d, 0x13, 0xad, 0xd1, 0xb2, 0x76, 0x17, 0x4f, + 0xa9, 0xfc, 0x9e, 0x86, 0xe9, 0xb7, 0x79, 0x4e, 0xce, 0xd6, 0x12, 0xf5, 0xc1, 0x3e, 0xa0, 0xd4, + 0xc8, 0xe7, 0xb4, 0x2b, 0xdb, 0xa1, 0x14, 0xe7, 0x90, 0xf2, 0x72, 0xed, 0x57, 0xbb, 0xdc, 0xaf, + 0x2c, 0x80, 0xe3, 0x33, 0x5f, 0x10, 0xab, 0xf5, 0x6a, 0x62, 0xbd, 0x09, 0xad, 0x48, 0x04, 0xf4, + 0xac, 0xa6, 0x73, 0x4f, 0x04, 0xb4, 0x68, 0x3a, 0x91, 0x59, 0x3d, 0x27, 0x52, 0xfb, 0x79, 0x91, + 0xf6, 0x9e, 0x56, 0xa1, 0x59, 0xba, 0xa0, 0x77, 0xa0, 0x21, 0x19, 0x0f, 0x27, 0xd4, 0x70, 0xea, + 0xcd, 0x89, 0xef, 0xec, 0x69, 0xe4, 0x6e, 0x05, 0x1b, 0x1f, 0xf4, 0x36, 0xd4, 0x75, 0x73, 0x37, + 0xe4, 0x5e, 0x9b, 0xe7, 0x7c, 0x2f, 0x07, 0xee, 0x56, 0x70, 0xe1, 0xd1, 0x19, 0x40, 0xa3, 0x08, + 0x87, 0xde, 0x82, 0x5a, 0xce, 0x5b, 0x13, 0x38, 0xbf, 0x75, 0xf9, 0x44, 0x8c, 0xb2, 0xdd, 0x9f, + 0xbc, 0xc3, 0x3c, 0x1e, 0xd6, 0x0e, 0x9d, 0x87, 0x16, 0xd4, 0x75, 0x54, 0x74, 0x17, 0x9a, 0x23, + 0xa6, 0x48, 0x92, 0x90, 0xb2, 0xb6, 0x6e, 0x19, 0xa6, 0x18, 0x4a, 0xce, 0x6c, 0x06, 0x95, 0xb1, + 0x6e, 0x8b, 0x28, 0x26, 0xbe, 0x1a, 0x32, 0x35, 0xc8, 0xdd, 0xf0, 0x2c, 0x00, 0xba, 0x05, 0x30, + 0xab, 0x7a, 0xde, 0xf0, 0xec, 0xb3, 0xca, 0xde, 0x2a, 0xcb, 0x2e, 0x87, 0x75, 0xb0, 0x65, 0x1a, + 0xf5, 0x3e, 0xaf, 0x82, 0xbd, 0x43, 0x29, 0xca, 0xa0, 0x41, 0xa2, 0xbc, 0x77, 0x18, 0x61, 0xce, + 0xc6, 0x4c, 0x3e, 0xfb, 0x4e, 0x50, 0x61, 0x7c, 0xb8, 0xf3, 0xf8, 0xd7, 0x4b, 0x95, 0xef, 0x7e, + 0xbb, 0xd4, 0x0f, 0x99, 0x1a, 0xa7, 0x23, 0xc7, 0x17, 0x91, 0x5b, 0xce, 0x55, 0xfd, 0xb7, 0x29, + 0x83, 0x07, 0xae, 0xca, 0x62, 0x2a, 0xb5, 0x83, 0xfc, 0xfa, 0xd9, 0xa3, 0xab, 0x8b, 0x13, 0x1a, + 0x12, 0x3f, 0xf3, 0xf2, 0xe9, 0x29, 0xbf, 0x7d, 0xf6, 0xe8, 0xaa, 0x85, 0xcd, 0x81, 0x68, 0x1d, + 0x5a, 0x21, 0x91, 0xde, 0x84, 0x45, 0x4c, 0xe9, 0xeb, 0xa9, 0xe1, 0x66, 0x48, 0xe4, 0x87, 0xf9, + 0x1e, 0x39, 0x50, 0x8f, 0x49, 0x46, 0x93, 0xa2, 0x05, 0x0e, 0xdb, 0x3f, 0xff, 0xb0, 0xb9, 0x6a, + 0x98, 0x0d, 0x82, 0x20, 0xa1, 0x52, 0xee, 0xa9, 0x84, 0xf1, 0x10, 0x17, 0x30, 0xb4, 0x05, 0x0b, + 0x61, 0x42, 0xb8, 0x32, 0x3d, 0x71, 0x9e, 0x47, 0x09, 0xec, 0xfd, 0x68, 0x81, 0xbd, 0xcf, 0xe2, + 0xff, 0xb2, 0x06, 0xd7, 0xa0, 0xa1, 0x58, 0x1c, 0xd3, 0xa4, 0xe8, 0x92, 0x73, 0x58, 0x1b, 0xdc, + 0xad, 0x6a, 0xdb, 0xea, 0xfd, 0x64, 0xc1, 0xd2, 0x20, 0x9d, 0x16, 0x8f, 0x77, 0x9b, 0x28, 0x92, + 0xa7, 0x4f, 0x0a, 0xb8, 0x56, 0xd7, 0xdc, 0xf4, 0x0d, 0x10, 0xbd, 0x0b, 0xcd, 0x5c, 0xbe, 0x5e, + 0x20, 0x7c, 0xf3, 0x3a, 0x2e, 0xbf, 0xa4, 0x2b, 0x9d, 0x9c, 0x79, 0x78, 0x41, 0x9a, 0xd1, 0x5c, + 0xbe, 0x0a, 0xfb, 0x6f, 0xbe, 0x0a, 0xb4, 0x0c, 0xb6, 0x64, 0xa1, 0xbe, 0xa7, 0x45, 0x9c, 0x2f, + 0x87, 0xef, 0x3d, 0x3e, 0xec, 0x5a, 0x4f, 0x0e, 0xbb, 0xd6, 0xd3, 0xc3, 0xae, 0xf5, 0xf0, 0xa8, + 0x5b, 0x79, 0x72, 0xd4, 0xad, 0xfc, 0x72, 0xd4, 0xad, 0xdc, 0xbf, 0x72, 0x76, 0xa1, 0x5d, 0x35, + 0x1d, 0x35, 0x74, 0x83, 0xba, 0xf1, 0x67, 0x00, 0x00, 0x00, 0xff, 0xff, 0xb1, 0x48, 0xf7, 0x44, + 0x41, 0x0a, 0x00, 0x00, } func (m *Tx) Marshal() (dAtA []byte, err error) { @@ -1364,6 +1389,16 @@ func (m *TxBody) MarshalToSizedBuffer(dAtA []byte) (int, error) { dAtA[i] = 0xfa } } + if m.Unordered { + i-- + if m.Unordered { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i-- + dAtA[i] = 0x20 + } if m.TimeoutHeight != 0 { i = encodeVarintTx(dAtA, i, uint64(m.TimeoutHeight)) i-- @@ -1942,6 +1977,9 @@ func (m *TxBody) Size() (n int) { if m.TimeoutHeight != 0 { n += 1 + sovTx(uint64(m.TimeoutHeight)) } + if m.Unordered { + n += 2 + } if len(m.ExtensionOptions) > 0 { for _, e := range m.ExtensionOptions { l = e.Size() @@ -2955,6 +2993,26 @@ func (m *TxBody) Unmarshal(dAtA []byte) error { break } } + case 4: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field Unordered", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + m.Unordered = bool(v != 0) case 1023: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field ExtensionOptions", wireType) diff --git a/types/tx_msg.go b/types/tx_msg.go index 399dafd4cc43..1f81dbbc0912 100644 --- a/types/tx_msg.go +++ b/types/tx_msg.go @@ -79,6 +79,14 @@ type ( GetTimeoutHeight() uint64 } + // TxWithUnordered extends the Tx interface by allowing a transaction to set + // the unordered field, which implicitly relies on TxWithTimeoutHeight. + TxWithUnordered interface { + TxWithTimeoutHeight + + GetUnordered() bool + } + // HasValidateBasic defines a type that has a ValidateBasic method. // ValidateBasic is deprecated and now facultative. // Prefer validating messages directly in the msg server. diff --git a/x/accounts/go.mod b/x/accounts/go.mod index d88aa56b2f1f..32d99885c126 100644 --- a/x/accounts/go.mod +++ b/x/accounts/go.mod @@ -11,9 +11,9 @@ require ( github.com/grpc-ecosystem/grpc-gateway v1.16.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( @@ -38,9 +38,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -94,7 +93,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/libp2p/go-buffer-pool v0.1.0 // indirect @@ -112,12 +111,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -141,7 +140,7 @@ require ( golang.org/x/crypto v0.17.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/accounts/go.sum b/x/accounts/go.sum index b97142dd787c..10ecd8dd7169 100644 --- a/x/accounts/go.sum +++ b/x/accounts/go.sum @@ -98,20 +98,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -417,8 +413,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -562,8 +558,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -595,8 +591,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -732,8 +728,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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 +784,8 @@ golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -941,8 +937,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/accounts/keeper_account_abstraction.go b/x/accounts/keeper_account_abstraction.go index 88b1f1da7351..fdca933a4bbc 100644 --- a/x/accounts/keeper_account_abstraction.go +++ b/x/accounts/keeper_account_abstraction.go @@ -17,6 +17,9 @@ var ( ErrBundlerPayment = errors.New("bundler payment failed") // ErrExecution is returned when the execution fails. ErrExecution = errors.New("execution failed") + // ErrDisallowedTxCompatInBundle is returned when the tx compat + // is populated in a bundle. + ErrDisallowedTxCompatInBundle = errors.New("tx compat field populated in bundle") ) // ExecuteUserOperation handles the execution of an abstracted account UserOperation. @@ -25,6 +28,13 @@ func (k Keeper) ExecuteUserOperation( bundler string, op *v1.UserOperation, ) *v1.UserOperationResponse { + // TxCompat field must not be allowed in a UserOperation sent from a bundle. + // Only the runtime can populate this field when an abstracted account sends + // a tx (not from a bundle) and this is converted into a UserOperation. + if op.TxCompat != nil { + return &v1.UserOperationResponse{Error: ErrDisallowedTxCompatInBundle.Error()} + } + resp := &v1.UserOperationResponse{} // authenticate diff --git a/x/accounts/msg_server.go b/x/accounts/msg_server.go index 20357ba3e27b..52fafeec0c38 100644 --- a/x/accounts/msg_server.go +++ b/x/accounts/msg_server.go @@ -3,9 +3,6 @@ package accounts import ( "context" - "google.golang.org/grpc/codes" - "google.golang.org/grpc/status" - "cosmossdk.io/core/event" "cosmossdk.io/x/accounts/internal/implementation" v1 "cosmossdk.io/x/accounts/v1" @@ -103,5 +100,15 @@ func (m msgServer) Execute(ctx context.Context, execute *v1.MsgExecute) (*v1.Msg } func (m msgServer) ExecuteBundle(ctx context.Context, req *v1.MsgExecuteBundle) (*v1.MsgExecuteBundleResponse, error) { - return nil, status.Error(codes.Unimplemented, "not implemented") + _, err := m.k.addressCodec.StringToBytes(req.Bundler) + if err != nil { + return nil, err + } + + resp := &v1.MsgExecuteBundleResponse{Responses: make([]*v1.UserOperationResponse, len(req.Operations))} + for i, op := range req.Operations { + resp.Responses[i] = m.k.ExecuteUserOperation(ctx, req.Bundler, op) + } + + return resp, nil } diff --git a/x/accounts/proto/cosmos/accounts/v1/account_abstraction.proto b/x/accounts/proto/cosmos/accounts/v1/account_abstraction.proto index 01fb36436fbc..8d279dad7824 100644 --- a/x/accounts/proto/cosmos/accounts/v1/account_abstraction.proto +++ b/x/accounts/proto/cosmos/accounts/v1/account_abstraction.proto @@ -17,7 +17,7 @@ message UserOperation { string authentication_method = 2; // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. - bytes authentication_data = 3; + google.protobuf.Any authentication_data = 3; // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. uint64 authentication_gas_limit = 4; @@ -42,6 +42,25 @@ message UserOperation { // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. uint64 execution_gas_limit = 8; + + // tx_compat is populated only when the operation is composed from a raw tx. + // In fact if a TX comes and the sender of the TX is an abstracted account, + // we convert the TX into a user operation, and try to authenticate using the + // x/accounts authenticate method. If a bundler tries to send a UserOperation + // with a populated tx_compat, the operation will immediately yield a failure. + TxCompat tx_compat = 9; +} + +// TxCompat provides compatibility for x/accounts abstracted account with the cosmos-sdk's Txs. +// In fact TxCompat contains fields coming from the Tx in raw and decoded format. The Raw format +// is mainly needed for proper sig verification. +message TxCompat { + // auth_info_bytes contains the auth info bytes of the tx. + // Must not be modified. + bytes auth_info_bytes = 1; + // body_bytes contains the body bytes of the tx. + // must not be modified. + bytes body_bytes = 2; } // UserOperationResponse defines the response of a UserOperation. diff --git a/x/accounts/v1/account_abstraction.pb.go b/x/accounts/v1/account_abstraction.pb.go index 95ebb759fca7..f51cf1cc070a 100644 --- a/x/accounts/v1/account_abstraction.pb.go +++ b/x/accounts/v1/account_abstraction.pb.go @@ -34,7 +34,7 @@ type UserOperation struct { AuthenticationMethod string `protobuf:"bytes,2,opt,name=authentication_method,json=authenticationMethod,proto3" json:"authentication_method,omitempty"` // authentication_data defines the authentication data associated with the authentication method. // It is the account implementer duty to assess that the UserOperation is properly signed. - AuthenticationData []byte `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` + AuthenticationData *types.Any `protobuf:"bytes,3,opt,name=authentication_data,json=authenticationData,proto3" json:"authentication_data,omitempty"` // authentication_gas_limit expresses the gas limit to be used for the authentication part of the // UserOperation. AuthenticationGasLimit uint64 `protobuf:"varint,4,opt,name=authentication_gas_limit,json=authenticationGasLimit,proto3" json:"authentication_gas_limit,omitempty"` @@ -59,6 +59,12 @@ type UserOperation struct { // execution_gas_limit defines the gas limit to be used for the execution of the UserOperation's // execution messages. ExecutionGasLimit uint64 `protobuf:"varint,8,opt,name=execution_gas_limit,json=executionGasLimit,proto3" json:"execution_gas_limit,omitempty"` + // tx_compat is populated only when the operation is composed from a raw tx. + // In fact if a TX comes and the sender of the TX is an abstracted account, + // we convert the TX into a user operation, and try to authenticate using the + // x/accounts authenticate method. If a bundler tries to send a UserOperation + // with a populated tx_compat, the operation will immediately yield a failure. + TxCompat *TxCompat `protobuf:"bytes,9,opt,name=tx_compat,json=txCompat,proto3" json:"tx_compat,omitempty"` } func (m *UserOperation) Reset() { *m = UserOperation{} } @@ -108,7 +114,7 @@ func (m *UserOperation) GetAuthenticationMethod() string { return "" } -func (m *UserOperation) GetAuthenticationData() []byte { +func (m *UserOperation) GetAuthenticationData() *types.Any { if m != nil { return m.AuthenticationData } @@ -150,6 +156,72 @@ func (m *UserOperation) GetExecutionGasLimit() uint64 { return 0 } +func (m *UserOperation) GetTxCompat() *TxCompat { + if m != nil { + return m.TxCompat + } + return nil +} + +// TxCompat provides compatibility for x/accounts abstracted account with the cosmos-sdk's Txs. +// In fact TxCompat contains fields coming from the Tx in raw and decoded format. The Raw format +// is mainly needed for proper sig verification. +type TxCompat struct { + // auth_info_bytes contains the auth info bytes of the tx. + // Must not be modified. + AuthInfoBytes []byte `protobuf:"bytes,1,opt,name=auth_info_bytes,json=authInfoBytes,proto3" json:"auth_info_bytes,omitempty"` + // body_bytes contains the body bytes of the tx. + // must not be modified. + BodyBytes []byte `protobuf:"bytes,2,opt,name=body_bytes,json=bodyBytes,proto3" json:"body_bytes,omitempty"` +} + +func (m *TxCompat) Reset() { *m = TxCompat{} } +func (m *TxCompat) String() string { return proto.CompactTextString(m) } +func (*TxCompat) ProtoMessage() {} +func (*TxCompat) Descriptor() ([]byte, []int) { + return fileDescriptor_9f9bcc910ad46d4b, []int{1} +} +func (m *TxCompat) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *TxCompat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_TxCompat.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *TxCompat) XXX_Merge(src proto.Message) { + xxx_messageInfo_TxCompat.Merge(m, src) +} +func (m *TxCompat) XXX_Size() int { + return m.Size() +} +func (m *TxCompat) XXX_DiscardUnknown() { + xxx_messageInfo_TxCompat.DiscardUnknown(m) +} + +var xxx_messageInfo_TxCompat proto.InternalMessageInfo + +func (m *TxCompat) GetAuthInfoBytes() []byte { + if m != nil { + return m.AuthInfoBytes + } + return nil +} + +func (m *TxCompat) GetBodyBytes() []byte { + if m != nil { + return m.BodyBytes + } + return nil +} + // UserOperationResponse defines the response of a UserOperation. // If the operation fails the error field will be populated. type UserOperationResponse struct { @@ -176,7 +248,7 @@ func (m *UserOperationResponse) Reset() { *m = UserOperationResponse{} } func (m *UserOperationResponse) String() string { return proto.CompactTextString(m) } func (*UserOperationResponse) ProtoMessage() {} func (*UserOperationResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_9f9bcc910ad46d4b, []int{1} + return fileDescriptor_9f9bcc910ad46d4b, []int{2} } func (m *UserOperationResponse) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -249,6 +321,7 @@ func (m *UserOperationResponse) GetError() string { func init() { proto.RegisterType((*UserOperation)(nil), "cosmos.accounts.v1.UserOperation") + proto.RegisterType((*TxCompat)(nil), "cosmos.accounts.v1.TxCompat") proto.RegisterType((*UserOperationResponse)(nil), "cosmos.accounts.v1.UserOperationResponse") } @@ -257,36 +330,41 @@ func init() { } var fileDescriptor_9f9bcc910ad46d4b = []byte{ - // 461 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x93, 0xcd, 0x6e, 0xd3, 0x40, - 0x14, 0x85, 0xe3, 0x24, 0x0d, 0x74, 0x00, 0x09, 0xa6, 0x49, 0xea, 0x76, 0x61, 0x45, 0x5d, 0x65, - 0x51, 0x8d, 0x55, 0x8a, 0xf8, 0x59, 0xf2, 0x27, 0x36, 0x14, 0x2a, 0x4b, 0xdd, 0xb0, 0xb1, 0x26, - 0xf6, 0x25, 0xb5, 0x88, 0x67, 0xa2, 0xb9, 0xe3, 0xaa, 0x79, 0x0b, 0xde, 0x0a, 0x96, 0x5d, 0xb2, - 0x44, 0x89, 0x78, 0x0f, 0x94, 0x19, 0xff, 0xc4, 0x71, 0x95, 0x5d, 0xac, 0x7b, 0xce, 0x3d, 0x27, - 0xdf, 0xcc, 0x90, 0xd3, 0x48, 0x62, 0x2a, 0xd1, 0xe7, 0x51, 0x24, 0x33, 0xa1, 0xd1, 0xbf, 0x39, - 0x2b, 0x7e, 0x87, 0x7c, 0x82, 0x5a, 0xf1, 0x48, 0x27, 0x52, 0xb0, 0xb9, 0x92, 0x5a, 0x52, 0x6a, - 0xd5, 0xac, 0x50, 0xb3, 0x9b, 0xb3, 0xe3, 0xa3, 0xa9, 0x94, 0xd3, 0x19, 0xf8, 0x46, 0x31, 0xc9, - 0xbe, 0xfb, 0x5c, 0x2c, 0xac, 0xfc, 0xe4, 0x57, 0x87, 0x3c, 0xb9, 0x42, 0x50, 0x5f, 0xe7, 0xa0, - 0xf8, 0x7a, 0x0d, 0x1d, 0x92, 0x1e, 0x82, 0x88, 0x41, 0xb9, 0xce, 0xc8, 0x19, 0xef, 0x07, 0xf9, - 0x17, 0x3d, 0x27, 0x03, 0x9e, 0xe9, 0x6b, 0x10, 0x3a, 0x89, 0x8c, 0x32, 0x4c, 0x41, 0x5f, 0xcb, - 0xd8, 0x6d, 0x1b, 0x59, 0xbf, 0x3e, 0xbc, 0x30, 0x33, 0xea, 0x93, 0x83, 0x2d, 0x53, 0xcc, 0x35, - 0x77, 0x3b, 0x23, 0x67, 0xfc, 0x38, 0xa0, 0xf5, 0xd1, 0x07, 0xae, 0x39, 0x7d, 0x4d, 0xdc, 0x2d, - 0xc3, 0x94, 0x63, 0x38, 0x4b, 0xd2, 0x44, 0xbb, 0xdd, 0x91, 0x33, 0xee, 0x06, 0xc3, 0xfa, 0xfc, - 0x13, 0xc7, 0xcf, 0xeb, 0x29, 0xfd, 0x42, 0xdc, 0x49, 0x26, 0xe2, 0x19, 0xa8, 0x70, 0xce, 0x17, - 0x29, 0x08, 0x1d, 0xa6, 0x80, 0xc8, 0xa7, 0x80, 0xee, 0xde, 0xa8, 0x33, 0x7e, 0xf4, 0xbc, 0xcf, - 0x2c, 0x07, 0x56, 0x70, 0x60, 0x6f, 0xc5, 0x22, 0x18, 0xe6, 0xae, 0x4b, 0x6b, 0xba, 0xc8, 0x3d, - 0xf4, 0x0d, 0x39, 0xda, 0xde, 0x57, 0x55, 0xe9, 0xd9, 0x2a, 0x75, 0x6b, 0x59, 0xe5, 0x3d, 0xa1, - 0x70, 0x0b, 0x51, 0x96, 0x53, 0xca, 0x4b, 0x3c, 0xd8, 0x51, 0xe2, 0x59, 0xa9, 0x2f, 0xf3, 0x19, - 0x39, 0xa8, 0x96, 0x54, 0xc9, 0x0f, 0x4d, 0x72, 0xa5, 0x2f, 0x42, 0x4f, 0xfe, 0xb5, 0xc9, 0xa0, - 0x76, 0x92, 0x01, 0xe0, 0x5c, 0x0a, 0x04, 0xfa, 0x92, 0x1c, 0xde, 0xc3, 0x34, 0x43, 0x88, 0xcd, - 0x11, 0x77, 0x83, 0x41, 0x03, 0xe9, 0x15, 0x42, 0x4c, 0x5f, 0x35, 0x89, 0x96, 0xc6, 0xb6, 0x35, - 0x36, 0x00, 0x18, 0xe3, 0x65, 0x13, 0x9d, 0xca, 0xcb, 0xa0, 0xdb, 0xd9, 0x81, 0xe1, 0xb0, 0xbe, - 0xaf, 0xf8, 0x07, 0x48, 0x4f, 0x37, 0x89, 0x96, 0x25, 0xec, 0x85, 0x78, 0xba, 0xc9, 0xc2, 0xe4, - 0x7f, 0xdc, 0x44, 0x57, 0x25, 0xef, 0xba, 0x05, 0xd5, 0xfa, 0x2a, 0xb4, 0x4f, 0xf6, 0x40, 0x29, - 0xa9, 0xcc, 0x69, 0xef, 0x07, 0xf6, 0xe3, 0xdd, 0x8b, 0xdf, 0x4b, 0xcf, 0xb9, 0x5b, 0x7a, 0xce, - 0xdf, 0xa5, 0xe7, 0xfc, 0x5c, 0x79, 0xad, 0xbb, 0x95, 0xd7, 0xfa, 0xb3, 0xf2, 0x5a, 0xdf, 0x8e, - 0xed, 0xd3, 0xc3, 0xf8, 0x07, 0x4b, 0xa4, 0x7f, 0xbb, 0xf9, 0x60, 0x27, 0x3d, 0x93, 0x76, 0xfe, - 0x3f, 0x00, 0x00, 0xff, 0xff, 0xf6, 0xb6, 0x1b, 0x5c, 0xcd, 0x03, 0x00, 0x00, + // 536 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x7c, 0x54, 0xcf, 0x6f, 0xd3, 0x30, + 0x18, 0x6d, 0xda, 0xae, 0xb4, 0x86, 0x09, 0xf0, 0xda, 0x2e, 0x9b, 0x20, 0xaa, 0x7a, 0x40, 0x3d, + 0x4c, 0x8e, 0xc6, 0x10, 0xb0, 0x23, 0x1b, 0x13, 0x42, 0x62, 0x30, 0x22, 0x76, 0xe1, 0x12, 0x39, + 0x89, 0xdb, 0x45, 0x34, 0x76, 0x64, 0x3b, 0x53, 0xf3, 0x5f, 0x70, 0xe4, 0x4f, 0xe2, 0xb8, 0x23, + 0x47, 0xd4, 0x8a, 0xff, 0x03, 0xc5, 0xf9, 0xd5, 0x34, 0xd0, 0x9b, 0xfd, 0x7d, 0xef, 0x7d, 0xef, + 0xc5, 0xef, 0x53, 0xc0, 0x91, 0xcb, 0x44, 0xc0, 0x84, 0x89, 0x5d, 0x97, 0x45, 0x54, 0x0a, 0xf3, + 0xf6, 0x38, 0x3f, 0xdb, 0xd8, 0x11, 0x92, 0x63, 0x57, 0xfa, 0x8c, 0xa2, 0x90, 0x33, 0xc9, 0x20, + 0x4c, 0xd1, 0x28, 0x47, 0xa3, 0xdb, 0xe3, 0xc3, 0x83, 0x19, 0x63, 0xb3, 0x39, 0x31, 0x15, 0xc2, + 0x89, 0xa6, 0x26, 0xa6, 0x71, 0x0a, 0x1f, 0xff, 0x68, 0x83, 0xdd, 0x6b, 0x41, 0xf8, 0xa7, 0x90, + 0x70, 0x9c, 0x8c, 0x81, 0x43, 0xd0, 0x11, 0x84, 0x7a, 0x84, 0xeb, 0xda, 0x48, 0x9b, 0xf4, 0xac, + 0xec, 0x06, 0x4f, 0xc0, 0x00, 0x47, 0xf2, 0x86, 0x50, 0xe9, 0xbb, 0x0a, 0x69, 0x07, 0x44, 0xde, + 0x30, 0x4f, 0x6f, 0x2a, 0x58, 0xbf, 0xda, 0xbc, 0x54, 0x3d, 0x78, 0x01, 0xf6, 0x36, 0x48, 0x1e, + 0x96, 0x58, 0x6f, 0x8d, 0xb4, 0xc9, 0xfd, 0xe7, 0x7d, 0x94, 0xfa, 0x42, 0xb9, 0x2f, 0xf4, 0x86, + 0xc6, 0x16, 0xac, 0x12, 0xde, 0x62, 0x89, 0xe1, 0x6b, 0xa0, 0x6f, 0x8c, 0x99, 0x61, 0x61, 0xcf, + 0xfd, 0xc0, 0x97, 0x7a, 0x7b, 0xa4, 0x4d, 0xda, 0xd6, 0xb0, 0xda, 0x7f, 0x87, 0xc5, 0x87, 0xa4, + 0x0b, 0x3f, 0x02, 0xdd, 0x89, 0xa8, 0x37, 0x27, 0xdc, 0x0e, 0x71, 0x1c, 0x10, 0x2a, 0xed, 0x80, + 0x08, 0x81, 0x67, 0x44, 0xe8, 0x3b, 0xa3, 0xd6, 0x7f, 0x5d, 0x0c, 0x33, 0xd6, 0x55, 0x4a, 0xba, + 0xcc, 0x38, 0xf0, 0x14, 0x1c, 0x6c, 0xce, 0x2b, 0xad, 0x74, 0x52, 0x2b, 0x55, 0x6a, 0x61, 0xe5, + 0x1c, 0x40, 0xb2, 0x20, 0x6e, 0x94, 0xbd, 0x5d, 0x66, 0xe2, 0xde, 0x16, 0x13, 0x8f, 0x0b, 0x7c, + 0xa1, 0x8f, 0xc0, 0x5e, 0x39, 0xa4, 0x54, 0xee, 0x2a, 0xe5, 0x12, 0x5f, 0x88, 0x9e, 0x82, 0x9e, + 0x5c, 0xd8, 0x2e, 0x0b, 0x42, 0x2c, 0xf5, 0x9e, 0x7a, 0xf6, 0x27, 0xa8, 0xbe, 0x22, 0xe8, 0xcb, + 0xe2, 0x5c, 0x61, 0xac, 0xae, 0xcc, 0x4e, 0xe3, 0xcf, 0xa0, 0x9b, 0x57, 0xe1, 0x33, 0xf0, 0x30, + 0x79, 0x60, 0xdb, 0xa7, 0x53, 0x66, 0x3b, 0xb1, 0x24, 0x42, 0x6d, 0xc7, 0x03, 0x6b, 0x37, 0x29, + 0xbf, 0xa7, 0x53, 0x76, 0x96, 0x14, 0xe1, 0x53, 0x00, 0x1c, 0xe6, 0xc5, 0x19, 0xa4, 0xa9, 0x20, + 0xbd, 0xa4, 0xa2, 0xda, 0xe3, 0x3f, 0x4d, 0x30, 0xa8, 0x6c, 0x9b, 0x45, 0x44, 0xc8, 0xa8, 0x20, + 0xf0, 0x25, 0xd8, 0xff, 0x47, 0xc2, 0x91, 0x20, 0x9e, 0x12, 0x6a, 0x5b, 0x83, 0x5a, 0xc0, 0xd7, + 0x82, 0x78, 0xf0, 0x55, 0x3d, 0xdf, 0x82, 0xd8, 0x4c, 0x89, 0xb5, 0x38, 0x14, 0xf1, 0xaa, 0x1e, + 0x24, 0xcf, 0xcc, 0x08, 0xbd, 0xb5, 0x25, 0x94, 0xfd, 0xea, 0xbc, 0xfc, 0x0b, 0x04, 0x3c, 0x5a, + 0xcf, 0xb7, 0x30, 0x91, 0xae, 0xe7, 0xa3, 0xf5, 0x64, 0x94, 0xfe, 0xc5, 0x7a, 0x90, 0xa5, 0xf2, + 0xb6, 0x9d, 0x2c, 0xc7, 0x97, 0xa2, 0x7d, 0xb0, 0x43, 0x38, 0x67, 0x5c, 0xed, 0x5e, 0xcf, 0x4a, + 0x2f, 0x67, 0x2f, 0x7e, 0x2e, 0x0d, 0xed, 0x6e, 0x69, 0x68, 0xbf, 0x97, 0x86, 0xf6, 0x7d, 0x65, + 0x34, 0xee, 0x56, 0x46, 0xe3, 0xd7, 0xca, 0x68, 0x7c, 0x3d, 0x4c, 0xb3, 0x17, 0xde, 0x37, 0xe4, + 0x33, 0x73, 0xb1, 0xfe, 0x53, 0x71, 0x3a, 0x4a, 0xed, 0xe4, 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, + 0xb2, 0x84, 0x4a, 0x05, 0x71, 0x04, 0x00, 0x00, } func (m *UserOperation) Marshal() (dAtA []byte, err error) { @@ -309,6 +387,18 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.TxCompat != nil { + { + size, err := m.TxCompat.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x4a + } if m.ExecutionGasLimit != 0 { i = encodeVarintAccountAbstraction(dAtA, i, uint64(m.ExecutionGasLimit)) i-- @@ -352,10 +442,15 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x20 } - if len(m.AuthenticationData) > 0 { - i -= len(m.AuthenticationData) - copy(dAtA[i:], m.AuthenticationData) - i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.AuthenticationData))) + if m.AuthenticationData != nil { + { + size, err := m.AuthenticationData.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintAccountAbstraction(dAtA, i, uint64(size)) + } i-- dAtA[i] = 0x1a } @@ -376,6 +471,43 @@ func (m *UserOperation) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *TxCompat) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *TxCompat) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *TxCompat) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.BodyBytes) > 0 { + i -= len(m.BodyBytes) + copy(dAtA[i:], m.BodyBytes) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.BodyBytes))) + i-- + dAtA[i] = 0x12 + } + if len(m.AuthInfoBytes) > 0 { + i -= len(m.AuthInfoBytes) + copy(dAtA[i:], m.AuthInfoBytes) + i = encodeVarintAccountAbstraction(dAtA, i, uint64(len(m.AuthInfoBytes))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *UserOperationResponse) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -474,8 +606,8 @@ func (m *UserOperation) Size() (n int) { if l > 0 { n += 1 + l + sovAccountAbstraction(uint64(l)) } - l = len(m.AuthenticationData) - if l > 0 { + if m.AuthenticationData != nil { + l = m.AuthenticationData.Size() n += 1 + l + sovAccountAbstraction(uint64(l)) } if m.AuthenticationGasLimit != 0 { @@ -499,6 +631,27 @@ func (m *UserOperation) Size() (n int) { if m.ExecutionGasLimit != 0 { n += 1 + sovAccountAbstraction(uint64(m.ExecutionGasLimit)) } + if m.TxCompat != nil { + l = m.TxCompat.Size() + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + return n +} + +func (m *TxCompat) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.AuthInfoBytes) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } + l = len(m.BodyBytes) + if l > 0 { + n += 1 + l + sovAccountAbstraction(uint64(l)) + } return n } @@ -639,7 +792,7 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field AuthenticationData", wireType) } - var byteLen int + var msglen int for shift := uint(0); ; shift += 7 { if shift >= 64 { return ErrIntOverflowAccountAbstraction @@ -649,24 +802,26 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { } 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 ErrInvalidLengthAccountAbstraction } - postIndex := iNdEx + byteLen + postIndex := iNdEx + msglen if postIndex < 0 { return ErrInvalidLengthAccountAbstraction } if postIndex > l { return io.ErrUnexpectedEOF } - m.AuthenticationData = append(m.AuthenticationData[:0], dAtA[iNdEx:postIndex]...) if m.AuthenticationData == nil { - m.AuthenticationData = []byte{} + m.AuthenticationData = &types.Any{} + } + if err := m.AuthenticationData.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err } iNdEx = postIndex case 4: @@ -794,6 +949,160 @@ func (m *UserOperation) Unmarshal(dAtA []byte) error { break } } + case 9: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field TxCompat", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.TxCompat == nil { + m.TxCompat = &TxCompat{} + } + if err := m.TxCompat.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipAccountAbstraction(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthAccountAbstraction + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *TxCompat) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: TxCompat: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: TxCompat: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field AuthInfoBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.AuthInfoBytes = append(m.AuthInfoBytes[:0], dAtA[iNdEx:postIndex]...) + if m.AuthInfoBytes == nil { + m.AuthInfoBytes = []byte{} + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field BodyBytes", wireType) + } + var byteLen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowAccountAbstraction + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + byteLen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if byteLen < 0 { + return ErrInvalidLengthAccountAbstraction + } + postIndex := iNdEx + byteLen + if postIndex < 0 { + return ErrInvalidLengthAccountAbstraction + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.BodyBytes = append(m.BodyBytes[:0], dAtA[iNdEx:postIndex]...) + if m.BodyBytes == nil { + m.BodyBytes = []byte{} + } + iNdEx = postIndex default: iNdEx = preIndex skippy, err := skipAccountAbstraction(dAtA[iNdEx:]) diff --git a/x/auth/ante/sigverify.go b/x/auth/ante/sigverify.go index 0b08d1876ad7..1978bcc44fee 100644 --- a/x/auth/ante/sigverify.go +++ b/x/auth/ante/sigverify.go @@ -146,9 +146,14 @@ func (spkd SetPubKeyDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate b return next(ctx, tx, simulate) } -// SigVerificationDecorator verifies all signatures for a tx and return an error if any are invalid. Note, -// the SigVerificationDecorator will not check signatures on ReCheck. -// It will also increase the sequence number, and consume gas for signature verification. +// SigVerificationDecorator verifies all signatures for a tx and returns an +// error if any are invalid. Note, the SigVerificationDecorator will not check +// signatures on ReCheckTx. It will also increase the sequence number, and consume +// gas for signature verification. +// +// In cases where unordered or parallel transactions are desired, it is recommended +// to to set unordered=true with a reasonable timeout_height value, in which case +// this nonce verification and increment will be skipped. // // CONTRACT: Pubkeys are set in context for all signers before this decorator runs // CONTRACT: Tx must implement SigVerifiableTx interface @@ -277,11 +282,15 @@ func (svd SigVerificationDecorator) authenticate(ctx sdk.Context, tx sdk.Tx, sim return err } - err = svd.increaseSequence(ctx, acc) - if err != nil { - return err + // Bypass incrementing sequence for transactions with unordered set to true. + // The actual parameters of the un-ordered tx will be checked in a separate + // decorator. + unorderedTx, ok := tx.(sdk.TxWithUnordered) + if ok && unorderedTx.GetUnordered() { + return nil } - return nil + + return svd.increaseSequence(ctx, acc) } // consumeSignatureGas will consume gas according to the pub-key being verified. @@ -419,8 +428,7 @@ func (vscd ValidateSigCountDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim for _, pk := range pubKeys { sigCount += CountSubKeys(pk) if uint64(sigCount) > params.TxSigLimit { - return ctx, errorsmod.Wrapf(sdkerrors.ErrTooManySignatures, - "signatures: %d, limit: %d", sigCount, params.TxSigLimit) + return ctx, errorsmod.Wrapf(sdkerrors.ErrTooManySignatures, "signatures: %d, limit: %d", sigCount, params.TxSigLimit) } } @@ -430,10 +438,9 @@ func (vscd ValidateSigCountDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, sim // DefaultSigVerificationGasConsumer is the default implementation of SignatureVerificationGasConsumer. It consumes gas // for signature verification based upon the public key type. The cost is fetched from the given params and is matched // by the concrete type. -func DefaultSigVerificationGasConsumer( - meter storetypes.GasMeter, sig signing.SignatureV2, params types.Params, -) error { +func DefaultSigVerificationGasConsumer(meter storetypes.GasMeter, sig signing.SignatureV2, params types.Params) error { pubkey := sig.PubKey + switch pubkey := pubkey.(type) { case *ed25519.PubKey: meter.ConsumeGas(params.SigVerifyCostED25519, "ante verify: ed25519") @@ -452,10 +459,12 @@ func DefaultSigVerificationGasConsumer( if !ok { return fmt.Errorf("expected %T, got, %T", &signing.MultiSignatureData{}, sig.Data) } + err := ConsumeMultisignatureVerificationGas(meter, multisignature, pubkey, params, sig.Sequence) if err != nil { return err } + return nil default: @@ -480,10 +489,12 @@ func ConsumeMultisignatureVerificationGas( Data: sig.Signatures[sigIndex], Sequence: accSeq, } + err := DefaultSigVerificationGasConsumer(meter, sigV2, params) if err != nil { return err } + sigIndex++ } @@ -507,6 +518,7 @@ func CountSubKeys(pub cryptotypes.PubKey) int { if pub == nil { return 0 } + v, ok := pub.(*kmultisig.LegacyAminoPubKey) if !ok { return 1 @@ -532,6 +544,7 @@ func signatureDataToBz(data signing.SignatureData) ([][]byte, error) { switch data := data.(type) { case *signing.SingleSignatureData: return [][]byte{data.Signature}, nil + case *signing.MultiSignatureData: sigs := [][]byte{} var err error @@ -541,19 +554,22 @@ func signatureDataToBz(data signing.SignatureData) ([][]byte, error) { if err != nil { return nil, err } + sigs = append(sigs, nestedSigs...) } multiSignature := cryptotypes.MultiSignature{ Signatures: sigs, } + aggregatedSig, err := multiSignature.Marshal() if err != nil { return nil, err } - sigs = append(sigs, aggregatedSig) + sigs = append(sigs, aggregatedSig) return sigs, nil + default: return nil, sdkerrors.ErrInvalidType.Wrapf("unexpected signature data type %T", data) } diff --git a/x/auth/ante/unordered.go b/x/auth/ante/unordered.go new file mode 100644 index 000000000000..c110e63650ce --- /dev/null +++ b/x/auth/ante/unordered.go @@ -0,0 +1,74 @@ +package ante + +import ( + "crypto/sha256" + + errorsmod "cosmossdk.io/errors" + "cosmossdk.io/x/auth/ante/unorderedtx" + + sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" +) + +var _ sdk.AnteDecorator = (*UnorderedTxDecorator)(nil) + +// UnorderedTxDecorator defines an AnteHandler decorator that is responsible for +// checking if a transaction is intended to be unordered and if so, evaluates +// the transaction accordingly. An unordered transaction will bypass having it's +// nonce incremented, which allows fire-and-forget along with possible parallel +// transaction processing, without having to deal with nonces. +// +// The transaction sender must ensure that unordered=true and a timeout_height +// is appropriately set. The AnteHandler will check that the transaction is not +// a duplicate and will evict it from memory when the timeout is reached. +// +// The UnorderedTxDecorator should be placed as early as possible in the AnteHandler +// chain to ensure that during DeliverTx, the transaction is added to the UnorderedTxManager. +type UnorderedTxDecorator struct { + // maxUnOrderedTTL defines the maximum TTL a transaction can define. + maxUnOrderedTTL uint64 + txManager *unorderedtx.Manager +} + +func NewUnorderedTxDecorator(maxTTL uint64, m *unorderedtx.Manager) *UnorderedTxDecorator { + return &UnorderedTxDecorator{ + maxUnOrderedTTL: maxTTL, + txManager: m, + } +} + +func (d *UnorderedTxDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { + unorderedTx, ok := tx.(sdk.TxWithUnordered) + if !ok || !unorderedTx.GetUnordered() { + // If the transaction does not implement unordered capabilities or has the + // unordered value as false, we bypass. + return next(ctx, tx, simulate) + } + + // TTL is defined as a specific block height at which this tx is no longer valid + ttl := unorderedTx.GetTimeoutHeight() + + if ttl == 0 { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "unordered transaction must have timeout_height set") + } + if ttl < uint64(ctx.BlockHeight()) { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "unordered transaction has a timeout_height that has already passed") + } + if ttl > uint64(ctx.BlockHeight())+d.maxUnOrderedTTL { + return ctx, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "unordered tx ttl exceeds %d", d.maxUnOrderedTTL) + } + + txHash := sha256.Sum256(ctx.TxBytes()) + + // check for duplicates + if d.txManager.Contains(txHash) { + return ctx, errorsmod.Wrap(sdkerrors.ErrInvalidRequest, "tx %X is duplicated") + } + + if ctx.ExecMode() == sdk.ExecModeFinalize { + // a new tx included in the block, add the hash to the unordered tx manager + d.txManager.Add(txHash, ttl) + } + + return next(ctx, tx, simulate) +} diff --git a/x/auth/ante/unordered_test.go b/x/auth/ante/unordered_test.go new file mode 100644 index 000000000000..61653ee75a46 --- /dev/null +++ b/x/auth/ante/unordered_test.go @@ -0,0 +1,154 @@ +package ante_test + +import ( + "crypto/sha256" + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/x/auth/ante" + "cosmossdk.io/x/auth/ante/unorderedtx" + + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" + "github.com/cosmos/cosmos-sdk/testutil/testdata" + sdk "github.com/cosmos/cosmos-sdk/types" + "github.com/cosmos/cosmos-sdk/types/tx/signing" +) + +func TestUnorderedTxDecorator_OrderedTx(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + + tx, txBz := genUnorderedTx(t, false, 0) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) + + _, err := chain(ctx, tx, false) + require.NoError(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_NoTTL(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + + tx, txBz := genUnorderedTx(t, true, 0) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) + + _, err := chain(ctx, tx, false) + require.Error(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_InvalidTTL(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + + tx, txBz := genUnorderedTx(t, true, 100+unorderedtx.DefaultMaxUnOrderedTTL+1) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) + + _, err := chain(ctx, tx, false) + require.Error(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_AlreadyExists(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + + tx, txBz := genUnorderedTx(t, true, 150) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100) + + txHash := sha256.Sum256(txBz) + txm.Add(txHash, 150) + + _, err := chain(ctx, tx, false) + require.Error(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_ValidCheckTx(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + + tx, txBz := genUnorderedTx(t, true, 150) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100).WithExecMode(sdk.ExecModeCheck) + + _, err := chain(ctx, tx, false) + require.NoError(t, err) +} + +func TestUnorderedTxDecorator_UnorderedTx_ValidDeliverTx(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + chain := sdk.ChainAnteDecorators(ante.NewUnorderedTxDecorator(unorderedtx.DefaultMaxUnOrderedTTL, txm)) + + tx, txBz := genUnorderedTx(t, true, 150) + ctx := sdk.Context{}.WithTxBytes(txBz).WithBlockHeight(100).WithExecMode(sdk.ExecModeFinalize) + + _, err := chain(ctx, tx, false) + require.NoError(t, err) + + txHash := sha256.Sum256(txBz) + require.True(t, txm.Contains(txHash)) +} + +func genUnorderedTx(t *testing.T, unordered bool, ttl uint64) (sdk.Tx, []byte) { + t.Helper() + + s := SetupTestSuite(t, true) + s.txBuilder = s.clientCtx.TxConfig.NewTxBuilder() + + // keys and addresses + priv1, _, addr1 := testdata.KeyTestPubAddr() + + // msg and signatures + msg := testdata.NewTestMsg(addr1) + feeAmount := testdata.NewTestFeeAmount() + gasLimit := testdata.NewTestGasLimit() + require.NoError(t, s.txBuilder.SetMsgs(msg)) + + s.txBuilder.SetFeeAmount(feeAmount) + s.txBuilder.SetGasLimit(gasLimit) + s.txBuilder.SetUnordered(unordered) + s.txBuilder.SetTimeoutHeight(ttl) + + privKeys, accNums, accSeqs := []cryptotypes.PrivKey{priv1}, []uint64{0}, []uint64{0} + tx, err := s.CreateTestTx(s.ctx, privKeys, accNums, accSeqs, s.ctx.ChainID(), signing.SignMode_SIGN_MODE_DIRECT) + require.NoError(t, err) + + txBz, err := s.encCfg.TxConfig.TxEncoder()(tx) + require.NoError(t, err) + + return tx, txBz +} diff --git a/x/auth/ante/unorderedtx/manager.go b/x/auth/ante/unorderedtx/manager.go new file mode 100644 index 000000000000..14fbe018b83b --- /dev/null +++ b/x/auth/ante/unorderedtx/manager.go @@ -0,0 +1,285 @@ +package unorderedtx + +import ( + "bufio" + "bytes" + "context" + "encoding/binary" + "errors" + "fmt" + "io" + "os" + "path/filepath" + "sort" + "sync" + "time" + + "golang.org/x/exp/maps" +) + +const ( + // DefaultMaxUnOrderedTTL defines the default maximum TTL an un-ordered transaction + // can set. + DefaultMaxUnOrderedTTL = 1024 + + dirName = "unordered_txs" + fileName = "data" +) + +// TxHash defines a transaction hash type alias, which is a fixed array of 32 bytes. +type TxHash [32]byte + +// Manager contains the tx hash dictionary for duplicates checking, and expire +// them when block production progresses. +type Manager struct { + // blockCh defines a channel to receive newly committed block heights + blockCh chan uint64 + // doneCh allows us to ensure the purgeLoop has gracefully terminated prior to closing + doneCh chan struct{} + + // dataDir defines the directory to store unexpired unordered transactions + // + // XXX: Note, ideally we avoid the need to store unexpired unordered transactions + // directly to file. However, store v1 does not allow such a primitive. But, + // once store v2 is fully integrated, we can remove manual file handling and + // store the unexpired unordered transactions directly to SS. + // + // Ref: https://github.com/cosmos/cosmos-sdk/issues/18467 + dataDir string + + mu sync.RWMutex + // txHashes defines a map from tx hash -> TTL value, which is used for duplicate + // checking and replay protection, as well as purging the map when the TTL is + // expired. + txHashes map[TxHash]uint64 +} + +func NewManager(dataDir string) *Manager { + path := filepath.Join(dataDir, dirName) + if _, err := os.Stat(path); errors.Is(err, os.ErrNotExist) { + _ = os.Mkdir(path, os.ModePerm) + } + + m := &Manager{ + dataDir: dataDir, + blockCh: make(chan uint64, 16), + doneCh: make(chan struct{}), + txHashes: make(map[TxHash]uint64), + } + + return m +} + +func (m *Manager) Start() { + go m.purgeLoop() +} + +// Close must be called when a node gracefully shuts down. Typically, this should +// be called in an application's Close() function, which is called by the server. +// Note, Start() must be called in order for Close() to not hang. +// +// It will free all necessary resources as well as writing all unexpired unordered +// transactions along with their TTL values to file. +func (m *Manager) Close() error { + close(m.blockCh) + <-m.doneCh + m.blockCh = nil + + return m.flushToFile() +} + +func (m *Manager) Contains(hash TxHash) bool { + m.mu.RLock() + defer m.mu.RUnlock() + + _, ok := m.txHashes[hash] + return ok +} + +func (m *Manager) Size() int { + m.mu.RLock() + defer m.mu.RUnlock() + + return len(m.txHashes) +} + +func (m *Manager) Add(txHash TxHash, ttl uint64) { + m.mu.Lock() + defer m.mu.Unlock() + + m.txHashes[txHash] = ttl +} + +// OnInit must be called when a node starts up. Typically, this should be called +// in an application's constructor, which is called by the server. +func (m *Manager) OnInit() error { + f, err := os.Open(filepath.Join(m.dataDir, dirName, fileName)) + if err != nil { + if errors.Is(err, os.ErrNotExist) { + // File does not exist, which we can assume that there are no unexpired + // unordered transactions. + return nil + } + + return fmt.Errorf("failed to open unconfirmed txs file: %w", err) + } + defer f.Close() + + var ( + r = bufio.NewReader(f) + buf = make([]byte, chunkSize) + ) + for { + n, err := io.ReadFull(r, buf) + if err != nil { + if errors.Is(err, io.EOF) { + break + } else { + return fmt.Errorf("failed to read unconfirmed txs file: %w", err) + } + } + if n != 32+8 { + return fmt.Errorf("read unexpected number of bytes from unconfirmed txs file: %d", n) + } + + var txHash TxHash + copy(txHash[:], buf[:txHashSize]) + + m.Add(txHash, binary.BigEndian.Uint64(buf[txHashSize:])) + } + + return nil +} + +// OnNewBlock sends the latest block number to the background purge loop, which +// should be called in ABCI Commit event. +func (m *Manager) OnNewBlock(blockHeight uint64) { + m.blockCh <- blockHeight +} + +func (m *Manager) exportSnapshot(height uint64, snapshotWriter func([]byte) error) error { + var buf bytes.Buffer + w := bufio.NewWriter(&buf) + + keys := maps.Keys(m.txHashes) + sort.Slice(keys, func(i, j int) bool { return bytes.Compare(keys[i][:], keys[j][:]) < 0 }) + + for _, txHash := range keys { + ttl := m.txHashes[txHash] + if height > ttl { + // skip expired txs that have yet to be purged + continue + } + + chunk := unorderedTxToBytes(txHash, ttl) + + if _, err := w.Write(chunk); err != nil { + return fmt.Errorf("failed to write unordered tx to buffer: %w", err) + } + } + + if err := w.Flush(); err != nil { + return fmt.Errorf("failed to flush unordered txs buffer: %w", err) + } + + return snapshotWriter(buf.Bytes()) +} + +// flushToFile writes all unexpired unordered transactions along with their TTL +// to file, overwriting the existing file if it exists. +func (m *Manager) flushToFile() error { + f, err := os.Create(filepath.Join(m.dataDir, dirName, fileName)) + if err != nil { + return fmt.Errorf("failed to create unordered txs file: %w", err) + } + defer f.Close() + + w := bufio.NewWriter(f) + for txHash, ttl := range m.txHashes { + chunk := unorderedTxToBytes(txHash, ttl) + + if _, err = w.Write(chunk); err != nil { + return fmt.Errorf("failed to write unordered tx to buffer: %w", err) + } + } + + if err = w.Flush(); err != nil { + return fmt.Errorf("failed to flush unordered txs buffer: %w", err) + } + + return nil +} + +// expiredTxs returns expired tx hashes based on the provided block height. +func (m *Manager) expiredTxs(blockHeight uint64) []TxHash { + m.mu.RLock() + defer m.mu.RUnlock() + + var result []TxHash + for txHash, ttl := range m.txHashes { + if blockHeight > ttl { + result = append(result, txHash) + } + } + + return result +} + +func (m *Manager) purge(txHashes []TxHash) { + m.mu.Lock() + defer m.mu.Unlock() + + for _, txHash := range txHashes { + delete(m.txHashes, txHash) + } +} + +// purgeLoop removes expired tx hashes in the background +func (m *Manager) purgeLoop() { + for { + latestHeight, ok := m.batchReceive() + if !ok { + // channel closed + m.doneCh <- struct{}{} + return + } + + hashes := m.expiredTxs(latestHeight) + if len(hashes) > 0 { + m.purge(hashes) + } + } +} + +func (m *Manager) batchReceive() (uint64, bool) { + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + + var latestHeight uint64 + for { + select { + case <-ctx.Done(): + return latestHeight, true + + case blockHeight, ok := <-m.blockCh: + if !ok { + // channel is closed + return 0, false + } + if blockHeight > latestHeight { + latestHeight = blockHeight + } + } + } +} + +func unorderedTxToBytes(txHash TxHash, ttl uint64) []byte { + chunk := make([]byte, chunkSize) + copy(chunk[:txHashSize], txHash[:]) + + ttlBz := make([]byte, ttlSize) + binary.BigEndian.PutUint64(ttlBz, ttl) + copy(chunk[txHashSize:], ttlBz) + + return chunk +} diff --git a/x/auth/ante/unorderedtx/manager_test.go b/x/auth/ante/unorderedtx/manager_test.go new file mode 100644 index 000000000000..04138e344657 --- /dev/null +++ b/x/auth/ante/unorderedtx/manager_test.go @@ -0,0 +1,150 @@ +package unorderedtx_test + +import ( + "testing" + "time" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/x/auth/ante/unorderedtx" +) + +func TestUnorderedTxManager_Close(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + txm.Start() + + require.NoError(t, txm.Close()) + require.Panics(t, func() { txm.Close() }) +} + +func TestUnorderedTxManager_SimpleSize(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + txm.Add([32]byte{0xFF}, 100) + txm.Add([32]byte{0xAA}, 100) + txm.Add([32]byte{0xCC}, 100) + + require.Equal(t, 3, txm.Size()) +} + +func TestUnorderedTxManager_SimpleContains(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + for i := 0; i < 10; i++ { + txHash := [32]byte{byte(i)} + txm.Add(txHash, 100) + require.True(t, txm.Contains(txHash)) + } + + for i := 10; i < 20; i++ { + txHash := [32]byte{byte(i)} + require.False(t, txm.Contains(txHash)) + } +} + +func TestUnorderedTxManager_InitEmpty(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + require.NoError(t, txm.OnInit()) +} + +func TestUnorderedTxManager_CloseInit(t *testing.T) { + dataDir := t.TempDir() + txm := unorderedtx.NewManager(dataDir) + txm.Start() + + // add a handful of unordered txs + for i := 0; i < 100; i++ { + txm.Add([32]byte{byte(i)}, 100) + } + + // close the manager, which should flush all unexpired txs to file + require.NoError(t, txm.Close()) + + // create a new manager, start it + txm2 := unorderedtx.NewManager(dataDir) + defer func() { + require.NoError(t, txm2.Close()) + }() + + // start and execute OnInit, which should load the unexpired txs from file + txm2.Start() + require.NoError(t, txm2.OnInit()) + require.Equal(t, 100, txm2.Size()) + + for i := 0; i < 100; i++ { + require.True(t, txm2.Contains([32]byte{byte(i)})) + } +} + +func TestUnorderedTxManager_Flow(t *testing.T) { + txm := unorderedtx.NewManager(t.TempDir()) + defer func() { + require.NoError(t, txm.Close()) + }() + + txm.Start() + + // Seed the manager with a txs, some of which should eventually be purged and + // the others will remain. Txs with TTL less than or equal to 50 should be purged. + for i := 1; i <= 100; i++ { + txHash := [32]byte{byte(i)} + + if i <= 50 { + txm.Add(txHash, uint64(i)) + } else { + txm.Add(txHash, 100) + } + } + + // start a goroutine that mimics new blocks being made every 500ms + doneBlockCh := make(chan bool) + go func() { + ticker := time.NewTicker(time.Millisecond * 500) + defer ticker.Stop() + + var ( + height uint64 = 1 + i = 101 + ) + for range ticker.C { + txm.OnNewBlock(height) + height++ + + if height > 51 { + doneBlockCh <- true + return + } else { + txm.Add([32]byte{byte(i)}, 50) + } + } + }() + + // Eventually all the txs that should be expired by block 50 should be purged. + // The remaining txs should remain. + require.Eventually( + t, + func() bool { + return txm.Size() == 50 + }, + 2*time.Minute, + 5*time.Second, + ) + + <-doneBlockCh +} diff --git a/x/auth/ante/unorderedtx/snapshotter.go b/x/auth/ante/unorderedtx/snapshotter.go new file mode 100644 index 000000000000..5941a11a6888 --- /dev/null +++ b/x/auth/ante/unorderedtx/snapshotter.go @@ -0,0 +1,92 @@ +package unorderedtx + +import ( + "encoding/binary" + "errors" + "io" + + snapshot "cosmossdk.io/store/snapshots/types" +) + +const ( + txHashSize = 32 + ttlSize = 8 + chunkSize = txHashSize + ttlSize +) + +var _ snapshot.ExtensionSnapshotter = &Snapshotter{} + +const ( + // SnapshotFormat defines the snapshot format of exported unordered transactions. + // No protobuf envelope, no metadata. + SnapshotFormat = 1 + + // SnapshotName defines the snapshot name of exported unordered transactions. + SnapshotName = "unordered_txs" +) + +type Snapshotter struct { + m *Manager +} + +func NewSnapshotter(m *Manager) *Snapshotter { + return &Snapshotter{m: m} +} + +func (s *Snapshotter) SnapshotName() string { + return SnapshotName +} + +func (s *Snapshotter) SnapshotFormat() uint32 { + return SnapshotFormat +} + +func (s *Snapshotter) SupportedFormats() []uint32 { + return []uint32{SnapshotFormat} +} + +func (s *Snapshotter) SnapshotExtension(height uint64, payloadWriter snapshot.ExtensionPayloadWriter) error { + // export all unordered transactions as a single blob + return s.m.exportSnapshot(height, payloadWriter) +} + +func (s *Snapshotter) RestoreExtension(height uint64, format uint32, payloadReader snapshot.ExtensionPayloadReader) error { + if format == SnapshotFormat { + return s.restore(height, payloadReader) + } + + return snapshot.ErrUnknownFormat +} + +func (s *Snapshotter) restore(height uint64, payloadReader snapshot.ExtensionPayloadReader) error { + // the payload should be the entire set of unordered transactions + payload, err := payloadReader() + if err != nil { + if errors.Is(err, io.EOF) { + return io.ErrUnexpectedEOF + } + + return err + } + + if len(payload)%chunkSize != 0 { + return errors.New("invalid unordered txs payload length") + } + + var i int + for i < len(payload) { + var txHash TxHash + copy(txHash[:], payload[i:i+txHashSize]) + + ttl := binary.BigEndian.Uint64(payload[i+txHashSize : i+chunkSize]) + + if height < ttl { + // only add unordered transactions that are still valid, i.e. unexpired + s.m.Add(txHash, ttl) + } + + i += chunkSize + } + + return nil +} diff --git a/x/auth/ante/unorderedtx/snapshotter_test.go b/x/auth/ante/unorderedtx/snapshotter_test.go new file mode 100644 index 000000000000..1645fbb90677 --- /dev/null +++ b/x/auth/ante/unorderedtx/snapshotter_test.go @@ -0,0 +1,56 @@ +package unorderedtx_test + +import ( + "testing" + + "github.com/stretchr/testify/require" + + "cosmossdk.io/x/auth/ante/unorderedtx" +) + +func TestSnapshotter(t *testing.T) { + dataDir := t.TempDir() + txm := unorderedtx.NewManager(dataDir) + + // add a handful of unordered txs + for i := 0; i < 100; i++ { + txm.Add([32]byte{byte(i)}, 100) + } + + var unorderedTxBz []byte + s := unorderedtx.NewSnapshotter(txm) + w := func(bz []byte) error { + unorderedTxBz = bz + return nil + } + + err := s.SnapshotExtension(50, w) + require.NoError(t, err) + require.NotEmpty(t, unorderedTxBz) + + pr := func() ([]byte, error) { + return unorderedTxBz, nil + } + + // restore with an invalid format which should result in an error + err = s.RestoreExtension(50, 2, pr) + require.Error(t, err) + + // restore with height > ttl which should result in no unordered txs synced + txm2 := unorderedtx.NewManager(dataDir) + s2 := unorderedtx.NewSnapshotter(txm2) + err = s2.RestoreExtension(200, unorderedtx.SnapshotFormat, pr) + require.NoError(t, err) + require.Empty(t, txm2.Size()) + + // restore with with height < ttl which should result in all unordered txs synced + txm3 := unorderedtx.NewManager(dataDir) + s3 := unorderedtx.NewSnapshotter(txm3) + err = s3.RestoreExtension(50, unorderedtx.SnapshotFormat, pr) + require.NoError(t, err) + require.Equal(t, 100, txm3.Size()) + + for i := 0; i < 100; i++ { + require.True(t, txm3.Contains([32]byte{byte(i)})) + } +} diff --git a/x/auth/go.mod b/x/auth/go.mod index 8a3ec98113c3..6a34013d0eb6 100644 --- a/x/auth/go.mod +++ b/x/auth/go.mod @@ -27,9 +27,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/viper v1.18.2 github.com/stretchr/testify v1.8.4 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 pgregory.net/rapid v1.1.0 sigs.k8s.io/yaml v1.4.0 @@ -50,9 +51,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -102,7 +102,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -122,12 +122,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -148,10 +148,9 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/auth/go.sum b/x/auth/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/auth/go.sum +++ b/x/auth/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/auth/signing/sig_verifiable_tx.go b/x/auth/signing/sig_verifiable_tx.go index c8a752e7e475..4c6934c1c8e7 100644 --- a/x/auth/signing/sig_verifiable_tx.go +++ b/x/auth/signing/sig_verifiable_tx.go @@ -22,6 +22,6 @@ type Tx interface { types.TxWithMemo types.FeeTx - types.TxWithTimeoutHeight + types.TxWithUnordered types.HasValidateBasic } diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index 3539c3dbcff3..ba7955b0ec57 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -221,6 +221,11 @@ func (w *wrapper) GetTimeoutHeight() uint64 { return w.tx.Body.TimeoutHeight } +// GetUnordered returns the transaction's unordered field (if set). +func (w *wrapper) GetUnordered() bool { + return w.tx.Body.Unordered +} + func (w *wrapper) GetSignaturesV2() ([]signing.SignatureV2, error) { signerInfos := w.tx.AuthInfo.SignerInfos sigs := w.tx.Signatures @@ -283,6 +288,13 @@ func (w *wrapper) SetTimeoutHeight(height uint64) { w.bodyBz = nil } +func (w *wrapper) SetUnordered(v bool) { + w.tx.Body.Unordered = v + + // set bodyBz to nil because the cached bodyBz no longer matches tx.Body + w.bodyBz = nil +} + func (w *wrapper) SetMemo(memo string) { w.tx.Body.Memo = memo diff --git a/x/auth/tx/encode_decode_test.go b/x/auth/tx/encode_decode_test.go index ae44448213a8..d2c1fff5fdab 100644 --- a/x/auth/tx/encode_decode_test.go +++ b/x/auth/tx/encode_decode_test.go @@ -65,6 +65,8 @@ func TestUnknownFields(t *testing.T) { shouldErr: false, }, { + // If new fields are added to TxBody the number for some_new_field in the proto definition must be set to + // one that it's not used in TxBody. name: "critical fields in TxBody should error on decode", body: &testdata.TestUpdatedTxBody{ Memo: "foo", diff --git a/x/authz/go.mod b/x/authz/go.mod index 5e9dd14365cb..345dad31254f 100644 --- a/x/authz/go.mod +++ b/x/authz/go.mod @@ -26,7 +26,7 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( @@ -48,9 +48,8 @@ require ( 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 - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -102,7 +101,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -123,12 +122,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -150,10 +149,10 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/authz/go.sum b/x/authz/go.sum index 0331af0dd9a6..a818346678e1 100644 --- a/x/authz/go.sum +++ b/x/authz/go.sum @@ -113,20 +113,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -438,8 +434,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -593,8 +589,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -626,8 +622,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -766,8 +762,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -824,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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -980,8 +976,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/bank/go.mod b/x/bank/go.mod index 08090b65dd35..11ac8f5216f4 100644 --- a/x/bank/go.mod +++ b/x/bank/go.mod @@ -44,9 +44,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -97,7 +96,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -117,12 +116,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -144,17 +143,17 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.16.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/bank/go.sum b/x/bank/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/bank/go.sum +++ b/x/bank/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/bank/keeper/msg_server.go b/x/bank/keeper/msg_server.go index 99a33c080201..548d4fdd11fe 100644 --- a/x/bank/keeper/msg_server.go +++ b/x/bank/keeper/msg_server.go @@ -2,7 +2,6 @@ package keeper import ( "context" - "fmt" "github.com/hashicorp/go-metrics" @@ -201,7 +200,7 @@ func (k msgServer) Burn(goCtx context.Context, msg *types.MsgBurn) (*types.MsgBu if !coins.IsValid() { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidCoins, coins.String()) } - fmt.Println("coins", coins) + if !coins.IsAllPositive() { return nil, errorsmod.Wrap(sdkerrors.ErrInvalidCoins, coins.String()) } diff --git a/x/circuit/go.mod b/x/circuit/go.mod index 62cf20bc44ac..9527e1e8df40 100644 --- a/x/circuit/go.mod +++ b/x/circuit/go.mod @@ -39,9 +39,8 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -96,7 +95,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -116,12 +115,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -144,17 +143,17 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.16.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/circuit/go.sum b/x/circuit/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/circuit/go.sum +++ b/x/circuit/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/distribution/go.mod b/x/distribution/go.mod index a61c3d88f056..2fad0f6dc664 100644 --- a/x/distribution/go.mod +++ b/x/distribution/go.mod @@ -48,9 +48,8 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -101,7 +100,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -120,12 +119,12 @@ require ( github.com/pelletier/go-toml/v2 v2.1.1 // indirect github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - github.com/prometheus/client_golang v1.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -147,17 +146,17 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.16.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/distribution/go.sum b/x/distribution/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/distribution/go.sum +++ b/x/distribution/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/distribution/keeper/hooks.go b/x/distribution/keeper/hooks.go index 924744f9035d..46605690c26f 100644 --- a/x/distribution/keeper/hooks.go +++ b/x/distribution/keeper/hooks.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/x/distribution/types" stakingtypes "cosmossdk.io/x/staking/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -187,3 +188,7 @@ func (h Hooks) BeforeDelegationRemoved(_ context.Context, _ sdk.AccAddress, _ sd func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error { return nil } + +func (h Hooks) AfterConsensusPubKeyUpdate(_ context.Context, _, _ cryptotypes.PubKey, _ sdk.Coin) error { + return nil +} diff --git a/x/evidence/go.mod b/x/evidence/go.mod index b247fd5ad499..8eb753e1bc62 100644 --- a/x/evidence/go.mod +++ b/x/evidence/go.mod @@ -26,7 +26,7 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( @@ -46,9 +46,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -100,7 +99,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -120,12 +119,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -147,10 +146,10 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/evidence/go.sum b/x/evidence/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/evidence/go.sum +++ b/x/evidence/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/evidence/keeper/infraction.go b/x/evidence/keeper/infraction.go index f8979c708750..2cffa540f7d9 100644 --- a/x/evidence/keeper/infraction.go +++ b/x/evidence/keeper/infraction.go @@ -40,6 +40,15 @@ func (k Keeper) handleEquivocationEvidence(ctx context.Context, evidence *types. } if len(validator.GetOperator()) != 0 { + // Get the consAddr from the validator read from the store and not from the evidence, + // because if the validator has rotated its key, the key in evidence could be outdated. + // (ValidatorByConsAddr can get a validator even if the key has been rotated) + valConsAddr, err := validator.GetConsAddr() + if err != nil { + return err + } + consAddr = valConsAddr + if _, err := k.slashingKeeper.GetPubkey(ctx, consAddr.Bytes()); err != nil { // Ignore evidence that cannot be handled. // diff --git a/x/feegrant/go.mod b/x/feegrant/go.mod index 7b0e023bd5af..0f975e57c59b 100644 --- a/x/feegrant/go.mod +++ b/x/feegrant/go.mod @@ -26,7 +26,7 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 ) @@ -48,9 +48,8 @@ require ( 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 - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -102,7 +101,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -123,12 +122,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -150,10 +149,10 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/feegrant/go.sum b/x/feegrant/go.sum index 3b6cf582fb0a..aa8a920b3c3d 100644 --- a/x/feegrant/go.sum +++ b/x/feegrant/go.sum @@ -115,20 +115,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -440,8 +436,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -595,8 +591,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -628,8 +624,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -768,8 +764,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -826,8 +822,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -982,8 +978,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/gov/CHANGELOG.md b/x/gov/CHANGELOG.md index 26e15e70a682..a22fc538d9d4 100644 --- a/x/gov/CHANGELOG.md +++ b/x/gov/CHANGELOG.md @@ -30,10 +30,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Add SPAM vote to proposals. * [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Add proposal types to proposals. * [#18620](https://github.com/cosmos/cosmos-sdk/pull/18620) Add optimistic proposals. +* [#18762](https://github.com/cosmos/cosmos-sdk/pull/18762) Add multiple choice proposals. ### Improvements -* [#18445](https://github.com/cosmos/cosmos-sdk/pull/18445) Extend gov config +* [#18856](https://github.com/cosmos/cosmos-sdk/pull/18856) Add `ProposalCancelMaxPeriod` for modifying how long a proposal can be cancelled after it has been submitted. +* [#18445](https://github.com/cosmos/cosmos-sdk/pull/18445) Extend gov config. * [#18532](https://github.com/cosmos/cosmos-sdk/pull/18532) Repurpose `govcliutils.NormalizeProposalType` to work for gov v1 proposal types. ### API Breaking Changes diff --git a/x/gov/README.md b/x/gov/README.md index 93eb4eb17b52..1f5538746292 100644 --- a/x/gov/README.md +++ b/x/gov/README.md @@ -461,12 +461,21 @@ More information on how to submit proposals in the [client section](#client). ### Proposal Submission -Proposals can be submitted by any account via a `MsgSubmitProposal` transaction. +Proposals can be submitted by any account via a `MsgSubmitProposal` or a `MsgSubmitMultipleChoiceProposal` transaction. ```protobuf reference https://github.com/cosmos/cosmos-sdk/blob/v0.47.0-rc1/proto/cosmos/gov/v1/tx.proto#L42-L69 ``` +:::note +A multiple choice proposal is a proposal where the voting options can be defined by the proposer. +It cannot have messages to execute. It is only a text proposal. +::: + +:::warning +Submitting a multiple choice proposal using `MsgSubmitProposal` is invalid, as vote options cannot be defined. +::: + All `sdk.Msgs` passed into the `messages` field of a `MsgSubmitProposal` message must be registered in the app's `MsgServiceRouter`. Each of these messages must have one signer, namely the gov module account. And finally, the metadata length @@ -540,7 +549,7 @@ The governance module emits the following events: ### Handlers -#### MsgSubmitProposal +#### MsgSubmitProposal, MsgSubmitMultipleChoiceProposal | Type | Attribute Key | Attribute Value | | ------------------- | ------------------- | --------------- | @@ -591,23 +600,26 @@ The governance module emits the following events: The governance module contains the following parameters: -| Key | Type | Example | -| ------------------------------- | ---------------------- | --------------------------------------- | -| min_deposit | array (coins) | [{"denom":"uatom","amount":"10000000"}] | -| max_deposit_period | string (time ns) | "172800000000000" (17280s) | -| voting_period | string (time ns) | "172800000000000" (17280s) | -| quorum | string (dec) | "0.334000000000000000" | -| threshold | string (dec) | "0.500000000000000000" | -| veto | string (dec) | "0.334000000000000000" | -| expedited_threshold | string (time ns) | "0.667000000000000000" | -| expedited_voting_period | string (time ns) | "86400000000000" (8600s) | -| expedited_min_deposit | array (coins) | [{"denom":"uatom","amount":"50000000"}] | -| burn_proposal_deposit_prevote | bool | false | -| burn_vote_quorum | bool | false | -| burn_vote_veto | bool | true | -| min_initial_deposit_ratio | string | "0.1" | -| optimistic_rejected_threshold | string (dec) | "0.1" | -| optimistic_authorized_addresses | bytes array (addresses) | [][] | +| Key | Type | Example | +| ------------------------------- | ----------------- | --------------------------------------- | +| min_deposit | array (coins) | [{"denom":"uatom","amount":"10000000"}] | +| max_deposit_period | string (time ns) | "172800000000000" (17280s) | +| voting_period | string (time ns) | "172800000000000" (17280s) | +| quorum | string (dec) | "0.334000000000000000" | +| threshold | string (dec) | "0.500000000000000000" | +| veto | string (dec) | "0.334000000000000000" | +| expedited_threshold | string (time ns) | "0.667000000000000000" | +| expedited_voting_period | string (time ns) | "86400000000000" (8600s) | +| expedited_min_deposit | array (coins) | [{"denom":"uatom","amount":"50000000"}] | +| burn_proposal_deposit_prevote | bool | false | +| burn_vote_quorum | bool | false | +| burn_vote_veto | bool | true | +| min_initial_deposit_ratio | string | "0.1" | +| proposal_cancel_ratio | string (dec) | "0.5" | +| proposal_cancel_dest | string (address) | "cosmos1.." or empty for burn | +| proposal_cancel_max_period | string (dec) | "0.5" | +| optimistic_rejected_threshold | string (dec) | "0.1" | +| optimistic_authorized_addresses | array (addresses) | [] | **NOTE**: The governance module contains parameters that are objects unlike other modules. If only a subset of parameters are desired to be changed, only they need diff --git a/x/gov/abci.go b/x/gov/abci.go index db0cb1dbb439..cc1fa9724774 100644 --- a/x/gov/abci.go +++ b/x/gov/abci.go @@ -267,10 +267,7 @@ func EndBlocker(ctx sdk.Context, keeper *keeper.Keeper) error { return false, nil }) - if err != nil { - return err - } - return nil + return err } // executes handle(msg) and recovers from panic. diff --git a/x/gov/go.mod b/x/gov/go.mod index 9362f7af4567..f98ef7577d5d 100644 --- a/x/gov/go.mod +++ b/x/gov/go.mod @@ -26,10 +26,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 ) @@ -50,9 +50,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -104,7 +103,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -124,12 +123,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -152,7 +151,7 @@ require ( golang.org/x/crypto v0.17.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 + golang.org/x/sync v0.6.0 golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/gov/go.sum b/x/gov/go.sum index 0331af0dd9a6..a818346678e1 100644 --- a/x/gov/go.sum +++ b/x/gov/go.sum @@ -113,20 +113,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -438,8 +434,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -593,8 +589,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -626,8 +622,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -766,8 +762,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -824,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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -980,8 +976,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/gov/keeper/deposit.go b/x/gov/keeper/deposit.go index 196fe346e590..b0c6ed7926bf 100644 --- a/x/gov/keeper/deposit.go +++ b/x/gov/keeper/deposit.go @@ -17,17 +17,17 @@ import ( ) // SetDeposit sets a Deposit to the gov store -func (keeper Keeper) SetDeposit(ctx context.Context, deposit v1.Deposit) error { - depositor, err := keeper.authKeeper.AddressCodec().StringToBytes(deposit.Depositor) +func (k Keeper) SetDeposit(ctx context.Context, deposit v1.Deposit) error { + depositor, err := k.authKeeper.AddressCodec().StringToBytes(deposit.Depositor) if err != nil { return err } - return keeper.Deposits.Set(ctx, collections.Join(deposit.ProposalId, sdk.AccAddress(depositor)), deposit) + return k.Deposits.Set(ctx, collections.Join(deposit.ProposalId, sdk.AccAddress(depositor)), deposit) } // GetDeposits returns all the deposits of a proposal -func (keeper Keeper) GetDeposits(ctx context.Context, proposalID uint64) (deposits v1.Deposits, err error) { - err = keeper.IterateDeposits(ctx, proposalID, func(_ collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (bool, error) { +func (k Keeper) GetDeposits(ctx context.Context, proposalID uint64) (deposits v1.Deposits, err error) { + err = k.IterateDeposits(ctx, proposalID, func(_ collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (bool, error) { deposits = append(deposits, &deposit) return false, nil }) @@ -35,23 +35,23 @@ func (keeper Keeper) GetDeposits(ctx context.Context, proposalID uint64) (deposi } // DeleteAndBurnDeposits deletes and burns all the deposits on a specific proposal. -func (keeper Keeper) DeleteAndBurnDeposits(ctx context.Context, proposalID uint64) error { +func (k Keeper) DeleteAndBurnDeposits(ctx context.Context, proposalID uint64) error { coinsToBurn := sdk.NewCoins() - err := keeper.IterateDeposits(ctx, proposalID, func(key collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (stop bool, err error) { + err := k.IterateDeposits(ctx, proposalID, func(key collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (stop bool, err error) { coinsToBurn = coinsToBurn.Add(deposit.Amount...) - return false, keeper.Deposits.Remove(ctx, key) + return false, k.Deposits.Remove(ctx, key) }) if err != nil { return err } - return keeper.bankKeeper.BurnCoins(ctx, keeper.authKeeper.GetModuleAddress(types.ModuleName), coinsToBurn) + return k.bankKeeper.BurnCoins(ctx, k.authKeeper.GetModuleAddress(types.ModuleName), coinsToBurn) } // IterateDeposits iterates over all the proposals deposits and performs a callback function -func (keeper Keeper) IterateDeposits(ctx context.Context, proposalID uint64, cb func(key collections.Pair[uint64, sdk.AccAddress], value v1.Deposit) (bool, error)) error { +func (k Keeper) IterateDeposits(ctx context.Context, proposalID uint64, cb func(key collections.Pair[uint64, sdk.AccAddress], value v1.Deposit) (bool, error)) error { rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) - if err := keeper.Deposits.Walk(ctx, rng, cb); err != nil { + if err := k.Deposits.Walk(ctx, rng, cb); err != nil { return err } @@ -60,9 +60,9 @@ func (keeper Keeper) IterateDeposits(ctx context.Context, proposalID uint64, cb // AddDeposit adds or updates a deposit of a specific depositor on a specific proposal. // Activates voting period when appropriate and returns true in that case, else returns false. -func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress, depositAmount sdk.Coins) (bool, error) { +func (k Keeper) AddDeposit(ctx context.Context, proposalID uint64, depositorAddr sdk.AccAddress, depositAmount sdk.Coins) (bool, error) { // Checks to see if proposal exists - proposal, err := keeper.Proposals.Get(ctx, proposalID) + proposal, err := k.Proposals.Get(ctx, proposalID) if err != nil { return false, err } @@ -73,7 +73,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // Check coins to be deposited match the proposal's deposit params - params, err := keeper.Params.Get(ctx) + params, err := k.Params.Get(ctx) if err != nil { return false, err } @@ -85,7 +85,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // the deposit must only contain valid denoms (listed in the min deposit param) - if err := keeper.validateDepositDenom(ctx, params, depositAmount); err != nil { + if err := k.validateDepositDenom(ctx, params, depositAmount); err != nil { return false, err } @@ -121,14 +121,14 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // update the governance module's account coins pool - err = keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) + err = k.bankKeeper.SendCoinsFromAccountToModule(ctx, depositorAddr, types.ModuleName, depositAmount) if err != nil { return false, err } // Update proposal proposal.TotalDeposit = sdk.NewCoins(proposal.TotalDeposit...).Add(depositAmount...) - err = keeper.SetProposal(ctx, proposal) + err = k.SetProposal(ctx, proposal) if err != nil { return false, err } @@ -136,7 +136,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito // Check if deposit has provided sufficient total funds to transition the proposal into the voting period activatedVotingPeriod := false if proposal.Status == v1.StatusDepositPeriod && sdk.NewCoins(proposal.TotalDeposit...).IsAllGTE(minDepositAmount) { - err = keeper.ActivateVotingPeriod(ctx, proposal) + err = k.ActivateVotingPeriod(ctx, proposal) if err != nil { return false, err } @@ -145,7 +145,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // Add or update deposit object - deposit, err := keeper.Deposits.Get(ctx, collections.Join(proposalID, depositorAddr)) + deposit, err := k.Deposits.Get(ctx, collections.Join(proposalID, depositorAddr)) switch { case err == nil: // deposit exists @@ -159,7 +159,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito } // called when deposit has been added to a proposal, however the proposal may not be active - err = keeper.Hooks().AfterProposalDeposit(ctx, proposalID, depositorAddr) + err = k.Hooks().AfterProposalDeposit(ctx, proposalID, depositorAddr) if err != nil { return false, err } @@ -173,7 +173,7 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito ), ) - err = keeper.SetDeposit(ctx, deposit) + err = k.SetDeposit(ctx, deposit) if err != nil { return false, err } @@ -184,17 +184,17 @@ func (keeper Keeper) AddDeposit(ctx context.Context, proposalID uint64, deposito // ChargeDeposit will charge proposal cancellation fee (deposits * proposal_cancel_burn_rate) and // send to a destAddress if defined or burn otherwise. // Remaining funds are send back to the depositor. -func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destAddress, proposalCancelRate string) error { +func (k Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destAddress, proposalCancelRate string) error { rate := sdkmath.LegacyMustNewDecFromStr(proposalCancelRate) var cancellationCharges sdk.Coins - deposits, err := keeper.GetDeposits(ctx, proposalID) + deposits, err := k.GetDeposits(ctx, proposalID) if err != nil { return err } for _, deposit := range deposits { - depositerAddress, err := keeper.authKeeper.AddressCodec().StringToBytes(deposit.Depositor) + depositerAddress, err := k.authKeeper.AddressCodec().StringToBytes(deposit.Depositor) if err != nil { return err } @@ -219,14 +219,14 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA } if !remainingAmount.IsZero() { - err := keeper.bankKeeper.SendCoinsFromModuleToAccount( + err := k.bankKeeper.SendCoinsFromModuleToAccount( ctx, types.ModuleName, depositerAddress, remainingAmount, ) if err != nil { return err } } - err = keeper.Deposits.Remove(ctx, collections.Join(deposit.ProposalId, sdk.AccAddress(depositerAddress))) + err = k.Deposits.Remove(ctx, collections.Join(deposit.ProposalId, sdk.AccAddress(depositerAddress))) if err != nil { return err } @@ -235,25 +235,25 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA // burn the cancellation fee or send the cancellation charges to destination address. if !cancellationCharges.IsZero() { // get the pool module account address - poolAddress := keeper.authKeeper.GetModuleAddress(pooltypes.ModuleName) + poolAddress := k.authKeeper.GetModuleAddress(pooltypes.ModuleName) switch { case destAddress == "": // burn the cancellation charges from deposits - err := keeper.bankKeeper.BurnCoins(ctx, keeper.authKeeper.GetModuleAddress(types.ModuleName), cancellationCharges) + err := k.bankKeeper.BurnCoins(ctx, k.authKeeper.GetModuleAddress(types.ModuleName), cancellationCharges) if err != nil { return err } case poolAddress.String() == destAddress: - err := keeper.poolKeeper.FundCommunityPool(ctx, cancellationCharges, keeper.ModuleAccountAddress()) + err := k.poolKeeper.FundCommunityPool(ctx, cancellationCharges, k.ModuleAccountAddress()) if err != nil { return err } default: - destAccAddress, err := keeper.authKeeper.AddressCodec().StringToBytes(destAddress) + destAccAddress, err := k.authKeeper.AddressCodec().StringToBytes(destAddress) if err != nil { return err } - err = keeper.bankKeeper.SendCoinsFromModuleToAccount( + err = k.bankKeeper.SendCoinsFromModuleToAccount( ctx, types.ModuleName, destAccAddress, cancellationCharges, ) if err != nil { @@ -266,14 +266,14 @@ func (keeper Keeper) ChargeDeposit(ctx context.Context, proposalID uint64, destA } // RefundAndDeleteDeposits refunds and deletes all the deposits on a specific proposal. -func (keeper Keeper) RefundAndDeleteDeposits(ctx context.Context, proposalID uint64) error { - return keeper.IterateDeposits(ctx, proposalID, func(key collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (bool, error) { +func (k Keeper) RefundAndDeleteDeposits(ctx context.Context, proposalID uint64) error { + return k.IterateDeposits(ctx, proposalID, func(key collections.Pair[uint64, sdk.AccAddress], deposit v1.Deposit) (bool, error) { depositor := key.K2() - err := keeper.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, deposit.Amount) + err := k.bankKeeper.SendCoinsFromModuleToAccount(ctx, types.ModuleName, depositor, deposit.Amount) if err != nil { return false, err } - err = keeper.Deposits.Remove(ctx, key) + err = k.Deposits.Remove(ctx, key) return false, err }) } @@ -281,7 +281,7 @@ func (keeper Keeper) RefundAndDeleteDeposits(ctx context.Context, proposalID uin // validateInitialDeposit validates if initial deposit is greater than or equal to the minimum // required at the time of proposal submission. This threshold amount is determined by // the deposit parameters. Returns nil on success, error otherwise. -func (keeper Keeper) validateInitialDeposit(ctx context.Context, params v1.Params, initialDeposit sdk.Coins, proposalType v1.ProposalType) error { +func (k Keeper) validateInitialDeposit(ctx context.Context, params v1.Params, initialDeposit sdk.Coins, proposalType v1.ProposalType) error { if !initialDeposit.IsValid() || initialDeposit.IsAnyNegative() { return errors.Wrap(sdkerrors.ErrInvalidCoins, initialDeposit.String()) } @@ -312,7 +312,7 @@ func (keeper Keeper) validateInitialDeposit(ctx context.Context, params v1.Param } // validateDepositDenom validates if the deposit denom is accepted by the governance module. -func (keeper Keeper) validateDepositDenom(ctx context.Context, params v1.Params, depositAmount sdk.Coins) error { +func (k Keeper) validateDepositDenom(ctx context.Context, params v1.Params, depositAmount sdk.Coins) error { denoms := []string{} acceptedDenoms := make(map[string]bool, len(params.MinDeposit)) for _, coin := range params.MinDeposit { diff --git a/x/gov/keeper/grpc_query.go b/x/gov/keeper/grpc_query.go index 5a76cff8e09b..32421f8800aa 100644 --- a/x/gov/keeper/grpc_query.go +++ b/x/gov/keeper/grpc_query.go @@ -2,6 +2,7 @@ package keeper import ( "context" + stderrors "errors" "google.golang.org/grpc/codes" "google.golang.org/grpc/status" @@ -17,7 +18,17 @@ import ( "github.com/cosmos/cosmos-sdk/types/query" ) -var _ v1.QueryServer = queryServer{} +var ( + _ v1.QueryServer = queryServer{} + + defaultVoteOptions = &v1.ProposalVoteOptions{ + OptionOne: "yes", + OptionTwo: "abstain", + OptionThree: "no", + OptionFour: "no_with_veto", + OptionSpam: "spam", + } +) type queryServer struct{ k *Keeper } @@ -44,14 +55,56 @@ func (q queryServer) Proposal(ctx context.Context, req *v1.QueryProposalRequest) } proposal, err := q.k.Proposals.Get(ctx, req.ProposalId) + if err == nil { + return &v1.QueryProposalResponse{Proposal: &proposal}, nil + } + if errors.IsOf(err, collections.ErrNotFound) { + return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) + } + return nil, status.Error(codes.Internal, err.Error()) +} + +// ProposalVoteOptions returns the proposal votes options +// It returns the stringified vote options if the proposal is a multiple choice proposal +// Otherwise it returns the generic vote options +func (q queryServer) ProposalVoteOptions(ctx context.Context, req *v1.QueryProposalVoteOptionsRequest) (*v1.QueryProposalVoteOptionsResponse, error) { + if req == nil { + return nil, status.Error(codes.InvalidArgument, "invalid request") + } + + if req.ProposalId == 0 { + return nil, status.Error(codes.InvalidArgument, "proposal id can not be 0") + } + + ok, err := q.k.Proposals.Has(ctx, req.ProposalId) if err != nil { - if errors.IsOf(err, collections.ErrNotFound) { - return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) + return nil, status.Error(codes.Internal, err.Error()) + } + + if !ok { + return nil, status.Errorf(codes.NotFound, "proposal %d doesn't exist", req.ProposalId) + } + + voteOptions, err := q.k.ProposalVoteOptions.Get(ctx, req.ProposalId) + if err != nil { + if stderrors.Is(err, collections.ErrNotFound) { // fallback to generic vote options + return &v1.QueryProposalVoteOptionsResponse{ + VoteOptions: defaultVoteOptions, + }, nil } + return nil, status.Error(codes.Internal, err.Error()) } - return &v1.QueryProposalResponse{Proposal: &proposal}, nil + return &v1.QueryProposalVoteOptionsResponse{ + VoteOptions: &v1.ProposalVoteOptions{ + OptionOne: voteOptions.OptionOne, + OptionTwo: voteOptions.OptionTwo, + OptionThree: voteOptions.OptionThree, + OptionFour: voteOptions.OptionFour, + OptionSpam: defaultVoteOptions.OptionSpam, + }, + }, nil } // Proposals implements the Query/Proposals gRPC method @@ -123,15 +176,14 @@ func (q queryServer) Vote(ctx context.Context, req *v1.QueryVoteRequest) (*v1.Qu return nil, err } vote, err := q.k.Votes.Get(ctx, collections.Join(req.ProposalId, sdk.AccAddress(voter))) - if err != nil { - if errors.IsOf(err, collections.ErrNotFound) { - return nil, status.Errorf(codes.InvalidArgument, - "voter: %v not found for proposal: %v", req.Voter, req.ProposalId) - } - return nil, status.Error(codes.Internal, err.Error()) + if err == nil { + return &v1.QueryVoteResponse{Vote: &vote}, nil } - - return &v1.QueryVoteResponse{Vote: &vote}, nil + if errors.IsOf(err, collections.ErrNotFound) { + return nil, status.Errorf(codes.InvalidArgument, + "voter: %v not found for proposal: %v", req.Voter, req.ProposalId) + } + return nil, status.Error(codes.Internal, err.Error()) } // Votes returns single proposal's votes diff --git a/x/gov/keeper/grpc_query_test.go b/x/gov/keeper/grpc_query_test.go index e92700dc2a23..f204a1048c0e 100644 --- a/x/gov/keeper/grpc_query_test.go +++ b/x/gov/keeper/grpc_query_test.go @@ -68,13 +68,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposal() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } proposalRes, err := queryClient.Proposal(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().NotEmpty(proposalRes.Proposal.String()) suite.Require().Equal(proposalRes.Proposal.String(), expProposal.String()) @@ -166,13 +168,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposal() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } proposalRes, err := queryClient.Proposal(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().NotEmpty(proposalRes.Proposal.String()) suite.Require().Equal(proposalRes.Proposal.String(), expProposal.String()) @@ -373,13 +377,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryProposals() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } proposals, err := queryClient.Proposals(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Len(proposals.GetProposals(), len(expRes.GetProposals())) @@ -423,13 +429,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryProposals() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } proposalRes, err := queryClient.Proposals(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().NotNil(proposalRes.Proposals) suite.Require().Equal(len(proposalRes.Proposals), 1) @@ -539,13 +547,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryVote() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } vote, err := queryClient.Vote(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes, vote) } else { @@ -654,13 +664,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVote() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } vote, err := queryClient.Vote(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes, vote) } else { @@ -758,13 +770,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryVotes() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } votes, err := queryClient.Votes(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes.GetVotes(), votes.GetVotes()) } else { @@ -863,13 +877,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryVotes() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } votes, err := queryClient.Votes(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes.GetVotes(), votes.GetVotes()) } else { @@ -945,13 +961,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryParams() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } params, err := queryClient.Params(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes.GetDepositParams(), params.GetDepositParams()) //nolint:staticcheck // SA1019: params.MinDeposit is deprecated: Use MinInitialDeposit instead. suite.Require().Equal(expRes.GetVotingParams(), params.GetVotingParams()) //nolint:staticcheck // SA1019: params.VotingPeriod is deprecated: Use VotingPeriod instead. @@ -1035,13 +1053,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryParams() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } params, err := queryClient.Params(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes.GetDepositParams(), params.GetDepositParams()) suite.Require().Equal(expRes.GetVotingParams(), params.GetVotingParams()) @@ -1140,13 +1160,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposit() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } deposit, err := queryClient.Deposit(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(deposit.GetDeposit(), expRes.GetDeposit()) } else { @@ -1243,13 +1265,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposit() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } deposit, err := queryClient.Deposit(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(deposit.GetDeposit(), expRes.GetDeposit()) } else { @@ -1339,13 +1363,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryDeposits() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } deposits, err := queryClient.Deposits(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes.GetDeposits(), deposits.GetDeposits()) } else { @@ -1438,13 +1464,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryDeposits() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } deposits, err := queryClient.Deposits(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().Equal(expRes.GetDeposits(), deposits.GetDeposits()) } else { @@ -1580,13 +1608,15 @@ func (suite *KeeperTestSuite) TestGRPCQueryTallyResult() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } tallyRes, err := queryClient.TallyResult(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().NotEmpty(tallyRes.Tally.String()) suite.Require().Equal(expTally.String(), tallyRes.Tally.String()) @@ -1719,13 +1749,15 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { }, } - for _, testCase := range testCases { - suite.Run(fmt.Sprintf("Case %s", testCase.msg), func() { - testCase.malleate() + for _, tc := range testCases { + suite.Run(fmt.Sprintf("Case %s", tc.msg), func() { + if tc.malleate != nil { + tc.malleate() + } tallyRes, err := queryClient.TallyResult(gocontext.Background(), req) - if testCase.expPass { + if tc.expPass { suite.Require().NoError(err) suite.Require().NotEmpty(tallyRes.Tally.String()) suite.Require().Equal(expTally.String(), tallyRes.Tally.String()) @@ -1736,3 +1768,133 @@ func (suite *KeeperTestSuite) TestLegacyGRPCQueryTallyResult() { }) } } + +func (suite *KeeperTestSuite) TestProposalVoteOptions() { + suite.reset() + + testCases := []struct { + name string + malleate func() + req *v1.QueryProposalVoteOptionsRequest + expResp *v1.QueryProposalVoteOptionsResponse + errStr string + }{ + { + name: "invalid proposal id", + req: &v1.QueryProposalVoteOptionsRequest{}, + errStr: "proposal id can not be 0", + }, + { + name: "proposal not found", + req: &v1.QueryProposalVoteOptionsRequest{ProposalId: 1}, + errStr: "proposal 1 doesn't exist", + }, + { + name: "non multiple choice proposal", + malleate: func() { + propTime := time.Now() + proposal := v1.Proposal{ + Id: 1, + Status: v1.StatusVotingPeriod, + SubmitTime: &propTime, + VotingStartTime: &propTime, + VotingEndTime: &propTime, + Metadata: "proposal metadata", + ProposalType: v1.ProposalType_PROPOSAL_TYPE_STANDARD, + } + err := suite.govKeeper.SetProposal(suite.ctx, proposal) + suite.Require().NoError(err) + }, + req: &v1.QueryProposalVoteOptionsRequest{ProposalId: 1}, + expResp: &v1.QueryProposalVoteOptionsResponse{ + VoteOptions: &v1.ProposalVoteOptions{ + OptionOne: "yes", + OptionTwo: "abstain", + OptionThree: "no", + OptionFour: "no_with_veto", + OptionSpam: "spam", + }, + }, + }, + { + name: "invalid multiple choice proposal", + req: &v1.QueryProposalVoteOptionsRequest{ProposalId: 2}, + malleate: func() { + propTime := time.Now() + proposal := v1.Proposal{ + Id: 2, + Status: v1.StatusVotingPeriod, + SubmitTime: &propTime, + VotingStartTime: &propTime, + VotingEndTime: &propTime, + Metadata: "proposal metadata", + ProposalType: v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE, + } + err := suite.govKeeper.SetProposal(suite.ctx, proposal) + suite.Require().NoError(err) + + // multiple choice proposal, but no vote options set + // because the query does not check the proposal type, + // it falls back to the default vote options + }, + expResp: &v1.QueryProposalVoteOptionsResponse{ + VoteOptions: &v1.ProposalVoteOptions{ + OptionOne: "yes", + OptionTwo: "abstain", + OptionThree: "no", + OptionFour: "no_with_veto", + OptionSpam: "spam", + }, + }, + }, + { + name: "multiple choice proposal", + req: &v1.QueryProposalVoteOptionsRequest{ProposalId: 3}, + malleate: func() { + propTime := time.Now() + proposal := v1.Proposal{ + Id: 3, + Status: v1.StatusVotingPeriod, + SubmitTime: &propTime, + VotingStartTime: &propTime, + VotingEndTime: &propTime, + Metadata: "proposal metadata", + ProposalType: v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE, + } + err := suite.govKeeper.SetProposal(suite.ctx, proposal) + suite.Require().NoError(err) + err = suite.govKeeper.ProposalVoteOptions.Set(suite.ctx, proposal.Id, v1.ProposalVoteOptions{ + OptionOne: "Vote for @tac0turle", + OptionTwo: "Vote for @facudomedica", + OptionThree: "Vote for @alexanderbez", + }) + suite.Require().NoError(err) + }, + expResp: &v1.QueryProposalVoteOptionsResponse{ + VoteOptions: &v1.ProposalVoteOptions{ + OptionOne: "Vote for @tac0turle", + OptionTwo: "Vote for @facudomedica", + OptionThree: "Vote for @alexanderbez", + OptionSpam: "spam", + }, + }, + }, + } + + for _, tc := range testCases { + suite.Run(tc.name, func() { + if tc.malleate != nil { + tc.malleate() + } + + resp, err := suite.queryClient.ProposalVoteOptions(suite.ctx, tc.req) + if tc.errStr != "" { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.errStr) + } else { + suite.Require().NoError(err) + suite.Require().Equal(tc.expResp, resp) + } + }) + } +} diff --git a/x/gov/keeper/keeper.go b/x/gov/keeper/keeper.go index 9cefe1f50853..0e882c7fba83 100644 --- a/x/gov/keeper/keeper.go +++ b/x/gov/keeper/keeper.go @@ -48,16 +48,22 @@ type Keeper struct { // should be the x/gov module account. authority string - Schema collections.Schema + Schema collections.Schema + // Constitution value: constitution Constitution collections.Item[string] - Params collections.Item[v1.Params] + // Params stores the governance parameters + Params collections.Item[v1.Params] // Deposits key: proposalID+depositorAddr | value: Deposit Deposits collections.Map[collections.Pair[uint64, sdk.AccAddress], v1.Deposit] // Votes key: proposalID+voterAddr | value: Vote - Votes collections.Map[collections.Pair[uint64, sdk.AccAddress], v1.Vote] + Votes collections.Map[collections.Pair[uint64, sdk.AccAddress], v1.Vote] + // ProposalID is a counter for proposals. It tracks the next proposal ID to be issued. ProposalID collections.Sequence // Proposals key:proposalID | value: Proposal Proposals collections.Map[uint64, v1.Proposal] + // ProposalVoteOptions key: proposalID | value: + // This is used to store multiple choice vote options + ProposalVoteOptions collections.Map[uint64, v1.ProposalVoteOptions] // ActiveProposalsQueue key: votingEndTime+proposalID | value: proposalID ActiveProposalsQueue collections.Map[collections.Pair[time.Time, uint64], uint64] // TODO(tip): this should be simplified and go into an index. // InactiveProposalsQueue key: depositEndTime+proposalID | value: proposalID @@ -123,6 +129,7 @@ func NewKeeper( Votes: collections.NewMap(sb, types.VotesKeyPrefix, "votes", collections.PairKeyCodec(collections.Uint64Key, sdk.LengthPrefixedAddressKey(sdk.AccAddressKey)), codec.CollValue[v1.Vote](cdc)), //nolint: staticcheck // sdk.LengthPrefixedAddressKey is needed to retain state compatibility ProposalID: collections.NewSequence(sb, types.ProposalIDKey, "proposal_id"), Proposals: collections.NewMap(sb, types.ProposalsKeyPrefix, "proposals", collections.Uint64Key, codec.CollValue[v1.Proposal](cdc)), + ProposalVoteOptions: collections.NewMap(sb, types.ProposalVoteOptionsKeyPrefix, "proposal_vote_options", collections.Uint64Key, codec.CollValue[v1.ProposalVoteOptions](cdc)), ActiveProposalsQueue: collections.NewMap(sb, types.ActiveProposalQueuePrefix, "active_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // sdk.TimeKey is needed to retain state compatibility InactiveProposalsQueue: collections.NewMap(sb, types.InactiveProposalQueuePrefix, "inactive_proposals_queue", collections.PairKeyCodec(sdk.TimeKey, collections.Uint64Key), collections.Uint64Value), // sdk.TimeKey is needed to retain state compatibility VotingPeriodProposals: collections.NewMap(sb, types.VotingPeriodProposalKeyPrefix, "voting_period_proposals", collections.Uint64Key, collections.BytesValue), @@ -135,7 +142,7 @@ func NewKeeper( return k } -// Hooks gets the hooks for governance *Keeper { +// Hooks gets the hooks for governance Keeper func (k *Keeper) Hooks() types.GovHooks { if k.hooks == nil { // return a no-op implementation if no hooks are set diff --git a/x/gov/keeper/keeper_test.go b/x/gov/keeper/keeper_test.go index de8793aa7db2..f24149a42183 100644 --- a/x/gov/keeper/keeper_test.go +++ b/x/gov/keeper/keeper_test.go @@ -49,7 +49,7 @@ func (suite *KeeperTestSuite) reset() { // Populate the gov account with some coins, as the TestProposal we have // is a MsgSend from the gov account. - coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) + coins := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(1000000))) err := bankKeeper.MintCoins(suite.ctx, mintModuleName, coins) suite.NoError(err) err = bankKeeper.SendCoinsFromModuleToModule(ctx, mintModuleName, types.ModuleName, coins) diff --git a/x/gov/keeper/msg_server.go b/x/gov/keeper/msg_server.go index be48b00c5dc3..af910d8b3916 100644 --- a/x/gov/keeper/msg_server.go +++ b/x/gov/keeper/msg_server.go @@ -118,6 +118,45 @@ func (k msgServer) SubmitProposal(goCtx context.Context, msg *v1.MsgSubmitPropos }, nil } +// SubmitMultipleChoiceProposal implements the MsgServer.SubmitMultipleChoiceProposal method. +func (k msgServer) SubmitMultipleChoiceProposal(ctx context.Context, msg *v1.MsgSubmitMultipleChoiceProposal) (*v1.MsgSubmitMultipleChoiceProposalResponse, error) { + resp, err := k.SubmitProposal(ctx, &v1.MsgSubmitProposal{ + InitialDeposit: msg.InitialDeposit, + Proposer: msg.Proposer, + Title: msg.Title, + Summary: msg.Summary, + Metadata: msg.Metadata, + ProposalType: v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE, + }) + if err != nil { + return nil, err + } + + if msg.VoteOptions == nil { + return nil, sdkerrors.ErrInvalidRequest.Wrap("vote options cannot be nil") + } + + // check that if a vote option is provided, the previous one is also provided + if (msg.VoteOptions.OptionTwo != "" && msg.VoteOptions.OptionOne == "") || + (msg.VoteOptions.OptionThree != "" && msg.VoteOptions.OptionTwo == "") || + (msg.VoteOptions.OptionFour != "" && msg.VoteOptions.OptionThree == "") { + return nil, sdkerrors.ErrInvalidRequest.Wrap("if a vote option is provided, the previous one must also be provided") + } + + // check that at least two vote options are provided + if msg.VoteOptions.OptionOne == "" && msg.VoteOptions.OptionTwo == "" { + return nil, sdkerrors.ErrInvalidRequest.Wrap("vote options cannot be empty, two or more options must be provided") + } + + if err := k.ProposalVoteOptions.Set(ctx, resp.ProposalId, *msg.VoteOptions); err != nil { + return nil, err + } + + return &v1.MsgSubmitMultipleChoiceProposalResponse{ + ProposalId: resp.ProposalId, + }, nil +} + // CancelProposal implements the MsgServer.CancelProposal method. func (k msgServer) CancelProposal(goCtx context.Context, msg *v1.MsgCancelProposal) (*v1.MsgCancelProposalResponse, error) { _, err := k.authKeeper.AddressCodec().StringToBytes(msg.Proposer) diff --git a/x/gov/keeper/msg_server_test.go b/x/gov/keeper/msg_server_test.go index 6dd9035cb3d8..af0b4dd9730a 100644 --- a/x/gov/keeper/msg_server_test.go +++ b/x/gov/keeper/msg_server_test.go @@ -298,6 +298,83 @@ func (suite *KeeperTestSuite) TestMsgSubmitProposal() { } } +// TestSubmitMultipleChoiceProposal tests only multiple choice proposal specific logic. +// Internally the message uses MsgSubmitProposal, which is tested above. +func (suite *KeeperTestSuite) TestSubmitMultipleChoiceProposal() { + suite.reset() + addrs := suite.addrs + proposer := addrs[0] + initialDeposit := sdk.NewCoins(sdk.NewCoin("stake", sdkmath.NewInt(100000))) + + cases := map[string]struct { + preRun func() (*v1.MsgSubmitMultipleChoiceProposal, error) + expErr bool + expErrMsg string + }{ + "empty options": { + preRun: func() (*v1.MsgSubmitMultipleChoiceProposal, error) { + return v1.NewMultipleChoiceMsgSubmitProposal( + initialDeposit, + proposer.String(), + "mandatory metadata", + "Proposal", + "description of proposal", + &v1.ProposalVoteOptions{}, + ) + }, + expErr: true, + expErrMsg: "vote options cannot be empty, two or more options must be provided", + }, + "invalid options": { + preRun: func() (*v1.MsgSubmitMultipleChoiceProposal, error) { + return v1.NewMultipleChoiceMsgSubmitProposal( + initialDeposit, + proposer.String(), + "mandatory metadata", + "Proposal", + "description of proposal", + &v1.ProposalVoteOptions{ + OptionOne: "Vote for me", + OptionFour: "Vote for them", + }, + ) + }, + expErr: true, + expErrMsg: "if a vote option is provided, the previous one must also be provided", + }, + "valid proposal": { + preRun: func() (*v1.MsgSubmitMultipleChoiceProposal, error) { + return v1.NewMultipleChoiceMsgSubmitProposal( + initialDeposit, + proposer.String(), + "mandatory metadata", + "Proposal", + "description of proposal", + &v1.ProposalVoteOptions{ + OptionOne: "Vote for me", + OptionTwo: "Vote for them", + }, + ) + }, + }, + } + + for name, tc := range cases { + suite.Run(name, func() { + msg, err := tc.preRun() + suite.Require().NoError(err) + res, err := suite.msgSrvr.SubmitMultipleChoiceProposal(suite.ctx, msg) + if tc.expErr { + suite.Require().Error(err) + suite.Require().Contains(err.Error(), tc.expErrMsg) + } else { + suite.Require().NoError(err) + suite.Require().NotNil(res.ProposalId) + } + }) + } +} + func (suite *KeeperTestSuite) TestMsgCancelProposal() { govAcct := suite.govKeeper.GetGovernanceAccount(suite.ctx).GetAddress() addrs := suite.addrs @@ -337,11 +414,11 @@ func (suite *KeeperTestSuite) TestMsgCancelProposal() { }, depositor: proposer, expErr: true, - expErrMsg: "not found", + expErrMsg: "proposal 0 doesn't exist", }, "valid proposal but invalid proposer": { preRun: func() uint64 { - return proposalID + return res.ProposalId }, depositor: addrs[1], expErr: true, diff --git a/x/gov/keeper/proposal.go b/x/gov/keeper/proposal.go index 761abe4d367e..1adc9cee9c7a 100644 --- a/x/gov/keeper/proposal.go +++ b/x/gov/keeper/proposal.go @@ -11,6 +11,7 @@ import ( "cosmossdk.io/collections" errorsmod "cosmossdk.io/errors" + sdkmath "cosmossdk.io/math" "cosmossdk.io/x/gov/types" v1 "cosmossdk.io/x/gov/types/v1" @@ -18,20 +19,22 @@ import ( ) // SubmitProposal creates a new proposal given an array of messages -func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress, proposalType v1.ProposalType) (v1.Proposal, error) { - params, err := keeper.Params.Get(ctx) +func (k Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, metadata, title, summary string, proposer sdk.AccAddress, proposalType v1.ProposalType) (v1.Proposal, error) { + params, err := k.Params.Get(ctx) if err != nil { return v1.Proposal{}, err } // additional checks per proposal types - if proposalType == v1.ProposalType_PROPOSAL_TYPE_OPTIMISTIC { - proposerStr, _ := keeper.authKeeper.AddressCodec().BytesToString(proposer) - - if len(params.OptimisticAuthorizedAddresses) > 0 { - if !slices.Contains(params.OptimisticAuthorizedAddresses, proposerStr) { - return v1.Proposal{}, errorsmod.Wrap(types.ErrInvalidProposer, "proposer is not authorized to submit optimistic proposal") - } + switch proposalType { + case v1.ProposalType_PROPOSAL_TYPE_OPTIMISTIC: + proposerStr, _ := k.authKeeper.AddressCodec().BytesToString(proposer) + if len(params.OptimisticAuthorizedAddresses) > 0 && !slices.Contains(params.OptimisticAuthorizedAddresses, proposerStr) { + return v1.Proposal{}, errorsmod.Wrap(types.ErrInvalidProposer, "proposer is not authorized to submit optimistic proposal") + } + case v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE: + if len(messages) > 0 { // cannot happen, except when the proposal is created via keeper call instead of message server. + return v1.Proposal{}, errorsmod.Wrap(types.ErrInvalidProposalMsg, "multiple choice proposal should not contain any messages") } } @@ -49,7 +52,7 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met } } - signers, _, err := keeper.cdc.GetMsgV1Signers(msg) + signers, _, err := k.cdc.GetMsgV1Signers(msg) if err != nil { return v1.Proposal{}, err } @@ -58,12 +61,12 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met } // assert that the governance module account is the only signer of the messages - if !bytes.Equal(signers[0], keeper.GetGovernanceAccount(ctx).GetAddress()) { + if !bytes.Equal(signers[0], k.GetGovernanceAccount(ctx).GetAddress()) { return v1.Proposal{}, errorsmod.Wrapf(types.ErrInvalidSigner, sdk.AccAddress(signers[0]).String()) } // use the msg service router to see that there is a valid route for that message. - handler := keeper.router.Handler(msg) + handler := k.router.Handler(msg) if handler == nil { return v1.Proposal{}, errorsmod.Wrap(types.ErrUnroutableProposalMsg, sdk.MsgTypeURL(msg)) } @@ -73,19 +76,21 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met // For other Msgs, we do not verify the proposal messages any further. // They may fail upon execution. // ref: https://github.com/cosmos/cosmos-sdk/pull/10868#discussion_r784872842 - if msg, ok := msg.(*v1.MsgExecLegacyContent); ok { - cacheCtx, _ := sdkCtx.CacheContext() - if _, err := handler(cacheCtx, msg); err != nil { - if errors.Is(types.ErrNoProposalHandlerExists, err) { - return v1.Proposal{}, err - } - return v1.Proposal{}, errorsmod.Wrap(types.ErrInvalidProposalContent, err.Error()) + msg, ok := msg.(*v1.MsgExecLegacyContent) + if !ok { + continue + } + cacheCtx, _ := sdkCtx.CacheContext() + if _, err := handler(cacheCtx, msg); err != nil { + if errors.Is(types.ErrNoProposalHandlerExists, err) { + return v1.Proposal{}, err } + return v1.Proposal{}, errorsmod.Wrap(types.ErrInvalidProposalContent, err.Error()) } } - proposalID, err := keeper.ProposalID.Next(ctx) + proposalID, err := k.ProposalID.Next(ctx) if err != nil { return v1.Proposal{}, err } @@ -96,17 +101,17 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met return v1.Proposal{}, err } - err = keeper.SetProposal(ctx, proposal) + err = k.SetProposal(ctx, proposal) if err != nil { return v1.Proposal{}, err } - err = keeper.InactiveProposalsQueue.Set(ctx, collections.Join(*proposal.DepositEndTime, proposalID), proposalID) + err = k.InactiveProposalsQueue.Set(ctx, collections.Join(*proposal.DepositEndTime, proposalID), proposalID) if err != nil { return v1.Proposal{}, err } // called right after a proposal is submitted - err = keeper.Hooks().AfterProposalSubmission(ctx, proposalID) + err = k.Hooks().AfterProposalSubmission(ctx, proposalID) if err != nil { return v1.Proposal{}, err } @@ -123,9 +128,17 @@ func (keeper Keeper) SubmitProposal(ctx context.Context, messages []sdk.Msg, met } // CancelProposal will cancel proposal before the voting period ends -func (keeper Keeper) CancelProposal(ctx context.Context, proposalID uint64, proposer string) error { +func (k Keeper) CancelProposal(ctx context.Context, proposalID uint64, proposer string) error { sdkCtx := sdk.UnwrapSDKContext(ctx) - proposal, err := keeper.Proposals.Get(ctx, proposalID) + proposal, err := k.Proposals.Get(ctx, proposalID) + if err != nil { + if errors.Is(err, collections.ErrNotFound) { + return types.ErrInvalidProposal.Wrapf("proposal %d doesn't exist", proposalID) + } + return err + } + + params, err := k.Params.Get(ctx) if err != nil { return err } @@ -146,36 +159,40 @@ func (keeper Keeper) CancelProposal(ctx context.Context, proposalID uint64, prop return types.ErrInvalidProposal.Wrap("proposal should be in the deposit or voting period") } - // Check proposal voting period is ended. - if proposal.VotingEndTime != nil && proposal.VotingEndTime.Before(sdkCtx.HeaderInfo().Time) { - return types.ErrVotingPeriodEnded.Wrapf("voting period is already ended for this proposal %d", proposalID) + // Check proposal is not too far in voting period to be canceled + if proposal.VotingEndTime != nil { + currentTime := sdkCtx.HeaderInfo().Time + + maxCancelPeriodRate := sdkmath.LegacyMustNewDecFromStr(params.ProposalCancelMaxPeriod) + maxCancelPeriod := time.Duration(float64(proposal.VotingEndTime.Sub(*proposal.VotingStartTime)) * maxCancelPeriodRate.MustFloat64()).Round(time.Second) + + if proposal.VotingEndTime.Before(currentTime) { + return types.ErrVotingPeriodEnded.Wrapf("voting period is already ended for this proposal %d", proposalID) + } else if proposal.VotingEndTime.Add(-maxCancelPeriod).Before(currentTime) { + return types.ErrTooLateToCancel.Wrapf("proposal %d is too late to cancel", proposalID) + } } // burn the (deposits * proposal_cancel_rate) amount or sent to cancellation destination address. // and deposits * (1 - proposal_cancel_rate) will be sent to depositors. - params, err := keeper.Params.Get(ctx) - if err != nil { - return err - } - - err = keeper.ChargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio) + err = k.ChargeDeposit(ctx, proposal.Id, params.ProposalCancelDest, params.ProposalCancelRatio) if err != nil { return err } if proposal.VotingStartTime != nil { - err = keeper.deleteVotes(ctx, proposal.Id) + err = k.deleteVotes(ctx, proposal.Id) if err != nil { return err } } - err = keeper.DeleteProposal(ctx, proposal.Id) + err = k.DeleteProposal(ctx, proposal.Id) if err != nil { return err } - keeper.Logger(ctx).Info( + k.Logger(ctx).Info( "proposal is canceled by proposer", "proposal", proposal.Id, "proposer", proposal.Proposer, @@ -185,57 +202,57 @@ func (keeper Keeper) CancelProposal(ctx context.Context, proposalID uint64, prop } // SetProposal sets a proposal to store. -func (keeper Keeper) SetProposal(ctx context.Context, proposal v1.Proposal) error { +func (k Keeper) SetProposal(ctx context.Context, proposal v1.Proposal) error { if proposal.Status == v1.StatusVotingPeriod { - err := keeper.VotingPeriodProposals.Set(ctx, proposal.Id, []byte{1}) + err := k.VotingPeriodProposals.Set(ctx, proposal.Id, []byte{1}) if err != nil { return err } } else { - err := keeper.VotingPeriodProposals.Remove(ctx, proposal.Id) + err := k.VotingPeriodProposals.Remove(ctx, proposal.Id) if err != nil { return err } } - return keeper.Proposals.Set(ctx, proposal.Id, proposal) + return k.Proposals.Set(ctx, proposal.Id, proposal) } // DeleteProposal deletes a proposal from store. -func (keeper Keeper) DeleteProposal(ctx context.Context, proposalID uint64) error { - proposal, err := keeper.Proposals.Get(ctx, proposalID) +func (k Keeper) DeleteProposal(ctx context.Context, proposalID uint64) error { + proposal, err := k.Proposals.Get(ctx, proposalID) if err != nil { return err } if proposal.DepositEndTime != nil { - err := keeper.InactiveProposalsQueue.Remove(ctx, collections.Join(*proposal.DepositEndTime, proposalID)) + err := k.InactiveProposalsQueue.Remove(ctx, collections.Join(*proposal.DepositEndTime, proposalID)) if err != nil { return err } } if proposal.VotingEndTime != nil { - err := keeper.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposalID)) + err := k.ActiveProposalsQueue.Remove(ctx, collections.Join(*proposal.VotingEndTime, proposalID)) if err != nil { return err } - err = keeper.VotingPeriodProposals.Remove(ctx, proposalID) + err = k.VotingPeriodProposals.Remove(ctx, proposalID) if err != nil { return err } } - return keeper.Proposals.Remove(ctx, proposalID) + return k.Proposals.Remove(ctx, proposalID) } // ActivateVotingPeriod activates the voting period of a proposal -func (keeper Keeper) ActivateVotingPeriod(ctx context.Context, proposal v1.Proposal) error { +func (k Keeper) ActivateVotingPeriod(ctx context.Context, proposal v1.Proposal) error { sdkCtx := sdk.UnwrapSDKContext(ctx) startTime := sdkCtx.HeaderInfo().Time proposal.VotingStartTime = &startTime var votingPeriod *time.Duration - params, err := keeper.Params.Get(ctx) + params, err := k.Params.Get(ctx) if err != nil { return err } @@ -248,15 +265,15 @@ func (keeper Keeper) ActivateVotingPeriod(ctx context.Context, proposal v1.Propo endTime := proposal.VotingStartTime.Add(*votingPeriod) proposal.VotingEndTime = &endTime proposal.Status = v1.StatusVotingPeriod - err = keeper.SetProposal(ctx, proposal) + err = k.SetProposal(ctx, proposal) if err != nil { return err } - err = keeper.InactiveProposalsQueue.Remove(ctx, collections.Join(*proposal.DepositEndTime, proposal.Id)) + err = k.InactiveProposalsQueue.Remove(ctx, collections.Join(*proposal.DepositEndTime, proposal.Id)) if err != nil { return err } - return keeper.ActiveProposalsQueue.Set(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id), proposal.Id) + return k.ActiveProposalsQueue.Set(ctx, collections.Join(*proposal.VotingEndTime, proposal.Id), proposal.Id) } diff --git a/x/gov/keeper/proposal_test.go b/x/gov/keeper/proposal_test.go index 281b6563d58b..6ea453078c9b 100644 --- a/x/gov/keeper/proposal_test.go +++ b/x/gov/keeper/proposal_test.go @@ -5,6 +5,7 @@ import ( "fmt" "strings" "testing" + "time" "github.com/stretchr/testify/require" @@ -166,6 +167,7 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { }{ {&tp, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, {&tp, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_EXPEDITED, nil}, + {nil, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE, nil}, // Keeper does not check the validity of title and description, no error {&v1beta1.TextProposal{Title: "", Description: "description"}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, {&v1beta1.TextProposal{Title: strings.Repeat("1234567890", 100), Description: "description"}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, nil}, @@ -175,12 +177,19 @@ func (suite *KeeperTestSuite) TestSubmitProposal() { {&tp, randomAddr.String(), "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrInvalidSigner}, // error only when invalid route {&invalidProposalRoute{}, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_STANDARD, types.ErrNoProposalHandlerExists}, + // error invalid multiple choice proposal + {&tp, govAcct, "", v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE, types.ErrInvalidProposalMsg}, } for i, tc := range testCases { - prop, err := v1.NewLegacyContent(tc.content, tc.authority) - suite.Require().NoError(err) - _, err = suite.govKeeper.SubmitProposal(suite.ctx, []sdk.Msg{prop}, tc.metadata, "title", "", suite.addrs[0], tc.proposalType) + msg := []sdk.Msg{} + if tc.content != nil { + prop, err := v1.NewLegacyContent(tc.content, tc.authority) + suite.Require().NoError(err) + msg = append(msg, prop) + } + + _, err := suite.govKeeper.SubmitProposal(suite.ctx, msg, tc.metadata, "title", "", suite.addrs[0], tc.proposalType) suite.Require().True(errors.Is(tc.expectedErr, err), "tc #%d; got: %v, expected: %v", i, err, tc.expectedErr) } } @@ -216,32 +225,32 @@ func (suite *KeeperTestSuite) TestCancelProposal() { suite.Require().NoError(err) testCases := []struct { - name string - malleate func() (proposalID uint64, proposer string) - proposalID uint64 - proposer string - expectedErr bool + name string + malleate func() (proposalID uint64, proposer string) + proposalID uint64 + proposer string + expectedErrMsg string }{ { name: "without proposer", malleate: func() (uint64, string) { - return 1, "" + return proposalID, "" }, - expectedErr: true, + expectedErrMsg: "invalid proposer", }, { name: "invalid proposal id", malleate: func() (uint64, string) { - return 1, suite.addrs[1].String() + return 10, suite.addrs[1].String() }, - expectedErr: true, + expectedErrMsg: "proposal 10 doesn't exist", }, { name: "valid proposalID but invalid proposer", malleate: func() (uint64, string) { return proposalID, suite.addrs[1].String() }, - expectedErr: true, + expectedErrMsg: "invalid proposer", }, { name: "valid proposalID but invalid proposal which has already passed", @@ -255,14 +264,32 @@ func (suite *KeeperTestSuite) TestCancelProposal() { suite.Require().NoError(err) return proposal2ID, suite.addrs[1].String() }, - expectedErr: true, + expectedErrMsg: "proposal should be in the deposit or voting period", + }, + { + name: "proposal canceled too late", + malleate: func() (uint64, string) { + suite.Require().NoError(suite.govKeeper.ActivateVotingPeriod(suite.ctx, proposal2)) + + proposal2, err = suite.govKeeper.Proposals.Get(suite.ctx, proposal2.Id) + suite.Require().Nil(err) + + headerInfo := suite.ctx.HeaderInfo() + // try to cancel 1min before the end of the voting period + // this should fail, as we allow to cancel proposal (by default) up to 1/2 of the voting period + headerInfo.Time = proposal2.VotingEndTime.Add(-1 * time.Minute) + suite.ctx = suite.ctx.WithHeaderInfo(headerInfo) + + suite.Require().NoError(err) + return proposal2ID, suite.addrs[1].String() + }, + expectedErrMsg: "too late", }, { name: "valid proposer and proposal id", malleate: func() (uint64, string) { return proposalID, suite.addrs[0].String() }, - expectedErr: false, }, { name: "valid case with deletion of votes", @@ -283,7 +310,6 @@ func (suite *KeeperTestSuite) TestCancelProposal() { return proposalID, suite.addrs[0].String() }, - expectedErr: false, }, } @@ -291,8 +317,8 @@ func (suite *KeeperTestSuite) TestCancelProposal() { suite.Run(tc.name, func() { pID, proposer := tc.malleate() err = suite.govKeeper.CancelProposal(suite.ctx, pID, proposer) - if tc.expectedErr { - suite.Require().Error(err) + if tc.expectedErrMsg != "" { + suite.Require().ErrorContains(err, tc.expectedErrMsg) } else { suite.Require().NoError(err) } diff --git a/x/gov/keeper/tally.go b/x/gov/keeper/tally.go index 95816e772468..7ae43d4132d3 100644 --- a/x/gov/keeper/tally.go +++ b/x/gov/keeper/tally.go @@ -11,25 +11,25 @@ import ( ) // Tally iterates over the votes and updates the tally of a proposal based on the voting power of the voters -func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { - validators, err := keeper.getCurrentValidators(ctx) +func (k Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { + validators, err := k.getCurrentValidators(ctx) if err != nil { return false, false, v1.TallyResult{}, err } - totalVoterPower, results, err := keeper.calculateVoteResultsAndVotingPower(ctx, proposal.Id, validators) + totalVoterPower, results, err := k.calculateVoteResultsAndVotingPower(ctx, proposal.Id, validators) if err != nil { return false, false, v1.TallyResult{}, err } - params, err := keeper.Params.Get(ctx) + params, err := k.Params.Get(ctx) if err != nil { return false, false, v1.TallyResult{}, err } tallyResults = v1.NewTallyResultFromMap(results) // If there is no staked coins, the proposal fails - totalBonded, err := keeper.sk.TotalBondedTokens(ctx) + totalBonded, err := k.sk.TotalBondedTokens(ctx) if err != nil { return false, false, v1.TallyResult{}, err } @@ -47,18 +47,24 @@ func (keeper Keeper) Tally(ctx context.Context, proposal v1.Proposal) (passes, b switch proposal.ProposalType { case v1.ProposalType_PROPOSAL_TYPE_OPTIMISTIC: - return keeper.tallyOptimistic(totalVoterPower, totalBonded, results, params) + return k.tallyOptimistic(totalVoterPower, totalBonded, results, params) case v1.ProposalType_PROPOSAL_TYPE_EXPEDITED: - return keeper.tallyExpedited(totalVoterPower, totalBonded, results, params) + return k.tallyExpedited(totalVoterPower, totalBonded, results, params) case v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE: - return keeper.tallyMultipleChoice(totalVoterPower, totalBonded, results, params) // TODO(@julienrbrt): implement in follow up + return k.tallyMultipleChoice(totalVoterPower, totalBonded, results, params) default: - return keeper.tallyStandard(totalVoterPower, totalBonded, results, params) + return k.tallyStandard(totalVoterPower, totalBonded, results, params) } } // tallyStandard tallies the votes of a standard proposal -func (keeper Keeper) tallyStandard(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { +// If there is not enough quorum of votes, the proposal fails +// If no one votes (everyone abstains), proposal fails +// If more than 1/3 of voters veto, proposal fails +// If more than 1/2 of non-abstaining voters vote Yes, proposal passes +// If more than 1/2 of non-abstaining voters vote No, proposal fails +// Checking for spam votes is done before calling this function +func (k Keeper) tallyStandard(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { tallyResults = v1.NewTallyResultFromMap(results) // If there is not enough quorum of votes, the proposal fails @@ -91,7 +97,13 @@ func (keeper Keeper) tallyStandard(totalVoterPower math.LegacyDec, totalBonded m } // tallyExpedited tallies the votes of an expedited proposal -func (keeper Keeper) tallyExpedited(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { +// If there is not enough quorum of votes, the proposal fails +// If no one votes (everyone abstains), proposal fails +// If more than 1/3 of voters veto, proposal fails +// If more than 2/3 of non-abstaining voters vote Yes, proposal passes +// If more than 1/2 of non-abstaining voters vote No, proposal fails +// Checking for spam votes is done before calling this function +func (k Keeper) tallyExpedited(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { tallyResults = v1.NewTallyResultFromMap(results) // If there is not enough quorum of votes, the proposal fails @@ -124,7 +136,11 @@ func (keeper Keeper) tallyExpedited(totalVoterPower math.LegacyDec, totalBonded } // tallyOptimistic tallies the votes of an optimistic proposal -func (keeper Keeper) tallyOptimistic(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { +// If proposal has no votes, proposal passes +// If the threshold of no is reached, proposal fails +// Any other case, proposal passes +// Checking for spam votes is done before calling this function +func (k Keeper) tallyOptimistic(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { tallyResults = v1.NewTallyResultFromMap(results) optimisticNoThreshold, _ := math.LegacyNewDecFromStr(params.OptimisticRejectedThreshold) @@ -142,7 +158,10 @@ func (keeper Keeper) tallyOptimistic(totalVoterPower math.LegacyDec, totalBonded } // tallyMultipleChoice tallies the votes of a multiple choice proposal -func (keeper Keeper) tallyMultipleChoice(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { +// If there is not enough quorum of votes, the proposal fails +// Any other case, proposal passes +// Checking for spam votes is done before calling this function +func (k Keeper) tallyMultipleChoice(totalVoterPower math.LegacyDec, totalBonded math.Int, results map[v1.VoteOption]math.LegacyDec, params v1.Params) (passes, burnDeposits bool, tallyResults v1.TallyResult, err error) { tallyResults = v1.NewTallyResultFromMap(results) // If there is not enough quorum of votes, the proposal fails @@ -152,14 +171,16 @@ func (keeper Keeper) tallyMultipleChoice(totalVoterPower math.LegacyDec, totalBo return false, params.BurnVoteQuorum, tallyResults, nil } + // a multiple choice proposal always passes unless it was spam or quorum was not reached. + return true, false, tallyResults, nil } // getCurrentValidators fetches all the bonded validators, insert them into currValidators -func (keeper Keeper) getCurrentValidators(ctx context.Context) (map[string]v1.ValidatorGovInfo, error) { +func (k Keeper) getCurrentValidators(ctx context.Context) (map[string]v1.ValidatorGovInfo, error) { currValidators := make(map[string]v1.ValidatorGovInfo) - if err := keeper.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator sdk.ValidatorI) (stop bool) { - valBz, err := keeper.sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) + if err := k.sk.IterateBondedValidatorsByPower(ctx, func(index int64, validator sdk.ValidatorI) (stop bool) { + valBz, err := k.sk.ValidatorAddressCodec().StringToBytes(validator.GetOperator()) if err != nil { return false } @@ -181,7 +202,7 @@ func (keeper Keeper) getCurrentValidators(ctx context.Context) (map[string]v1.Va // calculateVoteResultsAndVotingPower iterate over all votes, tally up the voting power of each validator // and returns the votes results from voters -func (keeper Keeper) calculateVoteResultsAndVotingPower( +func (k Keeper) calculateVoteResultsAndVotingPower( ctx context.Context, proposalID uint64, validators map[string]v1.ValidatorGovInfo, @@ -191,14 +212,14 @@ func (keeper Keeper) calculateVoteResultsAndVotingPower( // iterate over all votes, tally up the voting power of each validator rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) - if err := keeper.Votes.Walk(ctx, rng, func(key collections.Pair[uint64, sdk.AccAddress], vote v1.Vote) (bool, error) { + if err := k.Votes.Walk(ctx, rng, func(key collections.Pair[uint64, sdk.AccAddress], vote v1.Vote) (bool, error) { // if validator, just record it in the map - voter, err := keeper.authKeeper.AddressCodec().StringToBytes(vote.Voter) + voter, err := k.authKeeper.AddressCodec().StringToBytes(vote.Voter) if err != nil { return false, err } - valAddrStr, err := keeper.sk.ValidatorAddressCodec().BytesToString(voter) + valAddrStr, err := k.sk.ValidatorAddressCodec().BytesToString(voter) if err != nil { return false, err } @@ -209,7 +230,7 @@ func (keeper Keeper) calculateVoteResultsAndVotingPower( } // iterate over all delegations from voter, deduct from any delegated-to validators - err = keeper.sk.IterateDelegations(ctx, voter, func(index int64, delegation sdk.DelegationI) (stop bool) { + err = k.sk.IterateDelegations(ctx, voter, func(index int64, delegation sdk.DelegationI) (stop bool) { valAddrStr := delegation.GetValidatorAddr() if val, ok := validators[valAddrStr]; ok { @@ -236,7 +257,7 @@ func (keeper Keeper) calculateVoteResultsAndVotingPower( return false, err } - return false, keeper.Votes.Remove(ctx, collections.Join(vote.ProposalId, sdk.AccAddress(voter))) + return false, k.Votes.Remove(ctx, collections.Join(vote.ProposalId, sdk.AccAddress(voter))) }); err != nil { return math.LegacyDec{}, nil, err } diff --git a/x/gov/keeper/tally_test.go b/x/gov/keeper/tally_test.go index 01ee4ecd41ec..d5cd1731f5cb 100644 --- a/x/gov/keeper/tally_test.go +++ b/x/gov/keeper/tally_test.go @@ -939,3 +939,329 @@ func TestTally_Optimistic(t *testing.T) { }) } } + +// TODO(@julienrbrt): refactor tally result to fit all proposal types +func TestTally_MultipleChoice(t *testing.T) { + tests := []struct { + name string + setup func(tallyFixture) + expectedPass bool + expectedBurn bool + expectedTally v1.TallyResult + expectedError string + }{ + { + name: "no votes, no bonded tokens: prop fails", + setup: func(s tallyFixture) { + setTotalBonded(s, 0) + }, + expectedPass: false, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "0", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "no votes: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "0", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "one validator votes: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_THREE) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "0", + AbstainCount: "0", + NoCount: "1000000", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "one account votes without delegation: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + delegatorVote(s, s.delAddrs[0], nil, v1.VoteOption_VOTE_OPTION_ONE) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "0", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "one delegator votes: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + delegations := []stakingtypes.Delegation{{ + DelegatorAddress: s.delAddrs[0].String(), + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdkmath.LegacyNewDec(42), + }} + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "42", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "one delegator votes yes, validator votes also yes: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + delegations := []stakingtypes.Delegation{{ + DelegatorAddress: s.delAddrs[0].String(), + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdkmath.LegacyNewDec(42), + }} + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "1000000", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "one delegator votes yes, validator votes no: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + delegations := []stakingtypes.Delegation{{ + DelegatorAddress: s.delAddrs[0].String(), + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdkmath.LegacyNewDec(42), + }} + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_THREE) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "42", + AbstainCount: "0", + NoCount: "999958", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + // one delegator delegates 42 shares to 2 different validators (21 each) + // delegator votes yes + // first validator votes yes + // second validator votes no + // third validator (no delegation) votes abstain + name: "delegator with mixed delegations: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + delegations := []stakingtypes.Delegation{ + { + DelegatorAddress: s.delAddrs[0].String(), + ValidatorAddress: s.valAddrs[0].String(), + Shares: sdkmath.LegacyNewDec(21), + }, + { + DelegatorAddress: s.delAddrs[0].String(), + ValidatorAddress: s.valAddrs[1].String(), + Shares: sdkmath.LegacyNewDec(21), + }, + } + delegatorVote(s, s.delAddrs[0], delegations, v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_TWO) + }, + expectedPass: false, + expectedBurn: true, // burn because quorum not reached + expectedTally: v1.TallyResult{ + YesCount: "1000021", + AbstainCount: "1000000", + NoCount: "999979", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "quorum reached with only abstain: always passes in multiple choice tally", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_TWO) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_TWO) + }, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "0", + AbstainCount: "4000000", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "quorum reached with a majority of option 4: always passes in multiple choice tally", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_FOUR) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_FOUR) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_FOUR) + }, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "4000000", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "3000000", + SpamCount: "0", + }, + }, + { + name: "quorum reached, equality: always passes in multiple choice tally", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_ONE) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_THREE) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_THREE) + }, + expectedPass: true, + expectedBurn: false, + expectedTally: v1.TallyResult{ + YesCount: "2000000", + AbstainCount: "0", + NoCount: "2000000", + NoWithVetoCount: "0", + SpamCount: "0", + }, + }, + { + name: "quorum reached with spam > all other votes: prop fails/burn deposit", + setup: func(s tallyFixture) { + setTotalBonded(s, 10000000) + validatorVote(s, s.valAddrs[0], v1.VoteOption_VOTE_OPTION_ONE) + // spam votes + validatorVote(s, s.valAddrs[1], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[2], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[3], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[4], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[5], v1.VoteOption_VOTE_OPTION_SPAM) + validatorVote(s, s.valAddrs[6], v1.VoteOption_VOTE_OPTION_SPAM) + }, + expectedPass: false, + expectedBurn: true, + expectedTally: v1.TallyResult{ + YesCount: "1000000", + AbstainCount: "0", + NoCount: "0", + NoWithVetoCount: "0", + SpamCount: "6000000", + }, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + govKeeper, mocks, _, ctx := setupGovKeeper(t, mockAccountKeeperExpectations) + params := v1.DefaultParams() + // Ensure params value are different than false + params.BurnVoteQuorum = true + params.BurnVoteVeto = true + err := govKeeper.Params.Set(ctx, params) + require.NoError(t, err) + var ( + numVals = 10 + numDelegators = 5 + addrs = simtestutil.CreateRandomAccounts(numVals + numDelegators) + valAddrs = simtestutil.ConvertAddrsToValAddrs(addrs[:numVals]) + delAddrs = addrs[numVals:] + ) + // Mocks a bunch of validators + mocks.stakingKeeper.EXPECT(). + IterateBondedValidatorsByPower(ctx, gomock.Any()). + DoAndReturn( + func(ctx context.Context, fn func(index int64, validator sdk.ValidatorI) bool) error { + for i := int64(0); i < int64(numVals); i++ { + fn(i, stakingtypes.Validator{ + OperatorAddress: valAddrs[i].String(), + Status: stakingtypes.Bonded, + Tokens: sdkmath.NewInt(1000000), + DelegatorShares: sdkmath.LegacyNewDec(1000000), + }) + } + return nil + }) + + // Submit and activate a proposal + proposal, err := govKeeper.SubmitProposal(ctx, nil, "", "title", "summary", delAddrs[0], v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE) + require.NoError(t, err) + err = govKeeper.ProposalVoteOptions.Set(ctx, proposal.Id, v1.ProposalVoteOptions{ + OptionOne: "Vote Option 1", + OptionTwo: "Vote Option 2", + OptionThree: "Vote Option 3", + OptionFour: "Vote Option 4", + }) + require.NoError(t, err) + err = govKeeper.ActivateVotingPeriod(ctx, proposal) + require.NoError(t, err) + suite := tallyFixture{ + t: t, + proposal: proposal, + valAddrs: valAddrs, + delAddrs: delAddrs, + ctx: ctx, + keeper: govKeeper, + mocks: mocks, + } + tt.setup(suite) + + pass, burn, tally, err := govKeeper.Tally(ctx, proposal) + + require.NoError(t, err) + assert.Equal(t, tt.expectedPass, pass, "wrong pass") + assert.Equal(t, tt.expectedBurn, burn, "wrong burn") + assert.Equal(t, tt.expectedTally, tally) + // Assert votes removal after tally + rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposal.Id) + _, err = suite.keeper.Votes.Iterate(suite.ctx, rng) + assert.NoError(t, err) + }) + } +} diff --git a/x/gov/keeper/vote.go b/x/gov/keeper/vote.go index f06c3a9101f4..ebd3ae688770 100644 --- a/x/gov/keeper/vote.go +++ b/x/gov/keeper/vote.go @@ -2,6 +2,7 @@ package keeper import ( "context" + stderrors "errors" "fmt" "cosmossdk.io/collections" @@ -13,9 +14,9 @@ import ( ) // AddVote adds a vote on a specific proposal -func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress, options v1.WeightedVoteOptions, metadata string) error { +func (k Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr sdk.AccAddress, options v1.WeightedVoteOptions, metadata string) error { // Check if proposal is in voting period. - inVotingPeriod, err := keeper.VotingPeriodProposals.Has(ctx, proposalID) + inVotingPeriod, err := k.VotingPeriodProposals.Has(ctx, proposalID) if err != nil { return err } @@ -24,12 +25,12 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s return errors.Wrapf(types.ErrInactiveProposal, "%d", proposalID) } - if err := keeper.assertMetadataLength(metadata); err != nil { + if err := k.assertMetadataLength(metadata); err != nil { return err } // get proposal - proposal, err := keeper.Proposals.Get(ctx, proposalID) + proposal, err := k.Proposals.Get(ctx, proposalID) if err != nil { return err } @@ -40,21 +41,41 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s if option.Option != v1.OptionNo && option.Option != v1.OptionSpam { return errors.Wrap(types.ErrInvalidVote, "optimistic proposals can only be rejected") } - default: - if !v1.ValidWeightedVoteOption(*option) { - return errors.Wrap(types.ErrInvalidVote, option.String()) + case v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE: + proposalOptionsStr, err := k.ProposalVoteOptions.Get(ctx, proposalID) + if err != nil { + if stderrors.Is(err, collections.ErrNotFound) { + return errors.Wrap(types.ErrInvalidProposal, "invalid multiple choice proposal, no options set") + } + + return err + } + + // verify votes only on existing votes + if proposalOptionsStr.OptionOne == "" && option.Option == v1.OptionOne { // should never trigger option one is always mandatory + return errors.Wrap(types.ErrInvalidVote, "invalid vote option") + } else if proposalOptionsStr.OptionTwo == "" && option.Option == v1.OptionTwo { // should never trigger option two is always mandatory + return errors.Wrap(types.ErrInvalidVote, "invalid vote option") + } else if proposalOptionsStr.OptionThree == "" && option.Option == v1.OptionThree { + return errors.Wrap(types.ErrInvalidVote, "invalid vote option") + } else if proposalOptionsStr.OptionFour == "" && option.Option == v1.OptionFour { + return errors.Wrap(types.ErrInvalidVote, "invalid vote option") } } + + if !v1.ValidWeightedVoteOption(*option) { + return errors.Wrap(types.ErrInvalidVote, option.String()) + } } vote := v1.NewVote(proposalID, voterAddr, options, metadata) - err = keeper.Votes.Set(ctx, collections.Join(proposalID, voterAddr), vote) + err = k.Votes.Set(ctx, collections.Join(proposalID, voterAddr), vote) if err != nil { return err } // called after a vote on a proposal is cast - err = keeper.Hooks().AfterProposalVote(ctx, proposalID, voterAddr) + err = k.Hooks().AfterProposalVote(ctx, proposalID, voterAddr) if err != nil { return err } @@ -73,9 +94,9 @@ func (keeper Keeper) AddVote(ctx context.Context, proposalID uint64, voterAddr s } // deleteVotes deletes all the votes from a given proposalID. -func (keeper Keeper) deleteVotes(ctx context.Context, proposalID uint64) error { +func (k Keeper) deleteVotes(ctx context.Context, proposalID uint64) error { rng := collections.NewPrefixedPairRange[uint64, sdk.AccAddress](proposalID) - err := keeper.Votes.Clear(ctx, rng) + err := k.Votes.Clear(ctx, rng) if err != nil { return err } diff --git a/x/gov/keeper/vote_test.go b/x/gov/keeper/vote_test.go index 3220249e2b39..af2c46c1ccfb 100644 --- a/x/gov/keeper/vote_test.go +++ b/x/gov/keeper/vote_test.go @@ -14,6 +14,8 @@ import ( sdk "github.com/cosmos/cosmos-sdk/types" ) +var invalidOption v1.VoteOption = 0x10 + func TestVotes(t *testing.T) { govKeeper, mocks, _, ctx := setupGovKeeper(t) authKeeper, bankKeeper, stakingKeeper := mocks.acctKeeper, mocks.bankKeeper, mocks.stakingKeeper @@ -26,8 +28,6 @@ func TestVotes(t *testing.T) { proposalID := proposal.Id metadata := "metadata" - var invalidOption v1.VoteOption = 0x10 - require.Error(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), metadata), "proposal not on voting period") require.Error(t, govKeeper.AddVote(ctx, 10, addrs[0], v1.NewNonSplitVoteOption(v1.OptionYes), ""), "invalid proposal ID") @@ -106,3 +106,33 @@ func TestVotes(t *testing.T) { _, err = govKeeper.Votes.Get(ctx, collections.Join(proposalID+100, addrs[1])) require.ErrorIs(t, err, collections.ErrNotFound) } + +func TestVotes_MultipleChoiceProposal(t *testing.T) { + govKeeper, mocks, _, ctx := setupGovKeeper(t) + authKeeper, bankKeeper, stakingKeeper := mocks.acctKeeper, mocks.bankKeeper, mocks.stakingKeeper + addrs := simtestutil.AddTestAddrsIncremental(bankKeeper, stakingKeeper, ctx, 2, sdkmath.NewInt(10000000)) + authKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() + + proposal, err := govKeeper.SubmitProposal(ctx, nil, "", "title", "description", sdk.AccAddress("cosmos1ghekyjucln7y67ntx7cf27m9dpuxxemn4c8g4r"), v1.ProposalType_PROPOSAL_TYPE_MULTIPLE_CHOICE) + require.NoError(t, err) + err = govKeeper.ProposalVoteOptions.Set(ctx, proposal.Id, v1.ProposalVoteOptions{ + OptionOne: "Vote for @tac0turle", + OptionTwo: "Vote for @facudomedica", + OptionThree: "Vote for @alexanderbez", + }) + require.NoError(t, err) + + proposal.Status = v1.StatusVotingPeriod + require.NoError(t, govKeeper.SetProposal(ctx, proposal)) + + proposalID := proposal.Id + + // invalid options + require.Error(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(invalidOption), ""), "invalid option") + require.Error(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(v1.OptionFour), ""), "invalid option") // option four is not defined. + + // valid options + require.NoError(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(v1.OptionOne), "")) + require.NoError(t, govKeeper.AddVote(ctx, proposalID, addrs[1], v1.NewNonSplitVoteOption(v1.OptionTwo), "")) + require.NoError(t, govKeeper.AddVote(ctx, proposalID, addrs[0], v1.NewNonSplitVoteOption(v1.OptionThree), "")) +} diff --git a/x/gov/migrations/v6/store.go b/x/gov/migrations/v6/store.go index bebcfdfcaf74..5855125597a5 100644 --- a/x/gov/migrations/v6/store.go +++ b/x/gov/migrations/v6/store.go @@ -42,6 +42,7 @@ func MigrateStore(ctx sdk.Context, paramsCollection collections.Item[v1.Params], defaultParams := v1.DefaultParams() govParams.OptimisticAuthorizedAddresses = defaultParams.OptimisticAuthorizedAddresses govParams.OptimisticRejectedThreshold = defaultParams.OptimisticRejectedThreshold + govParams.ProposalCancelMaxPeriod = defaultParams.ProposalCancelMaxPeriod return paramsCollection.Set(ctx, govParams) } diff --git a/x/gov/proto/cosmos/gov/v1/gov.proto b/x/gov/proto/cosmos/gov/v1/gov.proto index 222de4104910..7753cedd6cd2 100644 --- a/x/gov/proto/cosmos/gov/v1/gov.proto +++ b/x/gov/proto/cosmos/gov/v1/gov.proto @@ -139,7 +139,7 @@ message Proposal { // proposal_type defines the type of the proposal // - // Since: cosmos-sdk 0.51 + // Since: x/gov v1.0.0 ProposalType proposal_type = 16; } @@ -164,6 +164,27 @@ enum ProposalStatus { PROPOSAL_STATUS_FAILED = 5; } +// ProposalVoteOptions defines the stringified vote options for proposals. +// This allows to support multiple choice options for a given proposal. +// +// Since: x/gov v1.0.0 +message ProposalVoteOptions { + // option_one is the first option of the proposal + string option_one = 1; + + // option_two is the second option of the proposal + string option_two = 2; + + // option_three is the third option of the proposal + string option_three = 3; + + // option_four is the fourth option of the proposal + string option_four = 4; + + // option_spam is always present for all proposals. + string option_spam = 5; +} + // TallyResult defines a standard tally for a governance proposal. message TallyResult { // yes_count is the number of yes votes on a proposal. @@ -289,12 +310,18 @@ message Params { [(gogoproto.nullable) = false, (amino.dont_omitempty) = true]; // burn deposits if a proposal does not meet quorum + // + // Since: cosmos-sdk 0.47 bool burn_vote_quorum = 13; // burn deposits if the proposal does not enter voting period + // + // Since: cosmos-sdk 0.47 bool burn_proposal_deposit_prevote = 14; // burn deposits if quorum with vote type no_veto is met + // + // Since: cosmos-sdk 0.47 bool burn_vote_veto = 15; // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. @@ -304,15 +331,23 @@ message Params { // Since: cosmos-sdk 0.50 string min_deposit_ratio = 16 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // proposal_cancel_max_period defines how far in the voting period a proposer can cancel a proposal. + // If the proposal is cancelled before the max cancel period, the deposit will be returned/burn to the + // depositors, according to the proposal_cancel_ratio and proposal_cancel_dest parameters. + // After the max cancel period, the proposal cannot be cancelled anymore. + // + // Since: x/gov v1.0.0 + string proposal_cancel_max_period = 17 [(cosmos_proto.scalar) = "cosmos.Dec"]; + // optimistic_authorized_addresses is an optional governance parameter that limits the authorized accounts than can // submit optimistic proposals // // Since: x/gov v1.0.0 - repeated string optimistic_authorized_addresses = 17 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + repeated string optimistic_authorized_addresses = 18 [(cosmos_proto.scalar) = "cosmos.AddressString"]; // optimistic rejected threshold defines at which percentage of NO votes, the optimistic proposal should fail and be // converted to a standard proposal. The threshold is expressed as a percentage of the total bonded tokens. // // Since: x/gov v1.0.0 - string optimistic_rejected_threshold = 18 [(cosmos_proto.scalar) = "cosmos.Dec"]; + string optimistic_rejected_threshold = 19 [(cosmos_proto.scalar) = "cosmos.Dec"]; } diff --git a/x/gov/proto/cosmos/gov/v1/query.proto b/x/gov/proto/cosmos/gov/v1/query.proto index 2477c8a58a69..44fe3740f36c 100644 --- a/x/gov/proto/cosmos/gov/v1/query.proto +++ b/x/gov/proto/cosmos/gov/v1/query.proto @@ -55,6 +55,11 @@ service Query { rpc TallyResult(QueryTallyResultRequest) returns (QueryTallyResultResponse) { option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/tally"; } + + // ProposalVoteOptions queries the valid voting options for a proposal. + rpc ProposalVoteOptions(QueryProposalVoteOptionsRequest) returns (QueryProposalVoteOptionsResponse) { + option (google.api.http).get = "/cosmos/gov/v1/proposals/{proposal_id}/vote_options"; + } } // QueryConstitutionRequest is the request type for the Query/Constitution RPC method @@ -203,3 +208,15 @@ message QueryTallyResultResponse { // tally defines the requested tally. TallyResult tally = 1; } + +// QueryProposalVoteOptionsRequest is the request type for the Query/ProposalVoteOptions RPC method. +message QueryProposalVoteOptionsRequest { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} + +// QueryProposalVoteOptionsResponse is the response type for the Query/ProposalVoteOptions RPC method. +message QueryProposalVoteOptionsResponse { + // vote_options defines the valid voting options for a proposal. + ProposalVoteOptions vote_options = 1; +} \ No newline at end of file diff --git a/x/gov/proto/cosmos/gov/v1/tx.proto b/x/gov/proto/cosmos/gov/v1/tx.proto index 78577d443d21..91f63d6b00f3 100644 --- a/x/gov/proto/cosmos/gov/v1/tx.proto +++ b/x/gov/proto/cosmos/gov/v1/tx.proto @@ -43,6 +43,11 @@ service Msg { // // Since: cosmos-sdk 0.50 rpc CancelProposal(MsgCancelProposal) returns (MsgCancelProposalResponse); + + // SubmitMultipleChoiceProposal defines a method to create new multiple choice proposal. + // + // Since: x/gov 1.0.0 + rpc SubmitMultipleChoiceProposal(MsgSubmitMultipleChoiceProposal) returns (MsgSubmitMultipleChoiceProposalResponse); } // MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary @@ -89,7 +94,7 @@ message MsgSubmitProposal { // proposal_type defines the type of proposal // When not set defaults to PROPOSAL_TYPE_STANDARD // - // Since: cosmos-sdk 0.51 + // Since: x/gov v1.0.0 ProposalType proposal_type = 8; } @@ -220,3 +225,41 @@ message MsgCancelProposalResponse { // canceled_height defines the block height at which the proposal is canceled. uint64 canceled_height = 3; } + +// MsgSubmitMultipleChoiceProposal defines a message to submit a multiple choice proposal. +// +// Since: x/gov 1.0.0 +message MsgSubmitMultipleChoiceProposal { + option (cosmos.msg.v1.signer) = "proposer"; + + // initial_deposit is the deposit value that must be paid at proposal submission. + repeated cosmos.base.v1beta1.Coin initial_deposit = 1 [ + (gogoproto.nullable) = false, + (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins", + (amino.dont_omitempty) = true, + (amino.encoding) = "legacy_coins" + ]; + + // proposer is the account address of the proposer. + string proposer = 2 [(cosmos_proto.scalar) = "cosmos.AddressString"]; + + // metadata is any arbitrary metadata attached to the proposal. + string metadata = 3; + + // title is the title of the proposal. + string title = 4; + + // summary is the summary of the proposal + string summary = 5; + + // vote_options defines the vote options for the proposal. + ProposalVoteOptions vote_options = 6; +} + +// MsgSubmitMultipleChoiceProposalResponse defines the Msg/SubmitMultipleChoiceProposal response type. +// +// Since: x/gov 1.0.0 +message MsgSubmitMultipleChoiceProposalResponse { + // proposal_id defines the unique id of the proposal. + uint64 proposal_id = 1; +} diff --git a/x/gov/simulation/genesis.go b/x/gov/simulation/genesis.go index 389edc1d012b..e3c96e036ec9 100644 --- a/x/gov/simulation/genesis.go +++ b/x/gov/simulation/genesis.go @@ -17,19 +17,20 @@ import ( // Simulation parameter constants const ( - MinDeposit = "min_deposit" - ExpeditedMinDeposit = "expedited_min_deposit" - DepositPeriod = "deposit_period" - MinInitialRatio = "min_initial_ratio" - VotingPeriod = "voting_period" - ExpeditedVotingPeriod = "expedited_voting_period" - Quorum = "quorum" - Threshold = "threshold" - ExpeditedThreshold = "expedited_threshold" - Veto = "veto" - OptimisticRejectedThreshold = "optimistic_rejected_threshold" - ProposalCancelRate = "proposal_cancel_rate" - MinDepositRatio = "min_deposit_ratio" + MinDeposit = "min_deposit" + ExpeditedMinDeposit = "expedited_min_deposit" + DepositPeriod = "deposit_period" + MinInitialRatio = "min_initial_ratio" + VotingPeriod = "voting_period" + ExpeditedVotingPeriod = "expedited_voting_period" + Quorum = "quorum" + Threshold = "threshold" + ExpeditedThreshold = "expedited_threshold" + Veto = "veto" + OptimisticRejectedThreshold = "optimistic_rejected_threshold" + ProposalCancelRate = "proposal_cancel_rate" + ProposalMaxCancelVotingPeriod = "proposal_max_cancel_voting_period" + MinDepositRatio = "min_deposit_ratio" // ExpeditedThreshold must be at least as large as the regular Threshold // Therefore, we use this break out point in randomization. @@ -66,6 +67,10 @@ func GenProposalCancelRate(r *rand.Rand) sdkmath.LegacyDec { return sdkmath.LegacyNewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdkmath.LegacyNewDec(100)) } +func GenProposalMaxCancelVotingPeriod(r *rand.Rand) sdkmath.LegacyDec { + return sdkmath.LegacyNewDec(int64(simulation.RandIntBetween(r, 0, 99))).Quo(sdkmath.LegacyNewDec(100)) +} + // GenVotingPeriod returns randomized VotingPeriod func GenVotingPeriod(r *rand.Rand) time.Duration { return time.Duration(simulation.RandIntBetween(r, expeditedMaxVotingPeriod, 2*expeditedMaxVotingPeriod)) * time.Second @@ -125,6 +130,9 @@ func RandomizedGenState(simState *module.SimulationState) { var proposalCancelRate sdkmath.LegacyDec simState.AppParams.GetOrGenerate(ProposalCancelRate, &proposalCancelRate, simState.Rand, func(r *rand.Rand) { proposalCancelRate = GenProposalCancelRate(r) }) + var proposalMaxCancelVotingPeriod sdkmath.LegacyDec + simState.AppParams.GetOrGenerate(ProposalMaxCancelVotingPeriod, &proposalMaxCancelVotingPeriod, simState.Rand, func(r *rand.Rand) { proposalMaxCancelVotingPeriod = GenProposalMaxCancelVotingPeriod(r) }) + var votingPeriod time.Duration simState.AppParams.GetOrGenerate(VotingPeriod, &votingPeriod, simState.Rand, func(r *rand.Rand) { votingPeriod = GenVotingPeriod(r) }) @@ -151,7 +159,7 @@ func RandomizedGenState(simState *module.SimulationState) { govGenesis := v1.NewGenesisState( startingProposalID, - v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), "", simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), optimisticRejectedThreshold.String(), []string{}), + v1.NewParams(minDeposit, expeditedMinDeposit, depositPeriod, votingPeriod, expeditedVotingPeriod, quorum.String(), threshold.String(), expitedVotingThreshold.String(), veto.String(), minInitialDepositRatio.String(), proposalCancelRate.String(), "", proposalMaxCancelVotingPeriod.String(), simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, simState.Rand.Intn(2) == 0, minDepositRatio.String(), optimisticRejectedThreshold.String(), []string{}), ) bz, err := json.MarshalIndent(&govGenesis, "", " ") diff --git a/x/gov/simulation/genesis_test.go b/x/gov/simulation/genesis_test.go index ce45a0b42b20..6e14ccc68613 100644 --- a/x/gov/simulation/genesis_test.go +++ b/x/gov/simulation/genesis_test.go @@ -46,22 +46,24 @@ func TestRandomizedGenState(t *testing.T) { simState.Cdc.MustUnmarshalJSON(simState.GenState[types.ModuleName], &govGenesis) const ( - tallyQuorum = "0.350000000000000000" - tallyThreshold = "0.495000000000000000" - tallyExpeditedThreshold = "0.545000000000000000" - tallyVetoThreshold = "0.327000000000000000" + tallyQuorum = "0.387000000000000000" + tallyThreshold = "0.452000000000000000" + tallyExpeditedThreshold = "0.537000000000000000" + tallyVetoThreshold = "0.276000000000000000" minInitialDepositDec = "0.880000000000000000" + proposalCancelMaxPeriod = "0.110000000000000000" ) assert.Equal(t, "272stake", govGenesis.Params.MinDeposit[0].String()) assert.Equal(t, "800stake", govGenesis.Params.ExpeditedMinDeposit[0].String()) assert.Equal(t, "41h11m36s", govGenesis.Params.MaxDepositPeriod.String()) - assert.Equal(t, float64(283889), govGenesis.Params.VotingPeriod.Seconds()) - assert.Equal(t, float64(123081), govGenesis.Params.ExpeditedVotingPeriod.Seconds()) + assert.Equal(t, float64(291928), govGenesis.Params.VotingPeriod.Seconds()) + assert.Equal(t, float64(33502), govGenesis.Params.ExpeditedVotingPeriod.Seconds()) assert.Equal(t, tallyQuorum, govGenesis.Params.Quorum) assert.Equal(t, tallyThreshold, govGenesis.Params.Threshold) assert.Equal(t, tallyExpeditedThreshold, govGenesis.Params.ExpeditedThreshold) assert.Equal(t, tallyVetoThreshold, govGenesis.Params.VetoThreshold) + assert.Equal(t, proposalCancelMaxPeriod, govGenesis.Params.ProposalCancelMaxPeriod) assert.Equal(t, uint64(0x28), govGenesis.StartingProposalId) assert.DeepEqual(t, []*v1.Deposit{}, govGenesis.Deposits) assert.DeepEqual(t, []*v1.Vote{}, govGenesis.Votes) diff --git a/x/gov/types/errors.go b/x/gov/types/errors.go index afbbbc2b70be..95e06916092c 100644 --- a/x/gov/types/errors.go +++ b/x/gov/types/errors.go @@ -26,4 +26,5 @@ var ( ErrSummaryTooLong = errors.Register(ModuleName, 22, "summary too long") ErrInvalidDepositDenom = errors.Register(ModuleName, 23, "invalid deposit denom") ErrTitleTooLong = errors.Register(ModuleName, 24, "title too long") + ErrTooLateToCancel = errors.Register(ModuleName, 25, "too late to cancel proposal") ) diff --git a/x/gov/types/keys.go b/x/gov/types/keys.go index 53ab36928007..2d0b4e869992 100644 --- a/x/gov/types/keys.go +++ b/x/gov/types/keys.go @@ -25,4 +25,5 @@ var ( VotesKeyPrefix = collections.NewPrefix(32) // VotesKeyPrefix stores the votes of proposals. ParamsKey = collections.NewPrefix(48) // ParamsKey stores the module's params. ConstitutionKey = collections.NewPrefix(49) // ConstitutionKey stores a chain's constitution. + ProposalVoteOptionsKeyPrefix = collections.NewPrefix(50) // ProposalVoteOptionsKeyPrefix stores the vote options of proposals. ) diff --git a/x/gov/types/v1/codec.go b/x/gov/types/v1/codec.go index c4b0b2b4956e..3043de58173b 100644 --- a/x/gov/types/v1/codec.go +++ b/x/gov/types/v1/codec.go @@ -12,6 +12,7 @@ import ( // governance module. func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgSubmitProposal{}, "cosmos-sdk/v1/MsgSubmitProposal") + legacy.RegisterAminoMsg(cdc, &MsgSubmitMultipleChoiceProposal{}, "gov/MsgSubmitMultipleChoiceProposal") legacy.RegisterAminoMsg(cdc, &MsgDeposit{}, "cosmos-sdk/v1/MsgDeposit") legacy.RegisterAminoMsg(cdc, &MsgVote{}, "cosmos-sdk/v1/MsgVote") legacy.RegisterAminoMsg(cdc, &MsgVoteWeighted{}, "cosmos-sdk/v1/MsgVoteWeighted") @@ -23,6 +24,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { func RegisterInterfaces(registry codectypes.InterfaceRegistry) { registry.RegisterImplementations((*sdk.Msg)(nil), &MsgSubmitProposal{}, + &MsgSubmitMultipleChoiceProposal{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgDeposit{}, diff --git a/x/gov/types/v1/gov.pb.go b/x/gov/types/v1/gov.pb.go index f8f0c2e3c5af..189043794942 100644 --- a/x/gov/types/v1/gov.pb.go +++ b/x/gov/types/v1/gov.pb.go @@ -351,7 +351,7 @@ type Proposal struct { FailedReason string `protobuf:"bytes,15,opt,name=failed_reason,json=failedReason,proto3" json:"failed_reason,omitempty"` // proposal_type defines the type of the proposal // - // Since: cosmos-sdk 0.51 + // Since: x/gov v1.0.0 ProposalType ProposalType `protobuf:"varint,16,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } @@ -501,6 +501,91 @@ func (m *Proposal) GetProposalType() ProposalType { return ProposalType_PROPOSAL_TYPE_UNSPECIFIED } +// ProposalVoteOptions defines the stringified vote options for proposals. +// This allows to support multiple choice options for a given proposal. +// +// Since: x/gov v1.0.0 +type ProposalVoteOptions struct { + // option_one is the first option of the proposal + OptionOne string `protobuf:"bytes,1,opt,name=option_one,json=optionOne,proto3" json:"option_one,omitempty"` + // option_two is the second option of the proposal + OptionTwo string `protobuf:"bytes,2,opt,name=option_two,json=optionTwo,proto3" json:"option_two,omitempty"` + // option_three is the third option of the proposal + OptionThree string `protobuf:"bytes,3,opt,name=option_three,json=optionThree,proto3" json:"option_three,omitempty"` + // option_four is the fourth option of the proposal + OptionFour string `protobuf:"bytes,4,opt,name=option_four,json=optionFour,proto3" json:"option_four,omitempty"` + // option_spam is always present for all proposals. + OptionSpam string `protobuf:"bytes,5,opt,name=option_spam,json=optionSpam,proto3" json:"option_spam,omitempty"` +} + +func (m *ProposalVoteOptions) Reset() { *m = ProposalVoteOptions{} } +func (m *ProposalVoteOptions) String() string { return proto.CompactTextString(m) } +func (*ProposalVoteOptions) ProtoMessage() {} +func (*ProposalVoteOptions) Descriptor() ([]byte, []int) { + return fileDescriptor_e05cb1c0d030febb, []int{3} +} +func (m *ProposalVoteOptions) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *ProposalVoteOptions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_ProposalVoteOptions.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *ProposalVoteOptions) XXX_Merge(src proto.Message) { + xxx_messageInfo_ProposalVoteOptions.Merge(m, src) +} +func (m *ProposalVoteOptions) XXX_Size() int { + return m.Size() +} +func (m *ProposalVoteOptions) XXX_DiscardUnknown() { + xxx_messageInfo_ProposalVoteOptions.DiscardUnknown(m) +} + +var xxx_messageInfo_ProposalVoteOptions proto.InternalMessageInfo + +func (m *ProposalVoteOptions) GetOptionOne() string { + if m != nil { + return m.OptionOne + } + return "" +} + +func (m *ProposalVoteOptions) GetOptionTwo() string { + if m != nil { + return m.OptionTwo + } + return "" +} + +func (m *ProposalVoteOptions) GetOptionThree() string { + if m != nil { + return m.OptionThree + } + return "" +} + +func (m *ProposalVoteOptions) GetOptionFour() string { + if m != nil { + return m.OptionFour + } + return "" +} + +func (m *ProposalVoteOptions) GetOptionSpam() string { + if m != nil { + return m.OptionSpam + } + return "" +} + // TallyResult defines a standard tally for a governance proposal. type TallyResult struct { // yes_count is the number of yes votes on a proposal. @@ -519,7 +604,7 @@ func (m *TallyResult) Reset() { *m = TallyResult{} } func (m *TallyResult) String() string { return proto.CompactTextString(m) } func (*TallyResult) ProtoMessage() {} func (*TallyResult) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{3} + return fileDescriptor_e05cb1c0d030febb, []int{4} } func (m *TallyResult) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -601,7 +686,7 @@ func (m *Vote) Reset() { *m = Vote{} } func (m *Vote) String() string { return proto.CompactTextString(m) } func (*Vote) ProtoMessage() {} func (*Vote) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{4} + return fileDescriptor_e05cb1c0d030febb, []int{5} } func (m *Vote) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -673,7 +758,7 @@ func (m *DepositParams) Reset() { *m = DepositParams{} } func (m *DepositParams) String() string { return proto.CompactTextString(m) } func (*DepositParams) ProtoMessage() {} func (*DepositParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{5} + return fileDescriptor_e05cb1c0d030febb, []int{6} } func (m *DepositParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -728,7 +813,7 @@ func (m *VotingParams) Reset() { *m = VotingParams{} } func (m *VotingParams) String() string { return proto.CompactTextString(m) } func (*VotingParams) ProtoMessage() {} func (*VotingParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{6} + return fileDescriptor_e05cb1c0d030febb, []int{7} } func (m *VotingParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -782,7 +867,7 @@ func (m *TallyParams) Reset() { *m = TallyParams{} } func (m *TallyParams) String() string { return proto.CompactTextString(m) } func (*TallyParams) ProtoMessage() {} func (*TallyParams) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{7} + return fileDescriptor_e05cb1c0d030febb, []int{8} } func (m *TallyParams) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -873,10 +958,16 @@ type Params struct { // Minimum expedited deposit for a proposal to enter voting period. ExpeditedMinDeposit []types.Coin `protobuf:"bytes,12,rep,name=expedited_min_deposit,json=expeditedMinDeposit,proto3" json:"expedited_min_deposit"` // burn deposits if a proposal does not meet quorum + // + // Since: cosmos-sdk 0.47 BurnVoteQuorum bool `protobuf:"varint,13,opt,name=burn_vote_quorum,json=burnVoteQuorum,proto3" json:"burn_vote_quorum,omitempty"` // burn deposits if the proposal does not enter voting period + // + // Since: cosmos-sdk 0.47 BurnProposalDepositPrevote bool `protobuf:"varint,14,opt,name=burn_proposal_deposit_prevote,json=burnProposalDepositPrevote,proto3" json:"burn_proposal_deposit_prevote,omitempty"` // burn deposits if quorum with vote type no_veto is met + // + // Since: cosmos-sdk 0.47 BurnVoteVeto bool `protobuf:"varint,15,opt,name=burn_vote_veto,json=burnVoteVeto,proto3" json:"burn_vote_veto,omitempty"` // The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. // Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be @@ -884,23 +975,30 @@ type Params struct { // // Since: cosmos-sdk 0.50 MinDepositRatio string `protobuf:"bytes,16,opt,name=min_deposit_ratio,json=minDepositRatio,proto3" json:"min_deposit_ratio,omitempty"` + // proposal_cancel_max_period defines how far in the voting period a proposer can cancel a proposal. + // If the proposal is cancelled before the max cancel period, the deposit will be returned/burn to the + // depositors, according to the proposal_cancel_ratio and proposal_cancel_dest parameters. + // After the max cancel period, the proposal cannot be cancelled anymore. + // + // Since: x/gov v1.0.0 + ProposalCancelMaxPeriod string `protobuf:"bytes,17,opt,name=proposal_cancel_max_period,json=proposalCancelMaxPeriod,proto3" json:"proposal_cancel_max_period,omitempty"` // optimistic_authorized_addresses is an optional governance parameter that limits the authorized accounts than can // submit optimistic proposals // // Since: x/gov v1.0.0 - OptimisticAuthorizedAddresses []string `protobuf:"bytes,17,rep,name=optimistic_authorized_addresses,json=optimisticAuthorizedAddresses,proto3" json:"optimistic_authorized_addresses,omitempty"` + OptimisticAuthorizedAddresses []string `protobuf:"bytes,18,rep,name=optimistic_authorized_addresses,json=optimisticAuthorizedAddresses,proto3" json:"optimistic_authorized_addresses,omitempty"` // optimistic rejected threshold defines at which percentage of NO votes, the optimistic proposal should fail and be // converted to a standard proposal. The threshold is expressed as a percentage of the total bonded tokens. // // Since: x/gov v1.0.0 - OptimisticRejectedThreshold string `protobuf:"bytes,18,opt,name=optimistic_rejected_threshold,json=optimisticRejectedThreshold,proto3" json:"optimistic_rejected_threshold,omitempty"` + OptimisticRejectedThreshold string `protobuf:"bytes,19,opt,name=optimistic_rejected_threshold,json=optimisticRejectedThreshold,proto3" json:"optimistic_rejected_threshold,omitempty"` } func (m *Params) Reset() { *m = Params{} } func (m *Params) String() string { return proto.CompactTextString(m) } func (*Params) ProtoMessage() {} func (*Params) Descriptor() ([]byte, []int) { - return fileDescriptor_e05cb1c0d030febb, []int{8} + return fileDescriptor_e05cb1c0d030febb, []int{9} } func (m *Params) XXX_Unmarshal(b []byte) error { return m.Unmarshal(b) @@ -1041,6 +1139,13 @@ func (m *Params) GetMinDepositRatio() string { return "" } +func (m *Params) GetProposalCancelMaxPeriod() string { + if m != nil { + return m.ProposalCancelMaxPeriod + } + return "" +} + func (m *Params) GetOptimisticAuthorizedAddresses() []string { if m != nil { return m.OptimisticAuthorizedAddresses @@ -1062,6 +1167,7 @@ func init() { proto.RegisterType((*WeightedVoteOption)(nil), "cosmos.gov.v1.WeightedVoteOption") proto.RegisterType((*Deposit)(nil), "cosmos.gov.v1.Deposit") proto.RegisterType((*Proposal)(nil), "cosmos.gov.v1.Proposal") + proto.RegisterType((*ProposalVoteOptions)(nil), "cosmos.gov.v1.ProposalVoteOptions") proto.RegisterType((*TallyResult)(nil), "cosmos.gov.v1.TallyResult") proto.RegisterType((*Vote)(nil), "cosmos.gov.v1.Vote") proto.RegisterType((*DepositParams)(nil), "cosmos.gov.v1.DepositParams") @@ -1073,110 +1179,117 @@ func init() { func init() { proto.RegisterFile("cosmos/gov/v1/gov.proto", fileDescriptor_e05cb1c0d030febb) } var fileDescriptor_e05cb1c0d030febb = []byte{ - // 1645 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4d, 0x6f, 0xe3, 0xc6, - 0x19, 0x36, 0xf5, 0x65, 0xe9, 0xd5, 0x87, 0xe9, 0x59, 0x6f, 0x4c, 0xdb, 0xb1, 0xe4, 0xa8, 0x41, - 0xe0, 0xba, 0x59, 0xa9, 0x4e, 0xba, 0x3d, 0x24, 0x05, 0x5a, 0x7d, 0x70, 0x6b, 0x1a, 0xb6, 0xa5, - 0x52, 0xb4, 0xbd, 0xdb, 0x0b, 0x4b, 0x8b, 0xb3, 0x32, 0x5b, 0x91, 0xa3, 0x92, 0x23, 0xc5, 0xea, - 0x0f, 0xe8, 0x39, 0xc7, 0x9e, 0x8a, 0xde, 0xda, 0x63, 0x0f, 0x41, 0xff, 0x41, 0x81, 0xa0, 0x87, - 0x22, 0xc8, 0xa9, 0x97, 0x6e, 0x8b, 0xdd, 0x43, 0x81, 0xfc, 0x84, 0x9e, 0x02, 0x0e, 0x87, 0x22, - 0x25, 0x2b, 0xb1, 0x9d, 0x8b, 0x4d, 0xbe, 0xef, 0xf3, 0x3c, 0xf3, 0xce, 0xfb, 0x31, 0x23, 0x09, - 0x36, 0xfb, 0xc4, 0xb3, 0x89, 0x57, 0x1f, 0x90, 0x49, 0x7d, 0x72, 0xe8, 0xff, 0xab, 0x8d, 0x5c, - 0x42, 0x09, 0x2a, 0x06, 0x8e, 0x9a, 0x6f, 0x99, 0x1c, 0x6e, 0x97, 0x39, 0xee, 0xca, 0xf0, 0x70, - 0x7d, 0x72, 0x78, 0x85, 0xa9, 0x71, 0x58, 0xef, 0x13, 0xcb, 0x09, 0xe0, 0xdb, 0x1b, 0x03, 0x32, - 0x20, 0xec, 0xb1, 0xee, 0x3f, 0x71, 0x6b, 0x65, 0x40, 0xc8, 0x60, 0x88, 0xeb, 0xec, 0xed, 0x6a, - 0xfc, 0xb2, 0x4e, 0x2d, 0x1b, 0x7b, 0xd4, 0xb0, 0x47, 0x1c, 0xb0, 0xb5, 0x08, 0x30, 0x9c, 0x29, - 0x77, 0x95, 0x17, 0x5d, 0xe6, 0xd8, 0x35, 0xa8, 0x45, 0xc2, 0x15, 0xb7, 0x82, 0x88, 0xf4, 0x60, - 0x51, 0x1e, 0x6d, 0xe0, 0x5a, 0x37, 0x6c, 0xcb, 0x21, 0x75, 0xf6, 0x37, 0x30, 0x55, 0x09, 0xa0, - 0x4b, 0x6c, 0x0d, 0xae, 0x29, 0x36, 0x2f, 0x08, 0xc5, 0x9d, 0x91, 0xaf, 0x84, 0x0e, 0x21, 0x43, - 0xd8, 0x93, 0x24, 0xec, 0x09, 0xfb, 0xa5, 0x0f, 0xb6, 0x6a, 0x73, 0xbb, 0xae, 0x45, 0x50, 0x95, - 0x03, 0xd1, 0x7b, 0x90, 0xf9, 0x84, 0x09, 0x49, 0x89, 0x3d, 0x61, 0x3f, 0xd7, 0x2c, 0x7d, 0xf9, - 0xd9, 0x13, 0xe0, 0xac, 0x36, 0xee, 0xab, 0xdc, 0x5b, 0xfd, 0x93, 0x00, 0xab, 0x6d, 0x3c, 0x22, - 0x9e, 0x45, 0x51, 0x05, 0xf2, 0x23, 0x97, 0x8c, 0x88, 0x67, 0x0c, 0x75, 0xcb, 0x64, 0x6b, 0xa5, - 0x54, 0x08, 0x4d, 0x8a, 0x89, 0x7e, 0x0c, 0x39, 0x33, 0xc0, 0x12, 0x97, 0xeb, 0x4a, 0x5f, 0x7e, - 0xf6, 0x64, 0x83, 0xeb, 0x36, 0x4c, 0xd3, 0xc5, 0x9e, 0xd7, 0xa3, 0xae, 0xe5, 0x0c, 0xd4, 0x08, - 0x8a, 0x7e, 0x02, 0x19, 0xc3, 0x26, 0x63, 0x87, 0x4a, 0xc9, 0xbd, 0xe4, 0x7e, 0x3e, 0x8a, 0xdf, - 0x2f, 0x53, 0x8d, 0x97, 0xa9, 0xd6, 0x22, 0x96, 0xd3, 0xcc, 0x7d, 0xfe, 0xaa, 0xb2, 0xf2, 0x97, - 0xff, 0xfd, 0xf5, 0x40, 0x50, 0x39, 0xa7, 0xfa, 0x8f, 0x0c, 0x64, 0xbb, 0x3c, 0x08, 0x54, 0x82, - 0xc4, 0x2c, 0xb4, 0x84, 0x65, 0xa2, 0x1f, 0x42, 0xd6, 0xc6, 0x9e, 0x67, 0x0c, 0xb0, 0x27, 0x25, - 0x98, 0xf8, 0x46, 0x2d, 0xa8, 0x48, 0x2d, 0xac, 0x48, 0xad, 0xe1, 0x4c, 0xd5, 0x19, 0x0a, 0x3d, - 0x85, 0x8c, 0x47, 0x0d, 0x3a, 0xf6, 0xa4, 0x24, 0x4b, 0xe6, 0xee, 0x42, 0x32, 0xc3, 0xa5, 0x7a, - 0x0c, 0xa4, 0x72, 0x30, 0x3a, 0x02, 0xf4, 0xd2, 0x72, 0x8c, 0xa1, 0x4e, 0x8d, 0xe1, 0x70, 0xaa, - 0xbb, 0xd8, 0x1b, 0x0f, 0xa9, 0x94, 0xda, 0x13, 0xf6, 0xf3, 0x1f, 0x6c, 0x2f, 0x48, 0x68, 0x3e, - 0x44, 0x65, 0x08, 0x55, 0x64, 0xac, 0x98, 0x05, 0x35, 0x20, 0xef, 0x8d, 0xaf, 0x6c, 0x8b, 0xea, - 0x7e, 0x9b, 0x49, 0x69, 0x2e, 0xb1, 0x18, 0xb5, 0x16, 0xf6, 0x60, 0x33, 0xf5, 0xe9, 0x7f, 0x2a, - 0x82, 0x0a, 0x01, 0xc9, 0x37, 0xa3, 0x63, 0x10, 0x79, 0x76, 0x75, 0xec, 0x98, 0x81, 0x4e, 0xe6, - 0x9e, 0x3a, 0x25, 0xce, 0x94, 0x1d, 0x93, 0x69, 0x29, 0x50, 0xa4, 0x84, 0x1a, 0x43, 0x9d, 0xdb, - 0xa5, 0xd5, 0x07, 0xd4, 0xa8, 0xc0, 0xa8, 0x61, 0x03, 0x9d, 0xc0, 0xfa, 0x84, 0x50, 0xcb, 0x19, - 0xe8, 0x1e, 0x35, 0x5c, 0xbe, 0xbf, 0xec, 0x3d, 0xe3, 0x5a, 0x0b, 0xa8, 0x3d, 0x9f, 0xc9, 0x02, - 0x3b, 0x02, 0x6e, 0x8a, 0xf6, 0x98, 0xbb, 0xa7, 0x56, 0x31, 0x20, 0x86, 0x5b, 0xdc, 0xf6, 0x9b, - 0x84, 0x1a, 0xa6, 0x41, 0x0d, 0x09, 0xfc, 0xb6, 0x55, 0x67, 0xef, 0x68, 0x03, 0xd2, 0xd4, 0xa2, - 0x43, 0x2c, 0xe5, 0x99, 0x23, 0x78, 0x41, 0x12, 0xac, 0x7a, 0x63, 0xdb, 0x36, 0xdc, 0xa9, 0x54, - 0x60, 0xf6, 0xf0, 0x15, 0xfd, 0x08, 0xb2, 0xc1, 0x44, 0x60, 0x57, 0x2a, 0xde, 0x31, 0x02, 0x33, - 0x24, 0xda, 0x83, 0x1c, 0xbe, 0x19, 0x61, 0xd3, 0xa2, 0xd8, 0x94, 0x4a, 0x7b, 0xc2, 0x7e, 0xb6, - 0x99, 0x90, 0x04, 0x35, 0x32, 0xa2, 0xef, 0x41, 0xf1, 0xa5, 0x61, 0x0d, 0xb1, 0xa9, 0xbb, 0xd8, - 0xf0, 0x88, 0x23, 0xad, 0xb1, 0x75, 0x0b, 0x81, 0x51, 0x65, 0x36, 0xf4, 0x33, 0x28, 0xce, 0x26, - 0x94, 0x4e, 0x47, 0x58, 0x12, 0x59, 0x0b, 0xef, 0x7c, 0x43, 0x0b, 0x6b, 0xd3, 0x11, 0x56, 0x0b, - 0xa3, 0xd8, 0x5b, 0xf5, 0xf7, 0x09, 0xc8, 0xc7, 0x9b, 0xf1, 0x07, 0x90, 0x9b, 0x62, 0x4f, 0xef, - 0xb3, 0xe9, 0x14, 0x6e, 0x1d, 0x15, 0x8a, 0x43, 0xd5, 0xec, 0x14, 0x7b, 0x2d, 0xdf, 0x8f, 0x3e, - 0x84, 0xa2, 0x71, 0xe5, 0x51, 0xc3, 0x72, 0x38, 0x21, 0xb1, 0x94, 0x50, 0xe0, 0xa0, 0x80, 0xf4, - 0x7d, 0xc8, 0x3a, 0x84, 0xe3, 0x93, 0x4b, 0xf1, 0xab, 0x0e, 0x09, 0xa0, 0x1f, 0x03, 0x72, 0x88, - 0xfe, 0x89, 0x45, 0xaf, 0xf5, 0x09, 0xa6, 0x21, 0x29, 0xb5, 0x94, 0xb4, 0xe6, 0x90, 0x4b, 0x8b, - 0x5e, 0x5f, 0x60, 0xca, 0xc9, 0x4f, 0x00, 0xbc, 0x91, 0x61, 0x73, 0x52, 0x7a, 0x29, 0x29, 0xe7, - 0x23, 0x18, 0xbc, 0xfa, 0x37, 0x01, 0x52, 0xfe, 0xb9, 0x79, 0xf7, 0xa9, 0x57, 0x83, 0xf4, 0x84, - 0x50, 0x7c, 0xf7, 0x89, 0x17, 0xc0, 0xd0, 0xc7, 0xb0, 0x1a, 0x1c, 0xc2, 0x9e, 0x94, 0x62, 0xa3, - 0xf4, 0xce, 0x42, 0x79, 0x6e, 0x9f, 0xf0, 0x6a, 0xc8, 0x98, 0x6b, 0xd5, 0xf4, 0x7c, 0xab, 0x1e, - 0xa7, 0xb2, 0x49, 0x31, 0x55, 0xfd, 0xb7, 0x00, 0x45, 0x3e, 0x70, 0x5d, 0xc3, 0x35, 0x6c, 0x0f, - 0xbd, 0x80, 0xbc, 0x6d, 0x39, 0xb3, 0xf9, 0x15, 0xee, 0x9a, 0xdf, 0x5d, 0x7f, 0x7e, 0xbf, 0x7a, - 0x55, 0x79, 0x1c, 0x63, 0xbd, 0x4f, 0x6c, 0x8b, 0x62, 0x7b, 0x44, 0xa7, 0x2a, 0xd8, 0x96, 0x13, - 0x4e, 0xb4, 0x0d, 0xc8, 0x36, 0x6e, 0x42, 0x90, 0x3e, 0xc2, 0xae, 0x45, 0x4c, 0x96, 0x08, 0x7f, - 0x85, 0xc5, 0x31, 0x6c, 0xf3, 0xab, 0xaf, 0xf9, 0xee, 0x57, 0xaf, 0x2a, 0x6f, 0xdf, 0x26, 0x46, - 0x8b, 0xfc, 0xc1, 0x9f, 0x52, 0xd1, 0x36, 0x6e, 0xc2, 0x9d, 0x30, 0xff, 0x47, 0x09, 0x49, 0xa8, - 0x3e, 0x87, 0xc2, 0x05, 0x9b, 0x5e, 0xbe, 0xbb, 0x36, 0xf0, 0x69, 0x0e, 0x57, 0x17, 0xee, 0x5a, - 0x3d, 0xc5, 0xd4, 0x0b, 0x01, 0x2b, 0xa6, 0xfc, 0x47, 0x81, 0xf7, 0x3e, 0x57, 0x7e, 0x0f, 0x32, - 0xbf, 0x1d, 0x13, 0x77, 0x6c, 0x2f, 0x69, 0x7c, 0x76, 0x47, 0x06, 0x5e, 0xf4, 0x3e, 0xe4, 0xe8, - 0xb5, 0x8b, 0xbd, 0x6b, 0x32, 0x34, 0xbf, 0xe1, 0x3a, 0x8d, 0x00, 0xe8, 0x29, 0x94, 0x58, 0xf3, - 0x46, 0x94, 0xe4, 0x52, 0x4a, 0xd1, 0x47, 0x69, 0x21, 0x88, 0x05, 0xf8, 0xf7, 0x1c, 0x64, 0x78, - 0x6c, 0xf2, 0x03, 0x6b, 0x1a, 0x3b, 0x93, 0xe3, 0xf5, 0x3b, 0xfd, 0x6e, 0xf5, 0x4b, 0x2d, 0xaf, - 0xcf, 0xed, 0x5a, 0x24, 0xbf, 0x43, 0x2d, 0x62, 0x79, 0x4f, 0xdd, 0x3f, 0xef, 0xe9, 0x87, 0xe7, - 0x3d, 0x73, 0x8f, 0xbc, 0x23, 0x05, 0xb6, 0xfc, 0x44, 0x5b, 0x8e, 0x45, 0xad, 0xe8, 0x12, 0xd4, - 0x59, 0xf8, 0xd2, 0xea, 0x52, 0x85, 0xb7, 0x6c, 0xcb, 0x51, 0x02, 0x3c, 0x4f, 0x8f, 0xea, 0xa3, - 0x51, 0x13, 0x1e, 0xcf, 0x4e, 0x92, 0xbe, 0xe1, 0xf4, 0xf1, 0x90, 0xcb, 0x64, 0x97, 0xca, 0x3c, - 0x0a, 0xc1, 0x2d, 0x86, 0x0d, 0x34, 0x8e, 0x61, 0x63, 0x51, 0xc3, 0xc4, 0x1e, 0x65, 0x37, 0xdf, - 0xb7, 0x9d, 0x3d, 0x68, 0x5e, 0xac, 0x8d, 0x3d, 0x8a, 0x2e, 0x61, 0x73, 0x76, 0xbf, 0xe8, 0xf3, - 0x75, 0x83, 0xfb, 0xd5, 0xed, 0xf1, 0x8c, 0x7f, 0x11, 0x2f, 0xe0, 0x4f, 0xe1, 0x51, 0x24, 0x1c, - 0xe5, 0x3b, 0xbf, 0x74, 0x9b, 0x68, 0x06, 0x8d, 0x92, 0xfe, 0x1c, 0x22, 0x65, 0x3d, 0xde, 0xe7, - 0x85, 0x07, 0xf4, 0x79, 0x14, 0xc3, 0x69, 0xd4, 0xf0, 0xfb, 0x20, 0x5e, 0x8d, 0x5d, 0xc7, 0xdf, - 0x2e, 0xd6, 0x79, 0x97, 0xf9, 0xd7, 0x74, 0x56, 0x2d, 0xf9, 0x76, 0xff, 0xc8, 0xfd, 0x45, 0xd0, - 0x5d, 0x0d, 0xd8, 0x65, 0xc8, 0x59, 0xba, 0x67, 0x43, 0xe2, 0x62, 0x9f, 0x1d, 0x5c, 0xd3, 0xea, - 0xb6, 0x0f, 0x0a, 0x2f, 0xd4, 0x70, 0x1a, 0x02, 0x04, 0x7a, 0x17, 0x4a, 0xd1, 0x62, 0x7e, 0x5b, - 0xb1, 0x4b, 0x3b, 0xab, 0x16, 0xc2, 0xa5, 0xfc, 0xdb, 0x09, 0x7d, 0x04, 0xeb, 0xb1, 0x2d, 0xf2, - 0x96, 0x10, 0x97, 0xe6, 0x6a, 0x2d, 0x1a, 0xdd, 0xa0, 0x1d, 0x7e, 0x05, 0x15, 0xff, 0x66, 0xb0, - 0x2d, 0x8f, 0x5a, 0x7d, 0xdd, 0x18, 0xd3, 0x6b, 0xe2, 0x5a, 0xbf, 0xc3, 0xa6, 0x6e, 0x04, 0xd5, - 0xc7, 0x9e, 0xb4, 0xbe, 0x97, 0xfc, 0xd6, 0xce, 0xd8, 0x8d, 0x04, 0x1a, 0x33, 0x7e, 0x23, 0xa4, - 0x23, 0x15, 0x62, 0x00, 0xdd, 0xc5, 0xbf, 0xc6, 0xfd, 0xf9, 0xaa, 0xa2, 0xa5, 0x91, 0xee, 0x44, - 0x24, 0x95, 0x73, 0x66, 0xe5, 0x3d, 0xf8, 0xb3, 0x00, 0x85, 0xf8, 0x67, 0x10, 0xb4, 0x0b, 0x5b, - 0x5d, 0xb5, 0xd3, 0xed, 0xf4, 0x1a, 0x27, 0xba, 0xf6, 0xa2, 0x2b, 0xeb, 0xe7, 0x67, 0xbd, 0xae, - 0xdc, 0x52, 0x9e, 0x29, 0x72, 0x5b, 0x5c, 0x41, 0xdb, 0xf0, 0xd6, 0xbc, 0xbb, 0xa7, 0x35, 0xce, - 0xda, 0x0d, 0xb5, 0x2d, 0x0a, 0xe8, 0x1d, 0xd8, 0x9d, 0xf7, 0x9d, 0x9e, 0x9f, 0x68, 0x4a, 0xf7, - 0x44, 0xd6, 0x5b, 0x47, 0x1d, 0xa5, 0x25, 0x8b, 0x09, 0xf4, 0x36, 0x48, 0xf3, 0x90, 0x4e, 0x57, - 0x53, 0x4e, 0x95, 0x9e, 0xa6, 0xb4, 0xc4, 0x24, 0xda, 0x81, 0xcd, 0x79, 0xaf, 0xfc, 0xbc, 0x2b, - 0xb7, 0x15, 0x4d, 0x6e, 0x8b, 0xa9, 0x83, 0xff, 0x0b, 0x00, 0xb1, 0x2f, 0x5a, 0x3b, 0xb0, 0x79, - 0xd1, 0xd1, 0x02, 0x81, 0xce, 0xd9, 0x42, 0x94, 0x8f, 0x60, 0x2d, 0xee, 0xec, 0x9c, 0xc9, 0xa2, - 0xb0, 0x68, 0x7c, 0x21, 0xf7, 0x6e, 0x1b, 0xb5, 0xcb, 0x8e, 0x98, 0x40, 0x9b, 0xf0, 0x28, 0x6e, - 0x6c, 0x34, 0x7b, 0x5a, 0x43, 0x39, 0x13, 0x13, 0xe8, 0x31, 0xac, 0xcf, 0xa1, 0x8f, 0x54, 0x59, - 0x16, 0x93, 0x08, 0x41, 0x29, 0x6e, 0x3e, 0xeb, 0x88, 0x49, 0xb4, 0x01, 0x62, 0xdc, 0xf6, 0xac, - 0x73, 0xae, 0x8a, 0x29, 0x7f, 0xff, 0xf3, 0x48, 0xfd, 0x52, 0xd1, 0x8e, 0xf4, 0x0b, 0x59, 0xeb, - 0x88, 0xa9, 0x45, 0x4e, 0xaf, 0xdb, 0x38, 0x15, 0xd3, 0xdb, 0x09, 0x51, 0x38, 0xf8, 0xa7, 0x00, - 0xa5, 0xf9, 0x6f, 0x3b, 0xa8, 0x02, 0x3b, 0xb3, 0x64, 0xf5, 0xb4, 0x86, 0x76, 0xde, 0x5b, 0x48, - 0x42, 0x15, 0xca, 0x8b, 0x80, 0xb6, 0xdc, 0xed, 0xf4, 0x14, 0x4d, 0xef, 0xca, 0xaa, 0xd2, 0x59, - 0x2c, 0x19, 0xc7, 0x5c, 0x74, 0x34, 0xe5, 0xec, 0xe7, 0x21, 0x24, 0x31, 0x57, 0x71, 0x0e, 0xe9, - 0x36, 0x7a, 0x3d, 0xb9, 0x2d, 0x26, 0xe7, 0xca, 0xc9, 0x7d, 0xaa, 0x7c, 0x2c, 0xb7, 0x58, 0xc5, - 0x96, 0x31, 0x9f, 0x35, 0x94, 0x13, 0xb9, 0x2d, 0xa6, 0x9b, 0x4f, 0x3f, 0x7f, 0x5d, 0x16, 0xbe, - 0x78, 0x5d, 0x16, 0xfe, 0xfb, 0xba, 0x2c, 0x7c, 0xfa, 0xa6, 0xbc, 0xf2, 0xc5, 0x9b, 0xf2, 0xca, - 0xbf, 0xde, 0x94, 0x57, 0x7e, 0xb9, 0x13, 0xb4, 0xae, 0x67, 0xfe, 0xa6, 0x66, 0x91, 0xfa, 0x0d, - 0xfb, 0x1d, 0xc1, 0xff, 0x00, 0xed, 0xd5, 0x27, 0x87, 0x57, 0x19, 0x76, 0xfc, 0x7d, 0xf8, 0x75, - 0x00, 0x00, 0x00, 0xff, 0xff, 0xeb, 0x02, 0x8a, 0x3f, 0x65, 0x10, 0x00, 0x00, + // 1748 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x9c, 0x58, 0x4f, 0x73, 0xe3, 0x48, + 0x15, 0x8f, 0x6c, 0xc7, 0xb1, 0x9f, 0xff, 0x44, 0xe9, 0x64, 0x36, 0x4a, 0xb2, 0x71, 0x32, 0x66, + 0x6b, 0x2b, 0x0c, 0x3b, 0x36, 0xd9, 0x65, 0x38, 0xec, 0x52, 0x05, 0x4e, 0xac, 0x21, 0x1a, 0x92, + 0xd8, 0xc8, 0x9a, 0x64, 0x86, 0x8b, 0x50, 0xa2, 0x1e, 0x47, 0x60, 0xa9, 0x8d, 0xd4, 0xce, 0xc4, + 0x7c, 0x00, 0xce, 0x5b, 0x9c, 0x38, 0x51, 0xdc, 0xe0, 0xc8, 0x61, 0x8b, 0xe2, 0x23, 0x6c, 0x71, + 0xa0, 0xb6, 0xf6, 0xc4, 0x85, 0x81, 0x9a, 0x39, 0x50, 0xb5, 0x1f, 0x81, 0xd3, 0x56, 0xb7, 0x5a, + 0x96, 0xe4, 0x78, 0x37, 0xc9, 0x5c, 0x66, 0xac, 0xf7, 0x7e, 0xbf, 0xd7, 0xdd, 0xef, 0xfd, 0xde, + 0x6b, 0x29, 0xb0, 0x7a, 0x4e, 0x02, 0x97, 0x04, 0xcd, 0x3e, 0xb9, 0x6c, 0x5e, 0xee, 0xb2, 0xff, + 0x1a, 0x43, 0x9f, 0x50, 0x82, 0x2a, 0xa1, 0xa3, 0xc1, 0x2c, 0x97, 0xbb, 0xeb, 0x35, 0x81, 0x3b, + 0xb3, 0x02, 0xdc, 0xbc, 0xdc, 0x3d, 0xc3, 0xd4, 0xda, 0x6d, 0x9e, 0x13, 0xc7, 0x0b, 0xe1, 0xeb, + 0x2b, 0x7d, 0xd2, 0x27, 0xfc, 0x67, 0x93, 0xfd, 0x12, 0xd6, 0xad, 0x3e, 0x21, 0xfd, 0x01, 0x6e, + 0xf2, 0xa7, 0xb3, 0xd1, 0x8b, 0x26, 0x75, 0x5c, 0x1c, 0x50, 0xcb, 0x1d, 0x0a, 0xc0, 0xda, 0x34, + 0xc0, 0xf2, 0xc6, 0xc2, 0x55, 0x9b, 0x76, 0xd9, 0x23, 0xdf, 0xa2, 0x0e, 0x89, 0x56, 0x5c, 0x0b, + 0x77, 0x64, 0x86, 0x8b, 0x8a, 0xdd, 0x86, 0xae, 0x25, 0xcb, 0x75, 0x3c, 0xd2, 0xe4, 0xff, 0x86, + 0xa6, 0x3a, 0x01, 0x74, 0x8a, 0x9d, 0xfe, 0x05, 0xc5, 0xf6, 0x09, 0xa1, 0xb8, 0x33, 0x64, 0x91, + 0xd0, 0x2e, 0xe4, 0x09, 0xff, 0xa5, 0x48, 0xdb, 0xd2, 0x4e, 0xf5, 0xc3, 0xb5, 0x46, 0xea, 0xd4, + 0x8d, 0x18, 0xaa, 0x0b, 0x20, 0x7a, 0x1f, 0xf2, 0x2f, 0x79, 0x20, 0x25, 0xb3, 0x2d, 0xed, 0x14, + 0xf7, 0xaa, 0x5f, 0x7e, 0xf6, 0x10, 0x04, 0xab, 0x8d, 0xcf, 0x75, 0xe1, 0xad, 0xff, 0x49, 0x82, + 0x85, 0x36, 0x1e, 0x92, 0xc0, 0xa1, 0x68, 0x0b, 0x4a, 0x43, 0x9f, 0x0c, 0x49, 0x60, 0x0d, 0x4c, + 0xc7, 0xe6, 0x6b, 0xe5, 0x74, 0x88, 0x4c, 0x9a, 0x8d, 0x7e, 0x08, 0x45, 0x3b, 0xc4, 0x12, 0x5f, + 0xc4, 0x55, 0xbe, 0xfc, 0xec, 0xe1, 0x8a, 0x88, 0xdb, 0xb2, 0x6d, 0x1f, 0x07, 0x41, 0x8f, 0xfa, + 0x8e, 0xd7, 0xd7, 0x63, 0x28, 0xfa, 0x11, 0xe4, 0x2d, 0x97, 0x8c, 0x3c, 0xaa, 0x64, 0xb7, 0xb3, + 0x3b, 0xa5, 0x78, 0xff, 0xac, 0x4c, 0x0d, 0x51, 0xa6, 0xc6, 0x3e, 0x71, 0xbc, 0xbd, 0xe2, 0xe7, + 0xaf, 0xb6, 0xe6, 0xfe, 0xf2, 0xbf, 0xbf, 0x3e, 0x90, 0x74, 0xc1, 0xa9, 0xff, 0x23, 0x0f, 0x85, + 0xae, 0xd8, 0x04, 0xaa, 0x42, 0x66, 0xb2, 0xb5, 0x8c, 0x63, 0xa3, 0xef, 0x43, 0xc1, 0xc5, 0x41, + 0x60, 0xf5, 0x71, 0xa0, 0x64, 0x78, 0xf0, 0x95, 0x46, 0x58, 0x91, 0x46, 0x54, 0x91, 0x46, 0xcb, + 0x1b, 0xeb, 0x13, 0x14, 0x7a, 0x04, 0xf9, 0x80, 0x5a, 0x74, 0x14, 0x28, 0x59, 0x9e, 0xcc, 0xcd, + 0xa9, 0x64, 0x46, 0x4b, 0xf5, 0x38, 0x48, 0x17, 0x60, 0x74, 0x00, 0xe8, 0x85, 0xe3, 0x59, 0x03, + 0x93, 0x5a, 0x83, 0xc1, 0xd8, 0xf4, 0x71, 0x30, 0x1a, 0x50, 0x25, 0xb7, 0x2d, 0xed, 0x94, 0x3e, + 0x5c, 0x9f, 0x0a, 0x61, 0x30, 0x88, 0xce, 0x11, 0xba, 0xcc, 0x59, 0x09, 0x0b, 0x6a, 0x41, 0x29, + 0x18, 0x9d, 0xb9, 0x0e, 0x35, 0x99, 0xcc, 0x94, 0x79, 0x11, 0x62, 0x7a, 0xd7, 0x46, 0xa4, 0xc1, + 0xbd, 0xdc, 0xa7, 0xff, 0xd9, 0x92, 0x74, 0x08, 0x49, 0xcc, 0x8c, 0x9e, 0x80, 0x2c, 0xb2, 0x6b, + 0x62, 0xcf, 0x0e, 0xe3, 0xe4, 0x6f, 0x19, 0xa7, 0x2a, 0x98, 0xaa, 0x67, 0xf3, 0x58, 0x1a, 0x54, + 0x28, 0xa1, 0xd6, 0xc0, 0x14, 0x76, 0x65, 0xe1, 0x0e, 0x35, 0x2a, 0x73, 0x6a, 0x24, 0xa0, 0x43, + 0x58, 0xba, 0x24, 0xd4, 0xf1, 0xfa, 0x66, 0x40, 0x2d, 0x5f, 0x9c, 0xaf, 0x70, 0xcb, 0x7d, 0x2d, + 0x86, 0xd4, 0x1e, 0x63, 0xf2, 0x8d, 0x1d, 0x80, 0x30, 0xc5, 0x67, 0x2c, 0xde, 0x32, 0x56, 0x25, + 0x24, 0x46, 0x47, 0x5c, 0x67, 0x22, 0xa1, 0x96, 0x6d, 0x51, 0x4b, 0x01, 0x26, 0x5b, 0x7d, 0xf2, + 0x8c, 0x56, 0x60, 0x9e, 0x3a, 0x74, 0x80, 0x95, 0x12, 0x77, 0x84, 0x0f, 0x48, 0x81, 0x85, 0x60, + 0xe4, 0xba, 0x96, 0x3f, 0x56, 0xca, 0xdc, 0x1e, 0x3d, 0xa2, 0x1f, 0x40, 0x21, 0xec, 0x08, 0xec, + 0x2b, 0x95, 0x1b, 0x5a, 0x60, 0x82, 0x44, 0xdb, 0x50, 0xc4, 0x57, 0x43, 0x6c, 0x3b, 0x14, 0xdb, + 0x4a, 0x75, 0x5b, 0xda, 0x29, 0xec, 0x65, 0x14, 0x49, 0x8f, 0x8d, 0xe8, 0x3b, 0x50, 0x79, 0x61, + 0x39, 0x03, 0x6c, 0x9b, 0x3e, 0xb6, 0x02, 0xe2, 0x29, 0x8b, 0x7c, 0xdd, 0x72, 0x68, 0xd4, 0xb9, + 0x0d, 0xfd, 0x04, 0x2a, 0x93, 0x0e, 0xa5, 0xe3, 0x21, 0x56, 0x64, 0x2e, 0xe1, 0x8d, 0x6f, 0x90, + 0xb0, 0x31, 0x1e, 0x62, 0xbd, 0x3c, 0x4c, 0x3c, 0xd5, 0xff, 0x2e, 0xc1, 0x72, 0xe4, 0x8e, 0xc7, + 0x46, 0x80, 0x36, 0x01, 0xc2, 0xc9, 0x61, 0x12, 0x0f, 0xf3, 0xfe, 0x2a, 0xea, 0xc5, 0xd0, 0xd2, + 0xf1, 0x70, 0xc2, 0x4d, 0x5f, 0x92, 0xb0, 0xf5, 0x23, 0xb7, 0xf1, 0x92, 0xa0, 0xfb, 0x50, 0x8e, + 0xdc, 0x17, 0x3e, 0xc6, 0xbc, 0xb3, 0x8a, 0x7a, 0x49, 0x00, 0x98, 0x89, 0x0d, 0x17, 0x01, 0x79, + 0x41, 0x46, 0x3e, 0x6f, 0x9c, 0xa2, 0x2e, 0x82, 0x3e, 0x26, 0x23, 0x3f, 0x01, 0x08, 0x86, 0x96, + 0xcb, 0xdb, 0x62, 0x02, 0xe8, 0x0d, 0x2d, 0xb7, 0xfe, 0xbb, 0x0c, 0x94, 0x92, 0x7d, 0xf4, 0x3d, + 0x28, 0x8e, 0x71, 0x60, 0x9e, 0xf3, 0xc1, 0x22, 0x5d, 0x9b, 0x72, 0x9a, 0x47, 0xf5, 0xc2, 0x18, + 0x07, 0xfb, 0xcc, 0x8f, 0x3e, 0x82, 0x8a, 0x75, 0x16, 0x50, 0xcb, 0xf1, 0x04, 0x21, 0x33, 0x93, + 0x50, 0x16, 0xa0, 0x90, 0xf4, 0x5d, 0x28, 0x78, 0x44, 0xe0, 0xb3, 0x33, 0xf1, 0x0b, 0x1e, 0x09, + 0xa1, 0x9f, 0x00, 0xf2, 0x88, 0xf9, 0xd2, 0xa1, 0x17, 0xe6, 0x25, 0xa6, 0x11, 0x29, 0x37, 0x93, + 0xb4, 0xe8, 0x91, 0x53, 0x87, 0x5e, 0x9c, 0x60, 0x2a, 0xc8, 0x0f, 0x01, 0xd8, 0x99, 0x05, 0x69, + 0x7e, 0x26, 0xa9, 0xc8, 0x10, 0x1c, 0x5e, 0xff, 0x9b, 0x04, 0x39, 0x56, 0xbb, 0x9b, 0x07, 0x76, + 0x03, 0xe6, 0x2f, 0x09, 0xc5, 0x37, 0x0f, 0xeb, 0x10, 0x86, 0x3e, 0x81, 0x85, 0x30, 0xe1, 0x81, + 0x92, 0xe3, 0x53, 0xe0, 0xfe, 0x94, 0xb2, 0xae, 0x5f, 0x4e, 0x7a, 0xc4, 0x48, 0x75, 0xd9, 0x7c, + 0xba, 0xcb, 0x9e, 0xe4, 0x0a, 0x59, 0x39, 0x57, 0xff, 0xb7, 0x04, 0x15, 0x31, 0x2b, 0xba, 0x96, + 0x6f, 0xb9, 0x01, 0x7a, 0x0e, 0x25, 0xd7, 0xf1, 0x26, 0xa3, 0x47, 0xba, 0x69, 0xf4, 0x6c, 0xb2, + 0xd1, 0xf3, 0xd5, 0xab, 0xad, 0x7b, 0x09, 0xd6, 0x07, 0xc4, 0x75, 0x28, 0x76, 0x87, 0x74, 0xac, + 0x83, 0xeb, 0x78, 0xd1, 0x30, 0x72, 0x01, 0xb9, 0xd6, 0x55, 0x04, 0x32, 0x87, 0xd8, 0x77, 0x88, + 0xcd, 0x13, 0xc1, 0x56, 0x98, 0x9e, 0x20, 0x6d, 0x71, 0x6b, 0xef, 0xbd, 0xf7, 0xd5, 0xab, 0xad, + 0x77, 0xaf, 0x13, 0xe3, 0x45, 0xfe, 0xc0, 0x06, 0x8c, 0xec, 0x5a, 0x57, 0xd1, 0x49, 0xb8, 0xff, + 0xe3, 0x8c, 0x22, 0xd5, 0x9f, 0x41, 0xf9, 0x84, 0x0f, 0x1e, 0x71, 0xba, 0x36, 0x88, 0x41, 0x14, + 0xad, 0x2e, 0xdd, 0xb4, 0x7a, 0x8e, 0x47, 0x2f, 0x87, 0xac, 0x44, 0xe4, 0x3f, 0x4a, 0x42, 0xfb, + 0x22, 0xf2, 0xfb, 0x90, 0xff, 0xcd, 0x88, 0xf8, 0x23, 0x77, 0x86, 0xf0, 0xf9, 0xf5, 0x1e, 0x7a, + 0xd1, 0x07, 0x50, 0x64, 0x1d, 0x19, 0x5c, 0x90, 0x81, 0xfd, 0x0d, 0x6f, 0x02, 0x31, 0x00, 0x3d, + 0x82, 0x2a, 0x17, 0x6f, 0x4c, 0xc9, 0xce, 0xa4, 0x54, 0x18, 0xca, 0x88, 0x40, 0x7c, 0x83, 0xbf, + 0x07, 0xc8, 0x8b, 0xbd, 0xa9, 0x77, 0xac, 0x69, 0xe2, 0x3a, 0x49, 0xd6, 0xef, 0xe8, 0xed, 0xea, + 0x97, 0x9b, 0x5d, 0x9f, 0xeb, 0xb5, 0xc8, 0xbe, 0x45, 0x2d, 0x12, 0x79, 0xcf, 0xdd, 0x3e, 0xef, + 0xf3, 0x77, 0xcf, 0x7b, 0xfe, 0x16, 0x79, 0x47, 0x1a, 0xac, 0xb1, 0x44, 0x3b, 0x9e, 0x43, 0x9d, + 0xf8, 0xfe, 0x36, 0xf9, 0xf6, 0x95, 0x85, 0x99, 0x11, 0xde, 0x71, 0x1d, 0x4f, 0x0b, 0xf1, 0x22, + 0x3d, 0x3a, 0x43, 0xa3, 0x3d, 0xb8, 0x37, 0x99, 0x24, 0xe7, 0x96, 0x77, 0x8e, 0x07, 0x22, 0x4c, + 0x61, 0x66, 0x98, 0xe5, 0x08, 0xbc, 0xcf, 0xb1, 0x61, 0x8c, 0x27, 0xb0, 0x32, 0x1d, 0xc3, 0xc6, + 0x01, 0xe5, 0x97, 0xf6, 0xb7, 0xcd, 0x1e, 0x94, 0x0e, 0xd6, 0xc6, 0x01, 0x45, 0xa7, 0xb0, 0x3a, + 0xb9, 0x1a, 0xcd, 0x74, 0xdd, 0xe0, 0x76, 0x75, 0xbb, 0x37, 0xe1, 0x9f, 0x24, 0x0b, 0xf8, 0x63, + 0x58, 0x8e, 0x03, 0xc7, 0xf9, 0x2e, 0xcd, 0x3c, 0x26, 0x9a, 0x40, 0xe3, 0xa4, 0x3f, 0x83, 0x38, + 0xb2, 0x99, 0xd4, 0x79, 0xf9, 0x0e, 0x3a, 0x8f, 0xf7, 0x70, 0x14, 0x0b, 0x7e, 0x07, 0xe4, 0xb3, + 0x91, 0xef, 0xb1, 0xe3, 0x62, 0x53, 0xa8, 0x8c, 0xbd, 0x61, 0x14, 0xf4, 0x2a, 0xb3, 0xb3, 0x91, + 0xfb, 0xf3, 0x50, 0x5d, 0x2d, 0xd8, 0xe4, 0xc8, 0x49, 0xba, 0x27, 0x4d, 0xe2, 0x63, 0xc6, 0x0e, + 0xdf, 0x30, 0xf4, 0x75, 0x06, 0x8a, 0x2e, 0xfb, 0xa8, 0x1b, 0x42, 0x04, 0x7a, 0x0f, 0xaa, 0xf1, + 0x62, 0x4c, 0x56, 0xfc, 0x7d, 0xa3, 0xa0, 0x97, 0xa3, 0xa5, 0xd8, 0xed, 0x84, 0x3e, 0x86, 0xa5, + 0xc4, 0x11, 0x85, 0x24, 0xe4, 0x99, 0xb9, 0x5a, 0x8c, 0x5b, 0x37, 0x94, 0xc3, 0xcf, 0x60, 0x7d, + 0x5a, 0x0e, 0xac, 0x9f, 0x45, 0x15, 0x97, 0x66, 0x06, 0x59, 0x4d, 0x4b, 0xe1, 0xc8, 0xba, 0x12, + 0x65, 0xfb, 0x25, 0x6c, 0xb1, 0x6b, 0xc6, 0x75, 0x02, 0xea, 0x9c, 0x9b, 0xd6, 0x88, 0x5e, 0x10, + 0xdf, 0xf9, 0x2d, 0xb6, 0x4d, 0x2b, 0x94, 0x12, 0x0e, 0x14, 0xb4, 0x9d, 0xfd, 0x56, 0x99, 0x6d, + 0xc6, 0x01, 0x5a, 0x13, 0x7e, 0x2b, 0xa2, 0x23, 0x1d, 0x12, 0x00, 0xd3, 0xc7, 0xbf, 0xc2, 0xe7, + 0x69, 0x89, 0x2c, 0xcf, 0xdc, 0xf1, 0x46, 0x4c, 0xd2, 0x05, 0x67, 0xa2, 0x95, 0x07, 0x7f, 0x96, + 0xa0, 0x9c, 0x7c, 0x17, 0x43, 0x9b, 0xb0, 0xd6, 0xd5, 0x3b, 0xdd, 0x4e, 0xaf, 0x75, 0x68, 0x1a, + 0xcf, 0xbb, 0xaa, 0xf9, 0xf4, 0xb8, 0xd7, 0x55, 0xf7, 0xb5, 0xc7, 0x9a, 0xda, 0x96, 0xe7, 0xd0, + 0x3a, 0xbc, 0x93, 0x76, 0xf7, 0x8c, 0xd6, 0x71, 0xbb, 0xa5, 0xb7, 0x65, 0x09, 0xdd, 0x87, 0xcd, + 0xb4, 0xef, 0xe8, 0xe9, 0xa1, 0xa1, 0x75, 0x0f, 0x55, 0x73, 0xff, 0xa0, 0xa3, 0xed, 0xab, 0x72, + 0x06, 0xbd, 0x0b, 0x4a, 0x1a, 0xd2, 0xe9, 0x1a, 0xda, 0x91, 0xd6, 0x33, 0xb4, 0x7d, 0x39, 0x8b, + 0x36, 0x60, 0x35, 0xed, 0x55, 0x9f, 0x75, 0xd5, 0xb6, 0x66, 0xa8, 0x6d, 0x39, 0xf7, 0xe0, 0xff, + 0x12, 0x40, 0xe2, 0x83, 0x73, 0x03, 0x56, 0x4f, 0x3a, 0x46, 0x18, 0xa0, 0x73, 0x3c, 0xb5, 0xcb, + 0x65, 0x58, 0x4c, 0x3a, 0x3b, 0xc7, 0xaa, 0x2c, 0x4d, 0x1b, 0x9f, 0xab, 0xbd, 0xeb, 0x46, 0xe3, + 0xb4, 0x23, 0x67, 0xd0, 0x2a, 0x2c, 0x27, 0x8d, 0xad, 0xbd, 0x9e, 0xd1, 0xd2, 0x8e, 0xe5, 0x0c, + 0xba, 0x07, 0x4b, 0x29, 0xf4, 0x81, 0xae, 0xaa, 0x72, 0x16, 0x21, 0xa8, 0x26, 0xcd, 0xc7, 0x1d, + 0x39, 0x8b, 0x56, 0x40, 0x4e, 0xda, 0x1e, 0x77, 0x9e, 0xea, 0x72, 0x8e, 0x9d, 0x3f, 0x8d, 0x34, + 0x4f, 0x35, 0xe3, 0xc0, 0x3c, 0x51, 0x8d, 0x8e, 0x9c, 0x9b, 0xe6, 0xf4, 0xba, 0xad, 0x23, 0x79, + 0x7e, 0x3d, 0x23, 0x4b, 0x0f, 0xfe, 0x29, 0x41, 0x35, 0xfd, 0xd5, 0x87, 0xb6, 0x60, 0x63, 0x92, + 0xac, 0x9e, 0xd1, 0x32, 0x9e, 0xf6, 0xa6, 0x92, 0x50, 0x87, 0xda, 0x34, 0xa0, 0xad, 0x76, 0x3b, + 0x3d, 0xcd, 0x30, 0xbb, 0xaa, 0xae, 0x75, 0xa6, 0x4b, 0x26, 0x30, 0x27, 0x1d, 0x43, 0x3b, 0xfe, + 0x69, 0x04, 0xc9, 0xa4, 0x2a, 0x2e, 0x20, 0xdd, 0x56, 0xaf, 0xa7, 0xb6, 0xe5, 0x6c, 0xaa, 0x9c, + 0xc2, 0xa7, 0xab, 0x4f, 0xd4, 0x7d, 0x5e, 0xb1, 0x59, 0xcc, 0xc7, 0x2d, 0xed, 0x50, 0x6d, 0xcb, + 0xf3, 0x7b, 0x8f, 0x3e, 0x7f, 0x5d, 0x93, 0xbe, 0x78, 0x5d, 0x93, 0xfe, 0xfb, 0xba, 0x26, 0x7d, + 0xfa, 0xa6, 0x36, 0xf7, 0xc5, 0x9b, 0xda, 0xdc, 0xbf, 0xde, 0xd4, 0xe6, 0x7e, 0xb1, 0x11, 0x4a, + 0x37, 0xb0, 0x7f, 0xdd, 0x70, 0x48, 0xf3, 0x8a, 0xff, 0x3d, 0x85, 0x7d, 0x48, 0x04, 0xcd, 0xcb, + 0xdd, 0xb3, 0x3c, 0x9f, 0xa5, 0x1f, 0x7d, 0x1d, 0x00, 0x00, 0xff, 0xff, 0x38, 0x0a, 0x94, 0x69, + 0x6d, 0x11, 0x00, 0x00, } func (m *WeightedVoteOption) Marshal() (dAtA []byte, err error) { @@ -1428,6 +1541,64 @@ func (m *Proposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *ProposalVoteOptions) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *ProposalVoteOptions) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *ProposalVoteOptions) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.OptionSpam) > 0 { + i -= len(m.OptionSpam) + copy(dAtA[i:], m.OptionSpam) + i = encodeVarintGov(dAtA, i, uint64(len(m.OptionSpam))) + i-- + dAtA[i] = 0x2a + } + if len(m.OptionFour) > 0 { + i -= len(m.OptionFour) + copy(dAtA[i:], m.OptionFour) + i = encodeVarintGov(dAtA, i, uint64(len(m.OptionFour))) + i-- + dAtA[i] = 0x22 + } + if len(m.OptionThree) > 0 { + i -= len(m.OptionThree) + copy(dAtA[i:], m.OptionThree) + i = encodeVarintGov(dAtA, i, uint64(len(m.OptionThree))) + i-- + dAtA[i] = 0x1a + } + if len(m.OptionTwo) > 0 { + i -= len(m.OptionTwo) + copy(dAtA[i:], m.OptionTwo) + i = encodeVarintGov(dAtA, i, uint64(len(m.OptionTwo))) + i-- + dAtA[i] = 0x12 + } + if len(m.OptionOne) > 0 { + i -= len(m.OptionOne) + copy(dAtA[i:], m.OptionOne) + i = encodeVarintGov(dAtA, i, uint64(len(m.OptionOne))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func (m *TallyResult) Marshal() (dAtA []byte, err error) { size := m.Size() dAtA = make([]byte, size) @@ -1693,7 +1864,7 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x92 + dAtA[i] = 0x9a } if len(m.OptimisticAuthorizedAddresses) > 0 { for iNdEx := len(m.OptimisticAuthorizedAddresses) - 1; iNdEx >= 0; iNdEx-- { @@ -1703,9 +1874,18 @@ func (m *Params) MarshalToSizedBuffer(dAtA []byte) (int, error) { i-- dAtA[i] = 0x1 i-- - dAtA[i] = 0x8a + dAtA[i] = 0x92 } } + if len(m.ProposalCancelMaxPeriod) > 0 { + i -= len(m.ProposalCancelMaxPeriod) + copy(dAtA[i:], m.ProposalCancelMaxPeriod) + i = encodeVarintGov(dAtA, i, uint64(len(m.ProposalCancelMaxPeriod))) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0x8a + } if len(m.MinDepositRatio) > 0 { i -= len(m.MinDepositRatio) copy(dAtA[i:], m.MinDepositRatio) @@ -1977,6 +2157,35 @@ func (m *Proposal) Size() (n int) { return n } +func (m *ProposalVoteOptions) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + l = len(m.OptionOne) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.OptionTwo) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.OptionThree) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.OptionFour) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + l = len(m.OptionSpam) + if l > 0 { + n += 1 + l + sovGov(uint64(l)) + } + return n +} + func (m *TallyResult) Size() (n int) { if m == nil { return 0 @@ -2156,6 +2365,10 @@ func (m *Params) Size() (n int) { if l > 0 { n += 2 + l + sovGov(uint64(l)) } + l = len(m.ProposalCancelMaxPeriod) + if l > 0 { + n += 2 + l + sovGov(uint64(l)) + } if len(m.OptimisticAuthorizedAddresses) > 0 { for _, s := range m.OptimisticAuthorizedAddresses { l = len(s) @@ -2946,6 +3159,216 @@ func (m *Proposal) Unmarshal(dAtA []byte) error { } return nil } +func (m *ProposalVoteOptions) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: ProposalVoteOptions: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: ProposalVoteOptions: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OptionOne", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionOne = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OptionTwo", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionTwo = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OptionThree", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionThree = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OptionFour", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionFour = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field OptionSpam", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.OptionSpam = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipGov(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthGov + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func (m *TallyResult) Unmarshal(dAtA []byte) error { l := len(dAtA) iNdEx := 0 @@ -4197,6 +4620,38 @@ func (m *Params) Unmarshal(dAtA []byte) error { m.MinDepositRatio = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex case 17: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalCancelMaxPeriod", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowGov + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthGov + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthGov + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.ProposalCancelMaxPeriod = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 18: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OptimisticAuthorizedAddresses", wireType) } @@ -4228,7 +4683,7 @@ func (m *Params) Unmarshal(dAtA []byte) error { } m.OptimisticAuthorizedAddresses = append(m.OptimisticAuthorizedAddresses, string(dAtA[iNdEx:postIndex])) iNdEx = postIndex - case 18: + case 19: if wireType != 2 { return fmt.Errorf("proto: wrong wireType = %d for field OptimisticRejectedThreshold", wireType) } diff --git a/x/gov/types/v1/msgs.go b/x/gov/types/v1/msgs.go index 847f35f75e3a..713d27ca295a 100644 --- a/x/gov/types/v1/msgs.go +++ b/x/gov/types/v1/msgs.go @@ -1,6 +1,8 @@ package v1 import ( + "errors" + "cosmossdk.io/x/gov/types/v1beta1" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -9,8 +11,8 @@ import ( ) var ( - _, _, _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{}, &MsgUpdateParams{}, &MsgCancelProposal{} - _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} + _, _, _, _, _, _, _, _ sdk.Msg = &MsgSubmitProposal{}, &MsgDeposit{}, &MsgVote{}, &MsgVoteWeighted{}, &MsgExecLegacyContent{}, &MsgUpdateParams{}, &MsgCancelProposal{}, &MsgSubmitMultipleChoiceProposal{} + _, _ codectypes.UnpackInterfacesMessage = &MsgSubmitProposal{}, &MsgExecLegacyContent{} ) // NewMsgSubmitProposal creates a new MsgSubmitProposal. @@ -61,6 +63,28 @@ func (m MsgSubmitProposal) UnpackInterfaces(unpacker codectypes.AnyUnpacker) err return sdktx.UnpackInterfaces(unpacker, m.Messages) } +// NewMsgSubmitMultipleChoiceProposal creates a new MsgSubmitMultipleChoiceProposal. +func NewMultipleChoiceMsgSubmitProposal( + initialDeposit sdk.Coins, + proposer, metadata, title, summary string, + votingOptions *ProposalVoteOptions, +) (*MsgSubmitMultipleChoiceProposal, error) { + if votingOptions == nil { + return nil, errors.New("voting options cannot be nil") + } + + m := &MsgSubmitMultipleChoiceProposal{ + InitialDeposit: initialDeposit, + Proposer: proposer, + Metadata: metadata, + Title: title, + Summary: summary, + VoteOptions: votingOptions, + } + + return m, nil +} + // NewMsgDeposit creates a new MsgDeposit instance func NewMsgDeposit(depositor sdk.AccAddress, proposalID uint64, amount sdk.Coins) *MsgDeposit { return &MsgDeposit{proposalID, depositor.String(), amount} diff --git a/x/gov/types/v1/params.go b/x/gov/types/v1/params.go index 73a6d7d2352e..47ed21b58271 100644 --- a/x/gov/types/v1/params.go +++ b/x/gov/types/v1/params.go @@ -28,6 +28,7 @@ var ( DefaultMinInitialDepositRatio = sdkmath.LegacyZeroDec() DefaultProposalCancelRatio = sdkmath.LegacyMustNewDecFromStr("0.5") DefaultProposalCancelDestAddress = "" + DefaultProposalCancelMaxPeriod = sdkmath.LegacyMustNewDecFromStr("0.5") DefaultBurnProposalPrevote = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteQuorom = false // set to false to replicate behavior of when this change was made (0.47) DefaultBurnVoteVeto = true // set to true to replicate behavior of when this change was made (0.47) @@ -63,7 +64,7 @@ func NewVotingParams(votingPeriod *time.Duration) VotingParams { // NewParams creates a new Params instance with given values. func NewParams( minDeposit, expeditedminDeposit sdk.Coins, maxDepositPeriod, votingPeriod, expeditedVotingPeriod time.Duration, - quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest string, + quorum, threshold, expeditedThreshold, vetoThreshold, minInitialDepositRatio, proposalCancelRatio, proposalCancelDest, proposalMaxCancelVotingPeriod string, burnProposalDeposit, burnVoteQuorum, burnVoteVeto bool, minDepositRatio, optimisticRejectedThreshold string, optimisticAuthorizedAddresses []string, ) Params { return Params{ @@ -79,6 +80,7 @@ func NewParams( MinInitialDepositRatio: minInitialDepositRatio, ProposalCancelRatio: proposalCancelRatio, ProposalCancelDest: proposalCancelDest, + ProposalCancelMaxPeriod: proposalMaxCancelVotingPeriod, BurnProposalDepositPrevote: burnProposalDeposit, BurnVoteQuorum: burnVoteQuorum, BurnVoteVeto: burnVoteVeto, @@ -103,6 +105,7 @@ func DefaultParams() Params { DefaultMinInitialDepositRatio.String(), DefaultProposalCancelRatio.String(), DefaultProposalCancelDestAddress, + DefaultProposalCancelMaxPeriod.String(), DefaultBurnProposalPrevote, DefaultBurnVoteQuorom, DefaultBurnVoteVeto, @@ -207,7 +210,7 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error { return fmt.Errorf("expedited voting period must be positive: %s", p.ExpeditedVotingPeriod) } if p.ExpeditedVotingPeriod.Seconds() >= p.VotingPeriod.Seconds() { - return fmt.Errorf("expedited voting period %s must be strictly less that the regular voting period %s", p.ExpeditedVotingPeriod, p.VotingPeriod) + return fmt.Errorf("expedited voting period %s must be strictly less than the regular voting period %s", p.ExpeditedVotingPeriod, p.VotingPeriod) } for _, addr := range p.OptimisticAuthorizedAddresses { @@ -238,6 +241,17 @@ func (p Params) ValidateBasic(addressCodec address.Codec) error { return fmt.Errorf("burn rate of cancel proposal is too large: %s", proposalCancelRate) } + proposalCancelMaxPeriod, err := sdkmath.LegacyNewDecFromStr(p.ProposalCancelMaxPeriod) + if err != nil { + return fmt.Errorf("invalid max cancel period of cancel proposal: %w", err) + } + if proposalCancelMaxPeriod.IsNegative() { + return fmt.Errorf("max cancel period of cancel proposal must be positive: %s", proposalCancelMaxPeriod) + } + if proposalCancelMaxPeriod.GT(sdkmath.LegacyOneDec()) { + return fmt.Errorf("max cancel period of cancel proposal is too large: %s", proposalCancelMaxPeriod) + } + if len(p.ProposalCancelDest) != 0 { _, err := sdk.AccAddressFromBech32(p.ProposalCancelDest) if err != nil { diff --git a/x/gov/types/v1/query.pb.go b/x/gov/types/v1/query.pb.go index 4898356b7e7b..6a885cc2c072 100644 --- a/x/gov/types/v1/query.pb.go +++ b/x/gov/types/v1/query.pb.go @@ -975,6 +975,98 @@ func (m *QueryTallyResultResponse) GetTally() *TallyResult { return nil } +// QueryProposalVoteOptionsRequest is the request type for the Query/ProposalVoteOptions RPC method. +type QueryProposalVoteOptionsRequest struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *QueryProposalVoteOptionsRequest) Reset() { *m = QueryProposalVoteOptionsRequest{} } +func (m *QueryProposalVoteOptionsRequest) String() string { return proto.CompactTextString(m) } +func (*QueryProposalVoteOptionsRequest) ProtoMessage() {} +func (*QueryProposalVoteOptionsRequest) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{18} +} +func (m *QueryProposalVoteOptionsRequest) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalVoteOptionsRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalVoteOptionsRequest.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalVoteOptionsRequest) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalVoteOptionsRequest.Merge(m, src) +} +func (m *QueryProposalVoteOptionsRequest) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalVoteOptionsRequest) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalVoteOptionsRequest.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalVoteOptionsRequest proto.InternalMessageInfo + +func (m *QueryProposalVoteOptionsRequest) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + +// QueryProposalVoteOptionsResponse is the response type for the Query/ProposalVoteOptions RPC method. +type QueryProposalVoteOptionsResponse struct { + // vote_options defines the valid voting options for a proposal. + VoteOptions *ProposalVoteOptions `protobuf:"bytes,1,opt,name=vote_options,json=voteOptions,proto3" json:"vote_options,omitempty"` +} + +func (m *QueryProposalVoteOptionsResponse) Reset() { *m = QueryProposalVoteOptionsResponse{} } +func (m *QueryProposalVoteOptionsResponse) String() string { return proto.CompactTextString(m) } +func (*QueryProposalVoteOptionsResponse) ProtoMessage() {} +func (*QueryProposalVoteOptionsResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_46a436d1109b50d0, []int{19} +} +func (m *QueryProposalVoteOptionsResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *QueryProposalVoteOptionsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_QueryProposalVoteOptionsResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *QueryProposalVoteOptionsResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_QueryProposalVoteOptionsResponse.Merge(m, src) +} +func (m *QueryProposalVoteOptionsResponse) XXX_Size() int { + return m.Size() +} +func (m *QueryProposalVoteOptionsResponse) XXX_DiscardUnknown() { + xxx_messageInfo_QueryProposalVoteOptionsResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_QueryProposalVoteOptionsResponse proto.InternalMessageInfo + +func (m *QueryProposalVoteOptionsResponse) GetVoteOptions() *ProposalVoteOptions { + if m != nil { + return m.VoteOptions + } + return nil +} + func init() { proto.RegisterType((*QueryConstitutionRequest)(nil), "cosmos.gov.v1.QueryConstitutionRequest") proto.RegisterType((*QueryConstitutionResponse)(nil), "cosmos.gov.v1.QueryConstitutionResponse") @@ -994,76 +1086,82 @@ func init() { proto.RegisterType((*QueryDepositsResponse)(nil), "cosmos.gov.v1.QueryDepositsResponse") proto.RegisterType((*QueryTallyResultRequest)(nil), "cosmos.gov.v1.QueryTallyResultRequest") proto.RegisterType((*QueryTallyResultResponse)(nil), "cosmos.gov.v1.QueryTallyResultResponse") + proto.RegisterType((*QueryProposalVoteOptionsRequest)(nil), "cosmos.gov.v1.QueryProposalVoteOptionsRequest") + proto.RegisterType((*QueryProposalVoteOptionsResponse)(nil), "cosmos.gov.v1.QueryProposalVoteOptionsResponse") } func init() { proto.RegisterFile("cosmos/gov/v1/query.proto", fileDescriptor_46a436d1109b50d0) } var fileDescriptor_46a436d1109b50d0 = []byte{ - // 1013 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x4b, 0x6f, 0xdc, 0x54, - 0x14, 0x8e, 0x27, 0x8f, 0x66, 0x4e, 0x1e, 0xc0, 0xe9, 0x23, 0xae, 0xd3, 0x4e, 0x83, 0x43, 0x93, - 0xf0, 0xa8, 0xcd, 0xa4, 0x4d, 0x2b, 0x41, 0x11, 0x6a, 0x5a, 0xa5, 0x20, 0xb1, 0x08, 0x6e, 0xc5, - 0x82, 0x4d, 0xe4, 0x66, 0x2c, 0xcb, 0x62, 0xea, 0xeb, 0xce, 0xbd, 0x33, 0x22, 0xa4, 0x11, 0x52, - 0x25, 0x1e, 0x2b, 0x40, 0xa2, 0x02, 0x7e, 0x08, 0x3f, 0x82, 0x65, 0x05, 0x1b, 0x96, 0x28, 0xe1, - 0x87, 0x20, 0xdf, 0x7b, 0xec, 0xb1, 0x1d, 0x8f, 0x67, 0x52, 0x45, 0x2c, 0xe7, 0xde, 0xef, 0x7c, - 0xe7, 0x3b, 0x8f, 0x7b, 0x8e, 0x07, 0x2e, 0xee, 0x32, 0xfe, 0x98, 0x71, 0xdb, 0x67, 0x3d, 0xbb, - 0xd7, 0xb4, 0x9f, 0x74, 0xbd, 0xce, 0x9e, 0x15, 0x75, 0x98, 0x60, 0x38, 0xa7, 0xae, 0x2c, 0x9f, - 0xf5, 0xac, 0x5e, 0xd3, 0x78, 0x8b, 0x90, 0x8f, 0x5c, 0xee, 0x29, 0x9c, 0xdd, 0x6b, 0x3e, 0xf2, - 0x84, 0xdb, 0xb4, 0x23, 0xd7, 0x0f, 0x42, 0x57, 0x04, 0x2c, 0x54, 0xa6, 0xc6, 0x25, 0x9f, 0x31, - 0xbf, 0xed, 0xd9, 0x6e, 0x14, 0xd8, 0x6e, 0x18, 0x32, 0x21, 0x2f, 0x39, 0xdd, 0x2e, 0xe4, 0x7d, - 0xc6, 0xfc, 0xea, 0x82, 0xc4, 0xec, 0xc8, 0x5f, 0x36, 0xb9, 0x97, 0x3f, 0x4c, 0x03, 0xf4, 0x4f, - 0x63, 0x9f, 0x77, 0x59, 0xc8, 0x45, 0x20, 0xba, 0x31, 0x9f, 0xe3, 0x3d, 0xe9, 0x7a, 0x5c, 0x98, - 0x1f, 0xc2, 0xc5, 0x92, 0x3b, 0x1e, 0xb1, 0x90, 0x7b, 0x68, 0xc2, 0xec, 0x6e, 0xe6, 0x5c, 0xd7, - 0x96, 0xb4, 0xb5, 0xba, 0x93, 0x3b, 0x33, 0x6f, 0xc1, 0x39, 0x49, 0xb0, 0xdd, 0x61, 0x11, 0xe3, - 0x6e, 0x9b, 0x88, 0xf1, 0x0a, 0xcc, 0x44, 0x74, 0xb4, 0x13, 0xb4, 0xa4, 0xe9, 0x84, 0x03, 0xc9, - 0xd1, 0xc7, 0x2d, 0xf3, 0x13, 0x38, 0x5f, 0x30, 0x24, 0xaf, 0xd7, 0x61, 0x3a, 0x81, 0x49, 0xb3, - 0x99, 0xf5, 0x05, 0x2b, 0x97, 0x4e, 0x2b, 0x35, 0x49, 0x81, 0xe6, 0x8f, 0xb5, 0x02, 0x1d, 0x4f, - 0x84, 0x6c, 0xc1, 0x2b, 0xa9, 0x10, 0x2e, 0x5c, 0xd1, 0xe5, 0x92, 0x75, 0x7e, 0xfd, 0xf2, 0x00, - 0xd6, 0x07, 0x12, 0xe4, 0xcc, 0x47, 0xb9, 0xdf, 0x68, 0xc1, 0x64, 0x8f, 0x09, 0xaf, 0xa3, 0xd7, - 0xe2, 0x2c, 0x6c, 0xea, 0x7f, 0xfe, 0x7e, 0xed, 0x1c, 0x11, 0xdc, 0x69, 0xb5, 0x3a, 0x1e, 0xe7, - 0x0f, 0x44, 0x27, 0x08, 0x7d, 0x47, 0xc1, 0xf0, 0x26, 0xd4, 0x5b, 0x5e, 0xc4, 0x78, 0x20, 0x58, - 0x47, 0x1f, 0x1f, 0x62, 0xd3, 0x87, 0xe2, 0x16, 0x40, 0xbf, 0x27, 0xf4, 0x09, 0x99, 0x80, 0x95, - 0x44, 0x6a, 0xdc, 0x40, 0x96, 0x6a, 0x34, 0x6a, 0x20, 0x6b, 0xdb, 0xf5, 0x3d, 0x8a, 0xd5, 0xc9, - 0x58, 0x9a, 0xbf, 0x69, 0x70, 0xa1, 0x98, 0x11, 0xca, 0xf0, 0x06, 0xd4, 0x93, 0xe0, 0xe2, 0x64, - 0x8c, 0x57, 0xa5, 0xb8, 0x8f, 0xc4, 0xfb, 0x39, 0x65, 0x35, 0xa9, 0x6c, 0x75, 0xa8, 0x32, 0xe5, - 0x33, 0x27, 0x6d, 0x17, 0x5e, 0x95, 0xca, 0x3e, 0x63, 0xc2, 0x1b, 0xb5, 0x5f, 0x4e, 0x9a, 0x7f, - 0xf3, 0x36, 0xbc, 0x96, 0x71, 0x42, 0x91, 0xaf, 0xc2, 0x44, 0x7c, 0x4b, 0x7d, 0x75, 0xb6, 0x10, - 0xb4, 0x84, 0x4a, 0x80, 0xf9, 0x34, 0x63, 0xcd, 0x47, 0xd6, 0xb8, 0x55, 0x92, 0xa1, 0x97, 0xa9, - 0xdd, 0xf7, 0x1a, 0x60, 0xd6, 0x3d, 0xa9, 0x7f, 0x53, 0xa5, 0x20, 0xa9, 0x59, 0xa9, 0x7c, 0x85, - 0x38, 0xbd, 0x5a, 0x6d, 0x90, 0x92, 0x6d, 0xb7, 0xe3, 0x3e, 0xce, 0x65, 0x42, 0x1e, 0xec, 0x88, - 0xbd, 0xc8, 0xa3, 0xc1, 0x00, 0xea, 0xe8, 0xe1, 0x5e, 0xe4, 0x99, 0xbf, 0xd4, 0xe0, 0x6c, 0xce, - 0x8e, 0x42, 0xb8, 0x07, 0x73, 0x3d, 0x26, 0x82, 0xd0, 0xdf, 0x51, 0x60, 0xaa, 0xc4, 0xe2, 0xf1, - 0x50, 0x82, 0xd0, 0x57, 0xb6, 0x9b, 0x35, 0x5d, 0x73, 0x66, 0x7b, 0x99, 0x13, 0xbc, 0x0f, 0xf3, - 0xf4, 0x60, 0x12, 0x1a, 0x15, 0xe1, 0xa5, 0x02, 0xcd, 0x3d, 0x05, 0xca, 0xf0, 0xcc, 0xb5, 0xb2, - 0x47, 0x78, 0x07, 0x66, 0x85, 0xdb, 0x6e, 0xef, 0x25, 0x34, 0xe3, 0x92, 0xc6, 0x28, 0xd0, 0x3c, - 0x8c, 0x21, 0x19, 0x92, 0x19, 0xd1, 0x3f, 0xc0, 0x6b, 0x30, 0x45, 0xc6, 0xea, 0xad, 0x9e, 0x2f, - 0xbe, 0x24, 0x95, 0x00, 0x02, 0x99, 0x21, 0xe5, 0x85, 0xa4, 0x8d, 0xdc, 0x5a, 0xb9, 0x71, 0x52, - 0x1b, 0x79, 0x9c, 0x98, 0x1f, 0xd1, 0x7c, 0x4e, 0xfd, 0x51, 0x21, 0xde, 0x85, 0x33, 0x04, 0xa2, - 0x12, 0x5c, 0x28, 0xcf, 0x9d, 0x93, 0xc0, 0xcc, 0xaf, 0xf3, 0x4c, 0xff, 0xff, 0xab, 0x78, 0xae, - 0xd1, 0x8c, 0xef, 0x2b, 0xa0, 0x60, 0xd6, 0x61, 0x9a, 0x54, 0x26, 0x6f, 0x63, 0x50, 0x34, 0x29, - 0xee, 0xf4, 0x5e, 0xc8, 0x7b, 0xb0, 0x20, 0x55, 0xc9, 0x2e, 0x71, 0x3c, 0xde, 0x6d, 0x8b, 0x13, - 0x2c, 0x41, 0xfd, 0xb8, 0x6d, 0x5a, 0xa1, 0x49, 0xd9, 0x67, 0x54, 0x9f, 0xd2, 0xa6, 0x24, 0x13, - 0x05, 0x5c, 0x3f, 0xaa, 0xc3, 0xa4, 0xa4, 0xc3, 0x6f, 0x35, 0x98, 0xcd, 0xae, 0x74, 0x5c, 0x2d, - 0x58, 0x0f, 0xfa, 0x20, 0x30, 0xd6, 0x86, 0x03, 0x95, 0x3e, 0x73, 0xf9, 0xd9, 0x5f, 0xff, 0xfe, - 0x5c, 0xbb, 0x8c, 0x8b, 0x76, 0xfe, 0x9b, 0x24, 0xfb, 0x79, 0x80, 0xdf, 0x68, 0x30, 0x9d, 0xec, - 0x12, 0x5c, 0x2e, 0xe3, 0x2e, 0x7c, 0x38, 0x18, 0x6f, 0x54, 0x83, 0xc8, 0xb9, 0x25, 0x9d, 0xaf, - 0xe1, 0x4a, 0xc1, 0x79, 0xba, 0xad, 0xec, 0xfd, 0x4c, 0xe6, 0x0f, 0xf0, 0x2b, 0xa8, 0xa7, 0x7b, - 0x10, 0x2b, 0x5d, 0x24, 0x7d, 0x6d, 0x5c, 0x1d, 0x82, 0x22, 0x25, 0x4b, 0x52, 0x89, 0x81, 0xfa, - 0x20, 0x25, 0xf8, 0x9d, 0x06, 0x13, 0xf1, 0x6c, 0xc6, 0x2b, 0x65, 0x8c, 0x99, 0x25, 0x68, 0x2c, - 0x0d, 0x06, 0x90, 0xb7, 0xdb, 0xd2, 0xdb, 0x4d, 0xbc, 0x31, 0x5a, 0xdc, 0xb6, 0xdc, 0x06, 0xf6, - 0xbe, 0x5c, 0x89, 0x07, 0xf8, 0x4c, 0x83, 0x49, 0xb9, 0x52, 0x70, 0xa0, 0xa7, 0x34, 0xfc, 0xd7, - 0x2b, 0x10, 0x24, 0xe6, 0x86, 0x14, 0x63, 0xe1, 0x3b, 0x27, 0x11, 0x83, 0x4f, 0x61, 0x8a, 0x46, - 0x67, 0xa9, 0x8b, 0xdc, 0xa2, 0x31, 0xcc, 0x2a, 0x08, 0xc9, 0x78, 0x5b, 0xca, 0xb8, 0x8a, 0xcb, - 0x45, 0x19, 0x12, 0x66, 0xef, 0x67, 0x36, 0xd5, 0x01, 0xfe, 0xaa, 0xc1, 0x19, 0x1a, 0x06, 0x58, - 0x4a, 0x9e, 0x1f, 0xcc, 0xc6, 0x72, 0x25, 0x86, 0x14, 0xdc, 0x95, 0x0a, 0x3e, 0xc0, 0xf7, 0x47, - 0x4c, 0x44, 0x32, 0x84, 0xec, 0xfd, 0x74, 0x50, 0x1f, 0xe0, 0x0f, 0x1a, 0x4c, 0x27, 0x93, 0x0d, - 0xab, 0xdc, 0xf2, 0xca, 0xa7, 0x52, 0x1c, 0x8e, 0xe6, 0x2d, 0x29, 0xae, 0x89, 0xf6, 0x09, 0xc5, - 0xe1, 0x73, 0x0d, 0x66, 0x32, 0x53, 0x06, 0x57, 0xca, 0xdc, 0x1d, 0x9f, 0x7a, 0xc6, 0xea, 0x50, - 0xdc, 0x4b, 0xf6, 0x8f, 0x9c, 0x72, 0x9b, 0x1b, 0x7f, 0x1c, 0x36, 0xb4, 0x17, 0x87, 0x0d, 0xed, - 0x9f, 0xc3, 0x86, 0xf6, 0xd3, 0x51, 0x63, 0xec, 0xc5, 0x51, 0x63, 0xec, 0xef, 0xa3, 0xc6, 0xd8, - 0xe7, 0x8b, 0x8a, 0x86, 0xb7, 0xbe, 0xb0, 0x02, 0x66, 0x7f, 0x29, 0xe9, 0xe2, 0xaa, 0xf3, 0xf8, - 0xdf, 0xd6, 0x94, 0xfc, 0x33, 0x74, 0xfd, 0xbf, 0x00, 0x00, 0x00, 0xff, 0xff, 0x87, 0x70, 0x46, - 0xfc, 0xb6, 0x0d, 0x00, 0x00, + // 1086 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x57, 0x5b, 0x6f, 0xdc, 0xc4, + 0x17, 0x8f, 0x37, 0x97, 0x26, 0x67, 0x93, 0xfc, 0xff, 0x9c, 0xb4, 0xcd, 0xd6, 0x69, 0x37, 0x61, + 0x42, 0x93, 0x70, 0xa9, 0xcd, 0x26, 0x4d, 0x2b, 0xd1, 0x22, 0xd4, 0xb4, 0xa4, 0x20, 0x21, 0x11, + 0xb6, 0x15, 0x0f, 0xbc, 0xac, 0xdc, 0xac, 0xb5, 0xb2, 0xd8, 0x7a, 0xdc, 0x9d, 0xd9, 0x15, 0x21, + 0x8d, 0x90, 0x2a, 0x71, 0x79, 0x02, 0x24, 0x2a, 0x2e, 0x9f, 0x03, 0x3e, 0x04, 0x8f, 0x15, 0xbc, + 0xf0, 0x88, 0x12, 0x3e, 0x08, 0xf2, 0xcc, 0xb1, 0xd7, 0x76, 0xbc, 0xb7, 0xaa, 0xe2, 0xd1, 0x33, + 0xbf, 0xf3, 0x3b, 0xbf, 0x39, 0xe7, 0xcc, 0x39, 0x63, 0xb8, 0xb0, 0xcf, 0xc5, 0x43, 0x2e, 0xec, + 0x06, 0xef, 0xd8, 0x9d, 0x8a, 0xfd, 0xa8, 0xed, 0xb6, 0x0e, 0xac, 0xa0, 0xc5, 0x25, 0xc7, 0x39, + 0xbd, 0x65, 0x35, 0x78, 0xc7, 0xea, 0x54, 0xcc, 0xd7, 0x08, 0xf9, 0xc0, 0x11, 0xae, 0xc6, 0xd9, + 0x9d, 0xca, 0x03, 0x57, 0x3a, 0x15, 0x3b, 0x70, 0x1a, 0x9e, 0xef, 0x48, 0x8f, 0xfb, 0xda, 0xd4, + 0xbc, 0xd8, 0xe0, 0xbc, 0xd1, 0x74, 0x6d, 0x27, 0xf0, 0x6c, 0xc7, 0xf7, 0xb9, 0x54, 0x9b, 0x82, + 0x76, 0x17, 0xd3, 0x3e, 0x43, 0x7e, 0xbd, 0x41, 0x62, 0x6a, 0xea, 0xcb, 0x26, 0xf7, 0xea, 0x83, + 0x99, 0x50, 0xfa, 0x28, 0xf4, 0x79, 0x9b, 0xfb, 0x42, 0x7a, 0xb2, 0x1d, 0xf2, 0x55, 0xdd, 0x47, + 0x6d, 0x57, 0x48, 0xf6, 0x0e, 0x5c, 0xc8, 0xd9, 0x13, 0x01, 0xf7, 0x85, 0x8b, 0x0c, 0x66, 0xf7, + 0x13, 0xeb, 0x25, 0x63, 0xc5, 0xd8, 0x98, 0xa9, 0xa6, 0xd6, 0xd8, 0x75, 0x38, 0xab, 0x08, 0xf6, + 0x5a, 0x3c, 0xe0, 0xc2, 0x69, 0x12, 0x31, 0x2e, 0x43, 0x31, 0xa0, 0xa5, 0x9a, 0x57, 0x57, 0xa6, + 0x13, 0x55, 0x88, 0x96, 0xde, 0xaf, 0xb3, 0x0f, 0xe0, 0x5c, 0xc6, 0x90, 0xbc, 0x6e, 0xc1, 0x74, + 0x04, 0x53, 0x66, 0xc5, 0xcd, 0x45, 0x2b, 0x15, 0x4e, 0x2b, 0x36, 0x89, 0x81, 0xec, 0xbb, 0x42, + 0x86, 0x4e, 0x44, 0x42, 0x76, 0xe1, 0x7f, 0xb1, 0x10, 0x21, 0x1d, 0xd9, 0x16, 0x8a, 0x75, 0x7e, + 0xf3, 0x52, 0x0f, 0xd6, 0x7b, 0x0a, 0x54, 0x9d, 0x0f, 0x52, 0xdf, 0x68, 0xc1, 0x64, 0x87, 0x4b, + 0xb7, 0x55, 0x2a, 0x84, 0x51, 0xd8, 0x29, 0xfd, 0xf1, 0xdb, 0x95, 0xb3, 0x44, 0x70, 0xab, 0x5e, + 0x6f, 0xb9, 0x42, 0xdc, 0x93, 0x2d, 0xcf, 0x6f, 0x54, 0x35, 0x0c, 0xaf, 0xc1, 0x4c, 0xdd, 0x0d, + 0xb8, 0xf0, 0x24, 0x6f, 0x95, 0xc6, 0x07, 0xd8, 0x74, 0xa1, 0xb8, 0x0b, 0xd0, 0xad, 0x89, 0xd2, + 0x84, 0x0a, 0xc0, 0x5a, 0x24, 0x35, 0x2c, 0x20, 0x4b, 0x17, 0x1a, 0x15, 0x90, 0xb5, 0xe7, 0x34, + 0x5c, 0x3a, 0x6b, 0x35, 0x61, 0xc9, 0x7e, 0x36, 0xe0, 0x7c, 0x36, 0x22, 0x14, 0xe1, 0x6d, 0x98, + 0x89, 0x0e, 0x17, 0x06, 0x63, 0xbc, 0x5f, 0x88, 0xbb, 0x48, 0xbc, 0x9b, 0x52, 0x56, 0x50, 0xca, + 0xd6, 0x07, 0x2a, 0xd3, 0x3e, 0x53, 0xd2, 0xf6, 0xe1, 0xff, 0x4a, 0xd9, 0xc7, 0x5c, 0xba, 0xc3, + 0xd6, 0xcb, 0xa8, 0xf1, 0x67, 0x37, 0xe1, 0xa5, 0x84, 0x13, 0x3a, 0xf9, 0x3a, 0x4c, 0x84, 0xbb, + 0x54, 0x57, 0x0b, 0x99, 0x43, 0x2b, 0xa8, 0x02, 0xb0, 0xc7, 0x09, 0x6b, 0x31, 0xb4, 0xc6, 0xdd, + 0x9c, 0x08, 0x3d, 0x4f, 0xee, 0xbe, 0x31, 0x00, 0x93, 0xee, 0x49, 0xfd, 0xab, 0x3a, 0x04, 0x51, + 0xce, 0x72, 0xe5, 0x6b, 0xc4, 0x8b, 0xcb, 0xd5, 0x36, 0x29, 0xd9, 0x73, 0x5a, 0xce, 0xc3, 0x54, + 0x24, 0xd4, 0x42, 0x4d, 0x1e, 0x04, 0x2e, 0x35, 0x06, 0xd0, 0x4b, 0xf7, 0x0f, 0x02, 0x97, 0xfd, + 0x58, 0x80, 0x85, 0x94, 0x1d, 0x1d, 0xe1, 0x0e, 0xcc, 0x75, 0xb8, 0xf4, 0xfc, 0x46, 0x4d, 0x83, + 0x29, 0x13, 0x4b, 0xa7, 0x8f, 0xe2, 0xf9, 0x0d, 0x6d, 0xbb, 0x53, 0x28, 0x19, 0xd5, 0xd9, 0x4e, + 0x62, 0x05, 0xef, 0xc2, 0x3c, 0x5d, 0x98, 0x88, 0x46, 0x9f, 0xf0, 0x62, 0x86, 0xe6, 0x8e, 0x06, + 0x25, 0x78, 0xe6, 0xea, 0xc9, 0x25, 0xbc, 0x05, 0xb3, 0xd2, 0x69, 0x36, 0x0f, 0x22, 0x9a, 0x71, + 0x45, 0x63, 0x66, 0x68, 0xee, 0x87, 0x90, 0x04, 0x49, 0x51, 0x76, 0x17, 0xf0, 0x0a, 0x4c, 0x91, + 0xb1, 0xbe, 0xab, 0xe7, 0xb2, 0x37, 0x49, 0x07, 0x80, 0x40, 0xcc, 0xa7, 0xb8, 0x90, 0xb4, 0xa1, + 0x4b, 0x2b, 0xd5, 0x4e, 0x0a, 0x43, 0xb7, 0x13, 0xf6, 0x1e, 0xf5, 0xe7, 0xd8, 0x1f, 0x25, 0xe2, + 0x4d, 0x38, 0x43, 0x20, 0x4a, 0xc1, 0xf9, 0xfc, 0xd8, 0x55, 0x23, 0x18, 0xfb, 0x22, 0xcd, 0xf4, + 0xdf, 0xdf, 0x8a, 0xa7, 0x06, 0xf5, 0xf8, 0xae, 0x02, 0x3a, 0xcc, 0x26, 0x4c, 0x93, 0xca, 0xe8, + 0x6e, 0xf4, 0x3a, 0x4d, 0x8c, 0x7b, 0x71, 0x37, 0xe4, 0x2d, 0x58, 0x54, 0xaa, 0x54, 0x95, 0x54, + 0x5d, 0xd1, 0x6e, 0xca, 0x11, 0x86, 0x60, 0xe9, 0xb4, 0x6d, 0x9c, 0xa1, 0x49, 0x55, 0x67, 0x94, + 0x9f, 0xdc, 0xa2, 0x24, 0x13, 0x0d, 0x64, 0x3b, 0xb0, 0x9c, 0xea, 0xf8, 0x61, 0x43, 0xf8, 0x30, + 0x50, 0xcf, 0x87, 0xa1, 0x15, 0x79, 0xb0, 0xd2, 0x9b, 0x83, 0x94, 0xbd, 0x0b, 0xe1, 0x75, 0x74, + 0x6b, 0x5c, 0xaf, 0x93, 0x40, 0xd6, 0x63, 0x84, 0x24, 0x19, 0x8a, 0x9d, 0xee, 0xc7, 0xe6, 0x2f, + 0x45, 0x98, 0x54, 0xbe, 0xf0, 0x2b, 0x03, 0x66, 0x93, 0x2f, 0x10, 0x5c, 0xcf, 0x70, 0xf5, 0x7a, + 0xbf, 0x98, 0x1b, 0x83, 0x81, 0x5a, 0x34, 0x5b, 0x7d, 0xf2, 0xe7, 0x3f, 0x3f, 0x14, 0x2e, 0xe1, + 0x92, 0x9d, 0x7e, 0x42, 0x25, 0x5f, 0x33, 0xf8, 0xa5, 0x01, 0xd3, 0x91, 0x6e, 0x5c, 0xcd, 0xe3, + 0xce, 0xbc, 0x73, 0xcc, 0x57, 0xfa, 0x83, 0xc8, 0xb9, 0xa5, 0x9c, 0x6f, 0xe0, 0x5a, 0xc6, 0x79, + 0x3c, 0x5c, 0xed, 0xc3, 0x44, 0x5a, 0x8e, 0xf0, 0x73, 0x98, 0x89, 0xc7, 0x36, 0xf6, 0x75, 0x11, + 0x65, 0xd6, 0xbc, 0x3c, 0x00, 0x45, 0x4a, 0x56, 0x94, 0x12, 0x13, 0x4b, 0xbd, 0x94, 0xe0, 0xd7, + 0x06, 0x4c, 0x84, 0x39, 0xc3, 0xe5, 0x3c, 0xc6, 0xc4, 0xcc, 0x36, 0x57, 0x7a, 0x03, 0xc8, 0xdb, + 0x4d, 0xe5, 0xed, 0x1a, 0x5e, 0x1d, 0xee, 0xdc, 0xb6, 0x1a, 0x5e, 0xf6, 0xa1, 0x9a, 0xe0, 0x47, + 0xf8, 0xc4, 0x80, 0x49, 0x35, 0x01, 0xb1, 0xa7, 0xa7, 0xf8, 0xf8, 0x2f, 0xf7, 0x41, 0x90, 0x98, + 0xab, 0x4a, 0x8c, 0x85, 0x6f, 0x8c, 0x22, 0x06, 0x1f, 0xc3, 0x14, 0x75, 0xfa, 0x5c, 0x17, 0xa9, + 0xb9, 0x68, 0xb2, 0x7e, 0x10, 0x92, 0xf1, 0xba, 0x92, 0x71, 0x19, 0x57, 0xb3, 0x32, 0x14, 0xcc, + 0x3e, 0x4c, 0x0c, 0xd6, 0x23, 0xfc, 0xc9, 0x80, 0x33, 0xd4, 0xbb, 0x30, 0x97, 0x3c, 0x3d, 0x47, + 0xcc, 0xd5, 0xbe, 0x18, 0x52, 0x70, 0x5b, 0x29, 0x78, 0x1b, 0x6f, 0x0c, 0x19, 0x88, 0xa8, 0x67, + 0xda, 0x87, 0xf1, 0x5c, 0x39, 0xc2, 0x6f, 0x0d, 0x98, 0x8e, 0x1a, 0x31, 0xf6, 0x73, 0x2b, 0xfa, + 0x5e, 0x95, 0x6c, 0x2f, 0x67, 0xd7, 0x95, 0xb8, 0x0a, 0xda, 0x23, 0x8a, 0xc3, 0xa7, 0x06, 0x14, + 0x13, 0x4d, 0x11, 0xd7, 0xf2, 0xdc, 0x9d, 0x6e, 0xd2, 0xe6, 0xfa, 0x40, 0xdc, 0x73, 0xd6, 0x8f, + 0x6a, 0xca, 0xf8, 0xab, 0x01, 0x0b, 0x39, 0xad, 0x10, 0xad, 0x7e, 0xf7, 0xf5, 0x74, 0xe7, 0x36, + 0xed, 0xa1, 0xf1, 0x24, 0xf7, 0x86, 0x92, 0xbb, 0x8d, 0x5b, 0x23, 0x94, 0x7b, 0xd4, 0xd2, 0x77, + 0xb6, 0x7f, 0x3f, 0x2e, 0x1b, 0xcf, 0x8e, 0xcb, 0xc6, 0xdf, 0xc7, 0x65, 0xe3, 0xfb, 0x93, 0xf2, + 0xd8, 0xb3, 0x93, 0xf2, 0xd8, 0x5f, 0x27, 0xe5, 0xb1, 0x4f, 0x96, 0x34, 0x9b, 0xa8, 0x7f, 0x6a, + 0x79, 0xdc, 0xfe, 0x4c, 0xb1, 0x86, 0xb5, 0x2a, 0xc2, 0x5f, 0xda, 0x29, 0xf5, 0xc7, 0xb9, 0xf5, + 0x6f, 0x00, 0x00, 0x00, 0xff, 0xff, 0x41, 0xdd, 0x3f, 0x7e, 0x1b, 0x0f, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -1096,6 +1194,8 @@ type QueryClient interface { Deposits(ctx context.Context, in *QueryDepositsRequest, opts ...grpc.CallOption) (*QueryDepositsResponse, error) // TallyResult queries the tally of a proposal vote. TallyResult(ctx context.Context, in *QueryTallyResultRequest, opts ...grpc.CallOption) (*QueryTallyResultResponse, error) + // ProposalVoteOptions queries the valid voting options for a proposal. + ProposalVoteOptions(ctx context.Context, in *QueryProposalVoteOptionsRequest, opts ...grpc.CallOption) (*QueryProposalVoteOptionsResponse, error) } type queryClient struct { @@ -1187,6 +1287,15 @@ func (c *queryClient) TallyResult(ctx context.Context, in *QueryTallyResultReque return out, nil } +func (c *queryClient) ProposalVoteOptions(ctx context.Context, in *QueryProposalVoteOptionsRequest, opts ...grpc.CallOption) (*QueryProposalVoteOptionsResponse, error) { + out := new(QueryProposalVoteOptionsResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Query/ProposalVoteOptions", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // QueryServer is the server API for Query service. type QueryServer interface { // Constitution queries the chain's constitution. @@ -1207,6 +1316,8 @@ type QueryServer interface { Deposits(context.Context, *QueryDepositsRequest) (*QueryDepositsResponse, error) // TallyResult queries the tally of a proposal vote. TallyResult(context.Context, *QueryTallyResultRequest) (*QueryTallyResultResponse, error) + // ProposalVoteOptions queries the valid voting options for a proposal. + ProposalVoteOptions(context.Context, *QueryProposalVoteOptionsRequest) (*QueryProposalVoteOptionsResponse, error) } // UnimplementedQueryServer can be embedded to have forward compatible implementations. @@ -1240,6 +1351,9 @@ func (*UnimplementedQueryServer) Deposits(ctx context.Context, req *QueryDeposit func (*UnimplementedQueryServer) TallyResult(ctx context.Context, req *QueryTallyResultRequest) (*QueryTallyResultResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method TallyResult not implemented") } +func (*UnimplementedQueryServer) ProposalVoteOptions(ctx context.Context, req *QueryProposalVoteOptionsRequest) (*QueryProposalVoteOptionsResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method ProposalVoteOptions not implemented") +} func RegisterQueryServer(s grpc1.Server, srv QueryServer) { s.RegisterService(&_Query_serviceDesc, srv) @@ -1407,6 +1521,24 @@ func _Query_TallyResult_Handler(srv interface{}, ctx context.Context, dec func(i return interceptor(ctx, in, info, handler) } +func _Query_ProposalVoteOptions_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(QueryProposalVoteOptionsRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(QueryServer).ProposalVoteOptions(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Query/ProposalVoteOptions", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(QueryServer).ProposalVoteOptions(ctx, req.(*QueryProposalVoteOptionsRequest)) + } + return interceptor(ctx, in, info, handler) +} + var _Query_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1.Query", HandlerType: (*QueryServer)(nil), @@ -1447,6 +1579,10 @@ var _Query_serviceDesc = grpc.ServiceDesc{ MethodName: "TallyResult", Handler: _Query_TallyResult_Handler, }, + { + MethodName: "ProposalVoteOptions", + Handler: _Query_ProposalVoteOptions_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/query.proto", @@ -2153,6 +2289,69 @@ func (m *QueryTallyResultResponse) MarshalToSizedBuffer(dAtA []byte) (int, error return len(dAtA) - i, nil } +func (m *QueryProposalVoteOptionsRequest) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalVoteOptionsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalVoteOptionsRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintQuery(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + +func (m *QueryProposalVoteOptionsResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *QueryProposalVoteOptionsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *QueryProposalVoteOptionsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VoteOptions != nil { + { + size, err := m.VoteOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintQuery(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintQuery(dAtA []byte, offset int, v uint64) int { offset -= sovQuery(v) base := offset @@ -2445,6 +2644,31 @@ func (m *QueryTallyResultResponse) Size() (n int) { return n } +func (m *QueryProposalVoteOptionsRequest) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovQuery(uint64(m.ProposalId)) + } + return n +} + +func (m *QueryProposalVoteOptionsResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.VoteOptions != nil { + l = m.VoteOptions.Size() + n += 1 + l + sovQuery(uint64(l)) + } + return n +} + func sovQuery(x uint64) (n int) { return (math_bits.Len64(x|1) + 6) / 7 } @@ -4282,6 +4506,161 @@ func (m *QueryTallyResultResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *QueryProposalVoteOptionsRequest) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalVoteOptionsRequest: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalVoteOptionsRequest: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *QueryProposalVoteOptionsResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: QueryProposalVoteOptionsResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: QueryProposalVoteOptionsResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VoteOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowQuery + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthQuery + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthQuery + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VoteOptions == nil { + m.VoteOptions = &ProposalVoteOptions{} + } + if err := m.VoteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipQuery(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthQuery + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipQuery(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1/query.pb.gw.go b/x/gov/types/v1/query.pb.gw.go index 7babaed36ba0..ff54cda2e588 100644 --- a/x/gov/types/v1/query.pb.gw.go +++ b/x/gov/types/v1/query.pb.gw.go @@ -545,6 +545,60 @@ func local_request_Query_TallyResult_0(ctx context.Context, marshaler runtime.Ma } +func request_Query_ProposalVoteOptions_0(ctx context.Context, marshaler runtime.Marshaler, client QueryClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalVoteOptionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := client.ProposalVoteOptions(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err + +} + +func local_request_Query_ProposalVoteOptions_0(ctx context.Context, marshaler runtime.Marshaler, server QueryServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq QueryProposalVoteOptionsRequest + var metadata runtime.ServerMetadata + + var ( + val string + ok bool + err error + _ = err + ) + + val, ok = pathParams["proposal_id"] + if !ok { + return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "proposal_id") + } + + protoReq.ProposalId, err = runtime.Uint64(val) + + if err != nil { + return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "proposal_id", err) + } + + msg, err := server.ProposalVoteOptions(ctx, &protoReq) + return msg, metadata, err + +} + // RegisterQueryHandlerServer registers the http handlers for service Query to "mux". // UnaryRPC :call QueryServer directly. // StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906. @@ -758,6 +812,29 @@ func RegisterQueryHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv }) + mux.Handle("GET", pattern_Query_ProposalVoteOptions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + var stream runtime.ServerTransportStream + ctx = grpc.NewContextWithServerTransportStream(ctx, &stream) + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Query_ProposalVoteOptions_0(rctx, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProposalVoteOptions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -979,6 +1056,26 @@ func RegisterQueryHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie }) + mux.Handle("GET", pattern_Query_ProposalVoteOptions_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { + ctx, cancel := context.WithCancel(req.Context()) + defer cancel() + inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req) + rctx, err := runtime.AnnotateContext(ctx, mux, req) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Query_ProposalVoteOptions_0(rctx, inboundMarshaler, client, req, pathParams) + ctx = runtime.NewServerMetadataContext(ctx, md) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + + forward_Query_ProposalVoteOptions_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + + }) + return nil } @@ -1000,6 +1097,8 @@ var ( pattern_Query_Deposits_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "deposits"}, "", runtime.AssumeColonVerbOpt(false))) pattern_Query_TallyResult_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "tally"}, "", runtime.AssumeColonVerbOpt(false))) + + pattern_Query_ProposalVoteOptions_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"cosmos", "gov", "v1", "proposals", "proposal_id", "vote_options"}, "", runtime.AssumeColonVerbOpt(false))) ) var ( @@ -1020,4 +1119,6 @@ var ( forward_Query_Deposits_0 = runtime.ForwardResponseMessage forward_Query_TallyResult_0 = runtime.ForwardResponseMessage + + forward_Query_ProposalVoteOptions_0 = runtime.ForwardResponseMessage ) diff --git a/x/gov/types/v1/tx.pb.go b/x/gov/types/v1/tx.pb.go index 143df2acc7f1..5bed6c5517ca 100644 --- a/x/gov/types/v1/tx.pb.go +++ b/x/gov/types/v1/tx.pb.go @@ -67,7 +67,7 @@ type MsgSubmitProposal struct { // proposal_type defines the type of proposal // When not set defaults to PROPOSAL_TYPE_STANDARD // - // Since: cosmos-sdk 0.51 + // Since: x/gov v1.0.0 ProposalType ProposalType `protobuf:"varint,8,opt,name=proposal_type,json=proposalType,proto3,enum=cosmos.gov.v1.ProposalType" json:"proposal_type,omitempty"` } @@ -844,6 +844,149 @@ func (m *MsgCancelProposalResponse) GetCanceledHeight() uint64 { return 0 } +// MsgSubmitMultipleChoiceProposal defines a message to submit a multiple choice proposal. +// +// Since: x/gov 1.0.0 +type MsgSubmitMultipleChoiceProposal struct { + // initial_deposit is the deposit value that must be paid at proposal submission. + InitialDeposit github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=initial_deposit,json=initialDeposit,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"initial_deposit"` + // proposer is the account address of the proposer. + Proposer string `protobuf:"bytes,2,opt,name=proposer,proto3" json:"proposer,omitempty"` + // metadata is any arbitrary metadata attached to the proposal. + Metadata string `protobuf:"bytes,3,opt,name=metadata,proto3" json:"metadata,omitempty"` + // title is the title of the proposal. + Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"` + // summary is the summary of the proposal + Summary string `protobuf:"bytes,5,opt,name=summary,proto3" json:"summary,omitempty"` + // vote_options defines the vote options for the proposal. + VoteOptions *ProposalVoteOptions `protobuf:"bytes,6,opt,name=vote_options,json=voteOptions,proto3" json:"vote_options,omitempty"` +} + +func (m *MsgSubmitMultipleChoiceProposal) Reset() { *m = MsgSubmitMultipleChoiceProposal{} } +func (m *MsgSubmitMultipleChoiceProposal) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMultipleChoiceProposal) ProtoMessage() {} +func (*MsgSubmitMultipleChoiceProposal) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{14} +} +func (m *MsgSubmitMultipleChoiceProposal) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMultipleChoiceProposal) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMultipleChoiceProposal.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitMultipleChoiceProposal) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMultipleChoiceProposal.Merge(m, src) +} +func (m *MsgSubmitMultipleChoiceProposal) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMultipleChoiceProposal) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMultipleChoiceProposal.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMultipleChoiceProposal proto.InternalMessageInfo + +func (m *MsgSubmitMultipleChoiceProposal) GetInitialDeposit() github_com_cosmos_cosmos_sdk_types.Coins { + if m != nil { + return m.InitialDeposit + } + return nil +} + +func (m *MsgSubmitMultipleChoiceProposal) GetProposer() string { + if m != nil { + return m.Proposer + } + return "" +} + +func (m *MsgSubmitMultipleChoiceProposal) GetMetadata() string { + if m != nil { + return m.Metadata + } + return "" +} + +func (m *MsgSubmitMultipleChoiceProposal) GetTitle() string { + if m != nil { + return m.Title + } + return "" +} + +func (m *MsgSubmitMultipleChoiceProposal) GetSummary() string { + if m != nil { + return m.Summary + } + return "" +} + +func (m *MsgSubmitMultipleChoiceProposal) GetVoteOptions() *ProposalVoteOptions { + if m != nil { + return m.VoteOptions + } + return nil +} + +// MsgSubmitMultipleChoiceProposalResponse defines the Msg/SubmitMultipleChoiceProposal response type. +// +// Since: x/gov 1.0.0 +type MsgSubmitMultipleChoiceProposalResponse struct { + // proposal_id defines the unique id of the proposal. + ProposalId uint64 `protobuf:"varint,1,opt,name=proposal_id,json=proposalId,proto3" json:"proposal_id,omitempty"` +} + +func (m *MsgSubmitMultipleChoiceProposalResponse) Reset() { + *m = MsgSubmitMultipleChoiceProposalResponse{} +} +func (m *MsgSubmitMultipleChoiceProposalResponse) String() string { return proto.CompactTextString(m) } +func (*MsgSubmitMultipleChoiceProposalResponse) ProtoMessage() {} +func (*MsgSubmitMultipleChoiceProposalResponse) Descriptor() ([]byte, []int) { + return fileDescriptor_9ff8f4a63b6fc9a9, []int{15} +} +func (m *MsgSubmitMultipleChoiceProposalResponse) XXX_Unmarshal(b []byte) error { + return m.Unmarshal(b) +} +func (m *MsgSubmitMultipleChoiceProposalResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + if deterministic { + return xxx_messageInfo_MsgSubmitMultipleChoiceProposalResponse.Marshal(b, m, deterministic) + } else { + b = b[:cap(b)] + n, err := m.MarshalToSizedBuffer(b) + if err != nil { + return nil, err + } + return b[:n], nil + } +} +func (m *MsgSubmitMultipleChoiceProposalResponse) XXX_Merge(src proto.Message) { + xxx_messageInfo_MsgSubmitMultipleChoiceProposalResponse.Merge(m, src) +} +func (m *MsgSubmitMultipleChoiceProposalResponse) XXX_Size() int { + return m.Size() +} +func (m *MsgSubmitMultipleChoiceProposalResponse) XXX_DiscardUnknown() { + xxx_messageInfo_MsgSubmitMultipleChoiceProposalResponse.DiscardUnknown(m) +} + +var xxx_messageInfo_MsgSubmitMultipleChoiceProposalResponse proto.InternalMessageInfo + +func (m *MsgSubmitMultipleChoiceProposalResponse) GetProposalId() uint64 { + if m != nil { + return m.ProposalId + } + return 0 +} + func init() { proto.RegisterType((*MsgSubmitProposal)(nil), "cosmos.gov.v1.MsgSubmitProposal") proto.RegisterType((*MsgSubmitProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitProposalResponse") @@ -859,82 +1002,90 @@ func init() { proto.RegisterType((*MsgUpdateParamsResponse)(nil), "cosmos.gov.v1.MsgUpdateParamsResponse") proto.RegisterType((*MsgCancelProposal)(nil), "cosmos.gov.v1.MsgCancelProposal") proto.RegisterType((*MsgCancelProposalResponse)(nil), "cosmos.gov.v1.MsgCancelProposalResponse") + proto.RegisterType((*MsgSubmitMultipleChoiceProposal)(nil), "cosmos.gov.v1.MsgSubmitMultipleChoiceProposal") + proto.RegisterType((*MsgSubmitMultipleChoiceProposalResponse)(nil), "cosmos.gov.v1.MsgSubmitMultipleChoiceProposalResponse") } func init() { proto.RegisterFile("cosmos/gov/v1/tx.proto", fileDescriptor_9ff8f4a63b6fc9a9) } var fileDescriptor_9ff8f4a63b6fc9a9 = []byte{ - // 1114 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xbc, 0x56, 0xcb, 0x6f, 0xdc, 0x44, - 0x18, 0xcf, 0xe4, 0xb5, 0xc9, 0xe4, 0xa5, 0x8c, 0xb6, 0xad, 0xe3, 0x16, 0xef, 0xd6, 0x45, 0xb0, - 0x4a, 0x89, 0xcd, 0x06, 0x52, 0xa1, 0xa5, 0x42, 0x74, 0xc3, 0xab, 0x12, 0x81, 0xca, 0x2d, 0x45, - 0x42, 0x48, 0x91, 0xb3, 0x1e, 0x1c, 0xab, 0x6b, 0x8f, 0xb5, 0x33, 0xbb, 0xca, 0xde, 0x10, 0xc7, - 0x9c, 0x7a, 0xe6, 0x2f, 0x40, 0x9c, 0x72, 0xe8, 0xad, 0x27, 0x6e, 0x15, 0xa7, 0x8a, 0x13, 0xa7, - 0x16, 0x25, 0x82, 0x20, 0xf8, 0x23, 0x40, 0x33, 0x1e, 0x7b, 0xfd, 0xca, 0xa6, 0x70, 0xe8, 0x65, - 0xd7, 0xf3, 0xbd, 0xe6, 0xfb, 0xfd, 0xbe, 0x6f, 0xbe, 0x19, 0x78, 0xb1, 0x43, 0xa8, 0x4f, 0xa8, - 0xe9, 0x92, 0x81, 0x39, 0x68, 0x9a, 0xec, 0xc0, 0x08, 0x7b, 0x84, 0x11, 0xb4, 0x14, 0xc9, 0x0d, - 0x97, 0x0c, 0x8c, 0x41, 0x53, 0xd5, 0xa4, 0xd9, 0x9e, 0x4d, 0xb1, 0x39, 0x68, 0xee, 0x61, 0x66, - 0x37, 0xcd, 0x0e, 0xf1, 0x82, 0xc8, 0x5c, 0xbd, 0x94, 0x0d, 0xc3, 0xbd, 0x22, 0x45, 0xd5, 0x25, - 0x2e, 0x11, 0x9f, 0x26, 0xff, 0x92, 0xd2, 0xb5, 0xc8, 0x7c, 0x37, 0x52, 0xc8, 0xad, 0xa4, 0xca, - 0x25, 0xc4, 0xed, 0x62, 0x53, 0xac, 0xf6, 0xfa, 0xdf, 0x98, 0x76, 0x30, 0xcc, 0x6d, 0xe2, 0x53, - 0x97, 0x6f, 0xe2, 0x53, 0x57, 0x2a, 0x56, 0x6d, 0xdf, 0x0b, 0x88, 0x29, 0x7e, 0xa5, 0xa8, 0x96, - 0x0f, 0xc3, 0x3c, 0x1f, 0x53, 0x66, 0xfb, 0x61, 0x64, 0xa0, 0xff, 0x3d, 0x05, 0x57, 0x77, 0xa8, - 0x7b, 0xb7, 0xbf, 0xe7, 0x7b, 0xec, 0x4e, 0x8f, 0x84, 0x84, 0xda, 0x5d, 0xf4, 0x26, 0x9c, 0xf3, - 0x31, 0xa5, 0xb6, 0x8b, 0xa9, 0x02, 0xea, 0x53, 0x8d, 0x85, 0xcd, 0xaa, 0x11, 0x45, 0x32, 0xe2, - 0x48, 0xc6, 0xad, 0x60, 0x68, 0x25, 0x56, 0xe8, 0x10, 0xc0, 0x15, 0x2f, 0xf0, 0x98, 0x67, 0x77, - 0x77, 0x1d, 0x1c, 0x12, 0xea, 0x31, 0x65, 0x52, 0x78, 0xae, 0x19, 0x12, 0x18, 0x27, 0xcd, 0x90, - 0xa4, 0x19, 0xdb, 0xc4, 0x0b, 0xda, 0x1f, 0x3d, 0x79, 0x56, 0x9b, 0xf8, 0xf1, 0x79, 0xad, 0xe1, - 0x7a, 0x6c, 0xbf, 0xbf, 0x67, 0x74, 0x88, 0x2f, 0x59, 0x90, 0x7f, 0x1b, 0xd4, 0x79, 0x60, 0xb2, - 0x61, 0x88, 0xa9, 0x70, 0xa0, 0xdf, 0x9f, 0x1e, 0xad, 0x2f, 0x76, 0xb1, 0x6b, 0x77, 0x86, 0xbb, - 0x9c, 0x76, 0xfa, 0xc3, 0xe9, 0xd1, 0x3a, 0xb0, 0x96, 0xe5, 0xce, 0x1f, 0x44, 0x1b, 0xa3, 0xb7, - 0xe1, 0x5c, 0x28, 0xa0, 0xe0, 0x9e, 0x32, 0x55, 0x07, 0x8d, 0xf9, 0xb6, 0xf2, 0xcb, 0xa3, 0x8d, - 0xaa, 0xcc, 0xe3, 0x96, 0xe3, 0xf4, 0x30, 0xa5, 0x77, 0x59, 0xcf, 0x0b, 0x5c, 0x2b, 0xb1, 0x44, - 0x2a, 0x07, 0xcd, 0x6c, 0xc7, 0x66, 0xb6, 0x32, 0xcd, 0xbd, 0xac, 0x64, 0x8d, 0xaa, 0x70, 0x86, - 0x79, 0xac, 0x8b, 0x95, 0x19, 0xa1, 0x88, 0x16, 0x48, 0x81, 0x15, 0xda, 0xf7, 0x7d, 0xbb, 0x37, - 0x54, 0x66, 0x85, 0x3c, 0x5e, 0xa2, 0x3a, 0x9c, 0xc7, 0x07, 0x21, 0x76, 0x3c, 0x86, 0x1d, 0xa5, - 0x52, 0x07, 0x8d, 0xb9, 0xf6, 0xa4, 0x02, 0xac, 0x91, 0x10, 0xbd, 0x0f, 0x97, 0x42, 0x49, 0xf7, - 0x2e, 0x47, 0xa8, 0xcc, 0xd5, 0x41, 0x63, 0x79, 0xf3, 0xb2, 0x91, 0xe9, 0x38, 0x23, 0x2e, 0xc9, - 0xbd, 0x61, 0x88, 0xad, 0xc5, 0x30, 0xb5, 0x6a, 0x35, 0xbf, 0x3b, 0x3d, 0x5a, 0x4f, 0xd2, 0x3f, - 0x3c, 0x3d, 0x5a, 0xaf, 0xa5, 0x58, 0x1b, 0x34, 0xcd, 0x42, 0x5d, 0xf5, 0x9b, 0x70, 0xad, 0x20, - 0xb4, 0x30, 0x0d, 0x49, 0x40, 0x31, 0xaa, 0xc1, 0x85, 0x24, 0x23, 0xcf, 0x51, 0x40, 0x1d, 0x34, - 0xa6, 0x2d, 0x18, 0x8b, 0x6e, 0x3b, 0xfa, 0x63, 0x00, 0xab, 0x3b, 0xd4, 0xfd, 0xf0, 0x00, 0x77, - 0x3e, 0x15, 0x35, 0xd8, 0x26, 0x01, 0xc3, 0x01, 0x43, 0x9f, 0xc1, 0x4a, 0x27, 0xfa, 0x14, 0x5e, - 0x67, 0x74, 0x4b, 0x5b, 0xfb, 0xf9, 0xd1, 0x86, 0x9a, 0x81, 0x17, 0xf7, 0x82, 0xf0, 0xb5, 0xe2, - 0x20, 0xe8, 0x0a, 0x9c, 0xb7, 0xfb, 0x6c, 0x9f, 0xf4, 0x3c, 0x36, 0x54, 0x26, 0x05, 0xb3, 0x23, - 0x41, 0x6b, 0x8b, 0xe3, 0x1e, 0xad, 0x39, 0x70, 0xbd, 0x00, 0xbc, 0x90, 0xa4, 0xae, 0xc1, 0x2b, - 0x65, 0xf2, 0x18, 0xbe, 0xfe, 0x3b, 0x80, 0x95, 0x1d, 0xea, 0xde, 0x27, 0x0c, 0xa3, 0xad, 0x12, - 0x2a, 0xda, 0xd5, 0xbf, 0x9e, 0xd5, 0xd2, 0xe2, 0xa8, 0xf7, 0x52, 0x04, 0x21, 0x03, 0xce, 0x0c, - 0x08, 0xc3, 0xbd, 0x28, 0xe7, 0x31, 0x4d, 0x17, 0x99, 0xa1, 0x26, 0x9c, 0x25, 0x21, 0xf3, 0x48, - 0x20, 0xba, 0x74, 0x79, 0x74, 0x54, 0x64, 0xf1, 0x79, 0x2e, 0x9f, 0x0b, 0x03, 0x4b, 0x1a, 0x8e, - 0x6b, 0xd2, 0xd6, 0xab, 0x9c, 0x98, 0x28, 0x34, 0x27, 0xe5, 0x42, 0x81, 0x14, 0x1e, 0x4f, 0x5f, - 0x85, 0x2b, 0xf2, 0x33, 0x81, 0xfe, 0x0f, 0x48, 0x64, 0x5f, 0x62, 0xcf, 0xdd, 0xe7, 0xfd, 0xf9, - 0x92, 0x28, 0x78, 0x17, 0x56, 0x22, 0x64, 0x54, 0x99, 0x12, 0xe3, 0xe2, 0x6a, 0x8e, 0x83, 0x38, - 0xa1, 0x14, 0x17, 0xb1, 0xc7, 0x58, 0x32, 0xde, 0xc8, 0x92, 0xf1, 0x4a, 0x29, 0x19, 0x71, 0x70, - 0x7d, 0x0d, 0x5e, 0xca, 0x89, 0x12, 0x72, 0xfe, 0x00, 0x10, 0xee, 0x50, 0x37, 0x9e, 0x2d, 0xff, - 0x93, 0x97, 0x1b, 0x70, 0x5e, 0x8e, 0x45, 0x72, 0x3e, 0x37, 0x23, 0x53, 0x74, 0x13, 0xce, 0xda, - 0x3e, 0xe9, 0x07, 0x4c, 0xd2, 0x33, 0x66, 0x9a, 0xce, 0xf3, 0x69, 0x1a, 0xed, 0x2c, 0x7d, 0x5a, - 0xd7, 0xc5, 0x51, 0x49, 0xa2, 0x71, 0x22, 0x94, 0x02, 0x11, 0x12, 0x99, 0x5e, 0x85, 0x68, 0xb4, - 0x4a, 0xe0, 0x3f, 0x8e, 0x7a, 0xe3, 0x8b, 0xd0, 0xb1, 0x19, 0xbe, 0x63, 0xf7, 0x6c, 0x9f, 0x72, - 0x30, 0xa3, 0xf3, 0x09, 0xce, 0x03, 0x93, 0x98, 0xa2, 0x77, 0xe0, 0x6c, 0x28, 0x22, 0x08, 0x06, - 0x16, 0x36, 0x2f, 0xe4, 0x87, 0x9d, 0x50, 0x66, 0x80, 0x44, 0xf6, 0xad, 0x1b, 0xc5, 0x33, 0x7f, - 0x2d, 0x05, 0xe4, 0x20, 0xbe, 0x71, 0x73, 0x99, 0xca, 0xba, 0xa6, 0x45, 0x09, 0xb0, 0x43, 0x20, - 0x6e, 0xbe, 0x6d, 0x3b, 0xe8, 0xe0, 0x6e, 0xea, 0xe6, 0x2b, 0x29, 0xef, 0x4a, 0xae, 0xbc, 0x99, - 0xca, 0xa6, 0x2f, 0x9b, 0xc9, 0x17, 0xbd, 0x6c, 0x5a, 0x4b, 0x99, 0xe1, 0xad, 0xff, 0x04, 0xc4, - 0x64, 0xce, 0x26, 0x93, 0x4c, 0xe6, 0xff, 0x9e, 0xd4, 0x6d, 0xb8, 0xd4, 0x11, 0xb1, 0xb0, 0xb3, - 0xcb, 0xaf, 0x7c, 0x49, 0xb8, 0x5a, 0x98, 0xcb, 0xf7, 0xe2, 0xf7, 0x40, 0x7b, 0x8e, 0xb3, 0xfe, - 0xf0, 0x79, 0x0d, 0x58, 0x8b, 0xb1, 0x2b, 0x57, 0xa2, 0xd7, 0xe1, 0x4a, 0x12, 0x6a, 0x5f, 0x1c, - 0x0e, 0x31, 0xad, 0xa6, 0xad, 0xe5, 0x58, 0xfc, 0x89, 0x90, 0x6e, 0xfe, 0x39, 0x0d, 0xa7, 0x76, - 0xa8, 0x8b, 0xbe, 0x86, 0xcb, 0xb9, 0xe7, 0x44, 0x3d, 0x57, 0xe7, 0xc2, 0x1d, 0xa4, 0x36, 0xce, - 0xb3, 0x48, 0xb8, 0xc0, 0x70, 0xb5, 0x78, 0x01, 0x5d, 0x2b, 0xba, 0x17, 0x8c, 0xd4, 0xeb, 0x2f, - 0x60, 0x94, 0x6c, 0xf3, 0x1e, 0x9c, 0x16, 0x37, 0xc1, 0xc5, 0xa2, 0x13, 0x97, 0xab, 0x5a, 0xb9, - 0x3c, 0xf1, 0xbf, 0x0f, 0x17, 0x33, 0xe3, 0xf4, 0x0c, 0xfb, 0x58, 0xaf, 0xbe, 0x36, 0x5e, 0x9f, - 0xc4, 0xfd, 0x18, 0x56, 0xe2, 0x49, 0xb4, 0x56, 0x74, 0x91, 0x2a, 0xf5, 0xea, 0x99, 0xaa, 0x74, - 0x82, 0x99, 0x33, 0x5d, 0x92, 0x60, 0x5a, 0x5f, 0x96, 0x60, 0xd9, 0xb1, 0xe2, 0xd5, 0xcf, 0x1d, - 0xa9, 0x92, 0xea, 0x67, 0x2d, 0xca, 0xaa, 0x5f, 0x7e, 0x12, 0xd4, 0x99, 0x6f, 0xf9, 0x58, 0x68, - 0x6f, 0x3d, 0x39, 0xd6, 0xc0, 0xd3, 0x63, 0x0d, 0xfc, 0x76, 0xac, 0x81, 0x87, 0x27, 0xda, 0xc4, - 0xd3, 0x13, 0x6d, 0xe2, 0xd7, 0x13, 0x6d, 0xe2, 0xab, 0xcb, 0x51, 0x24, 0xea, 0x3c, 0x30, 0x3c, - 0x22, 0xe7, 0x82, 0x78, 0x40, 0xf2, 0xe7, 0xfa, 0xac, 0x68, 0xfb, 0xb7, 0xfe, 0x0d, 0x00, 0x00, - 0xff, 0xff, 0x46, 0x1f, 0x89, 0xe5, 0xee, 0x0b, 0x00, 0x00, + // 1216 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xcc, 0x57, 0xcf, 0x6f, 0x1b, 0xc5, + 0x17, 0xcf, 0xc4, 0xb1, 0x9d, 0x4c, 0x7e, 0x29, 0x2b, 0xb7, 0xdd, 0x6c, 0xfb, 0xb5, 0xdd, 0xed, + 0x57, 0xd4, 0x4a, 0xe9, 0x1a, 0x07, 0x12, 0x21, 0x53, 0x21, 0xea, 0x50, 0xa0, 0x08, 0x43, 0xb5, + 0x2d, 0x45, 0x42, 0x48, 0xd6, 0xc6, 0x3b, 0x6c, 0x56, 0xf5, 0xee, 0xac, 0x3c, 0x63, 0x2b, 0xbe, + 0x21, 0x0e, 0x3d, 0xe4, 0xd4, 0x33, 0x7f, 0x01, 0xe2, 0x94, 0x43, 0x6f, 0x3d, 0x71, 0xab, 0x38, + 0x55, 0x9c, 0x38, 0xb5, 0x28, 0x11, 0x44, 0x82, 0x13, 0x7f, 0x01, 0x68, 0x66, 0x67, 0xd7, 0xfb, + 0xcb, 0x4e, 0xda, 0x03, 0xe2, 0x92, 0xec, 0xbc, 0x5f, 0xf3, 0xde, 0xe7, 0xbd, 0xf9, 0xcc, 0x18, + 0x9e, 0xef, 0x62, 0xe2, 0x60, 0x52, 0xb7, 0xf0, 0xb0, 0x3e, 0x6c, 0xd4, 0xe9, 0xbe, 0xe6, 0xf5, + 0x31, 0xc5, 0xd2, 0xb2, 0x2f, 0xd7, 0x2c, 0x3c, 0xd4, 0x86, 0x0d, 0xa5, 0x2c, 0xcc, 0x76, 0x0d, + 0x82, 0xea, 0xc3, 0xc6, 0x2e, 0xa2, 0x46, 0xa3, 0xde, 0xc5, 0xb6, 0xeb, 0x9b, 0x2b, 0x17, 0xe2, + 0x61, 0x98, 0x97, 0xaf, 0x28, 0x59, 0xd8, 0xc2, 0xfc, 0xb3, 0xce, 0xbe, 0x84, 0x74, 0xdd, 0x37, + 0xef, 0xf8, 0x0a, 0xb1, 0x95, 0x50, 0x59, 0x18, 0x5b, 0x3d, 0x54, 0xe7, 0xab, 0xdd, 0xc1, 0xd7, + 0x75, 0xc3, 0x1d, 0x25, 0x36, 0x71, 0x88, 0xc5, 0x36, 0x71, 0x88, 0x25, 0x14, 0x6b, 0x86, 0x63, + 0xbb, 0xb8, 0xce, 0xff, 0x0a, 0x51, 0x25, 0x19, 0x86, 0xda, 0x0e, 0x22, 0xd4, 0x70, 0x3c, 0xdf, + 0x40, 0xfd, 0x33, 0x07, 0xd7, 0xda, 0xc4, 0xba, 0x3b, 0xd8, 0x75, 0x6c, 0x7a, 0xa7, 0x8f, 0x3d, + 0x4c, 0x8c, 0x9e, 0xf4, 0x06, 0x9c, 0x77, 0x10, 0x21, 0x86, 0x85, 0x88, 0x0c, 0xaa, 0xb9, 0xda, + 0xe2, 0x66, 0x49, 0xf3, 0x23, 0x69, 0x41, 0x24, 0xed, 0xa6, 0x3b, 0xd2, 0x43, 0x2b, 0xe9, 0x00, + 0xc0, 0x55, 0xdb, 0xb5, 0xa9, 0x6d, 0xf4, 0x3a, 0x26, 0xf2, 0x30, 0xb1, 0xa9, 0x3c, 0xcb, 0x3d, + 0xd7, 0x35, 0x51, 0x18, 0x03, 0x4d, 0x13, 0xa0, 0x69, 0x3b, 0xd8, 0x76, 0x5b, 0x1f, 0x3c, 0x7d, + 0x5e, 0x99, 0xf9, 0xe1, 0x45, 0xa5, 0x66, 0xd9, 0x74, 0x6f, 0xb0, 0xab, 0x75, 0xb1, 0x23, 0x50, + 0x10, 0xff, 0xae, 0x13, 0xf3, 0x41, 0x9d, 0x8e, 0x3c, 0x44, 0xb8, 0x03, 0xf9, 0xee, 0xe4, 0x70, + 0x63, 0xa9, 0x87, 0x2c, 0xa3, 0x3b, 0xea, 0x30, 0xd8, 0xc9, 0xf7, 0x27, 0x87, 0x1b, 0x40, 0x5f, + 0x11, 0x3b, 0xbf, 0xef, 0x6f, 0x2c, 0xbd, 0x05, 0xe7, 0x3d, 0x5e, 0x0a, 0xea, 0xcb, 0xb9, 0x2a, + 0xa8, 0x2d, 0xb4, 0xe4, 0x9f, 0x1f, 0x5f, 0x2f, 0x89, 0x3c, 0x6e, 0x9a, 0x66, 0x1f, 0x11, 0x72, + 0x97, 0xf6, 0x6d, 0xd7, 0xd2, 0x43, 0x4b, 0x49, 0x61, 0x45, 0x53, 0xc3, 0x34, 0xa8, 0x21, 0xcf, + 0x31, 0x2f, 0x3d, 0x5c, 0x4b, 0x25, 0x98, 0xa7, 0x36, 0xed, 0x21, 0x39, 0xcf, 0x15, 0xfe, 0x42, + 0x92, 0x61, 0x91, 0x0c, 0x1c, 0xc7, 0xe8, 0x8f, 0xe4, 0x02, 0x97, 0x07, 0x4b, 0xa9, 0x0a, 0x17, + 0xd0, 0xbe, 0x87, 0x4c, 0x9b, 0x22, 0x53, 0x2e, 0x56, 0x41, 0x6d, 0xbe, 0x35, 0x2b, 0x03, 0x7d, + 0x2c, 0x94, 0xde, 0x83, 0xcb, 0x9e, 0x80, 0xbb, 0xc3, 0x2a, 0x94, 0xe7, 0xab, 0xa0, 0xb6, 0xb2, + 0x79, 0x51, 0x8b, 0x4d, 0x9c, 0x16, 0xb4, 0xe4, 0xde, 0xc8, 0x43, 0xfa, 0x92, 0x17, 0x59, 0x35, + 0x1b, 0xdf, 0x9e, 0x1c, 0x6e, 0x84, 0xe9, 0x1f, 0x9c, 0x1c, 0x6e, 0x54, 0x22, 0xa8, 0x0d, 0x1b, + 0xf5, 0x54, 0x5f, 0xd5, 0x1b, 0x70, 0x3d, 0x25, 0xd4, 0x11, 0xf1, 0xb0, 0x4b, 0x90, 0x54, 0x81, + 0x8b, 0x61, 0x46, 0xb6, 0x29, 0x83, 0x2a, 0xa8, 0xcd, 0xe9, 0x30, 0x10, 0xdd, 0x36, 0xd5, 0x27, + 0x00, 0x96, 0xda, 0xc4, 0xba, 0xb5, 0x8f, 0xba, 0x9f, 0xf0, 0x1e, 0xec, 0x60, 0x97, 0x22, 0x97, + 0x4a, 0x9f, 0xc2, 0x62, 0xd7, 0xff, 0xe4, 0x5e, 0x13, 0xa6, 0xa5, 0x55, 0xfe, 0xe9, 0xf1, 0x75, + 0x25, 0x56, 0x5e, 0x30, 0x0b, 0xdc, 0x57, 0x0f, 0x82, 0x48, 0x97, 0xe0, 0x82, 0x31, 0xa0, 0x7b, + 0xb8, 0x6f, 0xd3, 0x91, 0x3c, 0xcb, 0x91, 0x1d, 0x0b, 0x9a, 0x5b, 0xac, 0xee, 0xf1, 0x9a, 0x15, + 0xae, 0xa6, 0x0a, 0x4f, 0x25, 0xa9, 0x96, 0xe1, 0xa5, 0x2c, 0x79, 0x50, 0xbe, 0xfa, 0x1b, 0x80, + 0xc5, 0x36, 0xb1, 0xee, 0x63, 0x8a, 0xa4, 0xad, 0x0c, 0x28, 0x5a, 0xa5, 0x3f, 0x9e, 0x57, 0xa2, + 0x62, 0x7f, 0xf6, 0x22, 0x00, 0x49, 0x1a, 0xcc, 0x0f, 0x31, 0x45, 0x7d, 0x3f, 0xe7, 0x29, 0x43, + 0xe7, 0x9b, 0x49, 0x0d, 0x58, 0xc0, 0x1e, 0xb5, 0xb1, 0xcb, 0xa7, 0x74, 0x65, 0x7c, 0x54, 0x44, + 0xf3, 0x59, 0x2e, 0x9f, 0x71, 0x03, 0x5d, 0x18, 0x4e, 0x1b, 0xd2, 0xe6, 0xff, 0x19, 0x30, 0x7e, + 0x68, 0x06, 0xca, 0xb9, 0x14, 0x28, 0x2c, 0x9e, 0xba, 0x06, 0x57, 0xc5, 0x67, 0x58, 0xfa, 0xdf, + 0x20, 0x94, 0x7d, 0x81, 0x6c, 0x6b, 0x8f, 0xcd, 0xe7, 0xbf, 0x04, 0xc1, 0x3b, 0xb0, 0xe8, 0x57, + 0x46, 0xe4, 0x1c, 0xa7, 0x8b, 0xcb, 0x09, 0x0c, 0x82, 0x84, 0x22, 0x58, 0x04, 0x1e, 0x53, 0xc1, + 0x78, 0x3d, 0x0e, 0xc6, 0xff, 0x32, 0xc1, 0x08, 0x82, 0xab, 0xeb, 0xf0, 0x42, 0x42, 0x14, 0x82, + 0xf3, 0x3b, 0x80, 0xb0, 0x4d, 0xac, 0x80, 0x5b, 0x5e, 0x11, 0x97, 0x6d, 0xb8, 0x20, 0x68, 0x11, + 0x9f, 0x8e, 0xcd, 0xd8, 0x54, 0xba, 0x01, 0x0b, 0x86, 0x83, 0x07, 0x2e, 0x15, 0xf0, 0x4c, 0x61, + 0xd3, 0x05, 0xc6, 0xa6, 0xfe, 0xce, 0xc2, 0xa7, 0x79, 0x8d, 0x1f, 0x95, 0x30, 0x1a, 0x03, 0x42, + 0x4e, 0x01, 0x21, 0x2a, 0x53, 0x4b, 0x50, 0x1a, 0xaf, 0xc2, 0xf2, 0x9f, 0xf8, 0xb3, 0xf1, 0xb9, + 0x67, 0x1a, 0x14, 0xdd, 0x31, 0xfa, 0x86, 0x43, 0x58, 0x31, 0xe3, 0xf3, 0x09, 0x4e, 0x2b, 0x26, + 0x34, 0x95, 0xde, 0x86, 0x05, 0x8f, 0x47, 0xe0, 0x08, 0x2c, 0x6e, 0x9e, 0x4b, 0x92, 0x1d, 0x57, + 0xc6, 0x0a, 0xf1, 0xed, 0x9b, 0xdb, 0xe9, 0x33, 0x7f, 0x25, 0x52, 0xc8, 0x7e, 0x70, 0xe3, 0x26, + 0x32, 0x15, 0x7d, 0x8d, 0x8a, 0xc2, 0xc2, 0x0e, 0x00, 0xbf, 0xf9, 0x76, 0x0c, 0xb7, 0x8b, 0x7a, + 0x91, 0x9b, 0x2f, 0xa3, 0xbd, 0xab, 0x89, 0xf6, 0xc6, 0x3a, 0x1b, 0xbd, 0x6c, 0x66, 0xcf, 0x7a, + 0xd9, 0x34, 0x97, 0x63, 0xe4, 0xad, 0xfe, 0x08, 0x38, 0x33, 0xc7, 0x93, 0x09, 0x99, 0xf9, 0xe5, + 0x93, 0xba, 0x0d, 0x97, 0xbb, 0x3c, 0x16, 0x32, 0x3b, 0xec, 0xca, 0x17, 0x80, 0x2b, 0x29, 0x5e, + 0xbe, 0x17, 0xbc, 0x07, 0x5a, 0xf3, 0x0c, 0xf5, 0x47, 0x2f, 0x2a, 0x40, 0x5f, 0x0a, 0x5c, 0x99, + 0x52, 0xba, 0x0a, 0x57, 0xc3, 0x50, 0x7b, 0xfc, 0x70, 0x70, 0xb6, 0x9a, 0xd3, 0x57, 0x02, 0xf1, + 0x47, 0x5c, 0xaa, 0x3e, 0xcc, 0xc1, 0x4a, 0x78, 0xbb, 0xb4, 0x07, 0x3d, 0x6a, 0x7b, 0x3d, 0xb4, + 0xb3, 0x87, 0xed, 0x2e, 0x0a, 0xe1, 0xcd, 0x7a, 0x26, 0x80, 0xff, 0xc2, 0x33, 0x61, 0xf6, 0x95, + 0x9e, 0x09, 0xb9, 0x49, 0xcf, 0x84, 0xb9, 0x09, 0xcf, 0x84, 0x7c, 0xfc, 0x99, 0x70, 0x0b, 0x2e, + 0x31, 0x86, 0xea, 0x04, 0x14, 0x58, 0xe0, 0x5d, 0x52, 0x27, 0xbc, 0x01, 0xc6, 0x14, 0x48, 0xf4, + 0xc5, 0xe1, 0x78, 0x91, 0x1c, 0xa6, 0x8f, 0xe1, 0xd5, 0x53, 0xfa, 0x70, 0xe6, 0x3b, 0x7f, 0xf3, + 0xaf, 0x3c, 0xcc, 0xb5, 0x89, 0x25, 0x7d, 0x05, 0x57, 0x12, 0x6f, 0xc4, 0x6a, 0x22, 0xcb, 0xd4, + 0xc3, 0x42, 0xa9, 0x9d, 0x66, 0x11, 0xa6, 0x81, 0xe0, 0x5a, 0xfa, 0x55, 0x71, 0x25, 0xed, 0x9e, + 0x32, 0x52, 0xae, 0x9d, 0xc1, 0x28, 0xdc, 0xe6, 0x5d, 0x38, 0xc7, 0xaf, 0xf7, 0xf3, 0x69, 0x27, + 0x26, 0x57, 0xca, 0xd9, 0xf2, 0xd0, 0xff, 0x3e, 0x5c, 0x8a, 0xdd, 0x91, 0x13, 0xec, 0x03, 0xbd, + 0xf2, 0xda, 0x74, 0x7d, 0x18, 0xf7, 0x43, 0x58, 0x0c, 0x66, 0x72, 0x3d, 0xed, 0x22, 0x54, 0xca, + 0xe5, 0x89, 0xaa, 0x68, 0x82, 0x31, 0xa2, 0xce, 0x48, 0x30, 0xaa, 0xcf, 0x4a, 0x30, 0x8b, 0x2b, + 0x59, 0xf7, 0x13, 0x3c, 0x99, 0xd1, 0xfd, 0xb8, 0x45, 0x56, 0xf7, 0x27, 0xd0, 0xdb, 0x43, 0x00, + 0x2f, 0x4d, 0x65, 0x0d, 0x6d, 0xd2, 0x20, 0x65, 0xdb, 0x2b, 0xdb, 0x2f, 0x67, 0x1f, 0x24, 0xa2, + 0xe4, 0xbf, 0x61, 0x3c, 0xd1, 0xda, 0x7a, 0x7a, 0x54, 0x06, 0xcf, 0x8e, 0xca, 0xe0, 0xd7, 0xa3, + 0x32, 0x78, 0x74, 0x5c, 0x9e, 0x79, 0x76, 0x5c, 0x9e, 0xf9, 0xe5, 0xb8, 0x3c, 0xf3, 0xe5, 0x45, + 0x3f, 0x2e, 0x31, 0x1f, 0x68, 0x36, 0x16, 0xb7, 0x0e, 0xe7, 0x1d, 0xf6, 0x63, 0xb0, 0xc0, 0x49, + 0xf5, 0xcd, 0x7f, 0x02, 0x00, 0x00, 0xff, 0xff, 0x2b, 0x9b, 0x54, 0x57, 0x4c, 0x0e, 0x00, 0x00, } // Reference imports to suppress errors if they are not otherwise used. @@ -969,6 +1120,10 @@ type MsgClient interface { // // Since: cosmos-sdk 0.50 CancelProposal(ctx context.Context, in *MsgCancelProposal, opts ...grpc.CallOption) (*MsgCancelProposalResponse, error) + // SubmitMultipleChoiceProposal defines a method to create new multiple choice proposal. + // + // Since: x/gov 1.0.0 + SubmitMultipleChoiceProposal(ctx context.Context, in *MsgSubmitMultipleChoiceProposal, opts ...grpc.CallOption) (*MsgSubmitMultipleChoiceProposalResponse, error) } type msgClient struct { @@ -1042,6 +1197,15 @@ func (c *msgClient) CancelProposal(ctx context.Context, in *MsgCancelProposal, o return out, nil } +func (c *msgClient) SubmitMultipleChoiceProposal(ctx context.Context, in *MsgSubmitMultipleChoiceProposal, opts ...grpc.CallOption) (*MsgSubmitMultipleChoiceProposalResponse, error) { + out := new(MsgSubmitMultipleChoiceProposalResponse) + err := c.cc.Invoke(ctx, "/cosmos.gov.v1.Msg/SubmitMultipleChoiceProposal", in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + // MsgServer is the server API for Msg service. type MsgServer interface { // SubmitProposal defines a method to create new proposal given the messages. @@ -1064,6 +1228,10 @@ type MsgServer interface { // // Since: cosmos-sdk 0.50 CancelProposal(context.Context, *MsgCancelProposal) (*MsgCancelProposalResponse, error) + // SubmitMultipleChoiceProposal defines a method to create new multiple choice proposal. + // + // Since: x/gov 1.0.0 + SubmitMultipleChoiceProposal(context.Context, *MsgSubmitMultipleChoiceProposal) (*MsgSubmitMultipleChoiceProposalResponse, error) } // UnimplementedMsgServer can be embedded to have forward compatible implementations. @@ -1091,6 +1259,9 @@ func (*UnimplementedMsgServer) UpdateParams(ctx context.Context, req *MsgUpdateP func (*UnimplementedMsgServer) CancelProposal(ctx context.Context, req *MsgCancelProposal) (*MsgCancelProposalResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method CancelProposal not implemented") } +func (*UnimplementedMsgServer) SubmitMultipleChoiceProposal(ctx context.Context, req *MsgSubmitMultipleChoiceProposal) (*MsgSubmitMultipleChoiceProposalResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method SubmitMultipleChoiceProposal not implemented") +} func RegisterMsgServer(s grpc1.Server, srv MsgServer) { s.RegisterService(&_Msg_serviceDesc, srv) @@ -1222,6 +1393,24 @@ func _Msg_CancelProposal_Handler(srv interface{}, ctx context.Context, dec func( return interceptor(ctx, in, info, handler) } +func _Msg_SubmitMultipleChoiceProposal_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(MsgSubmitMultipleChoiceProposal) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(MsgServer).SubmitMultipleChoiceProposal(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: "/cosmos.gov.v1.Msg/SubmitMultipleChoiceProposal", + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(MsgServer).SubmitMultipleChoiceProposal(ctx, req.(*MsgSubmitMultipleChoiceProposal)) + } + return interceptor(ctx, in, info, handler) +} + var _Msg_serviceDesc = grpc.ServiceDesc{ ServiceName: "cosmos.gov.v1.Msg", HandlerType: (*MsgServer)(nil), @@ -1254,6 +1443,10 @@ var _Msg_serviceDesc = grpc.ServiceDesc{ MethodName: "CancelProposal", Handler: _Msg_CancelProposal_Handler, }, + { + MethodName: "SubmitMultipleChoiceProposal", + Handler: _Msg_SubmitMultipleChoiceProposal_Handler, + }, }, Streams: []grpc.StreamDesc{}, Metadata: "cosmos/gov/v1/tx.proto", @@ -1806,6 +1999,111 @@ func (m *MsgCancelProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, erro return len(dAtA) - i, nil } +func (m *MsgSubmitMultipleChoiceProposal) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitMultipleChoiceProposal) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMultipleChoiceProposal) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.VoteOptions != nil { + { + size, err := m.VoteOptions.MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0x32 + } + if len(m.Summary) > 0 { + i -= len(m.Summary) + copy(dAtA[i:], m.Summary) + i = encodeVarintTx(dAtA, i, uint64(len(m.Summary))) + i-- + dAtA[i] = 0x2a + } + if len(m.Title) > 0 { + i -= len(m.Title) + copy(dAtA[i:], m.Title) + i = encodeVarintTx(dAtA, i, uint64(len(m.Title))) + i-- + dAtA[i] = 0x22 + } + if len(m.Metadata) > 0 { + i -= len(m.Metadata) + copy(dAtA[i:], m.Metadata) + i = encodeVarintTx(dAtA, i, uint64(len(m.Metadata))) + i-- + dAtA[i] = 0x1a + } + if len(m.Proposer) > 0 { + i -= len(m.Proposer) + copy(dAtA[i:], m.Proposer) + i = encodeVarintTx(dAtA, i, uint64(len(m.Proposer))) + i-- + dAtA[i] = 0x12 + } + if len(m.InitialDeposit) > 0 { + for iNdEx := len(m.InitialDeposit) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.InitialDeposit[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintTx(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *MsgSubmitMultipleChoiceProposalResponse) Marshal() (dAtA []byte, err error) { + size := m.Size() + dAtA = make([]byte, size) + n, err := m.MarshalToSizedBuffer(dAtA[:size]) + if err != nil { + return nil, err + } + return dAtA[:n], nil +} + +func (m *MsgSubmitMultipleChoiceProposalResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *MsgSubmitMultipleChoiceProposalResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if m.ProposalId != 0 { + i = encodeVarintTx(dAtA, i, uint64(m.ProposalId)) + i-- + dAtA[i] = 0x8 + } + return len(dAtA) - i, nil +} + func encodeVarintTx(dAtA []byte, offset int, v uint64) int { offset -= sovTx(v) base := offset @@ -2053,39 +2351,86 @@ func (m *MsgCancelProposalResponse) Size() (n int) { return n } -func sovTx(x uint64) (n int) { - return (math_bits.Len64(x|1) + 6) / 7 -} -func sozTx(x uint64) (n int) { - return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) -} -func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { - l := len(dAtA) - iNdEx := 0 - for iNdEx < l { - preIndex := iNdEx - var wire uint64 - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return ErrIntOverflowTx - } - if iNdEx >= l { - return io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - wire |= uint64(b&0x7F) << shift - if b < 0x80 { - break - } - } - fieldNum := int32(wire >> 3) - wireType := int(wire & 0x7) - if wireType == 4 { - return fmt.Errorf("proto: MsgSubmitProposal: wiretype end group for non-group") +func (m *MsgSubmitMultipleChoiceProposal) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if len(m.InitialDeposit) > 0 { + for _, e := range m.InitialDeposit { + l = e.Size() + n += 1 + l + sovTx(uint64(l)) } - if fieldNum <= 0 { - return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + l = len(m.Proposer) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Metadata) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Title) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + l = len(m.Summary) + if l > 0 { + n += 1 + l + sovTx(uint64(l)) + } + if m.VoteOptions != nil { + l = m.VoteOptions.Size() + n += 1 + l + sovTx(uint64(l)) + } + return n +} + +func (m *MsgSubmitMultipleChoiceProposalResponse) Size() (n int) { + if m == nil { + return 0 + } + var l int + _ = l + if m.ProposalId != 0 { + n += 1 + sovTx(uint64(m.ProposalId)) + } + return n +} + +func sovTx(x uint64) (n int) { + return (math_bits.Len64(x|1) + 6) / 7 +} +func sozTx(x uint64) (n int) { + return sovTx(uint64((x << 1) ^ uint64((int64(x) >> 63)))) +} +func (m *MsgSubmitProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitProposal: illegal tag %d (wire type %d)", fieldNum, wire) } switch fieldNum { case 1: @@ -3572,6 +3917,323 @@ func (m *MsgCancelProposalResponse) Unmarshal(dAtA []byte) error { } return nil } +func (m *MsgSubmitMultipleChoiceProposal) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitMultipleChoiceProposal: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMultipleChoiceProposal: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field InitialDeposit", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.InitialDeposit = append(m.InitialDeposit, types1.Coin{}) + if err := m.InitialDeposit[len(m.InitialDeposit)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + case 2: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Proposer", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Proposer = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 3: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Metadata", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Metadata = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 4: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Title", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Title = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 5: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field Summary", wireType) + } + var stringLen uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + stringLen |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + intStringLen := int(stringLen) + if intStringLen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + intStringLen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + m.Summary = string(dAtA[iNdEx:postIndex]) + iNdEx = postIndex + case 6: + if wireType != 2 { + return fmt.Errorf("proto: wrong wireType = %d for field VoteOptions", wireType) + } + var msglen int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + msglen |= int(b&0x7F) << shift + if b < 0x80 { + break + } + } + if msglen < 0 { + return ErrInvalidLengthTx + } + postIndex := iNdEx + msglen + if postIndex < 0 { + return ErrInvalidLengthTx + } + if postIndex > l { + return io.ErrUnexpectedEOF + } + if m.VoteOptions == nil { + m.VoteOptions = &ProposalVoteOptions{} + } + if err := m.VoteOptions.Unmarshal(dAtA[iNdEx:postIndex]); err != nil { + return err + } + iNdEx = postIndex + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} +func (m *MsgSubmitMultipleChoiceProposalResponse) Unmarshal(dAtA []byte) error { + l := len(dAtA) + iNdEx := 0 + for iNdEx < l { + preIndex := iNdEx + var wire uint64 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + wire |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + fieldNum := int32(wire >> 3) + wireType := int(wire & 0x7) + if wireType == 4 { + return fmt.Errorf("proto: MsgSubmitMultipleChoiceProposalResponse: wiretype end group for non-group") + } + if fieldNum <= 0 { + return fmt.Errorf("proto: MsgSubmitMultipleChoiceProposalResponse: illegal tag %d (wire type %d)", fieldNum, wire) + } + switch fieldNum { + case 1: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field ProposalId", wireType) + } + m.ProposalId = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowTx + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.ProposalId |= uint64(b&0x7F) << shift + if b < 0x80 { + break + } + } + default: + iNdEx = preIndex + skippy, err := skipTx(dAtA[iNdEx:]) + if err != nil { + return err + } + if (skippy < 0) || (iNdEx+skippy) < 0 { + return ErrInvalidLengthTx + } + if (iNdEx + skippy) > l { + return io.ErrUnexpectedEOF + } + iNdEx += skippy + } + } + + if iNdEx > l { + return io.ErrUnexpectedEOF + } + return nil +} func skipTx(dAtA []byte) (n int, err error) { l := len(dAtA) iNdEx := 0 diff --git a/x/gov/types/v1/vote.go b/x/gov/types/v1/vote.go index 068952d71099..fcd40a061660 100644 --- a/x/gov/types/v1/vote.go +++ b/x/gov/types/v1/vote.go @@ -18,10 +18,10 @@ const ( OptionFour = VoteOption_VOTE_OPTION_FOUR OptionSpam = VoteOption_VOTE_OPTION_SPAM - OptionYes = OptionOne - OptionNo = OptionThree - OptionNoWithVeto = OptionFour - OptionAbstain = OptionTwo + OptionYes = VoteOption_VOTE_OPTION_YES + OptionNo = VoteOption_VOTE_OPTION_NO + OptionNoWithVeto = VoteOption_VOTE_OPTION_NO_WITH_VETO + OptionAbstain = VoteOption_VOTE_OPTION_ABSTAIN ) // NewVote creates a new Vote instance diff --git a/x/group/go.mod b/x/group/go.mod index b3b5d7111e28..b369a3b8f945 100644 --- a/x/group/go.mod +++ b/x/group/go.mod @@ -28,10 +28,10 @@ require ( github.com/manifoldco/promptui v0.9.0 github.com/spf13/cobra v1.8.0 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 pgregory.net/rapid v1.1.0 ) @@ -53,9 +53,8 @@ require ( 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 - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect @@ -106,7 +105,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -126,12 +125,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -155,7 +154,7 @@ require ( golang.org/x/crypto v0.17.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/group/go.sum b/x/group/go.sum index 027502528c0b..c89ba3732fc5 100644 --- a/x/group/go.sum +++ b/x/group/go.sum @@ -115,20 +115,16 @@ github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWH github.com/cockroachdb/apd/v2 v2.0.2 h1:weh8u7Cneje73dDh+2tEVLUvyBc89iwepWCD8b8034E= github.com/cockroachdb/apd/v2 v2.0.2/go.mod h1:DDxRlzC2lo3/vSlmSoS7JkqbbrARPuFOGr0B9pvN3Gw= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -440,8 +436,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -595,8 +591,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -628,8 +624,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -768,8 +764,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -826,8 +822,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -981,8 +977,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/mint/go.mod b/x/mint/go.mod index 55d58d42fc50..e7bed665f1c6 100644 --- a/x/mint/go.mod +++ b/x/mint/go.mod @@ -42,9 +42,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -97,7 +96,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -117,12 +116,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -145,17 +144,17 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.16.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/mint/go.sum b/x/mint/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/mint/go.sum +++ b/x/mint/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/nft/go.mod b/x/nft/go.mod index 4f64605be6a1..b0e81a7af709 100644 --- a/x/nft/go.mod +++ b/x/nft/go.mod @@ -42,9 +42,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -97,7 +96,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -117,12 +116,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -145,17 +144,17 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.16.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/nft/go.sum b/x/nft/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/nft/go.sum +++ b/x/nft/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/nft/keeper/nft.go b/x/nft/keeper/nft.go index 15a4c7ce1828..7123aaaf6e78 100644 --- a/x/nft/keeper/nft.go +++ b/x/nft/keeper/nft.go @@ -97,7 +97,7 @@ func (k Keeper) Update(ctx context.Context, token nft.NFT) error { return nil } -// Update defines a method for updating an exist nft +// updateWithNoCheck defines a method for updating an exist nft // Note: this method does not check whether the class already exists in nft. // The upper-layer application needs to check it when it needs to use it func (k Keeper) updateWithNoCheck(ctx context.Context, token nft.NFT) { @@ -126,7 +126,7 @@ func (k Keeper) Transfer(ctx context.Context, return nil } -// Transfer defines a method for sending a nft from one account to another account. +// transferWithNoCheck defines a method for sending a nft from one account to another account. // Note: this method does not check whether the class already exists in nft. // The upper-layer application needs to check it when it needs to use it func (k Keeper) transferWithNoCheck(ctx context.Context, diff --git a/x/params/go.mod b/x/params/go.mod index 50e545faee53..cdf15bbed280 100644 --- a/x/params/go.mod +++ b/x/params/go.mod @@ -45,9 +45,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect @@ -98,7 +97,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -118,12 +117,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -145,17 +144,17 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect golang.org/x/tools v0.16.0 // indirect google.golang.org/genproto v0.0.0-20231211222908-989df2bf70f3 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20231212172506-995d672761c0 // indirect - google.golang.org/protobuf v1.31.0 // indirect + google.golang.org/protobuf v1.32.0 // 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/params/go.sum b/x/params/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/params/go.sum +++ b/x/params/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/protocolpool/go.mod b/x/protocolpool/go.mod index ed954770fcf2..afb847dafe0b 100644 --- a/x/protocolpool/go.mod +++ b/x/protocolpool/go.mod @@ -25,7 +25,7 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 ) @@ -45,9 +45,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.2 // indirect github.com/cometbft/cometbft-db v0.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect @@ -100,7 +99,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -120,12 +119,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -148,10 +147,10 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/protocolpool/go.sum b/x/protocolpool/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/protocolpool/go.sum +++ b/x/protocolpool/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/slashing/CHANGELOG.md b/x/slashing/CHANGELOG.md index 85ad31d77969..ad84f2599709 100644 --- a/x/slashing/CHANGELOG.md +++ b/x/slashing/CHANGELOG.md @@ -29,6 +29,8 @@ Ref: https://keepachangelog.com/en/1.0.0/ ### Improvements +* [#18959](https://github.com/cosmos/cosmos-sdk/pull/18959) Avoid deserialization of parameters with every validator lookup + ### API Breaking Changes ### Bug Fixes diff --git a/x/slashing/abci.go b/x/slashing/abci.go index 453ec07a33d1..c0c209e4d1a7 100644 --- a/x/slashing/abci.go +++ b/x/slashing/abci.go @@ -20,9 +20,12 @@ func BeginBlocker(ctx context.Context, k keeper.Keeper) error { // store whether or not they have actually signed it and slash/unbond any // which have missed too many blocks in a row (downtime slashing) sdkCtx := sdk.UnwrapSDKContext(ctx) + params, err := k.Params.Get(ctx) + if err != nil { + return err + } for _, vote := range sdkCtx.CometInfo().LastCommit.Votes { - - err := k.HandleValidatorSignature(ctx, vote.Validator.Address, vote.Validator.Power, vote.BlockIDFlag) + err := k.HandleValidatorSignatureWithParams(ctx, params, vote.Validator.Address, vote.Validator.Power, vote.BlockIDFlag) if err != nil { return err } diff --git a/x/slashing/go.mod b/x/slashing/go.mod index f99941b9c27e..c85fa5580afd 100644 --- a/x/slashing/go.mod +++ b/x/slashing/go.mod @@ -28,7 +28,7 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 ) @@ -48,9 +48,8 @@ require ( github.com/cespare/xxhash v1.1.0 // indirect github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -102,7 +101,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -122,12 +121,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -150,10 +149,10 @@ require ( go.etcd.io/bbolt v1.3.7 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/slashing/go.sum b/x/slashing/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/slashing/go.sum +++ b/x/slashing/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/slashing/keeper/hooks.go b/x/slashing/keeper/hooks.go index a8a9b72df987..fb44c6a30d4d 100644 --- a/x/slashing/keeper/hooks.go +++ b/x/slashing/keeper/hooks.go @@ -9,6 +9,7 @@ import ( sdkmath "cosmossdk.io/math" "cosmossdk.io/x/slashing/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -99,3 +100,16 @@ func (h Hooks) BeforeValidatorSlashed(_ context.Context, _ sdk.ValAddress, _ sdk func (h Hooks) AfterUnbondingInitiated(_ context.Context, _ uint64) error { return nil } + +// AfterConsensusPubKeyUpdate triggers the functions to rotate the signing-infos also sets address pubkey relation. +func (h Hooks) AfterConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey cryptotypes.PubKey, _ sdk.Coin) error { + if err := h.k.performConsensusPubKeyUpdate(ctx, oldPubKey, newPubKey); err != nil { + return err + } + + if err := h.k.AddrPubkeyRelation.Remove(ctx, oldPubKey.Address()); err != nil { + return err + } + + return nil +} diff --git a/x/slashing/keeper/infractions.go b/x/slashing/keeper/infractions.go index ab0d0def3462..0260582c17e6 100644 --- a/x/slashing/keeper/infractions.go +++ b/x/slashing/keeper/infractions.go @@ -16,6 +16,14 @@ import ( // HandleValidatorSignature handles a validator signature, must be called once per validator per block. func (k Keeper) HandleValidatorSignature(ctx context.Context, addr cryptotypes.Address, power int64, signed comet.BlockIDFlag) error { + params, err := k.Params.Get(ctx) + if err != nil { + return err + } + return k.HandleValidatorSignatureWithParams(ctx, params, addr, power, signed) +} + +func (k Keeper) HandleValidatorSignatureWithParams(ctx context.Context, params types.Params, addr cryptotypes.Address, power int64, signed comet.BlockIDFlag) error { sdkCtx := sdk.UnwrapSDKContext(ctx) logger := k.Logger(ctx) height := sdkCtx.BlockHeight() @@ -39,10 +47,7 @@ func (k Keeper) HandleValidatorSignature(ctx context.Context, addr cryptotypes.A return err } - signedBlocksWindow, err := k.SignedBlocksWindow(ctx) - if err != nil { - return err - } + signedBlocksWindow := params.SignedBlocksWindow // Compute the relative index, so we count the blocks the validator *should* // have signed. We will use the 0-value default signing info if not present, @@ -82,10 +87,7 @@ func (k Keeper) HandleValidatorSignature(ctx context.Context, addr cryptotypes.A // bitmap value at this index has not changed, no need to update counter } - minSignedPerWindow, err := k.MinSignedPerWindow(ctx) - if err != nil { - return err - } + minSignedPerWindow := params.MinSignedPerWindowInt() consStr, err := k.sk.ConsensusAddressCodec().BytesToString(consAddr) if err != nil { diff --git a/x/slashing/keeper/params.go b/x/slashing/keeper/params.go index c3ee3bb2beaf..77601924ec7e 100644 --- a/x/slashing/keeper/params.go +++ b/x/slashing/keeper/params.go @@ -20,12 +20,7 @@ func (k Keeper) MinSignedPerWindow(ctx context.Context) (int64, error) { return 0, err } - signedBlocksWindow := params.SignedBlocksWindow - minSignedPerWindow := params.MinSignedPerWindow - - // NOTE: RoundInt64 will never panic as minSignedPerWindow is - // less than 1. - return minSignedPerWindow.MulInt64(signedBlocksWindow).RoundInt64(), nil + return params.MinSignedPerWindowInt(), nil } // DowntimeJailDuration - Downtime unbond duration diff --git a/x/slashing/keeper/signing_info.go b/x/slashing/keeper/signing_info.go index 51e258fea960..7f991fcf2483 100644 --- a/x/slashing/keeper/signing_info.go +++ b/x/slashing/keeper/signing_info.go @@ -12,6 +12,7 @@ import ( errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/slashing/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -75,6 +76,21 @@ func (k Keeper) SetMissedBlockBitmapChunk(ctx context.Context, addr sdk.ConsAddr return k.ValidatorMissedBlockBitmap.Set(ctx, collections.Join(addr.Bytes(), uint64(chunkIndex)), chunk) } +// getPreviousConsKey checks if the key rotated, returns the old consKey to get the missed blocks +// because missed blocks are still pointing to the old key +func (k Keeper) getPreviousConsKey(ctx context.Context, addr sdk.ConsAddress) (sdk.ConsAddress, error) { + oldPk, err := k.sk.ValidatorIdentifier(ctx, addr) + if err != nil { + return nil, err + } + + if oldPk != nil { + return oldPk, nil + } + + return addr, nil +} + // GetMissedBlockBitmapValue returns true if a validator missed signing a block // at the given index and false otherwise. The index provided is assumed to be // the index in the range [0, SignedBlocksWindow), which represents the bitmap @@ -82,6 +98,13 @@ func (k Keeper) SetMissedBlockBitmapChunk(ctx context.Context, addr sdk.ConsAddr // IndexOffset modulo SignedBlocksWindow. This index is used to fetch the chunk // in the bitmap and the relative bit in that chunk. func (k Keeper) GetMissedBlockBitmapValue(ctx context.Context, addr sdk.ConsAddress, index int64) (bool, error) { + // check the key rotated, if rotated use the returned consKey to get the missed blocks + // because missed blocks are still pointing to the old key + addr, err := k.getPreviousConsKey(ctx, addr) + if err != nil { + return false, err + } + // get the chunk or "word" in the logical bitmap chunkIndex := index / types.MissedBlockBitmapChunkSize @@ -111,6 +134,13 @@ func (k Keeper) GetMissedBlockBitmapValue(ctx context.Context, addr sdk.ConsAddr // index is used to fetch the chunk in the bitmap and the relative bit in that // chunk. func (k Keeper) SetMissedBlockBitmapValue(ctx context.Context, addr sdk.ConsAddress, index int64, missed bool) error { + // check the key rotated, if rotated use the returned consKey to get the missed blocks + // because missed blocks are still pointing to the old key + addr, err := k.getPreviousConsKey(ctx, addr) + if err != nil { + return err + } + // get the chunk or "word" in the logical bitmap chunkIndex := index / types.MissedBlockBitmapChunkSize @@ -144,19 +174,21 @@ func (k Keeper) SetMissedBlockBitmapValue(ctx context.Context, addr sdk.ConsAddr // DeleteMissedBlockBitmap removes a validator's missed block bitmap from state. func (k Keeper) DeleteMissedBlockBitmap(ctx context.Context, addr sdk.ConsAddress) error { + // check the key rotated, if rotated use the returned consKey to delete the missed blocks + // because missed blocks are still pointing to the old key + addr, err := k.getPreviousConsKey(ctx, addr) + if err != nil { + return err + } + rng := collections.NewPrefixedPairRange[[]byte, uint64](addr.Bytes()) - err := k.ValidatorMissedBlockBitmap.Walk(ctx, rng, func(key collections.Pair[[]byte, uint64], value []byte) (bool, error) { + return k.ValidatorMissedBlockBitmap.Walk(ctx, rng, func(key collections.Pair[[]byte, uint64], value []byte) (bool, error) { err := k.ValidatorMissedBlockBitmap.Remove(ctx, key) if err != nil { return true, err } return false, nil }) - if err != nil { - return err - } - - return nil } // IterateMissedBlockBitmap iterates over a validator's signed blocks window @@ -168,7 +200,7 @@ func (k Keeper) DeleteMissedBlockBitmap(ctx context.Context, addr sdk.ConsAddres func (k Keeper) IterateMissedBlockBitmap(ctx context.Context, addr sdk.ConsAddress, cb func(index int64, missed bool) (stop bool)) error { var index int64 rng := collections.NewPrefixedPairRange[[]byte, uint64](addr.Bytes()) - err := k.ValidatorMissedBlockBitmap.Walk(ctx, rng, func(key collections.Pair[[]byte, uint64], value []byte) (bool, error) { + return k.ValidatorMissedBlockBitmap.Walk(ctx, rng, func(key collections.Pair[[]byte, uint64], value []byte) (bool, error) { bs := bitset.New(uint(types.MissedBlockBitmapChunkSize)) if err := bs.UnmarshalBinary(value); err != nil { @@ -185,10 +217,6 @@ func (k Keeper) IterateMissedBlockBitmap(ctx context.Context, addr sdk.ConsAddre } return false, nil }) - if err != nil { - return err - } - return nil } // GetValidatorMissedBlocks returns array of missed blocks for given validator. @@ -209,3 +237,24 @@ func (k Keeper) GetValidatorMissedBlocks(ctx context.Context, addr sdk.ConsAddre return missedBlocks, err } + +// performConsensusPubKeyUpdate updates cons address to its pub key relation +// Updates signing info, missed blocks (removes old one, and sets new one) +func (k Keeper) performConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey cryptotypes.PubKey) error { + // Connect new consensus address with PubKey + if err := k.AddrPubkeyRelation.Set(ctx, newPubKey.Address(), newPubKey); err != nil { + return err + } + + // Migrate ValidatorSigningInfo from oldPubKey to newPubKey + signingInfo, err := k.ValidatorSigningInfo.Get(ctx, sdk.ConsAddress(oldPubKey.Address())) + if err != nil { + return types.ErrInvalidConsPubKey.Wrap("failed to get signing info for old public key") + } + + if err := k.ValidatorSigningInfo.Set(ctx, sdk.ConsAddress(newPubKey.Address()), signingInfo); err != nil { + return err + } + + return k.ValidatorSigningInfo.Remove(ctx, sdk.ConsAddress(oldPubKey.Address())) +} diff --git a/x/slashing/keeper/signing_info_test.go b/x/slashing/keeper/signing_info_test.go index d91564797441..13d88ca4cf78 100644 --- a/x/slashing/keeper/signing_info_test.go +++ b/x/slashing/keeper/signing_info_test.go @@ -3,6 +3,8 @@ package keeper_test import ( "time" + "github.com/golang/mock/gomock" + "cosmossdk.io/x/slashing/testutil" slashingtypes "cosmossdk.io/x/slashing/types" @@ -65,6 +67,8 @@ func (s *KeeperTestSuite) TestValidatorMissedBlockBitmap_SmallWindow() { params.SignedBlocksWindow = window require.NoError(keeper.Params.Set(ctx, params)) + s.stakingKeeper.EXPECT().ValidatorIdentifier(gomock.Any(), consAddr).Return(consAddr, nil).AnyTimes() + // validator misses all blocks in the window var valIdxOffset int64 for valIdxOffset < params.SignedBlocksWindow { @@ -97,5 +101,13 @@ func (s *KeeperTestSuite) TestValidatorMissedBlockBitmap_SmallWindow() { missedBlocks, err = keeper.GetValidatorMissedBlocks(ctx, consAddr) require.NoError(err) require.Len(missedBlocks, int(params.SignedBlocksWindow)-1) + + // if the validator rotated it's key there will be different consKeys and a mapping will be added in the state. + consAddr1 := sdk.ConsAddress(sdk.AccAddress([]byte("addr1_______________"))) + s.stakingKeeper.EXPECT().ValidatorIdentifier(gomock.Any(), consAddr1).Return(consAddr, nil).AnyTimes() + + missedBlocks, err = keeper.GetValidatorMissedBlocks(ctx, consAddr1) + require.NoError(err) + require.Len(missedBlocks, int(params.SignedBlocksWindow)-1) } } diff --git a/x/slashing/testutil/expected_keepers_mocks.go b/x/slashing/testutil/expected_keepers_mocks.go index eab397971dc9..ee9fdfebbe94 100644 --- a/x/slashing/testutil/expected_keepers_mocks.go +++ b/x/slashing/testutil/expected_keepers_mocks.go @@ -371,6 +371,21 @@ func (mr *MockStakingKeeperMockRecorder) ValidatorByConsAddr(arg0, arg1 interfac return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorByConsAddr", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorByConsAddr), arg0, arg1) } +// ValidatorIdentifier mocks base method. +func (m *MockStakingKeeper) ValidatorIdentifier(arg0 context.Context, arg1 types0.ConsAddress) (types0.ConsAddress, error) { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "ValidatorIdentifier", arg0, arg1) + ret0, _ := ret[0].(types0.ConsAddress) + ret1, _ := ret[1].(error) + return ret0, ret1 +} + +// ValidatorIdentifier indicates an expected call of ValidatorIdentifier. +func (mr *MockStakingKeeperMockRecorder) ValidatorIdentifier(arg0, arg1 interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "ValidatorIdentifier", reflect.TypeOf((*MockStakingKeeper)(nil).ValidatorIdentifier), arg0, arg1) +} + // MockStakingHooks is a mock of StakingHooks interface. type MockStakingHooks struct { ctrl *gomock.Controller diff --git a/x/slashing/types/errors.go b/x/slashing/types/errors.go index 4c26bc79fc83..4ab40d5cd8d2 100644 --- a/x/slashing/types/errors.go +++ b/x/slashing/types/errors.go @@ -13,4 +13,5 @@ var ( ErrNoSigningInfoFound = errors.Register(ModuleName, 8, "no validator signing info found") ErrValidatorTombstoned = errors.Register(ModuleName, 9, "validator already tombstoned") ErrInvalidSigner = errors.Register(ModuleName, 10, "expected authority account as only signer for proposal message") + ErrInvalidConsPubKey = errors.Register(ModuleName, 11, "invalid consensus pubkey") ) diff --git a/x/slashing/types/expected_keepers.go b/x/slashing/types/expected_keepers.go index 86db9bff2582..d8c9754be182 100644 --- a/x/slashing/types/expected_keepers.go +++ b/x/slashing/types/expected_keepers.go @@ -53,6 +53,10 @@ type StakingKeeper interface { // IsValidatorJailed returns if the validator is jailed. IsValidatorJailed(ctx context.Context, addr sdk.ConsAddress) (bool, error) + + // ValidatorIdentifier maps the new cons key to previous cons key (which is the address before the rotation). + // (that is: newConsKey -> oldConsKey) + ValidatorIdentifier(context.Context, sdk.ConsAddress) (sdk.ConsAddress, error) } // StakingHooks event hooks for staking validator object (noalias) diff --git a/x/slashing/types/params.go b/x/slashing/types/params.go index 2003922d6d2f..595bfda1d1e4 100644 --- a/x/slashing/types/params.go +++ b/x/slashing/types/params.go @@ -146,3 +146,13 @@ func validateSlashFractionDowntime(i interface{}) error { return nil } + +// MinSignedPerWindowInt returns min signed per window as an integer (vs the decimal in the param) +func (p *Params) MinSignedPerWindowInt() int64 { + signedBlocksWindow := p.SignedBlocksWindow + minSignedPerWindow := p.MinSignedPerWindow + + // NOTE: RoundInt64 will never panic as minSignedPerWindow is + // less than 1. + return minSignedPerWindow.MulInt64(signedBlocksWindow).RoundInt64() +} diff --git a/x/staking/go.mod b/x/staking/go.mod index e33255012b75..324c7f778be3 100644 --- a/x/staking/go.mod +++ b/x/staking/go.mod @@ -27,10 +27,10 @@ require ( github.com/spf13/cobra v1.8.0 github.com/spf13/pflag v1.0.5 github.com/stretchr/testify v1.8.4 - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 gotest.tools/v3 v3.5.1 ) @@ -52,9 +52,8 @@ require ( github.com/cespare/xxhash/v2 v2.2.0 // indirect github.com/cockroachdb/errors v1.11.1 // indirect github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/cosmos-db v1.0.0 // indirect @@ -105,7 +104,7 @@ require ( github.com/improbable-eng/grpc-web v0.15.0 // indirect github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -125,12 +124,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -153,7 +152,7 @@ require ( golang.org/x/crypto v0.17.0 // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/staking/go.sum b/x/staking/go.sum index 2056cbb51c82..1bd6a4773dba 100644 --- a/x/staking/go.sum +++ b/x/staking/go.sum @@ -109,20 +109,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -434,8 +430,8 @@ github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+o github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= @@ -587,8 +583,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -620,8 +616,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -760,8 +756,8 @@ golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq 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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -818,8 +814,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.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= +golang.org/x/sync v0.6.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= @@ -973,8 +969,8 @@ google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp0 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/x/staking/keeper/cons_pubkey.go b/x/staking/keeper/cons_pubkey.go index 690fcedbf196..c6a9763df328 100644 --- a/x/staking/keeper/cons_pubkey.go +++ b/x/staking/keeper/cons_pubkey.go @@ -3,13 +3,18 @@ package keeper import ( "bytes" "context" + "errors" "time" "cosmossdk.io/collections" + "cosmossdk.io/collections/indexes" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/x/staking/types" codectypes "github.com/cosmos/cosmos-sdk/codec/types" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // maxRotations is the value of max rotations can be made in unbonding period for a validator. @@ -29,7 +34,7 @@ func (k Keeper) setConsPubKeyRotationHistory( Height: height, Fee: fee, } - err := k.RotationHistory.Set(ctx, valAddr, history) + err := k.RotationHistory.Set(ctx, collections.Join(valAddr.Bytes(), height), history) if err != nil { return err } @@ -39,7 +44,7 @@ func (k Keeper) setConsPubKeyRotationHistory( return err } - queueTime := sdkCtx.BlockHeader().Time.Add(ubdTime) + queueTime := sdkCtx.HeaderInfo().Time.Add(ubdTime) if err := k.ValidatorConsensusKeyRotationRecordIndexKey.Set(ctx, collections.Join(valAddr.Bytes(), queueTime)); err != nil { return err } @@ -47,6 +52,85 @@ func (k Keeper) setConsPubKeyRotationHistory( return k.setConsKeyQueue(ctx, queueTime, valAddr) } +// updateToNewPubkey gets called from the `ApplyAndReturnValidatorSetUpdates` method during EndBlock. +// +// This method makes the relative state changes to update the keys, +// also maintains a map with old to new conskey rotation which is needed to retrieve the old conskey. +// And also triggers the hook to make changes required in slashing and distribution modules. +func (k Keeper) updateToNewPubkey(ctx context.Context, val types.Validator, oldPubKey, newPubKey *codectypes.Any, fee sdk.Coin) error { + consAddr, err := val.GetConsAddr() + if err != nil { + return err + } + + if err := k.ValidatorByConsensusAddress.Remove(ctx, consAddr); err != nil { + return err + } + + if err := k.DeleteValidatorByPowerIndex(ctx, val); err != nil { + return err + } + + val.ConsensusPubkey = newPubKey + if err := k.SetValidator(ctx, val); err != nil { + return err + } + if err := k.SetValidatorByConsAddr(ctx, val); err != nil { + return err + } + if err := k.SetValidatorByPowerIndex(ctx, val); err != nil { + return err + } + + oldPk, ok := oldPubKey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", oldPk) + } + + newPk, ok := newPubKey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", newPk) + } + + // sets a map: oldConsKey -> newConsKey + if err := k.OldToNewConsKeyMap.Set(ctx, oldPk.Address(), newPk.Address()); err != nil { + return err + } + + // sets a map: newConsKey -> oldConsKey + if err := k.setNewToOldConsKeyMap(ctx, sdk.ConsAddress(oldPk.Address()), sdk.ConsAddress(newPk.Address())); err != nil { + return err + } + + return k.Hooks().AfterConsensusPubKeyUpdate(ctx, oldPk, newPk, fee) +} + +// setNewToOldConsKeyMap adds an entry in the state with the current consKey to the initial consKey of the validator. +// it tries to find the oldPk if there is a entry already present in the state +func (k Keeper) setNewToOldConsKeyMap(ctx context.Context, oldPk, newPk sdk.ConsAddress) error { + pk, err := k.NewToOldConsKeyMap.Get(ctx, oldPk) + if err != nil && !errors.Is(err, collections.ErrNotFound) { + return err + } + + if pk != nil { + oldPk = pk + } + + return k.NewToOldConsKeyMap.Set(ctx, newPk, oldPk) +} + +// ValidatorIdentifier maps the new cons key to previous cons key (which is the address before the rotation). +// (that is: newConsKey -> oldConsKey) +func (k Keeper) ValidatorIdentifier(ctx context.Context, newPk sdk.ConsAddress) (sdk.ConsAddress, error) { + pk, err := k.NewToOldConsKeyMap.Get(ctx, newPk) + if err != nil && !errors.Is(err, collections.ErrNotFound) { + return nil, err + } + + return pk, nil +} + // exceedsMaxRotations returns true if the key rotations exceed the limit, currently we are limiting one rotation for unbonding period. func (k Keeper) exceedsMaxRotations(ctx context.Context, valAddr sdk.ValAddress) error { count := 0 @@ -70,10 +154,12 @@ func (k Keeper) exceedsMaxRotations(ctx context.Context, valAddr sdk.ValAddress) // this is to keep track of rotations made within the unbonding period func (k Keeper) setConsKeyQueue(ctx context.Context, ts time.Time, valAddr sdk.ValAddress) error { queueRec, err := k.ValidatorConsensusKeyRotationRecordQueue.Get(ctx, ts) - if err != nil { + // we should return if the key found here. + if err != nil && !errors.Is(err, collections.ErrNotFound) { return err } + // push the address if it is not present in the array. if !bytesSliceExists(queueRec.Addresses, valAddr.Bytes()) { // Address does not exist, so you can append it to the list queueRec.Addresses = append(queueRec.Addresses, valAddr.Bytes()) @@ -82,6 +168,7 @@ func (k Keeper) setConsKeyQueue(ctx context.Context, ts time.Time, valAddr sdk.V return k.ValidatorConsensusKeyRotationRecordQueue.Set(ctx, ts, queueRec) } +// bytesSliceExists tries to find the duplicate entry the array. func bytesSliceExists(sliceList [][]byte, targetBytes []byte) bool { for _, bytesSlice := range sliceList { if bytes.Equal(bytesSlice, targetBytes) { @@ -90,3 +177,79 @@ func bytesSliceExists(sliceList [][]byte, targetBytes []byte) bool { } return false } + +// PurgeAllMaturedConsKeyRotatedKeys deletes all the matured key rotations. +func (k Keeper) PurgeAllMaturedConsKeyRotatedKeys(ctx sdk.Context, maturedTime time.Time) error { + maturedRotatedValAddrs, err := k.getAndRemoveAllMaturedRotatedKeys(ctx, maturedTime) + if err != nil { + return err + } + + for _, valAddr := range maturedRotatedValAddrs { + err := k.deleteConsKeyIndexKey(ctx, valAddr, maturedTime) + if err != nil { + return err + } + } + + return nil +} + +// deleteConsKeyIndexKey deletes the keys which forms a with given validator address and time lesser than the given time. +// eventually there should be only one occurrence since we allow only one rotation for bonding period. +func (k Keeper) deleteConsKeyIndexKey(ctx sdk.Context, valAddr sdk.ValAddress, ts time.Time) error { + rng := new(collections.Range[collections.Pair[[]byte, time.Time]]). + StartInclusive(collections.Join(valAddr.Bytes(), time.Time{})). + EndInclusive(collections.Join(valAddr.Bytes(), ts)) + + return k.ValidatorConsensusKeyRotationRecordIndexKey.Walk(ctx, rng, func(key collections.Pair[[]byte, time.Time]) (stop bool, err error) { + return false, k.ValidatorConsensusKeyRotationRecordIndexKey.Remove(ctx, key) + }) +} + +// getAndRemoveAllMaturedRotatedKeys returns all matured valaddresses. +func (k Keeper) getAndRemoveAllMaturedRotatedKeys(ctx sdk.Context, matureTime time.Time) ([][]byte, error) { + valAddrs := [][]byte{} + + // get an iterator for all timeslices from time 0 until the current HeaderInfo time + rng := new(collections.Range[time.Time]).EndInclusive(matureTime) + err := k.ValidatorConsensusKeyRotationRecordQueue.Walk(ctx, rng, func(key time.Time, value types.ValAddrsOfRotatedConsKeys) (stop bool, err error) { + valAddrs = append(valAddrs, value.Addresses...) + return false, k.ValidatorConsensusKeyRotationRecordQueue.Remove(ctx, key) + }) + if err != nil { + return nil, err + } + + return valAddrs, nil +} + +// GetBlockConsPubKeyRotationHistory returns the rotation history for the current height. +func (k Keeper) GetBlockConsPubKeyRotationHistory(ctx context.Context) ([]types.ConsPubKeyRotationHistory, error) { + sdkCtx := sdk.UnwrapSDKContext(ctx) + + iterator, err := k.RotationHistory.Indexes.Block.MatchExact(ctx, uint64(sdkCtx.BlockHeight())) + if err != nil { + return nil, err + } + defer iterator.Close() + + return indexes.CollectValues(ctx, k.RotationHistory, iterator) +} + +// GetValidatorConsPubKeyRotationHistory iterates over all the rotated history objects in the state with the given valAddr and returns. +func (k Keeper) GetValidatorConsPubKeyRotationHistory(ctx sdk.Context, operatorAddress sdk.ValAddress) ([]types.ConsPubKeyRotationHistory, error) { + var historyObjects []types.ConsPubKeyRotationHistory + + rng := collections.NewPrefixedPairRange[[]byte, uint64](operatorAddress.Bytes()) + + err := k.RotationHistory.Walk(ctx, rng, func(key collections.Pair[[]byte, uint64], history types.ConsPubKeyRotationHistory) (stop bool, err error) { + historyObjects = append(historyObjects, history) + return false, nil + }) + if err != nil { + return nil, err + } + + return historyObjects, nil +} diff --git a/x/staking/keeper/cons_pubkey_test.go b/x/staking/keeper/cons_pubkey_test.go new file mode 100644 index 000000000000..1431a06ff3b2 --- /dev/null +++ b/x/staking/keeper/cons_pubkey_test.go @@ -0,0 +1,180 @@ +package keeper_test + +import ( + "time" + + "github.com/golang/mock/gomock" + + "cosmossdk.io/collections" + "cosmossdk.io/core/header" + authtypes "cosmossdk.io/x/auth/types" + stakingkeeper "cosmossdk.io/x/staking/keeper" + "cosmossdk.io/x/staking/testutil" + "cosmossdk.io/x/staking/types" + + codectypes "github.com/cosmos/cosmos-sdk/codec/types" + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *KeeperTestSuite) TestConsPubKeyRotationHistory() { + stakingKeeper, ctx := s.stakingKeeper, s.ctx + + _, addrVals := createValAddrs(2) + + // create a validator with a self-delegation + val := testutil.NewValidator(s.T(), addrVals[0], PKs[0]) + valTokens := stakingKeeper.TokensFromConsensusPower(ctx, 10) + val, issuedShares := val.AddTokensFromDel(valTokens) + s.Require().Equal(valTokens, issuedShares.RoundInt()) + + s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), types.NotBondedPoolName, types.BondedPoolName, gomock.Any()) + _ = stakingkeeper.TestingUpdateValidator(stakingKeeper, ctx, val, true) + val0AccAddr := sdk.AccAddress(addrVals[0].Bytes()) + selfDelegation := types.NewDelegation(val0AccAddr.String(), addrVals[0].String(), issuedShares) + + err := stakingKeeper.SetDelegation(ctx, selfDelegation) + s.Require().NoError(err) + + validators, err := stakingKeeper.GetAllValidators(ctx) + s.Require().NoError(err) + s.Require().Len(validators, 1) + + validator := validators[0] + valAddr, err := sdk.ValAddressFromBech32(validator.OperatorAddress) + s.Require().NoError(err) + + historyObjects, err := stakingKeeper.GetValidatorConsPubKeyRotationHistory(ctx, valAddr) + s.Require().NoError(err) + s.Require().Len(historyObjects, 0) + + newConsPub, err := codectypes.NewAnyWithValue(PKs[1]) + s.Require().NoError(err) + + newConsPub2, err := codectypes.NewAnyWithValue(PKs[2]) + s.Require().NoError(err) + + params, err := stakingKeeper.Params.Get(ctx) + s.Require().NoError(err) + + height := uint64(ctx.BlockHeight()) + err = stakingKeeper.RotationHistory.Set(ctx, collections.Join(valAddr.Bytes(), height), types.ConsPubKeyRotationHistory{ + OperatorAddress: valAddr, + OldConsPubkey: validator.ConsensusPubkey, + NewConsPubkey: newConsPub, + Height: height, + Fee: params.KeyRotationFee, + }) + s.Require().NoError(err) + + historyObjects, err = stakingKeeper.GetValidatorConsPubKeyRotationHistory(ctx, valAddr) + s.Require().NoError(err) + s.Require().Len(historyObjects, 1) + + historyObjects, err = stakingKeeper.GetBlockConsPubKeyRotationHistory(ctx) + s.Require().NoError(err) + s.Require().Len(historyObjects, 1) + + err = stakingKeeper.RotationHistory.Set(ctx, collections.Join(valAddr.Bytes(), height+1), types.ConsPubKeyRotationHistory{ + OperatorAddress: valAddr, + OldConsPubkey: newConsPub, + NewConsPubkey: newConsPub2, + Height: height + 1, + Fee: params.KeyRotationFee, + }) + s.Require().NoError(err) + + historyObjects1, err := stakingKeeper.GetValidatorConsPubKeyRotationHistory(ctx, valAddr) + s.Require().NoError(err) + s.Require().Len(historyObjects1, 2) + + historyObjects, err = stakingKeeper.GetBlockConsPubKeyRotationHistory(ctx) + s.Require().NoError(err) + + s.Require().Len(historyObjects, 1) +} + +func (s *KeeperTestSuite) TestValidatorIdentifier() { + stakingKeeper, ctx, accountKeeper, bankKeeper := s.stakingKeeper, s.ctx, s.accountKeeper, s.bankKeeper + + msgServer := stakingkeeper.NewMsgServerImpl(stakingKeeper) + s.setValidators(6) + validators, err := stakingKeeper.GetAllValidators(ctx) + s.Require().NoError(err) + s.Require().Len(validators, 6) + + initialConsAddr, err := validators[3].GetConsAddr() + s.Require().NoError(err) + + oldPk, err := stakingKeeper.ValidatorIdentifier(ctx, initialConsAddr) + s.Require().NoError(err) + s.Require().Nil(oldPk) + + bondedPool := authtypes.NewEmptyModuleAccount(types.BondedPoolName) + accountKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.BondedPoolName).Return(bondedPool).AnyTimes() + bankKeeper.EXPECT().GetBalance(gomock.Any(), bondedPool.GetAddress(), sdk.DefaultBondDenom).Return(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)).AnyTimes() + + val, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[3].GetOperator()) + s.Require().NoError(err) + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), sdk.AccAddress(val), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + + req, err := types.NewMsgRotateConsPubKey(validators[3].GetOperator(), PKs[495]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().NoError(err) + _, err = stakingKeeper.BlockValidatorUpdates(ctx) + s.Require().NoError(err) + params, err := stakingKeeper.Params.Get(ctx) + s.Require().NoError(err) + + oldPk1, err := stakingKeeper.ValidatorIdentifier(ctx, sdk.ConsAddress(PKs[495].Address())) + s.Require().NoError(err) + s.Require().Equal(oldPk1.Bytes(), initialConsAddr) + + ctx = ctx.WithHeaderInfo(header.Info{Time: ctx.BlockTime().Add(params.UnbondingTime).Add(time.Hour)}) + _, err = stakingKeeper.BlockValidatorUpdates(ctx) + s.Require().NoError(err) + + req, err = types.NewMsgRotateConsPubKey(validators[3].GetOperator(), PKs[494]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().NoError(err) + _, err = stakingKeeper.BlockValidatorUpdates(ctx) + s.Require().NoError(err) + + ctx = ctx.WithHeaderInfo(header.Info{Time: ctx.BlockTime().Add(params.UnbondingTime)}) + + oldPk2, err := stakingKeeper.ValidatorIdentifier(ctx, sdk.ConsAddress(PKs[494].Address())) + s.Require().NoError(err) + _, err = stakingKeeper.BlockValidatorUpdates(ctx) + s.Require().NoError(err) + + s.Require().Equal(oldPk2.Bytes(), initialConsAddr) +} + +func (s *KeeperTestSuite) setValidators(n int) { + stakingKeeper, ctx := s.stakingKeeper, s.ctx + + _, addrVals := createValAddrs(n) + + for i := 0; i < n; i++ { + val := testutil.NewValidator(s.T(), addrVals[i], PKs[i]) + valTokens := stakingKeeper.TokensFromConsensusPower(ctx, 10) + val, issuedShares := val.AddTokensFromDel(valTokens) + s.Require().Equal(valTokens, issuedShares.RoundInt()) + + s.bankKeeper.EXPECT().SendCoinsFromModuleToModule(gomock.Any(), types.NotBondedPoolName, types.BondedPoolName, gomock.Any()) + _ = stakingkeeper.TestingUpdateValidator(stakingKeeper, ctx, val, true) + val0AccAddr := sdk.AccAddress(addrVals[i].Bytes()) + selfDelegation := types.NewDelegation(val0AccAddr.String(), addrVals[i].String(), issuedShares) + err := stakingKeeper.SetDelegation(ctx, selfDelegation) + s.Require().NoError(err) + + err = stakingKeeper.SetValidatorByConsAddr(ctx, val) + s.Require().NoError(err) + + } + + validators, err := stakingKeeper.GetAllValidators(ctx) + s.Require().NoError(err) + s.Require().Len(validators, n) +} diff --git a/x/staking/keeper/hooks_test.go b/x/staking/keeper/hooks_test.go new file mode 100644 index 000000000000..b9cedf628d65 --- /dev/null +++ b/x/staking/keeper/hooks_test.go @@ -0,0 +1,15 @@ +package keeper_test + +import ( + sdk "github.com/cosmos/cosmos-sdk/types" +) + +func (s *KeeperTestSuite) TestHookAfterConsensusPubKeyUpdate() { + stKeeper := s.stakingKeeper + ctx := s.ctx + require := s.Require() + + rotationFee := sdk.NewInt64Coin("stake", 1000000) + err := stKeeper.Hooks().AfterConsensusPubKeyUpdate(ctx, PKs[0], PKs[1], rotationFee) + require.NoError(err) +} diff --git a/x/staking/keeper/keeper.go b/x/staking/keeper/keeper.go index 89b0090a501a..2ccae4ed0dfb 100644 --- a/x/staking/keeper/keeper.go +++ b/x/staking/keeper/keeper.go @@ -43,11 +43,11 @@ func HistoricalInfoCodec(cdc codec.BinaryCodec) collcodec.ValueCodec[types.Histo } type rotationHistoryIndexes struct { - Block *indexes.Multi[uint64, []byte, types.ConsPubKeyRotationHistory] + Block *indexes.Multi[uint64, collections.Pair[[]byte, uint64], types.ConsPubKeyRotationHistory] } -func (a rotationHistoryIndexes) IndexesList() []collections.Index[[]byte, types.ConsPubKeyRotationHistory] { - return []collections.Index[[]byte, types.ConsPubKeyRotationHistory]{ +func (a rotationHistoryIndexes) IndexesList() []collections.Index[collections.Pair[[]byte, uint64], types.ConsPubKeyRotationHistory] { + return []collections.Index[collections.Pair[[]byte, uint64], types.ConsPubKeyRotationHistory]{ a.Block, } } @@ -55,8 +55,12 @@ func (a rotationHistoryIndexes) IndexesList() []collections.Index[[]byte, types. func NewRotationHistoryIndexes(sb *collections.SchemaBuilder) rotationHistoryIndexes { return rotationHistoryIndexes{ Block: indexes.NewMulti( - sb, types.BlockConsPubKeyRotationHistoryKey, "cons_pubkey_history_by_block", collections.Uint64Key, collections.BytesKey, - func(_ []byte, v types.ConsPubKeyRotationHistory) (uint64, error) { + sb, + types.BlockConsPubKeyRotationHistoryKey, + "cons_pubkey_history_by_block", + collections.Uint64Key, + collections.PairKeyCodec(collections.BytesKey, collections.Uint64Key), + func(key collections.Pair[[]byte, uint64], v types.ConsPubKeyRotationHistory) (uint64, error) { return v.Height, nil }, ), @@ -119,11 +123,13 @@ type Keeper struct { ValidatorConsensusKeyRotationRecordIndexKey collections.KeySet[collections.Pair[[]byte, time.Time]] // ValidatorConsensusKeyRotationRecordQueue: this key is used to set the unbonding period time on each rotation ValidatorConsensusKeyRotationRecordQueue collections.Map[time.Time, types.ValAddrsOfRotatedConsKeys] - // RotatedConsKeyMapIndex: prefix for rotated cons address to new cons address - RotatedConsKeyMapIndex collections.Map[[]byte, []byte] + // NewToOldConsKeyMap: prefix for rotated old cons address to new cons address + NewToOldConsKeyMap collections.Map[[]byte, []byte] + // OldToNewConsKeyMap: prefix for rotated new cons address to old cons address + OldToNewConsKeyMap collections.Map[[]byte, []byte] // ValidatorConsPubKeyRotationHistory: consPubkey rotation history by validator // A index is being added with key `BlockConsPubKeyRotationHistory`: consPubkey rotation history by height - RotationHistory *collections.IndexedMap[[]byte, types.ConsPubKeyRotationHistory, rotationHistoryIndexes] + RotationHistory *collections.IndexedMap[collections.Pair[[]byte, uint64], types.ConsPubKeyRotationHistory, rotationHistoryIndexes] } // NewKeeper creates a new staking Keeper instance @@ -273,10 +279,18 @@ func NewKeeper( codec.CollValue[types.ValAddrsOfRotatedConsKeys](cdc), ), - // key format is: 105 | valAddr - RotatedConsKeyMapIndex: collections.NewMap( - sb, types.RotatedConsKeyMapIndex, - "cons_pubkey_map", + // key format is: 105 | consAddr + NewToOldConsKeyMap: collections.NewMap( + sb, types.NewToOldConsKeyMap, + "new_to_old_cons_key_map", + collections.BytesKey, + collections.BytesValue, + ), + + // key format is: 106 | consAddr + OldToNewConsKeyMap: collections.NewMap( + sb, types.OldToNewConsKeyMap, + "old_to_new_cons_key_map", collections.BytesKey, collections.BytesValue, ), @@ -287,7 +301,7 @@ func NewKeeper( sb, types.ValidatorConsPubKeyRotationHistoryKey, "cons_pub_rotation_history", - collections.BytesKey, + collections.PairKeyCodec(collections.BytesKey, collections.Uint64Key), codec.CollValue[types.ConsPubKeyRotationHistory](cdc), NewRotationHistoryIndexes(sb), ), diff --git a/x/staking/keeper/msg_server.go b/x/staking/keeper/msg_server.go index 53ecbbf1e8cf..0814e4b56bf9 100644 --- a/x/staking/keeper/msg_server.go +++ b/x/staking/keeper/msg_server.go @@ -617,7 +617,7 @@ func (k msgServer) RotateConsPubKey(ctx context.Context, msg *types.MsgRotateCon } // check cons key is already present in the key rotation history. - rotatedTo, err := k.RotatedConsKeyMapIndex.Get(ctx, pk.Address()) + rotatedTo, err := k.NewToOldConsKeyMap.Get(ctx, pk.Address()) if err != nil && !errors.Is(err, collections.ErrNotFound) { return nil, err } @@ -630,8 +630,8 @@ func (k msgServer) RotateConsPubKey(ctx context.Context, msg *types.MsgRotateCon newConsAddr := sdk.ConsAddress(pk.Address()) // checks if NewPubKey is not duplicated on ValidatorsByConsAddr - validator1, _ := k.Keeper.ValidatorByConsAddr(ctx, newConsAddr) - if validator1 != nil { + _, err = k.Keeper.ValidatorByConsAddr(ctx, newConsAddr) + if err == nil { return nil, types.ErrConsensusPubKeyAlreadyUsedForValidator } @@ -642,6 +642,10 @@ func (k msgServer) RotateConsPubKey(ctx context.Context, msg *types.MsgRotateCon validator2, err := k.Keeper.GetValidator(ctx, valAddr) if err != nil { + return nil, err + } + + if validator2.GetOperator() == "" { return nil, types.ErrNoValidatorFound } @@ -663,7 +667,7 @@ func (k msgServer) RotateConsPubKey(ctx context.Context, msg *types.MsgRotateCon return nil, err } - err = k.Keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, sdk.AccAddress(valAddr), types.DistributionModuleName, sdk.NewCoins(params.KeyRotationFee)) + err = k.Keeper.bankKeeper.SendCoinsFromAccountToModule(ctx, sdk.AccAddress(valAddr), types.PoolModuleName, sdk.NewCoins(params.KeyRotationFee)) if err != nil { return nil, err } diff --git a/x/staking/keeper/msg_server_test.go b/x/staking/keeper/msg_server_test.go index 9f371d3223c9..3b142ada4d03 100644 --- a/x/staking/keeper/msg_server_test.go +++ b/x/staking/keeper/msg_server_test.go @@ -10,7 +10,9 @@ import ( "cosmossdk.io/collections" "cosmossdk.io/core/header" "cosmossdk.io/math" - stakingtypes "cosmossdk.io/x/staking/types" + authtypes "cosmossdk.io/x/auth/types" + stakingkeeper "cosmossdk.io/x/staking/keeper" + "cosmossdk.io/x/staking/types" "github.com/cosmos/cosmos-sdk/codec/address" codectypes "github.com/cosmos/cosmos-sdk/codec/types" @@ -28,7 +30,7 @@ var ( func (s *KeeperTestSuite) execExpectCalls() { s.accountKeeper.EXPECT().AddressCodec().Return(address.NewBech32Codec("cosmos")).AnyTimes() - s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), Addr, stakingtypes.NotBondedPoolName, gomock.Any()).AnyTimes() + s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), Addr, types.NotBondedPoolName, gomock.Any()).AnyTimes() } func (s *KeeperTestSuite) TestMsgCreateValidator() { @@ -54,15 +56,15 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { testCases := []struct { name string - input *stakingtypes.MsgCreateValidator + input *types.MsgCreateValidator expErr bool expErrMsg string }{ { name: "empty description", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{}, - Commission: stakingtypes.CommissionRates{ + input: &types.MsgCreateValidator{ + Description: types.Description{}, + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -78,11 +80,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "invalid validator address", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -98,11 +100,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "empty validator pubkey", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -118,11 +120,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "validator pubkey len is invalid", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -138,11 +140,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "empty delegation amount", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -158,11 +160,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "nil delegation amount", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -178,11 +180,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "zero minimum self delegation", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -198,11 +200,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "negative minimum self delegation", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -218,11 +220,11 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "delegation less than minimum self delegation", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -238,15 +240,15 @@ func (s *KeeperTestSuite) TestMsgCreateValidator() { }, { name: "valid msg", - input: &stakingtypes.MsgCreateValidator{ - Description: stakingtypes.Description{ + input: &types.MsgCreateValidator{ + Description: types.Description{ Moniker: "NewValidator", Identity: "xyz", Website: "xyz.com", SecurityContact: "xyz@gmail.com", Details: "details", }, - Commission: stakingtypes.CommissionRates{ + Commission: types.CommissionRates{ Rate: math.LegacyNewDecWithPrec(5, 1), MaxRate: math.LegacyNewDecWithPrec(5, 1), MaxChangeRate: math.LegacyNewDec(0), @@ -284,8 +286,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { pk := ed25519.GenPrivKey().PubKey() require.NotNil(pk) - comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + comm := types.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + msg, err := types.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10)), types.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) @@ -303,15 +305,15 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { testCases := []struct { name string ctx sdk.Context - input *stakingtypes.MsgEditValidator + input *types.MsgEditValidator expErr bool expErrMsg string }{ { name: "invalid validator", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: sdk.AccAddress([]byte("invalid")).String(), @@ -324,8 +326,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "empty description", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{}, + input: &types.MsgEditValidator{ + Description: types.Description{}, ValidatorAddress: ValAddr.String(), CommissionRate: &newRate, MinSelfDelegation: &newSelfDel, @@ -336,8 +338,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "negative self delegation", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: ValAddr.String(), @@ -350,8 +352,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "invalid commission rate", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: ValAddr.String(), @@ -364,8 +366,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "validator does not exist", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: sdk.ValAddress([]byte("val")).String(), @@ -378,8 +380,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "change commmission rate in <24hrs", ctx: ctx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: ValAddr.String(), @@ -392,8 +394,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "minimum self delegation cannot decrease", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: ValAddr.String(), @@ -406,8 +408,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "validator self-delegation must be greater than min self delegation", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", }, ValidatorAddress: ValAddr.String(), @@ -420,8 +422,8 @@ func (s *KeeperTestSuite) TestMsgEditValidator() { { name: "valid msg", ctx: newCtx, - input: &stakingtypes.MsgEditValidator{ - Description: stakingtypes.Description{ + input: &types.MsgEditValidator{ + Description: types.Description{ Moniker: "TestValidator", Identity: "abc", Website: "abc.com", @@ -457,9 +459,9 @@ func (s *KeeperTestSuite) TestMsgDelegate() { pk := ed25519.GenPrivKey().PubKey() require.NotNil(pk) - comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + comm := types.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10)), stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := types.NewMsgCreateValidator(ValAddr.String(), pk, sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(10)), types.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) @@ -468,13 +470,13 @@ func (s *KeeperTestSuite) TestMsgDelegate() { testCases := []struct { name string - input *stakingtypes.MsgDelegate + input *types.MsgDelegate expErr bool expErrMsg string }{ { name: "invalid validator", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: sdk.AccAddress([]byte("invalid")).String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))}, @@ -484,7 +486,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "empty delegator", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: "", ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))}, @@ -494,7 +496,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "invalid delegator", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: "invalid", ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))}, @@ -504,7 +506,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "validator does not exist", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: sdk.ValAddress([]byte("val")).String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))}, @@ -514,7 +516,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "zero amount", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(0))}, @@ -524,7 +526,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "negative amount", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(-1))}, @@ -534,7 +536,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "invalid BondDenom", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: "test", Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))}, @@ -544,7 +546,7 @@ func (s *KeeperTestSuite) TestMsgDelegate() { }, { name: "valid msg", - input: &stakingtypes.MsgDelegate{ + input: &types.MsgDelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))}, @@ -581,17 +583,17 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { dstPk := ed25519.GenPrivKey().PubKey() require.NotNil(dstPk) - comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + comm := types.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) amt := sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))} - msg, err := stakingtypes.NewMsgCreateValidator(srcValAddr.String(), pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := types.NewMsgCreateValidator(srcValAddr.String(), pk, amt, types.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) require.NoError(err) require.NotNil(res) - s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), addr2, stakingtypes.NotBondedPoolName, gomock.Any()).AnyTimes() + s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), addr2, types.NotBondedPoolName, gomock.Any()).AnyTimes() - msg, err = stakingtypes.NewMsgCreateValidator(dstValAddr.String(), dstPk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err = types.NewMsgCreateValidator(dstValAddr.String(), dstPk, amt, types.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err = msgServer.CreateValidator(ctx, msg) @@ -599,20 +601,20 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { require.NotNil(res) shares := math.LegacyNewDec(100) - del := stakingtypes.NewDelegation(Addr.String(), srcValAddr.String(), shares) + del := types.NewDelegation(Addr.String(), srcValAddr.String(), shares) require.NoError(keeper.SetDelegation(ctx, del)) _, err = keeper.Delegations.Get(ctx, collections.Join(Addr, srcValAddr)) require.NoError(err) testCases := []struct { name string - input *stakingtypes.MsgBeginRedelegate + input *types.MsgBeginRedelegate expErr bool expErrMsg string }{ { name: "invalid source validator", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: sdk.AccAddress([]byte("invalid")).String(), ValidatorDstAddress: dstValAddr.String(), @@ -623,7 +625,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "empty delegator", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: "", ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: dstValAddr.String(), @@ -634,7 +636,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "invalid delegator", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: "invalid", ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: dstValAddr.String(), @@ -645,7 +647,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "invalid destination validator", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: sdk.AccAddress([]byte("invalid")).String(), @@ -656,7 +658,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "validator does not exist", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: sdk.ValAddress([]byte("invalid")).String(), ValidatorDstAddress: dstValAddr.String(), @@ -667,7 +669,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "self redelegation", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: srcValAddr.String(), @@ -678,7 +680,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "amount greater than delegated shares amount", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: dstValAddr.String(), @@ -689,7 +691,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "zero amount", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: dstValAddr.String(), @@ -700,7 +702,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "invalid coin denom", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: dstValAddr.String(), @@ -711,7 +713,7 @@ func (s *KeeperTestSuite) TestMsgBeginRedelegate() { }, { name: "valid msg", - input: &stakingtypes.MsgBeginRedelegate{ + input: &types.MsgBeginRedelegate{ DelegatorAddress: Addr.String(), ValidatorSrcAddress: srcValAddr.String(), ValidatorDstAddress: dstValAddr.String(), @@ -743,30 +745,30 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { pk := ed25519.GenPrivKey().PubKey() require.NotNil(pk) - comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + comm := types.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) amt := sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))} - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := types.NewMsgCreateValidator(ValAddr.String(), pk, amt, types.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) require.NoError(err) require.NotNil(res) shares := math.LegacyNewDec(100) - del := stakingtypes.NewDelegation(Addr.String(), ValAddr.String(), shares) + del := types.NewDelegation(Addr.String(), ValAddr.String(), shares) require.NoError(keeper.SetDelegation(ctx, del)) _, err = keeper.Delegations.Get(ctx, collections.Join(Addr, ValAddr)) require.NoError(err) testCases := []struct { name string - input *stakingtypes.MsgUndelegate + input *types.MsgUndelegate expErr bool expErrMsg string }{ { name: "invalid validator", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: sdk.AccAddress([]byte("invalid")).String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -776,7 +778,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "empty delegator", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: "", ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: shares.RoundInt()}, @@ -786,7 +788,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "invalid delegator", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: "invalid", ValidatorAddress: ValAddr.String(), Amount: sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: shares.RoundInt()}, @@ -796,7 +798,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "validator does not exist", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: sdk.ValAddress([]byte("invalid")).String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -806,7 +808,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "amount greater than delegated shares amount", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(101)), @@ -816,7 +818,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "zero amount", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), @@ -826,7 +828,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "invalid coin denom", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin("test", shares.RoundInt()), @@ -836,7 +838,7 @@ func (s *KeeperTestSuite) TestMsgUndelegate() { }, { name: "valid msg", - input: &stakingtypes.MsgUndelegate{ + input: &types.MsgUndelegate{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -866,25 +868,25 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { pk := ed25519.GenPrivKey().PubKey() require.NotNil(pk) - comm := stakingtypes.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) + comm := types.NewCommissionRates(math.LegacyNewDec(0), math.LegacyNewDec(0), math.LegacyNewDec(0)) amt := sdk.Coin{Denom: sdk.DefaultBondDenom, Amount: keeper.TokensFromConsensusPower(s.ctx, int64(100))} - s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), Addr, stakingtypes.NotBondedPoolName, gomock.Any()).AnyTimes() + s.bankKeeper.EXPECT().DelegateCoinsFromAccountToModule(gomock.Any(), Addr, types.NotBondedPoolName, gomock.Any()).AnyTimes() - msg, err := stakingtypes.NewMsgCreateValidator(ValAddr.String(), pk, amt, stakingtypes.Description{Moniker: "NewVal"}, comm, math.OneInt()) + msg, err := types.NewMsgCreateValidator(ValAddr.String(), pk, amt, types.Description{Moniker: "NewVal"}, comm, math.OneInt()) require.NoError(err) res, err := msgServer.CreateValidator(ctx, msg) require.NoError(err) require.NotNil(res) shares := math.LegacyNewDec(100) - del := stakingtypes.NewDelegation(Addr.String(), ValAddr.String(), shares) + del := types.NewDelegation(Addr.String(), ValAddr.String(), shares) require.NoError(keeper.SetDelegation(ctx, del)) resDel, err := keeper.Delegations.Get(ctx, collections.Join(Addr, ValAddr)) require.NoError(err) require.Equal(del, resDel) - ubd := stakingtypes.NewUnbondingDelegation(Addr, ValAddr, 10, ctx.HeaderInfo().Time.Add(time.Minute*10), shares.RoundInt(), 0, keeper.ValidatorAddressCodec(), ak.AddressCodec()) + ubd := types.NewUnbondingDelegation(Addr, ValAddr, 10, ctx.HeaderInfo().Time.Add(time.Minute*10), shares.RoundInt(), 0, keeper.ValidatorAddressCodec(), ak.AddressCodec()) require.NoError(keeper.SetUnbondingDelegation(ctx, ubd)) resUnbond, err := keeper.GetUnbondingDelegation(ctx, Addr, ValAddr) require.NoError(err) @@ -892,13 +894,13 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { testCases := []struct { name string - input *stakingtypes.MsgCancelUnbondingDelegation + input *types.MsgCancelUnbondingDelegation expErr bool expErrMsg string }{ { name: "invalid validator", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: sdk.AccAddress([]byte("invalid")).String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -909,7 +911,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "empty delegator", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: "", ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -920,7 +922,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "invalid delegator", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: "invalid", ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -931,7 +933,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "entry not found at height", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -942,7 +944,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "invalid height", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -953,7 +955,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "invalid coin", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin("test", shares.RoundInt()), @@ -964,7 +966,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "validator does not exist", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: sdk.ValAddress([]byte("invalid")).String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -975,7 +977,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "amount is greater than balance", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(101)), @@ -986,7 +988,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "zero amount", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, math.NewInt(0)), @@ -997,7 +999,7 @@ func (s *KeeperTestSuite) TestMsgCancelUnbondingDelegation() { }, { name: "valid msg", - input: &stakingtypes.MsgCancelUnbondingDelegation{ + input: &types.MsgCancelUnbondingDelegation{ DelegatorAddress: Addr.String(), ValidatorAddress: ValAddr.String(), Amount: sdk.NewCoin(sdk.DefaultBondDenom, shares.RoundInt()), @@ -1027,38 +1029,38 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { testCases := []struct { name string - input *stakingtypes.MsgUpdateParams + input *types.MsgUpdateParams expErr bool expErrMsg string }{ { name: "valid params", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.DefaultParams(), + Params: types.DefaultParams(), }, expErr: false, }, { name: "invalid authority", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: "invalid", - Params: stakingtypes.DefaultParams(), + Params: types.DefaultParams(), }, expErr: true, expErrMsg: "invalid authority", }, { name: "negative commission rate", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.Params{ + Params: types.Params{ MinCommissionRate: math.LegacyNewDec(-10), - UnbondingTime: stakingtypes.DefaultUnbondingTime, - MaxValidators: stakingtypes.DefaultMaxValidators, - MaxEntries: stakingtypes.DefaultMaxEntries, - HistoricalEntries: stakingtypes.DefaultHistoricalEntries, - BondDenom: stakingtypes.BondStatusBonded, + UnbondingTime: types.DefaultUnbondingTime, + MaxValidators: types.DefaultMaxValidators, + MaxEntries: types.DefaultMaxEntries, + HistoricalEntries: types.DefaultHistoricalEntries, + BondDenom: types.BondStatusBonded, }, }, expErr: true, @@ -1066,15 +1068,15 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { }, { name: "commission rate cannot be bigger than 100", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.Params{ + Params: types.Params{ MinCommissionRate: math.LegacyNewDec(2), - UnbondingTime: stakingtypes.DefaultUnbondingTime, - MaxValidators: stakingtypes.DefaultMaxValidators, - MaxEntries: stakingtypes.DefaultMaxEntries, - HistoricalEntries: stakingtypes.DefaultHistoricalEntries, - BondDenom: stakingtypes.BondStatusBonded, + UnbondingTime: types.DefaultUnbondingTime, + MaxValidators: types.DefaultMaxValidators, + MaxEntries: types.DefaultMaxEntries, + HistoricalEntries: types.DefaultHistoricalEntries, + BondDenom: types.BondStatusBonded, }, }, expErr: true, @@ -1082,14 +1084,14 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { }, { name: "invalid bond denom", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.Params{ - MinCommissionRate: stakingtypes.DefaultMinCommissionRate, - UnbondingTime: stakingtypes.DefaultUnbondingTime, - MaxValidators: stakingtypes.DefaultMaxValidators, - MaxEntries: stakingtypes.DefaultMaxEntries, - HistoricalEntries: stakingtypes.DefaultHistoricalEntries, + Params: types.Params{ + MinCommissionRate: types.DefaultMinCommissionRate, + UnbondingTime: types.DefaultUnbondingTime, + MaxValidators: types.DefaultMaxValidators, + MaxEntries: types.DefaultMaxEntries, + HistoricalEntries: types.DefaultHistoricalEntries, BondDenom: "", }, }, @@ -1098,15 +1100,15 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { }, { name: "max validators must be positive", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.Params{ - MinCommissionRate: stakingtypes.DefaultMinCommissionRate, - UnbondingTime: stakingtypes.DefaultUnbondingTime, + Params: types.Params{ + MinCommissionRate: types.DefaultMinCommissionRate, + UnbondingTime: types.DefaultUnbondingTime, MaxValidators: 0, - MaxEntries: stakingtypes.DefaultMaxEntries, - HistoricalEntries: stakingtypes.DefaultHistoricalEntries, - BondDenom: stakingtypes.BondStatusBonded, + MaxEntries: types.DefaultMaxEntries, + HistoricalEntries: types.DefaultHistoricalEntries, + BondDenom: types.BondStatusBonded, }, }, expErr: true, @@ -1114,15 +1116,15 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { }, { name: "max entries most be positive", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.Params{ - MinCommissionRate: stakingtypes.DefaultMinCommissionRate, - UnbondingTime: stakingtypes.DefaultUnbondingTime, - MaxValidators: stakingtypes.DefaultMaxValidators, + Params: types.Params{ + MinCommissionRate: types.DefaultMinCommissionRate, + UnbondingTime: types.DefaultUnbondingTime, + MaxValidators: types.DefaultMaxValidators, MaxEntries: 0, - HistoricalEntries: stakingtypes.DefaultHistoricalEntries, - BondDenom: stakingtypes.BondStatusBonded, + HistoricalEntries: types.DefaultHistoricalEntries, + BondDenom: types.BondStatusBonded, }, }, expErr: true, @@ -1130,14 +1132,14 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { }, { name: "negative unbounding time", - input: &stakingtypes.MsgUpdateParams{ + input: &types.MsgUpdateParams{ Authority: keeper.GetAuthority(), - Params: stakingtypes.Params{ + Params: types.Params{ UnbondingTime: time.Hour * 24 * 7 * 3 * -1, - MaxEntries: stakingtypes.DefaultMaxEntries, - MaxValidators: stakingtypes.DefaultMaxValidators, - HistoricalEntries: stakingtypes.DefaultHistoricalEntries, - MinCommissionRate: stakingtypes.DefaultMinCommissionRate, + MaxEntries: types.DefaultMaxEntries, + MaxValidators: types.DefaultMaxValidators, + HistoricalEntries: types.DefaultHistoricalEntries, + MinCommissionRate: types.DefaultMinCommissionRate, BondDenom: "denom", }, }, @@ -1159,3 +1161,190 @@ func (s *KeeperTestSuite) TestMsgUpdateParams() { }) } } + +func (s *KeeperTestSuite) TestConsKeyRotn() { + stakingKeeper, ctx, accountKeeper, bankKeeper := s.stakingKeeper, s.ctx, s.accountKeeper, s.bankKeeper + + msgServer := stakingkeeper.NewMsgServerImpl(stakingKeeper) + s.setValidators(6) + validators, err := stakingKeeper.GetAllValidators(ctx) + s.Require().NoError(err) + + s.Require().Len(validators, 6) + + existingPubkey, ok := validators[1].ConsensusPubkey.GetCachedValue().(cryptotypes.PubKey) + s.Require().True(ok) + + bondedPool := authtypes.NewEmptyModuleAccount(types.BondedPoolName) + accountKeeper.EXPECT().GetModuleAccount(gomock.Any(), types.BondedPoolName).Return(bondedPool).AnyTimes() + bankKeeper.EXPECT().GetBalance(gomock.Any(), bondedPool.GetAddress(), sdk.DefaultBondDenom).Return(sdk.NewInt64Coin(sdk.DefaultBondDenom, 1000000)).AnyTimes() + + testCases := []struct { + name string + malleate func() sdk.Context + validator string + newPubKey cryptotypes.PubKey + isErr bool + errMsg string + }{ + { + name: "1st iteration no error", + malleate: func() sdk.Context { + val, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[0].GetOperator()) + s.Require().NoError(err) + + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), sdk.AccAddress(val), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + return ctx + }, + isErr: false, + errMsg: "", + newPubKey: PKs[499], + validator: validators[0].GetOperator(), + }, + { + name: "pubkey already associated with another validator", + malleate: func() sdk.Context { return ctx }, + isErr: true, + errMsg: "consensus pubkey is already used for a validator", + newPubKey: existingPubkey, + validator: validators[0].GetOperator(), + }, + { + name: "non existing validator", + malleate: func() sdk.Context { return ctx }, + isErr: true, + errMsg: "decoding bech32 failed", + newPubKey: PKs[498], + validator: "non_existing_val", + }, + { + name: "limit exceeding", + malleate: func() sdk.Context { + val, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[2].GetOperator()) + s.Require().NoError(err) + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), sdk.AccAddress(val), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + + req, err := types.NewMsgRotateConsPubKey(validators[2].GetOperator(), PKs[495]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().NoError(err) + + return ctx + }, + isErr: true, + errMsg: "exceeding maximum consensus pubkey rotations within unbonding period", + newPubKey: PKs[494], + validator: validators[2].GetOperator(), + }, + { + name: "limit exceeding, but it should rotate after unbonding period", + malleate: func() sdk.Context { + params, err := stakingKeeper.Params.Get(ctx) + s.Require().NoError(err) + val, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(validators[3].GetOperator()) + s.Require().NoError(err) + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), sdk.AccAddress(val), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + + // 1st rotation should pass, since limit is 1 + req, err := types.NewMsgRotateConsPubKey(validators[3].GetOperator(), PKs[494]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().NoError(err) + + // this shouldn't mature the recent rotation since unbonding period isn't reached + s.Require().NoError(stakingKeeper.PurgeAllMaturedConsKeyRotatedKeys(ctx, ctx.BlockTime())) + + // 2nd rotation should fail since limit exceeding + req, err = types.NewMsgRotateConsPubKey(validators[3].GetOperator(), PKs[493]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().Error(err, "exceeding maximum consensus pubkey rotations within unbonding period") + + // This should remove the keys from queue + // after setting the blocktime to reach the unbonding period + newCtx := ctx.WithHeaderInfo(header.Info{Time: ctx.BlockTime().Add(params.UnbondingTime)}) + s.Require().NoError(stakingKeeper.PurgeAllMaturedConsKeyRotatedKeys(newCtx, newCtx.BlockTime())) + return newCtx + }, + isErr: false, + newPubKey: PKs[493], + validator: validators[3].GetOperator(), + }, + { + name: "verify other validator rotation blocker", + malleate: func() sdk.Context { + params, err := stakingKeeper.Params.Get(ctx) + s.Require().NoError(err) + valStr4 := validators[4].GetOperator() + valStr5 := validators[5].GetOperator() + valAddr4, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(valStr4) + s.Require().NoError(err) + + valAddr5, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(valStr5) + s.Require().NoError(err) + + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), sdk.AccAddress(valAddr4), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + bankKeeper.EXPECT().SendCoinsFromAccountToModule(gomock.Any(), sdk.AccAddress(valAddr5), gomock.Any(), gomock.Any()).Return(nil).AnyTimes() + + // add 2 days to the current time and add rotate key, it should allow to rotate. + newCtx := ctx.WithHeaderInfo(header.Info{Time: ctx.BlockTime().Add(2 * 24 * time.Hour)}) + req1, err := types.NewMsgRotateConsPubKey(valStr5, PKs[491]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(newCtx, req1) + s.Require().NoError(err) + + // 1st rotation should pass, since limit is 1 + req, err := types.NewMsgRotateConsPubKey(valStr4, PKs[490]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().NoError(err) + + // this shouldn't mature the recent rotation since unbonding period isn't reached + s.Require().NoError(stakingKeeper.PurgeAllMaturedConsKeyRotatedKeys(ctx, ctx.BlockTime())) + + // 2nd rotation should fail since limit exceeding + req, err = types.NewMsgRotateConsPubKey(valStr4, PKs[489]) + s.Require().NoError(err) + _, err = msgServer.RotateConsPubKey(ctx, req) + s.Require().Error(err, "exceeding maximum consensus pubkey rotations within unbonding period") + + // This should remove the keys from queue + // after setting the blocktime to reach the unbonding period, + // but other validator which rotated with addition of 2 days shouldn't be removed, so it should stop the rotation of valStr5. + newCtx1 := ctx.WithHeaderInfo(header.Info{Time: ctx.BlockTime().Add(params.UnbondingTime).Add(time.Hour)}) + s.Require().NoError(stakingKeeper.PurgeAllMaturedConsKeyRotatedKeys(newCtx1, newCtx1.BlockTime())) + return newCtx1 + }, + isErr: true, + newPubKey: PKs[492], + errMsg: "exceeding maximum consensus pubkey rotations within unbonding period", + validator: validators[5].GetOperator(), + }, + } + + for _, tc := range testCases { + s.T().Run(tc.name, func(t *testing.T) { + newCtx := tc.malleate() + + req, err := types.NewMsgRotateConsPubKey(tc.validator, tc.newPubKey) + s.Require().NoError(err) + + _, err = msgServer.RotateConsPubKey(newCtx, req) + if tc.isErr { + s.Require().Error(err) + s.Require().Contains(err.Error(), tc.errMsg) + } else { + s.Require().NoError(err) + _, err = stakingKeeper.EndBlocker(newCtx) + s.Require().NoError(err) + + addr, err := stakingKeeper.ValidatorAddressCodec().StringToBytes(tc.validator) + s.Require().NoError(err) + + valInfo, err := stakingKeeper.GetValidator(newCtx, addr) + s.Require().NoError(err) + s.Require().Equal(valInfo.ConsensusPubkey, req.NewPubkey) + } + }) + } +} diff --git a/x/staking/keeper/val_state_change.go b/x/staking/keeper/val_state_change.go index 3d09937c1ef4..cbebd10410c9 100644 --- a/x/staking/keeper/val_state_change.go +++ b/x/staking/keeper/val_state_change.go @@ -10,10 +10,14 @@ import ( gogotypes "github.com/cosmos/gogoproto/types" "cosmossdk.io/core/address" + errorsmod "cosmossdk.io/errors" "cosmossdk.io/math" "cosmossdk.io/x/staking/types" + cryptocodec "github.com/cosmos/cosmos-sdk/crypto/codec" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" + sdkerrors "github.com/cosmos/cosmos-sdk/types/errors" ) // BlockValidatorUpdates calculates the ValidatorUpdates for the current block @@ -112,6 +116,11 @@ func (k Keeper) BlockValidatorUpdates(ctx context.Context) ([]abci.ValidatorUpda ) } + err = k.PurgeAllMaturedConsKeyRotatedKeys(sdkCtx, sdkCtx.HeaderInfo().Time) + if err != nil { + return nil, err + } + return validatorUpdates, nil } @@ -241,6 +250,63 @@ func (k Keeper) ApplyAndReturnValidatorSetUpdates(ctx context.Context) (updates updates = append(updates, validator.ABCIValidatorUpdateZero()) } + // ApplyAndReturnValidatorSetUpdates checks if there is ConsPubKeyRotationHistory + // with ConsPubKeyRotationHistory.RotatedHeight == ctx.BlockHeight() and if so, generates 2 ValidatorUpdate, + // one for a remove validator and one for create new validator + historyObjects, err := k.GetBlockConsPubKeyRotationHistory(ctx) + if err != nil { + return nil, err + } + + for _, history := range historyObjects { + valAddr := history.OperatorAddress + if err != nil { + return nil, err + } + + validator, err := k.GetValidator(ctx, valAddr) + if err != nil { + return nil, err + } + + oldPk, ok := history.OldConsPubkey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", oldPk) + } + oldCmtPk, err := cryptocodec.ToCmtProtoPublicKey(oldPk) + if err != nil { + return nil, err + } + + newPk, ok := history.NewConsPubkey.GetCachedValue().(cryptotypes.PubKey) + if !ok { + return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidType, "Expecting cryptotypes.PubKey, got %T", oldPk) + } + newCmtPk, err := cryptocodec.ToCmtProtoPublicKey(newPk) + if err != nil { + return nil, err + } + + // a validator cannot rotate keys if it's not bonded or if it's jailed + // - a validator can be unbonding state but jailed status false + // - a validator can be jailed and status can be unbonding + if !(validator.Jailed || validator.Status != types.Bonded) { + updates = append(updates, abci.ValidatorUpdate{ + PubKey: oldCmtPk, + Power: 0, + }) + + updates = append(updates, abci.ValidatorUpdate{ + PubKey: newCmtPk, + Power: validator.ConsensusPower(powerReduction), + }) + + if err := k.updateToNewPubkey(ctx, validator, history.OldConsPubkey, history.NewConsPubkey, history.Fee); err != nil { + return nil, err + } + } + } + // Update the pools based on the recent updates in the validator set: // - The tokens from the non-bonded candidates that enter the new validator set need to be transferred // to the Bonded pool. diff --git a/x/staking/keeper/validator.go b/x/staking/keeper/validator.go index b95dd87a7742..ca3f0391fa8f 100644 --- a/x/staking/keeper/validator.go +++ b/x/staking/keeper/validator.go @@ -38,11 +38,21 @@ func (k Keeper) GetValidator(ctx context.Context, addr sdk.ValAddress) (validato func (k Keeper) GetValidatorByConsAddr(ctx context.Context, consAddr sdk.ConsAddress) (validator types.Validator, err error) { opAddr, err := k.ValidatorByConsensusAddress.Get(ctx, consAddr) if err != nil && !errors.Is(err, collections.ErrNotFound) { - return validator, err + // if the validator not found try to find it in the map of `OldToNewConsKeyMap`` because validator may've rotated it's key. + if !errors.Is(err, collections.ErrNotFound) { + return types.Validator{}, err + } + + newConsAddr, err := k.OldToNewConsKeyMap.Get(ctx, consAddr) + if err != nil { + return types.Validator{}, err + } + + opAddr = newConsAddr } if opAddr == nil { - return validator, types.ErrNoValidatorFound + return types.Validator{}, types.ErrNoValidatorFound } return k.GetValidator(ctx, opAddr) diff --git a/x/staking/testutil/expected_keepers_mocks.go b/x/staking/testutil/expected_keepers_mocks.go index 57ebb96eb140..fdf54c9085b2 100644 --- a/x/staking/testutil/expected_keepers_mocks.go +++ b/x/staking/testutil/expected_keepers_mocks.go @@ -13,7 +13,8 @@ import ( math "cosmossdk.io/math" types "cosmossdk.io/x/staking/types" crypto "github.com/cometbft/cometbft/proto/tendermint/crypto" - types0 "github.com/cosmos/cosmos-sdk/types" + types0 "github.com/cosmos/cosmos-sdk/crypto/types" + types1 "github.com/cosmos/cosmos-sdk/types" gomock "github.com/golang/mock/gomock" ) @@ -55,10 +56,10 @@ func (mr *MockAccountKeeperMockRecorder) AddressCodec() *gomock.Call { } // GetAccount mocks base method. -func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types0.AccAddress) types0.AccountI { +func (m *MockAccountKeeper) GetAccount(ctx context.Context, addr types1.AccAddress) types1.AccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAccount", ctx, addr) - ret0, _ := ret[0].(types0.AccountI) + ret0, _ := ret[0].(types1.AccountI) return ret0 } @@ -69,10 +70,10 @@ func (mr *MockAccountKeeperMockRecorder) GetAccount(ctx, addr interface{}) *gomo } // GetModuleAccount mocks base method. -func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName string) types0.ModuleAccountI { +func (m *MockAccountKeeper) GetModuleAccount(ctx context.Context, moduleName string) types1.ModuleAccountI { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetModuleAccount", ctx, moduleName) - ret0, _ := ret[0].(types0.ModuleAccountI) + ret0, _ := ret[0].(types1.ModuleAccountI) return ret0 } @@ -83,10 +84,10 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAccount(ctx, moduleName interf } // GetModuleAddress mocks base method. -func (m *MockAccountKeeper) GetModuleAddress(name string) types0.AccAddress { +func (m *MockAccountKeeper) GetModuleAddress(name string) types1.AccAddress { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetModuleAddress", name) - ret0, _ := ret[0].(types0.AccAddress) + ret0, _ := ret[0].(types1.AccAddress) return ret0 } @@ -97,7 +98,7 @@ func (mr *MockAccountKeeperMockRecorder) GetModuleAddress(name interface{}) *gom } // IterateAccounts mocks base method. -func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, process func(types0.AccountI) bool) { +func (m *MockAccountKeeper) IterateAccounts(ctx context.Context, process func(types1.AccountI) bool) { m.ctrl.T.Helper() m.ctrl.Call(m, "IterateAccounts", ctx, process) } @@ -109,7 +110,7 @@ func (mr *MockAccountKeeperMockRecorder) IterateAccounts(ctx, process interface{ } // SetModuleAccount mocks base method. -func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types0.ModuleAccountI) { +func (m *MockAccountKeeper) SetModuleAccount(arg0 context.Context, arg1 types1.ModuleAccountI) { m.ctrl.T.Helper() m.ctrl.Call(m, "SetModuleAccount", arg0, arg1) } @@ -144,7 +145,7 @@ func (m *MockBankKeeper) EXPECT() *MockBankKeeperMockRecorder { } // BurnCoins mocks base method. -func (m *MockBankKeeper) BurnCoins(arg0 context.Context, arg1 []byte, arg2 types0.Coins) error { +func (m *MockBankKeeper) BurnCoins(arg0 context.Context, arg1 []byte, arg2 types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BurnCoins", arg0, arg1, arg2) ret0, _ := ret[0].(error) @@ -158,7 +159,7 @@ func (mr *MockBankKeeperMockRecorder) BurnCoins(arg0, arg1, arg2 interface{}) *g } // DelegateCoinsFromAccountToModule mocks base method. -func (m *MockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr types0.AccAddress, recipientModule string, amt types0.Coins) error { +func (m *MockBankKeeper) DelegateCoinsFromAccountToModule(ctx context.Context, senderAddr types1.AccAddress, recipientModule string, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "DelegateCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) ret0, _ := ret[0].(error) @@ -172,10 +173,10 @@ func (mr *MockBankKeeperMockRecorder) DelegateCoinsFromAccountToModule(ctx, send } // GetAllBalances mocks base method. -func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types0.AccAddress) types0.Coins { +func (m *MockBankKeeper) GetAllBalances(ctx context.Context, addr types1.AccAddress) types1.Coins { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetAllBalances", ctx, addr) - ret0, _ := ret[0].(types0.Coins) + ret0, _ := ret[0].(types1.Coins) return ret0 } @@ -186,10 +187,10 @@ func (mr *MockBankKeeperMockRecorder) GetAllBalances(ctx, addr interface{}) *gom } // GetBalance mocks base method. -func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types0.AccAddress, denom string) types0.Coin { +func (m *MockBankKeeper) GetBalance(ctx context.Context, addr types1.AccAddress, denom string) types1.Coin { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetBalance", ctx, addr, denom) - ret0, _ := ret[0].(types0.Coin) + ret0, _ := ret[0].(types1.Coin) return ret0 } @@ -200,10 +201,10 @@ func (mr *MockBankKeeperMockRecorder) GetBalance(ctx, addr, denom interface{}) * } // GetSupply mocks base method. -func (m *MockBankKeeper) GetSupply(ctx context.Context, denom string) types0.Coin { +func (m *MockBankKeeper) GetSupply(ctx context.Context, denom string) types1.Coin { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetSupply", ctx, denom) - ret0, _ := ret[0].(types0.Coin) + ret0, _ := ret[0].(types1.Coin) return ret0 } @@ -214,10 +215,10 @@ func (mr *MockBankKeeperMockRecorder) GetSupply(ctx, denom interface{}) *gomock. } // LockedCoins mocks base method. -func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types0.AccAddress) types0.Coins { +func (m *MockBankKeeper) LockedCoins(ctx context.Context, addr types1.AccAddress) types1.Coins { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "LockedCoins", ctx, addr) - ret0, _ := ret[0].(types0.Coins) + ret0, _ := ret[0].(types1.Coins) return ret0 } @@ -228,7 +229,7 @@ func (mr *MockBankKeeperMockRecorder) LockedCoins(ctx, addr interface{}) *gomock } // SendCoinsFromAccountToModule mocks base method. -func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types0.AccAddress, recipientModule string, amt types0.Coins) error { +func (m *MockBankKeeper) SendCoinsFromAccountToModule(ctx context.Context, senderAddr types1.AccAddress, recipientModule string, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendCoinsFromAccountToModule", ctx, senderAddr, recipientModule, amt) ret0, _ := ret[0].(error) @@ -242,7 +243,7 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromAccountToModule(ctx, senderAd } // SendCoinsFromModuleToModule mocks base method. -func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt types0.Coins) error { +func (m *MockBankKeeper) SendCoinsFromModuleToModule(ctx context.Context, senderPool, recipientPool string, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SendCoinsFromModuleToModule", ctx, senderPool, recipientPool, amt) ret0, _ := ret[0].(error) @@ -256,10 +257,10 @@ func (mr *MockBankKeeperMockRecorder) SendCoinsFromModuleToModule(ctx, senderPoo } // SpendableCoins mocks base method. -func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types0.AccAddress) types0.Coins { +func (m *MockBankKeeper) SpendableCoins(ctx context.Context, addr types1.AccAddress) types1.Coins { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SpendableCoins", ctx, addr) - ret0, _ := ret[0].(types0.Coins) + ret0, _ := ret[0].(types1.Coins) return ret0 } @@ -270,7 +271,7 @@ func (mr *MockBankKeeperMockRecorder) SpendableCoins(ctx, addr interface{}) *gom } // UndelegateCoinsFromModuleToAccount mocks base method. -func (m *MockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types0.AccAddress, amt types0.Coins) error { +func (m *MockBankKeeper) UndelegateCoinsFromModuleToAccount(ctx context.Context, senderModule string, recipientAddr types1.AccAddress, amt types1.Coins) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "UndelegateCoinsFromModuleToAccount", ctx, senderModule, recipientAddr, amt) ret0, _ := ret[0].(error) @@ -307,10 +308,10 @@ func (m *MockValidatorSet) EXPECT() *MockValidatorSetMockRecorder { } // Delegation mocks base method. -func (m *MockValidatorSet) Delegation(arg0 context.Context, arg1 types0.AccAddress, arg2 types0.ValAddress) (types0.DelegationI, error) { +func (m *MockValidatorSet) Delegation(arg0 context.Context, arg1 types1.AccAddress, arg2 types1.ValAddress) (types1.DelegationI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Delegation", arg0, arg1, arg2) - ret0, _ := ret[0].(types0.DelegationI) + ret0, _ := ret[0].(types1.DelegationI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -322,7 +323,7 @@ func (mr *MockValidatorSetMockRecorder) Delegation(arg0, arg1, arg2 interface{}) } // GetPubKeyByConsAddr mocks base method. -func (m *MockValidatorSet) GetPubKeyByConsAddr(arg0 context.Context, arg1 types0.ConsAddress) (crypto.PublicKey, error) { +func (m *MockValidatorSet) GetPubKeyByConsAddr(arg0 context.Context, arg1 types1.ConsAddress) (crypto.PublicKey, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "GetPubKeyByConsAddr", arg0, arg1) ret0, _ := ret[0].(crypto.PublicKey) @@ -337,7 +338,7 @@ func (mr *MockValidatorSetMockRecorder) GetPubKeyByConsAddr(arg0, arg1 interface } // IterateBondedValidatorsByPower mocks base method. -func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { +func (m *MockValidatorSet) IterateBondedValidatorsByPower(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateBondedValidatorsByPower", arg0, arg1) ret0, _ := ret[0].(error) @@ -351,7 +352,7 @@ func (mr *MockValidatorSetMockRecorder) IterateBondedValidatorsByPower(arg0, arg } // IterateValidators mocks base method. -func (m *MockValidatorSet) IterateValidators(arg0 context.Context, arg1 func(int64, types0.ValidatorI) bool) error { +func (m *MockValidatorSet) IterateValidators(arg0 context.Context, arg1 func(int64, types1.ValidatorI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateValidators", arg0, arg1) ret0, _ := ret[0].(error) @@ -365,7 +366,7 @@ func (mr *MockValidatorSetMockRecorder) IterateValidators(arg0, arg1 interface{} } // Jail mocks base method. -func (m *MockValidatorSet) Jail(arg0 context.Context, arg1 types0.ConsAddress) error { +func (m *MockValidatorSet) Jail(arg0 context.Context, arg1 types1.ConsAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Jail", arg0, arg1) ret0, _ := ret[0].(error) @@ -394,7 +395,7 @@ func (mr *MockValidatorSetMockRecorder) MaxValidators(arg0 interface{}) *gomock. } // Slash mocks base method. -func (m *MockValidatorSet) Slash(arg0 context.Context, arg1 types0.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) (math.Int, error) { +func (m *MockValidatorSet) Slash(arg0 context.Context, arg1 types1.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Slash", arg0, arg1, arg2, arg3, arg4) ret0, _ := ret[0].(math.Int) @@ -409,7 +410,7 @@ func (mr *MockValidatorSetMockRecorder) Slash(arg0, arg1, arg2, arg3, arg4 inter } // SlashWithInfractionReason mocks base method. -func (m *MockValidatorSet) SlashWithInfractionReason(arg0 context.Context, arg1 types0.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 stakingv1beta1.Infraction) (math.Int, error) { +func (m *MockValidatorSet) SlashWithInfractionReason(arg0 context.Context, arg1 types1.ConsAddress, arg2, arg3 int64, arg4 math.LegacyDec, arg5 stakingv1beta1.Infraction) (math.Int, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "SlashWithInfractionReason", arg0, arg1, arg2, arg3, arg4, arg5) ret0, _ := ret[0].(math.Int) @@ -454,7 +455,7 @@ func (mr *MockValidatorSetMockRecorder) TotalBondedTokens(arg0 interface{}) *gom } // Unjail mocks base method. -func (m *MockValidatorSet) Unjail(arg0 context.Context, arg1 types0.ConsAddress) error { +func (m *MockValidatorSet) Unjail(arg0 context.Context, arg1 types1.ConsAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Unjail", arg0, arg1) ret0, _ := ret[0].(error) @@ -468,10 +469,10 @@ func (mr *MockValidatorSetMockRecorder) Unjail(arg0, arg1 interface{}) *gomock.C } // Validator mocks base method. -func (m *MockValidatorSet) Validator(arg0 context.Context, arg1 types0.ValAddress) (types0.ValidatorI, error) { +func (m *MockValidatorSet) Validator(arg0 context.Context, arg1 types1.ValAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "Validator", arg0, arg1) - ret0, _ := ret[0].(types0.ValidatorI) + ret0, _ := ret[0].(types1.ValidatorI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -483,10 +484,10 @@ func (mr *MockValidatorSetMockRecorder) Validator(arg0, arg1 interface{}) *gomoc } // ValidatorByConsAddr mocks base method. -func (m *MockValidatorSet) ValidatorByConsAddr(arg0 context.Context, arg1 types0.ConsAddress) (types0.ValidatorI, error) { +func (m *MockValidatorSet) ValidatorByConsAddr(arg0 context.Context, arg1 types1.ConsAddress) (types1.ValidatorI, error) { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "ValidatorByConsAddr", arg0, arg1) - ret0, _ := ret[0].(types0.ValidatorI) + ret0, _ := ret[0].(types1.ValidatorI) ret1, _ := ret[1].(error) return ret0, ret1 } @@ -535,7 +536,7 @@ func (mr *MockDelegationSetMockRecorder) GetValidatorSet() *gomock.Call { } // IterateDelegations mocks base method. -func (m *MockDelegationSet) IterateDelegations(ctx context.Context, delegator types0.AccAddress, fn func(int64, types0.DelegationI) bool) error { +func (m *MockDelegationSet) IterateDelegations(ctx context.Context, delegator types1.AccAddress, fn func(int64, types1.DelegationI) bool) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "IterateDelegations", ctx, delegator, fn) ret0, _ := ret[0].(error) @@ -571,8 +572,22 @@ func (m *MockStakingHooks) EXPECT() *MockStakingHooksMockRecorder { return m.recorder } +// AfterConsensusPubKeyUpdate mocks base method. +func (m *MockStakingHooks) AfterConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey types0.PubKey, rotationFee types1.Coin) error { + m.ctrl.T.Helper() + ret := m.ctrl.Call(m, "AfterConsensusPubKeyUpdate", ctx, oldPubKey, newPubKey, rotationFee) + ret0, _ := ret[0].(error) + return ret0 +} + +// AfterConsensusPubKeyUpdate indicates an expected call of AfterConsensusPubKeyUpdate. +func (mr *MockStakingHooksMockRecorder) AfterConsensusPubKeyUpdate(ctx, oldPubKey, newPubKey, rotationFee interface{}) *gomock.Call { + mr.mock.ctrl.T.Helper() + return mr.mock.ctrl.RecordCallWithMethodType(mr.mock, "AfterConsensusPubKeyUpdate", reflect.TypeOf((*MockStakingHooks)(nil).AfterConsensusPubKeyUpdate), ctx, oldPubKey, newPubKey, rotationFee) +} + // AfterDelegationModified mocks base method. -func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types0.AccAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) AfterDelegationModified(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterDelegationModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -600,7 +615,7 @@ func (mr *MockStakingHooksMockRecorder) AfterUnbondingInitiated(ctx, id interfac } // AfterValidatorBeginUnbonding mocks base method. -func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr types0.ConsAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBeginUnbonding(ctx context.Context, consAddr types1.ConsAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBeginUnbonding", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -614,7 +629,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorBeginUnbonding(ctx, consAd } // AfterValidatorBonded mocks base method. -func (m *MockStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr types0.ConsAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorBonded(ctx context.Context, consAddr types1.ConsAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorBonded", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -628,7 +643,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorBonded(ctx, consAddr, valA } // AfterValidatorCreated mocks base method. -func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorCreated(ctx context.Context, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorCreated", ctx, valAddr) ret0, _ := ret[0].(error) @@ -642,7 +657,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorCreated(ctx, valAddr inter } // AfterValidatorRemoved mocks base method. -func (m *MockStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr types0.ConsAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) AfterValidatorRemoved(ctx context.Context, consAddr types1.ConsAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "AfterValidatorRemoved", ctx, consAddr, valAddr) ret0, _ := ret[0].(error) @@ -656,7 +671,7 @@ func (mr *MockStakingHooksMockRecorder) AfterValidatorRemoved(ctx, consAddr, val } // BeforeDelegationCreated mocks base method. -func (m *MockStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr types0.AccAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationCreated(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationCreated", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -670,7 +685,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationCreated(ctx, delAddr, va } // BeforeDelegationRemoved mocks base method. -func (m *MockStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr types0.AccAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationRemoved(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationRemoved", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -684,7 +699,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationRemoved(ctx, delAddr, va } // BeforeDelegationSharesModified mocks base method. -func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr types0.AccAddress, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) BeforeDelegationSharesModified(ctx context.Context, delAddr types1.AccAddress, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeDelegationSharesModified", ctx, delAddr, valAddr) ret0, _ := ret[0].(error) @@ -698,7 +713,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeDelegationSharesModified(ctx, delA } // BeforeValidatorModified mocks base method. -func (m *MockStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr types0.ValAddress) error { +func (m *MockStakingHooks) BeforeValidatorModified(ctx context.Context, valAddr types1.ValAddress) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorModified", ctx, valAddr) ret0, _ := ret[0].(error) @@ -712,7 +727,7 @@ func (mr *MockStakingHooksMockRecorder) BeforeValidatorModified(ctx, valAddr int } // BeforeValidatorSlashed mocks base method. -func (m *MockStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr types0.ValAddress, fraction math.LegacyDec) error { +func (m *MockStakingHooks) BeforeValidatorSlashed(ctx context.Context, valAddr types1.ValAddress, fraction math.LegacyDec) error { m.ctrl.T.Helper() ret := m.ctrl.Call(m, "BeforeValidatorSlashed", ctx, valAddr, fraction) ret0, _ := ret[0].(error) diff --git a/x/staking/types/codec.go b/x/staking/types/codec.go index 5f5b48e9afb7..9f3bec47a742 100644 --- a/x/staking/types/codec.go +++ b/x/staking/types/codec.go @@ -18,6 +18,7 @@ func RegisterLegacyAminoCodec(cdc *codec.LegacyAmino) { legacy.RegisterAminoMsg(cdc, &MsgBeginRedelegate{}, "cosmos-sdk/MsgBeginRedelegate") legacy.RegisterAminoMsg(cdc, &MsgCancelUnbondingDelegation{}, "cosmos-sdk/MsgCancelUnbondingDelegation") legacy.RegisterAminoMsg(cdc, &MsgUpdateParams{}, "cosmos-sdk/x/staking/MsgUpdateParams") + legacy.RegisterAminoMsg(cdc, &MsgRotateConsPubKey{}, "cosmos-sdk/MsgRotateConsPubKey") cdc.RegisterInterface((*isStakeAuthorization_Validators)(nil), nil) cdc.RegisterConcrete(&StakeAuthorization_AllowList{}, "cosmos-sdk/StakeAuthorization/AllowList", nil) diff --git a/x/staking/types/expected_keepers.go b/x/staking/types/expected_keepers.go index 9f3c318471e0..e6b6b98956d6 100644 --- a/x/staking/types/expected_keepers.go +++ b/x/staking/types/expected_keepers.go @@ -9,6 +9,7 @@ import ( "cosmossdk.io/core/address" "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -107,6 +108,7 @@ type StakingHooks interface { AfterDelegationModified(ctx context.Context, delAddr sdk.AccAddress, valAddr sdk.ValAddress) error BeforeValidatorSlashed(ctx context.Context, valAddr sdk.ValAddress, fraction math.LegacyDec) error AfterUnbondingInitiated(ctx context.Context, id uint64) error + AfterConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey cryptotypes.PubKey, rotationFee sdk.Coin) error } // StakingHooksWrapper is a wrapper for modules to inject StakingHooks using depinject. diff --git a/x/staking/types/hooks.go b/x/staking/types/hooks.go index 8a052d9514a1..9fad002b0170 100644 --- a/x/staking/types/hooks.go +++ b/x/staking/types/hooks.go @@ -5,6 +5,7 @@ import ( sdkmath "cosmossdk.io/math" + cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" ) @@ -116,3 +117,12 @@ func (h MultiStakingHooks) AfterUnbondingInitiated(ctx context.Context, id uint6 } return nil } + +func (h MultiStakingHooks) AfterConsensusPubKeyUpdate(ctx context.Context, oldPubKey, newPubKey cryptotypes.PubKey, rotationFee sdk.Coin) error { + for i := range h { + if err := h[i].AfterConsensusPubKeyUpdate(ctx, oldPubKey, newPubKey, rotationFee); err != nil { + return err + } + } + return nil +} diff --git a/x/staking/types/keys.go b/x/staking/types/keys.go index b7d99c9db2ef..e764c9c86169 100644 --- a/x/staking/types/keys.go +++ b/x/staking/types/keys.go @@ -25,10 +25,10 @@ const ( // GovModuleName is the name of the gov module GovModuleName = "gov" - // distributionModuleName duplicates the distribution module's name to avoid a cyclic dependency with x/distribution. + // PoolModuleName duplicates the Protocolpool module's name to avoid a cyclic dependency with x/protocolpool. // It should be synced with the distribution module's name if it is ever changed. // See: https://github.com/cosmos/cosmos-sdk/blob/912390d5fc4a32113ea1aacc98b77b2649aea4c2/x/distribution/types/keys.go#L15 - DistributionModuleName = "distribution" + PoolModuleName = "protocolpool" ) var ( @@ -68,7 +68,8 @@ var ( BlockConsPubKeyRotationHistoryKey = collections.NewPrefix(102) // prefix for consPubkey rotation history by height ValidatorConsensusKeyRotationRecordQueueKey = collections.NewPrefix(103) // this key is used to set the unbonding period time on each rotation ValidatorConsensusKeyRotationRecordIndexKey = collections.NewPrefix(104) // this key is used to restrict the validator next rotation within waiting (unbonding) period - RotatedConsKeyMapIndex = collections.NewPrefix(105) // prefix for rotated cons address to new cons address + NewToOldConsKeyMap = collections.NewPrefix(105) // prefix for rotated cons address to new cons address + OldToNewConsKeyMap = collections.NewPrefix(106) // prefix for rotated cons address to new cons address ) // UnbondingType defines the type of unbonding operation diff --git a/x/staking/types/msg.go b/x/staking/types/msg.go index 0119bc82adcc..683d8495a673 100644 --- a/x/staking/types/msg.go +++ b/x/staking/types/msg.go @@ -142,3 +142,35 @@ func NewMsgCancelUnbondingDelegation(delAddr, valAddr string, creationHeight int CreationHeight: creationHeight, } } + +// NewMsgRotateConsPubKey creates a new MsgRotateConsPubKey instance. +func NewMsgRotateConsPubKey(valAddr string, pubKey cryptotypes.PubKey) (*MsgRotateConsPubKey, error) { + var pkAny *codectypes.Any + if pubKey != nil { + var err error + if pkAny, err = codectypes.NewAnyWithValue(pubKey); err != nil { + return nil, err + } + } + return &MsgRotateConsPubKey{ + ValidatorAddress: valAddr, + NewPubkey: pkAny, + }, nil +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (msg MsgRotateConsPubKey) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + var pubKey cryptotypes.PubKey + return unpacker.UnpackAny(msg.NewPubkey, &pubKey) +} + +// UnpackInterfaces implements UnpackInterfacesMessage.UnpackInterfaces +func (hi ConsPubKeyRotationHistory) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { + var oldPubKey cryptotypes.PubKey + err := unpacker.UnpackAny(hi.OldConsPubkey, &oldPubKey) + if err != nil { + return err + } + var newPubKey cryptotypes.PubKey + return unpacker.UnpackAny(hi.NewConsPubkey, &newPubKey) +} diff --git a/x/tx/CHANGELOG.md b/x/tx/CHANGELOG.md index ccfd28117cd7..a001f957cc22 100644 --- a/x/tx/CHANGELOG.md +++ b/x/tx/CHANGELOG.md @@ -29,6 +29,12 @@ Ref: https://keepachangelog.com/en/1.0.0/ # Changelog +## [Unreleased] + +### Improvements + +* [#18857](https://github.com/cosmos/cosmos-sdk/pull/18857) Moved `FormatCoins` from `core/coins` to this package under `signing/textual`. + ## v0.13.0 ### Improvements diff --git a/x/tx/go.mod b/x/tx/go.mod index 559e2409c663..7bcb92d103dc 100644 --- a/x/tx/go.mod +++ b/x/tx/go.mod @@ -15,7 +15,7 @@ require ( github.com/pkg/errors v0.9.1 github.com/stretchr/testify v1.8.4 github.com/tendermint/go-amino v0.16.0 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.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 dac57019bef3..4d558c971de7 100644 --- a/x/tx/go.sum +++ b/x/tx/go.sum @@ -64,8 +64,8 @@ google.golang.org/grpc v1.60.1 h1:26+wFr+cNqSGFcOXcabYC0lUVJVRa2Sb2ortSK7VrEU= google.golang.org/grpc v1.60.1/go.mod h1:OlCHIeLYqSSsLi6i49B5QGdzaMZK9+M7LXN2FKz4eGM= 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.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +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/signing/textual/coins.go b/x/tx/signing/textual/coins.go index 049b13421429..3e3232ded699 100644 --- a/x/tx/signing/textual/coins.go +++ b/x/tx/signing/textual/coins.go @@ -3,13 +3,13 @@ package textual import ( "context" "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" ) @@ -48,7 +48,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 } @@ -76,7 +76,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 +217,86 @@ 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 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 ea139bd451b5..c9e1bbf6dd7a 100644 --- a/x/tx/signing/textual/coins_test.go +++ b/x/tx/signing/textual/coins_test.go @@ -106,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/upgrade/go.mod b/x/upgrade/go.mod index fa35af74d9e8..8cf3a32592fa 100644 --- a/x/upgrade/go.mod +++ b/x/upgrade/go.mod @@ -27,7 +27,7 @@ require ( github.com/stretchr/testify v1.8.4 google.golang.org/genproto/googleapis/api v0.0.0-20231120223509-83a465c0220f google.golang.org/grpc v1.60.1 - google.golang.org/protobuf v1.31.0 + google.golang.org/protobuf v1.32.0 ) require ( @@ -58,9 +58,8 @@ require ( 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 - github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 // indirect + github.com/cockroachdb/pebble v1.0.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.8.0 // indirect github.com/cosmos/btcutil v1.0.5 // indirect github.com/cosmos/go-bip39 v1.0.0 // indirect @@ -119,7 +118,7 @@ require ( github.com/inconshreveable/mousetrap v1.1.0 // indirect github.com/jmespath/go-jmespath v0.4.0 // indirect github.com/jmhodges/levigo v1.0.0 // indirect - github.com/klauspost/compress v1.17.3 // indirect + github.com/klauspost/compress v1.17.4 // indirect github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect @@ -141,12 +140,12 @@ require ( github.com/petermattis/goid v0.0.0-20231126143041-f558c26febf5 // 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.17.0 // indirect + github.com/prometheus/client_golang v1.18.0 // indirect github.com/prometheus/client_model v0.5.0 // indirect github.com/prometheus/common v0.45.0 // indirect github.com/prometheus/procfs v0.12.0 // indirect github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect - github.com/rogpeppe/go-internal v1.11.0 // indirect + github.com/rogpeppe/go-internal v1.12.0 // indirect github.com/rs/cors v1.8.3 // indirect github.com/rs/zerolog v1.31.0 // indirect github.com/sagikazarmark/locafero v0.4.0 // indirect @@ -168,11 +167,11 @@ require ( go.opencensus.io v0.24.0 // indirect go.uber.org/multierr v1.11.0 // indirect golang.org/x/crypto v0.17.0 // indirect - golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611 // indirect + golang.org/x/exp v0.0.0-20231226003508-02704c960a9b // indirect golang.org/x/mod v0.14.0 // indirect golang.org/x/net v0.19.0 // indirect golang.org/x/oauth2 v0.15.0 // indirect - golang.org/x/sync v0.5.0 // indirect + golang.org/x/sync v0.6.0 // indirect golang.org/x/sys v0.15.0 // indirect golang.org/x/term v0.15.0 // indirect golang.org/x/text v0.14.0 // indirect diff --git a/x/upgrade/go.sum b/x/upgrade/go.sum index 89bff52742a1..18a33d05983b 100644 --- a/x/upgrade/go.sum +++ b/x/upgrade/go.sum @@ -313,20 +313,16 @@ github.com/cncf/xds/go v0.0.0-20210922020428-25de7278fc84/go.mod h1:eXthEFrGJvWH github.com/cncf/xds/go v0.0.0-20211001041855-01bcc9b48dfe/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cncf/xds/go v0.0.0-20211011173535-cb28da3451f1/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= github.com/cockroachdb/datadriven v0.0.0-20190809214429-80d97fb3cbaa/go.mod h1:zn76sxSg3SzpJ0PPJaLDCu+Bu0Lg3sKTORVIj19EIF8= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f h1:otljaYPt5hWxV3MUfO5dFPFiOXg9CyG5/kCfayTqsJ4= -github.com/cockroachdb/datadriven v1.0.3-0.20230413201302-be42291fc80f/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877 h1:1MLK4YpFtIEo3ZtMA5C795Wtv5VuUnrXX7mQG+aHg6o= +github.com/cockroachdb/datadriven v1.0.3-0.20230801171734-e384cf455877/go.mod h1:a9RdTaap04u637JoCzcUoIcDmvwSUtcUFtT/C3kJlTU= github.com/cockroachdb/errors v1.11.1 h1:xSEW75zKaKCWzR3OfxXUxgrk/NtT4G1MiOv5lWZazG8= github.com/cockroachdb/errors v1.11.1/go.mod h1:8MUxA3Gi6b25tYlFEBGLf+D8aISL+M4MIpiWMSNRfxw= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b h1:r6VH0faHjZeQy818SGhaone5OnYfxFR/+AzdY3sf5aE= github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b/go.mod h1:Vz9DsVWQQhf3vs21MhPMZpMGSht7O/2vFW2xusFUVOs= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895 h1:XANOgPYtvELQ/h4IrmPAohXqe2pWA8Bwhejr3VQoZsA= -github.com/cockroachdb/metamorphic v0.0.0-20231108215700-4ba948b56895/go.mod h1:aPd7gM9ov9M8v32Yy5NJrDyOcD8z642dqs+F0CeNXfA= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6 h1:E5oguuHKsZiUgmEOOzRz1zM3ev1rGZhN0tf06fXrbP4= -github.com/cockroachdb/pebble v0.0.0-20231129003907-ce7560a81fb6/go.mod h1:BHuaMa/lK7fUe75BlsteiiTu8ptIG+qSAuDtGMArP18= +github.com/cockroachdb/pebble v1.0.0 h1:WZWlV/s78glZbY2ylUITDOWSVBD3cLjcWPLRPFbHNYg= +github.com/cockroachdb/pebble v1.0.0/go.mod h1:bynZ3gvVyhlvjLI7PT6dmZ7g76xzJ7HpxfjgkzCGz6s= github.com/cockroachdb/redact v1.1.5 h1:u1PMllDkdFfPWaNGMyLD1+so+aq3uUItthCFqzwPJ30= 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/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= github.com/cometbft/cometbft v0.38.2 h1:io0JCh5EPxINKN5ZMI5hCdpW3QVZRy+o8qWe3mlJa/8= github.com/cometbft/cometbft v0.38.2/go.mod h1:PIi48BpzwlHqtV3mzwPyQgOyOnU94BNBimLS2ebBHOg= @@ -720,8 +716,8 @@ github.com/klauspost/compress v1.10.3/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYs github.com/klauspost/compress v1.11.7/go.mod h1:aoV0uJVorq1K+umq18yTdKaF57EivdYsUV+/s2qKfXs= github.com/klauspost/compress v1.12.3/go.mod h1:8dP1Hq4DHOhN9w426knH3Rhby4rFm6D8eO+e+Dq5Gzg= github.com/klauspost/compress v1.15.11/go.mod h1:QPwzmACJjUTFsnSHH934V6woptycfrDDJnH7hvFVbGM= -github.com/klauspost/compress v1.17.3 h1:qkRjuerhUU1EmXLYGkSH6EZL+vPSxIrYjLNAK4slzwA= -github.com/klauspost/compress v1.17.3/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= +github.com/klauspost/compress v1.17.4 h1:Ej5ixsIri7BrIjBkRZLTo6ghwrEtHFk7ijlczPW4fZ4= +github.com/klauspost/compress v1.17.4/go.mod h1:/dCuZOvVtNoHsyb+cuJD3itjs3NbnF6KH9zAO4BDxPM= github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg= github.com/klauspost/cpuid/v2 v2.2.4 h1:acbojRNwl3o09bUq+yDCtZFc1aiwaAAxtcn8YkZXnvk= github.com/klauspost/cpuid/v2 v2.2.4/go.mod h1:RVVoqg1df56z8g3pUjL/3lE5UfnlrJX8tyFgg4nqhuY= @@ -880,8 +876,8 @@ 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.17.0 h1:rl2sfwZMtSthVU752MqfjQozy7blglC+1SOtjMAMh+Q= -github.com/prometheus/client_golang v1.17.0/go.mod h1:VeL+gMmOAxkS2IqfCq0ZmHSL+LjWfWDUmp1mBz9JgUY= +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-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= github.com/prometheus/client_model v0.0.0-20190129233127-fd36f4220a90/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= @@ -913,8 +909,8 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= -github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= -github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= +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= github.com/rs/cors v1.7.0/go.mod h1:gFx+x8UowdsKA9AchylcLynDq+nNFfI8FkUZdN/jGCU= github.com/rs/cors v1.8.3 h1:O+qNyWn7Z+F9M0ILBHgMVPuB1xTOucVd5gtaYyXBpRo= github.com/rs/cors v1.8.3/go.mod h1:XyqrcTp5zjWr1wsJ8PIRZssZ8b/WMcMf71DJnit4EMU= @@ -1084,8 +1080,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-20231214170342-aacd6d4b4611 h1:qCEDpW1G+vcj3Y7Fy52pEM1AWm3abj8WimGYejI3SC4= -golang.org/x/exp v0.0.0-20231214170342-aacd6d4b4611/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b h1:kLiC65FbiHWFAOu+lxwNPujcsl8VYyTYYEZnsOO1WK4= +golang.org/x/exp v0.0.0-20231226003508-02704c960a9b/go.mod h1:iRJReGqOEeBhDZGkGbynYwcHlctCvnjTYIamk7uXpHI= 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= @@ -1221,8 +1217,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.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE= -golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +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/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= @@ -1663,8 +1659,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8= -google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= +google.golang.org/protobuf v1.32.0 h1:pPC6BG5ex8PDFnkbrGU3EixyhKcQ2aDuBS36lqK/C7I= +google.golang.org/protobuf v1.32.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=