diff --git a/CHANGELOG.md b/CHANGELOG.md index ea9c2570345..bebe17abcc9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -44,6 +44,131 @@ Ref: https://keepachangelog.com/en/1.0.0/ * (baseapp & types) [#17712](https://github.com/cosmos/cosmos-sdk/pull/17712) Introduce `PreBlock`, which runs before begin blocker other modules, and allows to modify consensus parameters, and the changes are visible to the following state machine logics. Additionally it can be used for vote extensions. * (genutil) [#17571](https://github.com/cosmos/cosmos-sdk/pull/17571) Allow creation of `AppGenesis` without a file lookup. +<<<<<<< HEAD +======= +* (server) [#17094](https://github.com/cosmos/cosmos-sdk/pull/17094) Add duration `shutdown-grace` for resource clean up (closing database handles) before exit. +* (x/gov) [#17780](https://github.com/cosmos/cosmos-sdk/pull/17780) Recover panics and turn them into errors when executing x/gov proposals. + +### Improvements + +* (client) [#17503](https://github.com/cosmos/cosmos-sdk/pull/17503) Add `client.Context{}.WithAddressCodec`, `WithValidatorAddressCodec`, `WithConsensusAddressCodec` to provide address codecs to the client context. See the [UPGRADING.md](./UPGRADING.md) for more details. +* (crypto/keyring) [#17503](https://github.com/cosmos/cosmos-sdk/pull/17503) Simplify keyring interfaces to use `[]byte` instead of `sdk.Address` for addresses. +* (all) [#16537](https://github.com/cosmos/cosmos-sdk/pull/16537) Properly propagated `fmt.Errorf` errors and using `errors.New` where appropriate. +* (rpc) [#17470](https://github.com/cosmos/cosmos-sdk/pull/17470) Avoid open 0.0.0.0 to public by default and add `listen-ip-address` argument for `testnet init-files` cmd. +* (types/module) [#17554](https://github.com/cosmos/cosmos-sdk/pull/17554) Introduce `HasABCIGenesis` which is implemented by a module only when a validatorset update needs to be returned +* (baseapp) [#17667](https://github.com/cosmos/cosmos-sdk/pull/17667) Close databases opened by cosmos-sdk during BaseApp shutdown +* (types) [#17670](https://github.com/cosmos/cosmos-sdk/pull/17670) Use `ctx.CometInfo` in place of `ctx.VoteInfos` +* [#17733](https://github.com/cosmos/cosmos-sdk/pull/17733) Ensure `buf export` exports all proto dependencies + +### Bug Fixes + +* (types) [#16583](https://github.com/cosmos/cosmos-sdk/pull/16583), [#17372](https://github.com/cosmos/cosmos-sdk/pull/17372), [#17421](https://github.com/cosmos/cosmos-sdk/pull/17421), [#17713](https://github.com/cosmos/cosmos-sdk/pull/17713) Introduce `PreBlock`, which executes in `FinalizeBlock` before `BeginBlock`. It allows the application to modify consensus parameters and have access to VE state. Note, `PreFinalizeBlockHook` is replaced by`PreBlocker`. +* (baseapp) [#17518](https://github.com/cosmos/cosmos-sdk/pull/17518) Utilizing voting power from vote extensions (CometBFT) instead of the current bonded tokens (x/staking) to determine if a set of vote extensions are valid. +* (config) [#17649](https://github.com/cosmos/cosmos-sdk/pull/17649) Fix `mempool.max-txs` configuration is invalid in `app.config`. +* (mempool) [#17668](https://github.com/cosmos/cosmos-sdk/pull/17668) Fix: `PriorityNonceIterator.Next()` nil pointer ref for min priority at the end of iteration. + +### API Breaking Changes + +* (x/staking) [#17778](https://github.com/cosmos/cosmos-sdk/pull/17778) Use collections for `Params` + * remove from `Keeper`: `GetParams`, `SetParams` +* (types/simulation) [#17737](https://github.com/cosmos/cosmos-sdk/pull/17737) Remove unused parameter from `RandomFees` +* (x/staking) [#17486](https://github.com/cosmos/cosmos-sdk/pull/17486) Use collections for `RedelegationQueueKey`: + * remove from `types`: `GetRedelegationTimeKey` + * remove from `Keeper`: `RedelegationQueueIterator` +* (x/staking) [#17562](https://github.com/cosmos/cosmos-sdk/pull/17562) Use collections for `ValidatorQueue` + * remove from `types`: `GetValidatorQueueKey`, `ParseValidatorQueueKey` + * remove from `Keeper`: `ValidatorQueueIterator` +* (x/staking) [#17498](https://github.com/cosmos/cosmos-sdk/pull/17498) Use collections for `LastValidatorPower`: + * remove from `types`: `GetLastValidatorPowerKey` + * remove from `Keeper`: `LastValidatorsIterator`, `IterateLastValidators` +* (x/staking) [#17291](https://github.com/cosmos/cosmos-sdk/pull/17291) Use collections for `UnbondingDelegationByValIndex`: + * remove from `types`: `GetUBDKeyFromValIndexKey`, `GetUBDsByValIndexKey`, `GetUBDByValIndexKey` +* (x/slashing) [#17568](https://github.com/cosmos/cosmos-sdk/pull/17568) Use collections for `ValidatorMissedBlockBitmap`: + * remove from `types`: `ValidatorMissedBlockBitmapPrefixKey`, `ValidatorMissedBlockBitmapKey` +* (x/staking) [#17481](https://github.com/cosmos/cosmos-sdk/pull/17481) Use collections for `UnbondingQueue`: + * remove from `Keeper`: `UBDQueueIterator` + * remove from `types`: `GetUnbondingDelegationTimeKey` +* (x/staking) [#17123](https://github.com/cosmos/cosmos-sdk/pull/17123) Use collections for `Validators` +* (x/staking) [#17270](https://github.com/cosmos/cosmos-sdk/pull/17270) Use collections for `UnbondingDelegation`: + * remove from `types`: `GetUBDsKey` + * remove from `Keeper`: `IterateUnbondingDelegations`, `IterateDelegatorUnbondingDelegations` +* (client/keys) [#17503](https://github.com/cosmos/cosmos-sdk/pull/17503) `clientkeys.NewKeyOutput`, `MkConsKeyOutput`, `MkValKeyOutput`, `MkAccKeyOutput`, `MkAccKeysOutput` now take their corresponding address codec instead of using the global SDK config. +* (x/staking) [#17336](https://github.com/cosmos/cosmos-sdk/pull/17336) Use collections for `RedelegationByValDstIndexKey`: + * remove from `types`: `GetREDByValDstIndexKey`, `GetREDsToValDstIndexKey` +* (x/staking) [#17332](https://github.com/cosmos/cosmos-sdk/pull/17332) Use collections for `RedelegationByValSrcIndexKey`: + * remove from `types`: `GetREDKeyFromValSrcIndexKey`, `GetREDsFromValSrcIndexKey` +* (x/staking) [#17315](https://github.com/cosmos/cosmos-sdk/pull/17315) Use collections for `RedelegationKey`: + * remove from `keeper`: `GetRedelegation` +* (types) `module.BeginBlockAppModule` has been replaced by Core API `appmodule.HasBeginBlocker`. +* (types) `module.EndBlockAppModule` has been replaced by Core API `appmodule.HasEndBlocker` or `module.HasABCIEndBlock` when needing validator updates. +* (x/slashing) [#17044](https://github.com/cosmos/cosmos-sdk/pull/17044) Use collections for `AddrPubkeyRelation`: + * remove from `types`: `AddrPubkeyRelationKey` + * remove from `Keeper`: `AddPubkey` +* (x/staking) [#17260](https://github.com/cosmos/cosmos-sdk/pull/17260) Use collections for `DelegationKey`: + * remove from `types`: `GetDelegationKey`, `GetDelegationsKey` +* (x/staking) [#17288](https://github.com/cosmos/cosmos-sdk/pull/17288) Use collections for `UnbondingIndex`: + * remove from `types`: `GetUnbondingIndexKey`. +* (x/staking) [#17256](https://github.com/cosmos/cosmos-sdk/pull/17256) Use collections for `UnbondingID`. +* (x/staking) [#17260](https://github.com/cosmos/cosmos-sdk/pull/17260) Use collections for `ValidatorByConsAddr`: + * remove from `types`: `GetValidatorByConsAddrKey` +* (x/staking) [#17248](https://github.com/cosmos/cosmos-sdk/pull/17248) Use collections for `UnbondingType`. + * remove from `types`: `GetUnbondingTypeKey`. +* (client) [#17259](https://github.com/cosmos/cosmos-sdk/pull/17259) Remove deprecated `clientCtx.PrintObjectLegacy`. Use `clientCtx.PrintProto` or `clientCtx.PrintRaw` instead. +* (x/distribution) [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Use collections for `PreviousProposer` and `ValidatorSlashEvents`: + * remove from `Keeper`: `GetPreviousProposerConsAddr`, `SetPreviousProposerConsAddr`, `GetValidatorHistoricalReferenceCount`, `GetValidatorSlashEvent`, `SetValidatorSlashEvent`. +* (x/feegrant) [#16535](https://github.com/cosmos/cosmos-sdk/pull/16535) Use collections for `FeeAllowance`, `FeeAllowanceQueue`. +* (x/staking) [#17063](https://github.com/cosmos/cosmos-sdk/pull/17063) Use collections for `HistoricalInfo`: + * remove `Keeper`: `GetHistoricalInfo`, `SetHistoricalInfo` +* (x/staking) [#17062](https://github.com/cosmos/cosmos-sdk/pull/17062) Use collections for `ValidatorUpdates`: + * remove `Keeper`: `SetValidatorUpdates`, `GetValidatorUpdates` +* (x/slashing) [#17023](https://github.com/cosmos/cosmos-sdk/pull/17023) Use collections for `ValidatorSigningInfo`: + * remove `Keeper`: `SetValidatorSigningInfo`, `GetValidatorSigningInfo`, `IterateValidatorSigningInfos` +* (x/staking) [#17026](https://github.com/cosmos/cosmos-sdk/pull/17026) Use collections for `LastTotalPower`: + * remove `Keeper`: `SetLastTotalPower`, `GetLastTotalPower` +* (x/distribution) [#16440](https://github.com/cosmos/cosmos-sdk/pull/16440) use collections for `DelegatorWithdrawAddresState`: + * remove `Keeper`: `SetDelegatorWithdrawAddr`, `DeleteDelegatorWithdrawAddr`, `IterateDelegatorWithdrawAddrs`. +* (x/distribution) [#16459](https://github.com/cosmos/cosmos-sdk/pull/16459) use collections for `ValidatorCurrentRewards` state management: + * remove `Keeper`: `IterateValidatorCurrentRewards`, `GetValidatorCurrentRewards`, `SetValidatorCurrentRewards`, `DeleteValidatorCurrentRewards` +* (x/authz) [#16509](https://github.com/cosmos/cosmos-sdk/pull/16509) `AcceptResponse` has been moved to sdk/types/authz and the `Updated` field is now of the type `sdk.Msg` instead of `authz.Authorization`. +* (x/distribution) [#16483](https://github.com/cosmos/cosmos-sdk/pull/16483) use collections for `DelegatorStartingInfo` state management: + * remove `Keeper`: `IterateDelegatorStartingInfo`, `GetDelegatorStartingInfo`, `SetDelegatorStartingInfo`, `DeleteDelegatorStartingInfo`, `HasDelegatorStartingInfo` +* (x/distribution) [#16571](https://github.com/cosmos/cosmos-sdk/pull/16571) use collections for `ValidatorAccumulatedCommission` state management: + * remove `Keeper`: `IterateValidatorAccumulatedCommission`, `GetValidatorAccumulatedCommission`, `SetValidatorAccumulatedCommission`, `DeleteValidatorAccumulatedCommission` +* (x/distribution) [#16590](https://github.com/cosmos/cosmos-sdk/pull/16590) use collections for `ValidatorOutstandingRewards` state management: + * remove `Keeper`: `IterateValidatorOutstandingRewards`, `GetValidatorOutstandingRewards`, `SetValidatorOutstandingRewards`, `DeleteValidatorOutstandingRewards` +* (x/distribution) [#16607](https://github.com/cosmos/cosmos-sdk/pull/16607) use collections for `ValidatorHistoricalRewards` state management: + * remove `Keeper`: `IterateValidatorHistoricalRewards`, `GetValidatorHistoricalRewards`, `SetValidatorHistoricalRewards`, `DeleteValidatorHistoricalRewards`, `DeleteValidatorHistoricalReward`, `DeleteAllValidatorHistoricalRewards` +* (x/slashing) [#16441](https://github.com/cosmos/cosmos-sdk/pull/16441) Params state is migrated to collections. `GetParams` has been removed. +* (types) [#16918](https://github.com/cosmos/cosmos-sdk/pull/16918) Remove `IntProto` and `DecProto`. Instead, `math.Int` and `math.LegacyDec` should be used respectively. Both types support `Marshal` and `Unmarshal` which should be used for binary marshaling. +* (client) [#17215](https://github.com/cosmos/cosmos-sdk/pull/17215) `server.StartCmd`,`server.ExportCmd`,`server.NewRollbackCmd`,`pruning.Cmd`,`genutilcli.InitCmd`,`genutilcli.GenTxCmd`,`genutilcli.CollectGenTxsCmd`,`genutilcli.AddGenesisAccountCmd`, do not take a home directory anymore. It is inferred from the root command. +* (baseapp) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) `SetProtocolVersion` has been renamed to `SetAppVersion`. It now updates the consensus params in baseapp's `ParamStore`. +* (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 `"github.com/cosmos/cosmos-sdk/x/staking/types".Infraction_*` in favour of `"cosmossdk.io/api/cosmos/staking/v1beta1".Infraction_` in order to remove dependency between modules on staking +* (x/gov) [#17496](https://github.com/cosmos/cosmos-sdk/pull/17469) in `x/gov/types/v1beta1/vote.go` `NewVote` was removed, constructing the struct is required for this type +* (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 +* (x/distribution) [#17670](https://github.com/cosmos/cosmos-sdk/pull/17670) `AllocateTokens` takes `comet.VoteInfos` instead of `[]abci.VoteInfo` +* (x/auth) [#17787](https://github.com/cosmos/cosmos-sdk/pull/17787) remove tip functionality +* (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()`. +* (client) [#17746](https://github.com/cosmos/cosmos-sdk/pull/17746) `txEncodeAmino` & `txDecodeAmino` txs via grpc and rest were removed + * `RegisterLegacyAmino` was removed from `AppModuleBasic` +* (x/staking) [#17655](https://github.com/cosmos/cosmos-sdk/pull/17655) `QueryHistoricalInfo` was adjusted to return `HistoricalRecord` and marked `Hist` as deprecated. + +### CLI Breaking Changes + +### State Machine Breaking + +* (x/distribution) [#17115](https://github.com/cosmos/cosmos-sdk/pull/17115) Migrate `PreviousProposer` to collections. +* (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. + +## [v0.50.0-rc.0](https://github.com/cosmos/cosmos-sdk/releases/tag/v0.50.0-rc.0) - 2023-08-18 + +### Features + +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) * (keyring) [#17424](https://github.com/cosmos/cosmos-sdk/pull/17424) Allows to import private keys encoded in hex. * (client/rpc) [#17274](https://github.com/cosmos/cosmos-sdk/pull/17274) Add `QueryEventForTxCmd` cmd to subscribe and wait event for transaction by hash. * (codec) [#17042](https://github.com/cosmos/cosmos-sdk/pull/17042) Add `CollValueV2` which supports encoding of protov2 messages in collections. diff --git a/api/cosmos/tx/signing/v1beta1/signing.pulsar.go b/api/cosmos/tx/signing/v1beta1/signing.pulsar.go index 0e6c1282705..7885b82a8ab 100644 --- a/api/cosmos/tx/signing/v1beta1/signing.pulsar.go +++ b/api/cosmos/tx/signing/v1beta1/signing.pulsar.go @@ -2729,8 +2729,7 @@ const ( SignMode_SIGN_MODE_TEXTUAL SignMode = 2 // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. + // require signers signing over other signers' `signer_info`. // // Since: cosmos-sdk 0.46 SignMode_SIGN_MODE_DIRECT_AUX SignMode = 3 diff --git a/api/cosmos/tx/v1beta1/tx.pulsar.go b/api/cosmos/tx/v1beta1/tx.pulsar.go index e96c797a907..4b00dac60a6 100644 --- a/api/cosmos/tx/v1beta1/tx.pulsar.go +++ b/api/cosmos/tx/v1beta1/tx.pulsar.go @@ -8329,12 +8329,9 @@ type SignDocDirectAux struct { AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` // sequence is the sequence number of the signing account. Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"` - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. + // tips have been depreacted and should not be used // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. + // Deprecated: Do not use. Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` } @@ -8393,6 +8390,7 @@ func (x *SignDocDirectAux) GetSequence() uint64 { return 0 } +// Deprecated: Do not use. func (x *SignDocDirectAux) GetTip() *Tip { if x != nil { return x.Tip @@ -8509,6 +8507,8 @@ type AuthInfo struct { // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 + // + // Deprecated: Do not use. Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` } @@ -8546,6 +8546,7 @@ func (x *AuthInfo) GetFee() *Fee { return nil } +// Deprecated: Do not use. func (x *AuthInfo) GetTip() *Tip { if x != nil { return x.Tip @@ -8763,6 +8764,8 @@ func (x *Fee) GetGranter() string { // Tip is the tip used for meta-transactions. // // Since: cosmos-sdk 0.46 +// +// Deprecated: Do not use. type Tip struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -9011,7 +9014,7 @@ var file_cosmos_tx_v1beta1_tx_proto_rawDesc = []byte{ 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, - 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xee, 0x01, 0x0a, 0x10, + 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x22, 0xf2, 0x01, 0x0a, 0x10, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x44, 0x69, 0x72, 0x65, 0x63, 0x74, 0x41, 0x75, 0x78, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x64, 0x79, 0x5f, 0x62, 0x79, 0x74, 0x65, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x62, 0x6f, 0x64, 0x79, 0x42, 0x79, 0x74, 0x65, 0x73, 0x12, @@ -9024,121 +9027,122 @@ var file_cosmos_tx_v1beta1_tx_proto_rawDesc = []byte{ 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1a, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, + 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, 0x52, 0x03, 0x74, 0x69, 0x70, 0x22, 0x95, 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, 0xa0, 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, 0x28, 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, 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, + 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, + 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, - 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, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xb2, 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, + 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, 0x06, 0x74, 0x69, 0x70, 0x70, 0x65, 0x72, 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, 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, } var ( diff --git a/baseapp/baseapp.go b/baseapp/baseapp.go index 23532823854..5d65ca0f31e 100644 --- a/baseapp/baseapp.go +++ b/baseapp/baseapp.go @@ -72,7 +72,7 @@ type BaseApp struct { mempool mempool.Mempool // application side mempool anteHandler sdk.AnteHandler // ante handler for fee and auth - postHandler sdk.PostHandler // post handler, optional, e.g. for tips + postHandler sdk.PostHandler // post handler, optional initChainer sdk.InitChainer // ABCI InitChain handler preBlocker sdk.PreBlocker // logic to run before BeginBlocker diff --git a/client/tx/aux_builder.go b/client/tx/aux_builder.go index 0500979b985..be9616ae759 100644 --- a/client/tx/aux_builder.go +++ b/client/tx/aux_builder.go @@ -6,7 +6,6 @@ import ( "github.com/cosmos/gogoproto/proto" "google.golang.org/protobuf/types/known/anypb" - basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" txsigning "cosmossdk.io/x/tx/signing" "cosmossdk.io/x/tx/signing/aminojson" @@ -130,12 +129,6 @@ func (b *AuxTxBuilder) SetSignMode(mode signing.SignMode) error { return nil } -// SetTip sets an optional tip in the AuxSignerData. -func (b *AuxTxBuilder) SetTip(tip *tx.Tip) { - b.checkEmptyFields() - b.auxSignerData.SignDoc.Tip = tip -} - // SetSignature sets the aux signer's signature in the AuxSignerData. func (b *AuxTxBuilder) SetSignature(sig []byte) { b.checkEmptyFields() @@ -214,11 +207,7 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) { handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{ FileResolver: proto.HybridResolver, }) - legacyTip := b.auxSignerData.SignDoc.Tip - tip := &txv1beta1.Tip{ - Amount: make([]*basev1beta1.Coin, len(legacyTip.Amount)), - Tipper: legacyTip.Tipper, - } + auxBody := &txv1beta1.TxBody{ Messages: body.Messages, Memo: body.Memo, @@ -230,12 +219,7 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) { ExtensionOptions: nil, NonCriticalExtensionOptions: nil, } - for i, coin := range legacyTip.Amount { - tip.Amount[i] = &basev1beta1.Coin{ - Denom: coin.Denom, - Amount: coin.Amount.String(), - } - } + signBz, err = handler.GetSignBytes( context.Background(), txsigning.SignerData{ @@ -254,7 +238,6 @@ func (b *AuxTxBuilder) GetSignBytes() ([]byte, error) { // over empty fees. // ref: https://github.com/cosmos/cosmos-sdk/pull/10348 Fee: &txv1beta1.Fee{}, - Tip: tip, }, }, ) diff --git a/client/tx/aux_builder_test.go b/client/tx/aux_builder_test.go index 9a967192e50..af61fc09818 100644 --- a/client/tx/aux_builder_test.go +++ b/client/tx/aux_builder_test.go @@ -84,25 +84,11 @@ func TestAuxTxBuilder(t *testing.T) { }, true, "got unknown sign mode SIGN_MODE_UNSPECIFIED", }, - { - "GetSignBytes tipper should not be nil (if tip is set)", - func() error { - require.NoError(t, b.SetMsgs(msg1)) - require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(&typestx.Tip{}) - require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) - - _, err := b.GetSignBytes() - return err - }, - true, "tipper cannot be empty", - }, { "GetSignBytes works for DIRECT_AUX", func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) _, err := b.GetSignBytes() @@ -115,7 +101,6 @@ func TestAuxTxBuilder(t *testing.T) { func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) _, err := b.GetSignBytes() @@ -131,7 +116,6 @@ func TestAuxTxBuilder(t *testing.T) { func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) require.NoError(t, b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX)) @@ -153,7 +137,6 @@ func TestAuxTxBuilder(t *testing.T) { b.SetChainID(chainID) require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) err := b.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX) require.NoError(t, err) @@ -176,7 +159,6 @@ func TestAuxTxBuilder(t *testing.T) { func() error { require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) err := b.SetSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) require.NoError(t, err) @@ -196,7 +178,6 @@ func TestAuxTxBuilder(t *testing.T) { b.SetChainID(chainID) require.NoError(t, b.SetMsgs(msg1)) require.NoError(t, b.SetPubKey(pub1)) - b.SetTip(tip) b.SetAddress(addr1.String()) err := b.SetSignMode(signing.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) require.NoError(t, err) @@ -250,7 +231,6 @@ func checkCorrectData(t *testing.T, cdc codec.Codec, auxSignerData typestx.AuxSi require.Equal(t, chainID, auxSignerData.SignDoc.ChainId) require.Equal(t, msgAny, body.GetMessages()[0]) require.Equal(t, pkAny, auxSignerData.SignDoc.PublicKey) - require.Equal(t, tip, auxSignerData.SignDoc.Tip) require.Equal(t, signMode, auxSignerData.Mode) require.Equal(t, rawSig, auxSignerData.Sig) } diff --git a/client/tx/factory.go b/client/tx/factory.go index f30c8216c21..eca55c08600 100644 --- a/client/tx/factory.go +++ b/client/tx/factory.go @@ -18,7 +18,6 @@ import ( "github.com/cosmos/cosmos-sdk/crypto/keys/secp256k1" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -38,7 +37,6 @@ type Factory struct { generateOnly bool memo string fees sdk.Coins - tip *tx.Tip feeGranter sdk.AccAddress feePayer sdk.AccAddress gasPrices sdk.DecCoins @@ -105,12 +103,16 @@ func NewFactoryCLI(clientCtx client.Context, flagSet *pflag.FlagSet) (Factory, e feesStr, _ := flagSet.GetString(flags.FlagFees) f = f.WithFees(feesStr) +<<<<<<< HEAD tipsStr, _ := flagSet.GetString(flags.FlagTip) // Add tips to factory. The tipper is necessarily the Msg signer, i.e. // the from address. f = f.WithTips(tipsStr, clientCtx.FromAddress.String()) gasPricesStr, _ := flagSet.GetString(flags.FlagGasPrices) +======= + gasPricesStr := clientCtx.Viper.GetString(flags.FlagGasPrices) +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) f = f.WithGasPrices(gasPricesStr) f = f.WithPreprocessTxHook(clientCtx.PreprocessTxHook) @@ -169,20 +171,6 @@ func (f Factory) WithFees(fees string) Factory { return f } -// WithTips returns a copy of the Factory with an updated tip. -func (f Factory) WithTips(tip, tipper string) Factory { - parsedTips, err := sdk.ParseCoinsNormalized(tip) - if err != nil { - panic(err) - } - - f.tip = &tx.Tip{ - Tipper: tipper, - Amount: parsedTips, - } - return f -} - // WithGasPrices returns a copy of the Factory with updated gas prices. func (f Factory) WithGasPrices(gasPrices string) Factory { parsedGasPrices, err := sdk.ParseDecCoins(gasPrices) diff --git a/client/tx/legacy_test.go b/client/tx/legacy_test.go index 2e337088cf2..53751d4d90d 100644 --- a/client/tx/legacy_test.go +++ b/client/tx/legacy_test.go @@ -3,7 +3,6 @@ package tx_test import ( "github.com/cosmos/cosmos-sdk/testutil/testdata" "github.com/cosmos/cosmos-sdk/types" - typestx "github.com/cosmos/cosmos-sdk/types/tx" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" ) @@ -19,5 +18,4 @@ var ( msg1 = banktypes.NewMsgSend(addr1, addr2, types.NewCoins(types.NewInt64Coin("wack", 2))) chainID = "test-chain" - tip = &typestx.Tip{Tipper: addr1.String(), Amount: testdata.NewTestFeeAmount()} ) diff --git a/client/tx/tx.go b/client/tx/tx.go index d9446906c42..c86b4a0d733 100644 --- a/client/tx/tx.go +++ b/client/tx/tx.go @@ -393,6 +393,7 @@ func makeAuxSignerData(clientCtx client.Context, f Factory, msgs ...sdk.Msg) (tx return tx.AuxSignerData{}, err } +<<<<<<< HEAD if f.tip != nil { if _, err := sdk.AccAddressFromBech32(f.tip.Tipper); err != nil { return tx.AuxSignerData{}, sdkerrors.ErrInvalidAddress.Wrap("tipper must be a bech32 address") @@ -400,6 +401,8 @@ func makeAuxSignerData(clientCtx client.Context, f Factory, msgs ...sdk.Msg) (tx b.SetTip(f.tip) } +======= +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) err = b.SetSignMode(f.SignMode()) if err != nil { return tx.AuxSignerData{}, err diff --git a/client/tx/tx_test.go b/client/tx/tx_test.go index 1cb480b3c5b..36ece26b92d 100644 --- a/client/tx/tx_test.go +++ b/client/tx/tx_test.go @@ -9,8 +9,6 @@ import ( "github.com/stretchr/testify/require" "google.golang.org/grpc" - "cosmossdk.io/math" - "github.com/cosmos/cosmos-sdk/client" "github.com/cosmos/cosmos-sdk/client/tx" "github.com/cosmos/cosmos-sdk/codec" @@ -388,22 +386,12 @@ func TestPreprocessHook(t *testing.T) { extAny, err := codectypes.NewAnyWithValue(extVal) requireT.NoError(err) - coin := sdk.Coin{ - Denom: "atom", - Amount: math.NewInt(20), - } - newTip := &txtypes.Tip{ - Amount: sdk.Coins{coin}, - Tipper: "galaxy", - } - preprocessHook := client.PreprocessTxFn(func(chainID string, key keyring.KeyType, tx client.TxBuilder) error { extensionBuilder, ok := tx.(authtx.ExtensionOptionsTxBuilder) requireT.True(ok) // Set new extension and tip extensionBuilder.SetExtensionOptions(extAny) - tx.SetTip(newTip) return nil }) @@ -435,9 +423,6 @@ func TestPreprocessHook(t *testing.T) { opt := hasExtOptsTx.GetExtensionOptions()[0] requireT.Equal(opt, extAny) - - tip := txb.GetTx().GetTip() - requireT.Equal(tip, newTip) } func testSigners(require *require.Assertions, tr signing.Tx, pks ...cryptotypes.PubKey) []signingtypes.SignatureV2 { diff --git a/client/tx_config.go b/client/tx_config.go index 4f6af35fa2a..4dd1caa0139 100644 --- a/client/tx_config.go +++ b/client/tx_config.go @@ -47,7 +47,6 @@ type ( SetFeeAmount(amount sdk.Coins) SetFeePayer(feePayer sdk.AccAddress) SetGasLimit(limit uint64) - SetTip(tip *tx.Tip) SetTimeoutHeight(height uint64) SetFeeGranter(feeGranter sdk.AccAddress) AddAuxSignerData(tx.AuxSignerData) error diff --git a/docs/docs/develop/advanced/00-baseapp.md b/docs/docs/develop/advanced/00-baseapp.md index 293a82928af..7121991e977 100644 --- a/docs/docs/develop/advanced/00-baseapp.md +++ b/docs/docs/develop/advanced/00-baseapp.md @@ -412,7 +412,8 @@ First, it retrieves the `sdk.Msg`'s fully-qualified type name, by checking the ` `PostHandler` is similar to `AnteHandler`, but it, as the name suggests, executes custom post tx processing logic after [`RunMsgs`](#runmsgs) is called. `PostHandler` receives the `Result` of the the `RunMsgs` in order to enable this customizable behavior. -Like `AnteHandler`s, `PostHandler`s are theoretically optional, one use case for `PostHandler`s is transaction tips (enabled by default in simapp). +Like `AnteHandler`s, `PostHandler`s are theoretically optional. + Other use cases like unused gas refund can also be enabled by `PostHandler`s. ```go reference diff --git a/docs/docs/develop/advanced/01-transactions.md b/docs/docs/develop/advanced/01-transactions.md index eee4fae3797..1901675fbcb 100644 --- a/docs/docs/develop/advanced/01-transactions.md +++ b/docs/docs/develop/advanced/01-transactions.md @@ -91,7 +91,6 @@ https://github.com/cosmos/cosmos-sdk/blob/v0.50.0-alpha.0/proto/cosmos/tx/v1beta The use case is a multi-signer transaction, where one of the signers is appointed to gather all signatures, broadcast the signature and pay for fees, and the others only care about the transaction body. This generally allows for a better multi-signing UX. If Alice, Bob and Charlie are part of a 3-signer transaction, then Alice and Bob can both use `SIGN_MODE_DIRECT_AUX` to sign over the `TxBody` and their own signer info (no need an additional step to gather other signers' ones, like in `SIGN_MODE_DIRECT`), without specifying a fee in their SignDoc. Charlie can then gather both signatures from Alice and Bob, and create the final transaction by appending a fee. Note that the fee payer of the transaction (in our case Charlie) must sign over the fees, so must use `SIGN_MODE_DIRECT` or `SIGN_MODE_LEGACY_AMINO_JSON`. -A concrete use case is implemented in [transaction tips](./14-tips.md): the tipper may use `SIGN_MODE_DIRECT_AUX` to specify a tip in the transaction, without signing over the actual transaction fees. Then, the fee payer appends fees inside the tipper's desired `TxBody`, and as an exchange for paying the fees and broadcasting the transaction, receives the tipper's transaction tips as payment. #### `SIGN_MODE_TEXTUAL` diff --git a/proto/cosmos/tx/signing/v1beta1/signing.proto b/proto/cosmos/tx/signing/v1beta1/signing.proto index faad739b5aa..06ab80d8075 100644 --- a/proto/cosmos/tx/signing/v1beta1/signing.proto +++ b/proto/cosmos/tx/signing/v1beta1/signing.proto @@ -32,8 +32,7 @@ enum SignMode { // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. + // require signers signing over other signers' `signer_info`. // // Since: cosmos-sdk 0.46 SIGN_MODE_DIRECT_AUX = 3; diff --git a/proto/cosmos/tx/v1beta1/tx.proto b/proto/cosmos/tx/v1beta1/tx.proto index 9ac0d932a3e..cfaac70449f 100644 --- a/proto/cosmos/tx/v1beta1/tx.proto +++ b/proto/cosmos/tx/v1beta1/tx.proto @@ -88,13 +88,8 @@ message SignDocDirectAux { // sequence is the sequence number of the signing account. uint64 sequence = 5; - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. - // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. - Tip tip = 6; + // tips have been depreacted and should not be used + Tip tip = 6 [deprecated = true]; } // TxBody is the body of a transaction that all signers sign over. @@ -142,14 +137,13 @@ message AuthInfo { // based on the cost of evaluating the body and doing signature verification // of the signers. This can be estimated via simulation. Fee fee = 2; - // Tip is the optional tip used for transactions fees paid in another denom. // // This field is ignored if the chain didn't enable tips, i.e. didn't add the // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 - Tip tip = 3; + Tip tip = 3 [deprecated = true]; } // SignerInfo describes the public key and signing mode of a single top-level @@ -232,6 +226,7 @@ message Fee { // // Since: cosmos-sdk 0.46 message Tip { + option deprecated = true; // amount is the amount of the tip repeated cosmos.base.v1beta1.Coin amount = 1 [ (gogoproto.nullable) = false, diff --git a/simapp/app.go b/simapp/app.go index fce1f00f881..6bb39872312 100644 --- a/simapp/app.go +++ b/simapp/app.go @@ -513,12 +513,7 @@ func NewSimApp( // meaning that both `runMsgs` and `postHandler` state will be committed if // both are successful, and both will be reverted if any of the two fails. // - // The SDK exposes a default postHandlers chain, which comprises of only - // one decorator: the Transaction Tips decorator. However, some chains do - // not need it by default, so feel free to comment the next line if you do - // not need tips. - // To read more about tips: - // https://docs.cosmos.network/main/core/tips.html + // The SDK exposes a default postHandlers chain // // Please note that changing any of the anteHandler or postHandler chain is // likely to be a state-machine breaking change, which needs a coordinated diff --git a/simapp/simd/cmd/commands.go b/simapp/simd/cmd/commands.go index 3b8c93cca32..1cf34155810 100644 --- a/simapp/simd/cmd/commands.go +++ b/simapp/simd/cmd/commands.go @@ -188,7 +188,6 @@ func txCommand() *cobra.Command { authcmd.GetBroadcastCommand(), authcmd.GetEncodeCommand(), authcmd.GetDecodeCommand(), - authcmd.GetAuxToFeeCommand(), authcmd.GetSimulateCmd(), ) diff --git a/tests/e2e/auth/suite.go b/tests/e2e/auth/suite.go index c39f7130a63..fd12683c485 100644 --- a/tests/e2e/auth/suite.go +++ b/tests/e2e/auth/suite.go @@ -1676,12 +1676,6 @@ func (s *E2ETestSuite) TestAuxToFeeWithTips() { genTxFile := testutil.WriteToNewTempFile(s.T(), string(res.Bytes())) defer genTxFile.Close() - // broadcast the tx - res, err = authclitestutil.TxAuxToFeeExec( - val.ClientCtx, - genTxFile.Name(), - tc.feePayerArgs..., - ) s.Require().NoError(s.network.WaitForNextBlock()) switch { diff --git a/tests/integration/auth/client/cli/suite_test.go b/tests/integration/auth/client/cli/suite_test.go index f618c64b8d6..937ae914ad3 100644 --- a/tests/integration/auth/client/cli/suite_test.go +++ b/tests/integration/auth/client/cli/suite_test.go @@ -1204,13 +1204,6 @@ func (s *CLITestSuite) TestAuxToFeeWithTips() { genTxFile := testutil.WriteToNewTempFile(s.T(), string(res.Bytes())) defer genTxFile.Close() - // broadcast the tx - res, err = authtestutil.TxAuxToFeeExec( - s.clientCtx, - genTxFile.Name(), - tc.feePayerArgs..., - ) - switch { case tc.expectErrBroadCast: require.Error(err) diff --git a/tests/integration/tx/aminojson/aminojson_test.go b/tests/integration/tx/aminojson/aminojson_test.go index 485b2ee36ec..9d18372efd6 100644 --- a/tests/integration/tx/aminojson/aminojson_test.go +++ b/tests/integration/tx/aminojson/aminojson_test.go @@ -49,7 +49,6 @@ import ( "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/bech32" "github.com/cosmos/cosmos-sdk/types/module/testutil" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" @@ -149,10 +148,6 @@ func TestAminoJSON_Equivalence(t *testing.T) { AccNum: 1, AccSeq: 2, SignerAddress: "signerAddress", - Tip: &txv1beta1.Tip{ - Tipper: "tipper", - Amount: []*v1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, - }, Fee: &txv1beta1.Fee{ Amount: []*v1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, }, @@ -170,10 +165,6 @@ func TestAminoJSON_Equivalence(t *testing.T) { require.NoError(t, txBuilder.SetMsgs([]types.Msg{tt.Gogo}...)) txBuilder.SetMemo(handlerOptions.Memo) txBuilder.SetFeeAmount(types.Coins{types.NewInt64Coin("uatom", 1000)}) - txBuilder.SetTip(&txtypes.Tip{ - Amount: types.Coins{types.NewInt64Coin("uatom", 1000)}, - Tipper: "tipper", - }) theTx := txBuilder.GetTx() legacySigningData := signing.SignerData{ diff --git a/types/tx/direct_aux.go b/types/tx/direct_aux.go index 73189ff840c..de6346fbf03 100644 --- a/types/tx/direct_aux.go +++ b/types/tx/direct_aux.go @@ -17,12 +17,6 @@ func (s *SignDocDirectAux) ValidateBasic() error { return sdkerrors.ErrInvalidPubKey.Wrap("public key cannot be empty") } - if s.Tip != nil { - if s.Tip.Tipper == "" { - return sdkerrors.ErrInvalidRequest.Wrap("tipper cannot be empty") - } - } - return nil } diff --git a/types/tx/direct_aux_test.go b/types/tx/direct_aux_test.go index 5f8c7aefc33..f9e90b8e27e 100644 --- a/types/tx/direct_aux_test.go +++ b/types/tx/direct_aux_test.go @@ -14,7 +14,7 @@ import ( func TestSignDocDirectAux(t *testing.T) { bodyBz := []byte{42} - _, pk, addr := testdata.KeyTestPubAddr() + _, pk, _ := testdata.KeyTestPubAddr() pkAny, err := codectypes.NewAnyWithValue(pk) require.NoError(t, err) @@ -25,12 +25,10 @@ func TestSignDocDirectAux(t *testing.T) { }{ {"empty bodyBz", tx.SignDocDirectAux{}, true}, {"empty pubkey", tx.SignDocDirectAux{BodyBytes: bodyBz}, true}, - {"empty tipper", tx.SignDocDirectAux{BodyBytes: bodyBz, PublicKey: pkAny, Tip: &tx.Tip{Amount: testdata.NewTestFeeAmount()}}, true}, {"happy case w/o tip", tx.SignDocDirectAux{BodyBytes: bodyBz, PublicKey: pkAny}, false}, {"happy case w/ tip", tx.SignDocDirectAux{ BodyBytes: bodyBz, PublicKey: pkAny, - Tip: &tx.Tip{Tipper: addr.String(), Amount: testdata.NewTestFeeAmount()}, }, false}, } diff --git a/types/tx/signing/signing.pb.go b/types/tx/signing/signing.pb.go index 54beb1b1fbf..02f64a4824d 100644 --- a/types/tx/signing/signing.pb.go +++ b/types/tx/signing/signing.pb.go @@ -49,8 +49,7 @@ const ( SignMode_SIGN_MODE_TEXTUAL SignMode = 2 // SIGN_MODE_DIRECT_AUX specifies a signing mode which uses // SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - // require signers signing over other signers' `signer_info`. It also allows - // for adding Tips in transactions. + // require signers signing over other signers' `signer_info`. // // Since: cosmos-sdk 0.46 SignMode_SIGN_MODE_DIRECT_AUX SignMode = 3 diff --git a/types/tx/tips.go b/types/tx/tips.go deleted file mode 100644 index ca8afb36d5a..00000000000 --- a/types/tx/tips.go +++ /dev/null @@ -1,11 +0,0 @@ -package tx - -import ( - sdk "github.com/cosmos/cosmos-sdk/types" -) - -// TipTx defines the interface to be implemented by Txs that handle Tips. -type TipTx interface { - sdk.FeeTx - GetTip() *Tip -} diff --git a/types/tx/tx.pb.go b/types/tx/tx.pb.go index 6782890cc9e..8173108d390 100644 --- a/types/tx/tx.pb.go +++ b/types/tx/tx.pb.go @@ -264,13 +264,8 @@ type SignDocDirectAux struct { AccountNumber uint64 `protobuf:"varint,4,opt,name=account_number,json=accountNumber,proto3" json:"account_number,omitempty"` // sequence is the sequence number of the signing account. Sequence uint64 `protobuf:"varint,5,opt,name=sequence,proto3" json:"sequence,omitempty"` - // Tip is the optional tip used for transactions fees paid in another denom. - // It should be left empty if the signer is not the tipper for this - // transaction. - // - // This field is ignored if the chain didn't enable tips, i.e. didn't add the - // `TipDecorator` in its posthandler. - Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` + // tips have been depreacted and should not be used + Tip *Tip `protobuf:"bytes,6,opt,name=tip,proto3" json:"tip,omitempty"` // Deprecated: Do not use. } func (m *SignDocDirectAux) Reset() { *m = SignDocDirectAux{} } @@ -341,6 +336,7 @@ func (m *SignDocDirectAux) GetSequence() uint64 { return 0 } +// Deprecated: Do not use. func (m *SignDocDirectAux) GetTip() *Tip { if m != nil { return m.Tip @@ -462,7 +458,7 @@ type AuthInfo struct { // `TipDecorator` in its posthandler. // // Since: cosmos-sdk 0.46 - Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` + Tip *Tip `protobuf:"bytes,3,opt,name=tip,proto3" json:"tip,omitempty"` // Deprecated: Do not use. } func (m *AuthInfo) Reset() { *m = AuthInfo{} } @@ -512,6 +508,7 @@ func (m *AuthInfo) GetFee() *Fee { return nil } +// Deprecated: Do not use. func (m *AuthInfo) GetTip() *Tip { if m != nil { return m.Tip @@ -866,6 +863,8 @@ func (m *Fee) GetGranter() string { // Tip is the tip used for meta-transactions. // // Since: cosmos-sdk 0.46 +// +// Deprecated: Do not use. type Tip struct { // amount is the amount of the tip Amount github_com_cosmos_cosmos_sdk_types.Coins `protobuf:"bytes,1,rep,name=amount,proto3,castrepeated=github.com/cosmos/cosmos-sdk/types.Coins" json:"amount"` @@ -1021,73 +1020,74 @@ func init() { func init() { proto.RegisterFile("cosmos/tx/v1beta1/tx.proto", fileDescriptor_96d1575ffde80842) } var fileDescriptor_96d1575ffde80842 = []byte{ - // 1052 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, 0xaa, 0x9b, 0xbf, - 0xab, 0x82, 0x55, 0x29, 0xbb, 0x6d, 0x7a, 0xa0, 0x20, 0x04, 0xd8, 0x0d, 0x51, 0xaa, 0x52, 0x90, - 0x36, 0x39, 0xf5, 0xb2, 0x1a, 0xaf, 0x27, 0xeb, 0x51, 0xbd, 0x33, 0xcb, 0xce, 0x2c,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6e, - 0x74, 0x76, 0x92, 0x79, 0x4b, 0xc2, 0x0c, 0xdc, 0xe2, 0x45, 0xd8, 0x7f, 0xf3, 0x45, 0xa0, 0x55, - 0xb0, 0x05, 0x0d, 0x75, 0x8d, 0x96, 0x3d, 0xb5, 0x1c, 0xbe, 0xfb, 0xe4, 0xb8, 0x6b, 0x3d, 0x3d, - 0xee, 0x5a, 0xcf, 0x8e, 0xbb, 0xd6, 0xa3, 0x93, 0x6e, 0xe5, 0xe9, 0x49, 0xb7, 0xf2, 0xf3, 0x49, - 0xb7, 0xf2, 0xe0, 0xda, 0xe2, 0x24, 0xbb, 0x72, 0x36, 0x6a, 0xe8, 0xe6, 0x74, 0xeb, 0x8f, 0x00, - 0x00, 0x00, 0xff, 0xff, 0x1f, 0x66, 0x4c, 0xda, 0x17, 0x0a, 0x00, 0x00, + // 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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, 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, } func (m *Tx) Marshal() (dAtA []byte, err error) { diff --git a/x/auth/README.md b/x/auth/README.md index 4b5a2ad1f45..1d5e22b5d87 100644 --- a/x/auth/README.md +++ b/x/auth/README.md @@ -481,17 +481,6 @@ simd tx broadcast tx.signed.json More information about the `broadcast` command can be found running `simd tx broadcast --help`. -#### `aux-to-fee` - -The `aux-to-fee` comamnds includes the aux signer data in the tx, broadcast the tx, and sends the tip amount to the broadcaster. -[Learn more about tip transaction](https://docs.cosmos.network/main/core/tips). - -```bash -# simd tx bank send --aux (optional: --tip --tipper ) -simd tx aux-to-fee tx.aux.signed.json -``` - -More information about the `aux-to-fee` command can be found running `simd tx aux-to-fee --help`. ### gRPC diff --git a/x/auth/client/cli/tips.go b/x/auth/client/cli/tips.go deleted file mode 100644 index 82904c6ab06..00000000000 --- a/x/auth/client/cli/tips.go +++ /dev/null @@ -1,93 +0,0 @@ -package cli - -import ( - "fmt" - "os" - - "github.com/spf13/cobra" - - "github.com/cosmos/cosmos-sdk/client" - "github.com/cosmos/cosmos-sdk/client/flags" - clienttx "github.com/cosmos/cosmos-sdk/client/tx" - "github.com/cosmos/cosmos-sdk/codec" - "github.com/cosmos/cosmos-sdk/types/tx" - authclient "github.com/cosmos/cosmos-sdk/x/auth/client" -) - -func GetAuxToFeeCommand() *cobra.Command { - cmd := &cobra.Command{ - Use: "aux-to-fee ", - Short: "Includes the aux signer data in the tx, broadcast the tx, and sends the tip amount to the broadcaster", - Args: cobra.ExactArgs(1), - RunE: func(cmd *cobra.Command, args []string) error { - clientCtx, err := client.GetClientTxContext(cmd) - if err != nil { - return err - } - - auxSignerData := tx.AuxSignerData{} - err = readAuxSignerData(clientCtx.Codec, &auxSignerData, args[0]) - if err != nil { - return err - } - - if auxSignerData.SignDoc.ChainId != clientCtx.ChainID { - return fmt.Errorf("expected chain-id %s, got %s in aux signer data", clientCtx.ChainID, auxSignerData.SignDoc.ChainId) - } - - f, err := clienttx.NewFactoryCLI(clientCtx, cmd.Flags()) - if err != nil { - return err - } - - txBuilder := clientCtx.TxConfig.NewTxBuilder() - err = txBuilder.AddAuxSignerData(auxSignerData) - if err != nil { - return err - } - - txBuilder.SetFeePayer(clientCtx.FromAddress) - txBuilder.SetFeeAmount(f.Fees()) - txBuilder.SetGasLimit(f.Gas()) - - if clientCtx.GenerateOnly { - json, err := clientCtx.TxConfig.TxJSONEncoder()(txBuilder.GetTx()) - if err != nil { - return err - } - return clientCtx.PrintString(fmt.Sprintf("%s\n", json)) - } - - err = authclient.SignTx(f, clientCtx, clientCtx.FromName, txBuilder, clientCtx.Offline, false) - if err != nil { - return err - } - - txBytes, err := clientCtx.TxConfig.TxEncoder()(txBuilder.GetTx()) - if err != nil { - return err - } - - // broadcast to a CometBFT node - res, err := clientCtx.BroadcastTx(txBytes) - if err != nil { - return err - } - - return clientCtx.PrintProto(res) - }, - } - - flags.AddTxFlagsToCmd(cmd) - - return cmd -} - -func readAuxSignerData(cdc codec.Codec, auxSignerData *tx.AuxSignerData, filename string) error { - bytes, err := os.ReadFile(filename) - if err != nil { - return err - } - - return cdc.UnmarshalJSON(bytes, auxSignerData) -} diff --git a/x/auth/client/testutil/helpers.go b/x/auth/client/testutil/helpers.go index 8ca44048cbd..092b061a83c 100644 --- a/x/auth/client/testutil/helpers.go +++ b/x/auth/client/testutil/helpers.go @@ -80,15 +80,6 @@ func TxDecodeExec(clientCtx client.Context, encodedTx string, extraArgs ...strin return clitestutil.ExecTestCLICmd(clientCtx, cli.GetDecodeCommand(), append(args, extraArgs...)) } -// TxAuxToFeeExec executes `GetAuxToFeeCommand` cli command with given args. -func TxAuxToFeeExec(clientCtx client.Context, filename string, extraArgs ...string) (testutil.BufferWriter, error) { - args := []string{ - filename, - } - - return clitestutil.ExecTestCLICmd(clientCtx, cli.GetAuxToFeeCommand(), append(args, extraArgs...)) -} - func TxMultiSignBatchExec(clientCtx client.Context, filename, from, sigFile1, sigFile2 string, extraArgs ...string) (testutil.BufferWriter, error) { args := []string{ fmt.Sprintf("--%s=%s", flags.FlagKeyringBackend, keyring.BackendTest), diff --git a/x/auth/migrations/legacytx/stdsign.go b/x/auth/migrations/legacytx/stdsign.go index 5d489837bc8..e5a4e454cb9 100644 --- a/x/auth/migrations/legacytx/stdsign.go +++ b/x/auth/migrations/legacytx/stdsign.go @@ -14,7 +14,6 @@ import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/crypto/types/multisig" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -41,7 +40,6 @@ type StdSignDoc struct { Memo string `json:"memo" yaml:"memo"` Fee json.RawMessage `json:"fee" yaml:"fee"` Msgs []json.RawMessage `json:"msgs" yaml:"msgs"` - Tip *StdTip `json:"tip,omitempty" yaml:"tip"` } var RegressionTestingAminoCodec *codec.LegacyAmino @@ -62,7 +60,7 @@ func mustSortJSON(bz []byte) []byte { // StdSignBytes returns the bytes to sign for a transaction. // Deprecated: Please use x/tx/signing/aminojson instead. -func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string, tip *tx.Tip) []byte { +func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgs []sdk.Msg, memo string) []byte { if RegressionTestingAminoCodec == nil { panic(fmt.Errorf("must set RegressionTestingAminoCodec before calling StdSignBytes")) } @@ -72,15 +70,6 @@ func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, msgsBytes = append(msgsBytes, mustSortJSON(bz)) } - var stdTip *StdTip - if tip != nil { - if tip.Tipper == "" { - panic(fmt.Errorf("tipper cannot be empty")) - } - - stdTip = &StdTip{Amount: tip.Amount, Tipper: tip.Tipper} - } - bz, err := legacy.Cdc.MarshalJSON(StdSignDoc{ AccountNumber: accnum, ChainID: chainID, @@ -89,7 +78,6 @@ func StdSignBytes(chainID string, accnum, sequence, timeout uint64, fee StdFee, Msgs: msgsBytes, Sequence: sequence, TimeoutHeight: timeout, - Tip: stdTip, }) if err != nil { panic(err) diff --git a/x/auth/migrations/legacytx/stdtx.go b/x/auth/migrations/legacytx/stdtx.go index d2a16cfb0b1..900991c0145 100644 --- a/x/auth/migrations/legacytx/stdtx.go +++ b/x/auth/migrations/legacytx/stdtx.go @@ -8,7 +8,6 @@ import ( codectypes "github.com/cosmos/cosmos-sdk/codec/types" cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -170,9 +169,6 @@ func (tx StdTx) FeeGranter() sdk.AccAddress { return nil } -// GetTip always returns nil for StdTx -func (tx StdTx) GetTip() *tx.Tip { return nil } - func (tx StdTx) UnpackInterfaces(unpacker codectypes.AnyUnpacker) error { for _, m := range tx.Msgs { err := codectypes.UnpackInterfaces(m, unpacker) diff --git a/x/auth/migrations/legacytx/stdtx_builder.go b/x/auth/migrations/legacytx/stdtx_builder.go index 80d3450a441..3965c79cc72 100644 --- a/x/auth/migrations/legacytx/stdtx_builder.go +++ b/x/auth/migrations/legacytx/stdtx_builder.go @@ -45,10 +45,6 @@ func (s *StdTxBuilder) SetGasLimit(limit uint64) { s.StdTx.Fee.Gas = limit } -func (s *StdTxBuilder) SetTip(tip *tx.Tip) { - panic("StdTxBuilder does not support tips") -} - // SetMemo implements TxBuilder.SetMemo func (s *StdTxBuilder) SetMemo(memo string) { s.Memo = memo diff --git a/x/auth/migrations/legacytx/stdtx_test.go b/x/auth/migrations/legacytx/stdtx_test.go index b7ad91da34b..f49357ca639 100644 --- a/x/auth/migrations/legacytx/stdtx_test.go +++ b/x/auth/migrations/legacytx/stdtx_test.go @@ -39,16 +39,11 @@ func TestStdSignBytes(t *testing.T) { fee *txv1beta1.Fee msgs []sdk.Msg memo string - tip *txv1beta1.Tip } defaultFee := &txv1beta1.Fee{ Amount: []*basev1beta1.Coin{{Denom: "atom", Amount: "150"}}, GasLimit: 100000, } - defaultTip := &txv1beta1.Tip{ - Amount: []*basev1beta1.Coin{{Denom: "tiptoken", Amount: "150"}}, - Tipper: addr.String(), - } msgStr := fmt.Sprintf(`{"type":"testpb/TestMsg","value":{"signers":["%s"]}}`, addr) tests := []struct { name string @@ -57,54 +52,39 @@ func TestStdSignBytes(t *testing.T) { }{ { "with timeout height", - args{"1234", 3, 6, 10, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 10, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","timeout_height":"10"}`, msgStr), }, { "no timeout height (omitempty)", - args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr), }, { "empty fee", - args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr), }, { "no fee payer and fee granter (both omitempty)", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6"}`, msgStr), }, { "with fee granter, no fee payer (omitempty)", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, msgStr), }, { "with fee payer, no fee granter (omitempty)", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, msgStr), }, { "with fee payer and fee granter", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", nil}, + args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String(), Granter: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo"}, fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","granter":"%s","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6"}`, addr, addr, msgStr), }, - { - "no fee, with tip", - args{"1234", 3, 6, 0, &txv1beta1.Fee{}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, msgStr, addr), - }, - { - "with fee and with tip", - args{"1234", 3, 6, 0, &txv1beta1.Fee{Amount: defaultFee.Amount, GasLimit: defaultFee.GasLimit, Payer: addr.String()}, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", defaultTip}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000","payer":"%s"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[{"amount":"150","denom":"tiptoken"}],"tipper":"%s"}}`, addr, msgStr, addr), - }, - { - "with empty tip (but not nil), tipper cannot be empty", - args{"1234", 3, 6, 0, defaultFee, []sdk.Msg{testdata.NewTestMsg(addr)}, "memo", &txv1beta1.Tip{Tipper: addr.String()}}, - fmt.Sprintf(`{"account_number":"3","chain_id":"1234","fee":{"amount":[{"amount":"150","denom":"atom"}],"gas":"100000"},"memo":"memo","msgs":[%s],"sequence":"6","tip":{"amount":[],"tipper":"%s"}}`, msgStr, addr), - }, } handler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{ FileResolver: proto.HybridResolver, @@ -137,7 +117,6 @@ func TestStdSignBytes(t *testing.T) { }, AuthInfo: &txv1beta1.AuthInfo{ Fee: tc.args.fee, - Tip: tc.args.tip, }, }, ) diff --git a/x/auth/posthandler/tips.go b/x/auth/posthandler/tips.go deleted file mode 100644 index 33a5f69e908..00000000000 --- a/x/auth/posthandler/tips.go +++ /dev/null @@ -1,58 +0,0 @@ -package posthandler - -import ( - "fmt" - - sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" - "github.com/cosmos/cosmos-sdk/x/auth/types" -) - -// ValidateBasicDecorator will call tx.ValidateBasic and return any non-nil error. -// If ValidateBasic passes, decorator calls next AnteHandler in chain. Note, -// ValidateBasicDecorator decorator will not get executed on ReCheckTx since it -// is not dependent on application state. -type tipDecorator struct { - bankKeeper types.BankKeeper -} - -// NewTipDecorator returns a new decorator for handling transactions with -// tips. -// -// IMPORTANT: This decorator is still in beta, please use it at your own risk. -func NewTipDecorator(bankKeeper types.BankKeeper) sdk.AnteDecorator { - return tipDecorator{ - bankKeeper: bankKeeper, - } -} - -func (d tipDecorator) AnteHandle(ctx sdk.Context, tx sdk.Tx, simulate bool, next sdk.AnteHandler) (sdk.Context, error) { - err := d.transferTip(ctx, tx) - if err != nil { - return ctx, err - } - - return next(ctx, tx, simulate) -} - -// transferTip transfers the tip from the tipper to the fee payer. -func (d tipDecorator) transferTip(ctx sdk.Context, sdkTx sdk.Tx) error { - tipTx, ok := sdkTx.(tx.TipTx) - - // No-op if the tx doesn't have tips. - if !ok || tipTx.GetTip() == nil { - return nil - } - - tipper, err := sdk.AccAddressFromBech32(tipTx.GetTip().Tipper) - if err != nil { - return err - } - - coins := tipTx.GetTip().Amount - if err := d.bankKeeper.IsSendEnabledCoins(ctx, coins...); err != nil { - return fmt.Errorf("cannot tip these coins: %w", err) - } - - return d.bankKeeper.SendCoins(ctx, tipper, tipTx.FeePayer(), coins) -} diff --git a/x/auth/signing/sig_verifiable_tx.go b/x/auth/signing/sig_verifiable_tx.go index 7aa05219f1c..0b6da14aff5 100644 --- a/x/auth/signing/sig_verifiable_tx.go +++ b/x/auth/signing/sig_verifiable_tx.go @@ -3,7 +3,6 @@ package signing import ( cryptotypes "github.com/cosmos/cosmos-sdk/crypto/types" "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" ) @@ -23,7 +22,6 @@ type Tx interface { types.TxWithMemo types.FeeTx - tx.TipTx types.TxWithTimeoutHeight types.HasValidateBasic } diff --git a/x/auth/tx/adapter.go b/x/auth/tx/adapter.go index 50081fdbde3..5ce5c8a9198 100644 --- a/x/auth/tx/adapter.go +++ b/x/auth/tx/adapter.go @@ -54,23 +54,6 @@ func (w *wrapper) GetSigningTxData() txsigning.TxData { } } - var txTip *txv1beta1.Tip - tip := authInfo.Tip - if tip != nil { - tipCoins := tip.GetAmount() - tipAmount := make([]*basev1beta1.Coin, len(tipCoins)) - for i, coin := range tipCoins { - tipAmount[i] = &basev1beta1.Coin{ - Denom: coin.Denom, - Amount: coin.Amount.String(), - } - } - txTip = &txv1beta1.Tip{ - Amount: tipAmount, - Tipper: tip.Tipper, - } - } - txSignerInfos := make([]*txv1beta1.SignerInfo, len(authInfo.SignerInfos)) for i, signerInfo := range authInfo.SignerInfos { modeInfo := &txv1beta1.ModeInfo{} @@ -94,7 +77,6 @@ func (w *wrapper) GetSigningTxData() txsigning.TxData { Payer: authInfo.Fee.Payer, Granter: authInfo.Fee.Granter, }, - Tip: txTip, } txBody := &txv1beta1.TxBody{ diff --git a/x/auth/tx/aux_test.go b/x/auth/tx/aux_test.go index 1ee64ff7735..af802f37935 100644 --- a/x/auth/tx/aux_test.go +++ b/x/auth/tx/aux_test.go @@ -6,15 +6,12 @@ import ( "github.com/stretchr/testify/require" - "cosmossdk.io/math" - clienttx "github.com/cosmos/cosmos-sdk/client/tx" codectypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" _ "github.com/cosmos/cosmos-sdk/testutil/testdata/testpb" sdk "github.com/cosmos/cosmos-sdk/types" moduletestutil "github.com/cosmos/cosmos-sdk/types/module/testutil" - txtypes "github.com/cosmos/cosmos-sdk/types/tx" "github.com/cosmos/cosmos-sdk/types/tx/signing" authsigning "github.com/cosmos/cosmos-sdk/x/auth/signing" ) @@ -25,9 +22,9 @@ var ( aux2Priv, aux2Pk, aux2Addr = testdata.KeyTestPubAddr() feepayerPriv, feepayerPk, feepayerAddr = testdata.KeyTestPubAddr() - msg = testdata.NewTestMsg(tipperAddr, aux2Addr) - memo = "test-memo" - tip = &txtypes.Tip{Tipper: tipperAddr.String(), Amount: sdk.NewCoins(sdk.NewCoin("tip-denom", math.NewIntFromUint64(123)))} + msg = testdata.NewTestMsg(tipperAddr, aux2Addr) + memo = "test-memo" + chainID = "test-chain" gas = testdata.NewTestGasLimit() fee = testdata.NewTestFeeAmount() @@ -47,8 +44,8 @@ func TestBuilderWithAux(t *testing.T) { testdata.RegisterInterfaces(interfaceRegistry) // Create an AuxTxBuilder for tipper (1st signer) - tipperBuilder, tipperSig := makeTipperTxBuilder(t) - tipperSignerData, err := tipperBuilder.GetAuxSignerData() + txBuilder, txSig := makeTxBuilder(t) + txSignerData, err := txBuilder.GetAuxSignerData() require.NoError(t, err) // Create an AuxTxBuilder for aux2 (2nd signer) @@ -59,9 +56,16 @@ func TestBuilderWithAux(t *testing.T) { aux2Builder.SetTimeoutHeight(3) aux2Builder.SetMemo(memo) aux2Builder.SetChainID(chainID) +<<<<<<< HEAD aux2Builder.SetMsgs(msg) aux2Builder.SetPubKey(aux2Pk) aux2Builder.SetTip(tip) +======= + err = aux2Builder.SetMsgs(msg) + require.NoError(t, err) + err = aux2Builder.SetPubKey(aux2Pk) + require.NoError(t, err) +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) extOptAny, err := codectypes.NewAnyWithValue(extOpt) require.NoError(t, err) aux2Builder.SetExtensionOptions(extOptAny) @@ -90,30 +94,28 @@ func TestBuilderWithAux(t *testing.T) { malleate func() expErr bool }{ - {"address and msg signer mistacher", func() { tipperBuilder.SetAddress("foobar") }, true}, - {"memo mismatch", func() { tipperBuilder.SetMemo("mismatch") }, true}, - {"timeout height mismatch", func() { tipperBuilder.SetTimeoutHeight(98) }, true}, - {"extension options length mismatch", func() { tipperBuilder.SetExtensionOptions() }, true}, - {"extension options member mismatch", func() { tipperBuilder.SetExtensionOptions(&codectypes.Any{}) }, true}, - {"non-critical extension options length mismatch", func() { tipperBuilder.SetNonCriticalExtensionOptions() }, true}, - {"non-critical extension options member mismatch", func() { tipperBuilder.SetNonCriticalExtensionOptions(&codectypes.Any{}) }, true}, - {"tip amount mismatch", func() { tipperBuilder.SetTip(&txtypes.Tip{Tipper: tip.Tipper, Amount: sdk.NewCoins()}) }, true}, - {"tipper mismatch", func() { tipperBuilder.SetTip(&txtypes.Tip{Tipper: "mismatch", Amount: tip.Amount}) }, true}, + {"address and msg signer mistacher", func() { txBuilder.SetAddress("foobar") }, true}, + {"memo mismatch", func() { txBuilder.SetMemo("mismatch") }, true}, + {"timeout height mismatch", func() { txBuilder.SetTimeoutHeight(98) }, true}, + {"extension options length mismatch", func() { txBuilder.SetExtensionOptions() }, true}, + {"extension options member mismatch", func() { txBuilder.SetExtensionOptions(&codectypes.Any{}) }, true}, + {"non-critical extension options length mismatch", func() { txBuilder.SetNonCriticalExtensionOptions() }, true}, + {"non-critical extension options member mismatch", func() { txBuilder.SetNonCriticalExtensionOptions(&codectypes.Any{}) }, true}, {"happy case", func() {}, false}, } for _, tc := range testcases { tc := tc t.Run(tc.name, func(t *testing.T) { - tipperBuilder, tipperSig = makeTipperTxBuilder(t) + txBuilder, txSig = makeTxBuilder(t) tc.malleate() - _, err := tipperBuilder.GetSignBytes() + _, err := txBuilder.GetSignBytes() require.NoError(t, err) - tipperSignerData, err = tipperBuilder.GetAuxSignerData() + txSignerData, err = txBuilder.GetAuxSignerData() require.NoError(t, err) - err = w.AddAuxSignerData(tipperSignerData) + err = w.AddAuxSignerData(txSignerData) if tc.expErr { require.Error(t, err) } else { @@ -127,10 +129,14 @@ func TestBuilderWithAux(t *testing.T) { w.SetGasLimit(gas) sigs, err := w.(authsigning.SigVerifiableTx).GetSignaturesV2() require.NoError(t, err) - tipperSigV2 := sigs[0] + txSigV2 := sigs[0] aux2SigV2 := sigs[1] // Set all signer infos. +<<<<<<< HEAD w.SetSignatures(tipperSigV2, aux2SigV2, signing.SignatureV2{ +======= + err = w.SetSignatures(txSigV2, aux2SigV2, signing.SignatureV2{ +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) PubKey: feepayerPk, Sequence: 15, }) @@ -150,7 +156,11 @@ func TestBuilderWithAux(t *testing.T) { feepayerSig, err := feepayerPriv.Sign(signBz) require.NoError(t, err) // Set all signatures. +<<<<<<< HEAD w.SetSignatures(tipperSigV2, aux2SigV2, signing.SignatureV2{ +======= + err = w.SetSignatures(txSigV2, aux2SigV2, signing.SignatureV2{ +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) PubKey: feepayerPk, Data: &signing.SingleSignatureData{ SignMode: signing.SignMode_SIGN_MODE_DIRECT, @@ -167,7 +177,6 @@ func TestBuilderWithAux(t *testing.T) { require.Equal(t, tx.(sdk.FeeTx).FeePayer(), []byte(feepayerAddr)) require.Equal(t, tx.(sdk.FeeTx).GetFee(), fee) require.Equal(t, tx.(sdk.FeeTx).GetGas(), gas) - require.Equal(t, tip, tx.(txtypes.TipTx).GetTip()) require.Equal(t, msg, tx.GetMsgs()[0]) require.Equal(t, memo, tx.(sdk.TxWithMemo).GetMemo()) require.Equal(t, uint64(3), tx.(sdk.TxWithTimeoutHeight).GetTimeoutHeight()) @@ -176,7 +185,7 @@ func TestBuilderWithAux(t *testing.T) { require.Len(t, sigs, 3) require.Equal(t, signing.SignatureV2{ PubKey: tipperPk, - Data: &signing.SingleSignatureData{SignMode: signing.SignMode_SIGN_MODE_DIRECT_AUX, Signature: tipperSig}, + Data: &signing.SingleSignatureData{SignMode: signing.SignMode_SIGN_MODE_DIRECT_AUX, Signature: txSig}, Sequence: 2, }, sigs[0]) require.Equal(t, signing.SignatureV2{ @@ -191,6 +200,7 @@ func TestBuilderWithAux(t *testing.T) { }, sigs[2]) } +<<<<<<< HEAD func makeTipperTxBuilder(t *testing.T) (clienttx.AuxTxBuilder, []byte) { tipperBuilder := clienttx.NewAuxTxBuilder() tipperBuilder.SetAddress(tipperAddr.String()) @@ -202,17 +212,32 @@ func makeTipperTxBuilder(t *testing.T) (clienttx.AuxTxBuilder, []byte) { tipperBuilder.SetMsgs(msg) tipperBuilder.SetPubKey(tipperPk) tipperBuilder.SetTip(tip) +======= +func makeTxBuilder(t *testing.T) (clienttx.AuxTxBuilder, []byte) { + t.Helper() + txBuilder := clienttx.NewAuxTxBuilder() + txBuilder.SetAddress(tipperAddr.String()) + txBuilder.SetAccountNumber(1) + txBuilder.SetSequence(2) + txBuilder.SetTimeoutHeight(3) + txBuilder.SetMemo(memo) + txBuilder.SetChainID(chainID) + err := txBuilder.SetMsgs(msg) + require.NoError(t, err) + err = txBuilder.SetPubKey(tipperPk) + require.NoError(t, err) +>>>>>>> 6715b5afb (refactor!: remove tips (#17787)) extOptAny, err := codectypes.NewAnyWithValue(extOpt) require.NoError(t, err) - tipperBuilder.SetExtensionOptions(extOptAny) - tipperBuilder.SetNonCriticalExtensionOptions(extOptAny) - err = tipperBuilder.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX) + txBuilder.SetExtensionOptions(extOptAny) + txBuilder.SetNonCriticalExtensionOptions(extOptAny) + err = txBuilder.SetSignMode(signing.SignMode_SIGN_MODE_DIRECT_AUX) require.NoError(t, err) - signBz, err := tipperBuilder.GetSignBytes() + signBz, err := txBuilder.GetSignBytes() require.NoError(t, err) tipperSig, err := tipperPriv.Sign(signBz) require.NoError(t, err) - tipperBuilder.SetSignature(tipperSig) + txBuilder.SetSignature(tipperSig) - return tipperBuilder, tipperSig + return txBuilder, tipperSig } diff --git a/x/auth/tx/builder.go b/x/auth/tx/builder.go index 7f3a398e029..4d13c11e876 100644 --- a/x/auth/tx/builder.go +++ b/x/auth/tx/builder.go @@ -45,10 +45,8 @@ type wrapper struct { var ( _ authsigning.Tx = &wrapper{} _ client.TxBuilder = &wrapper{} - _ tx.TipTx = &wrapper{} _ ante.HasExtensionOptionsTx = &wrapper{} _ ExtensionOptionsTxBuilder = &wrapper{} - _ tx.TipTx = &wrapper{} ) // ExtensionOptionsTxBuilder defines a TxBuilder that can also set extensions. @@ -214,10 +212,6 @@ func (w *wrapper) FeeGranter() []byte { return w.tx.FeeGranter(w.cdc) } -func (w *wrapper) GetTip() *tx.Tip { - return w.tx.AuthInfo.Tip -} - func (w *wrapper) GetMemo() string { return w.tx.Body.Memo } @@ -318,13 +312,6 @@ func (w *wrapper) SetFeeAmount(coins sdk.Coins) { w.authInfoBz = nil } -func (w *wrapper) SetTip(tip *tx.Tip) { - w.tx.AuthInfo.Tip = tip - - // set authInfoBz to nil because the cached authInfoBz no longer matches tx.AuthInfo - w.authInfoBz = nil -} - func (w *wrapper) SetFeePayer(feePayer sdk.AccAddress) { if w.tx.AuthInfo.Fee == nil { w.tx.AuthInfo.Fee = &tx.Fee{} @@ -499,14 +486,6 @@ func (w *wrapper) AddAuxSignerData(data tx.AuxSignerData) error { } } } - if w.tx.AuthInfo.Tip != nil && data.SignDoc.Tip != nil { - if !w.tx.AuthInfo.Tip.Amount.Equal(data.SignDoc.Tip.Amount) { - return sdkerrors.ErrInvalidRequest.Wrapf("TxBuilder has tip %+v, got %+v in AuxSignerData", w.tx.AuthInfo.Tip.Amount, data.SignDoc.Tip.Amount) - } - if w.tx.AuthInfo.Tip.Tipper != data.SignDoc.Tip.Tipper { - return sdkerrors.ErrInvalidRequest.Wrapf("TxBuilder has tipper %s, got %s in AuxSignerData", w.tx.AuthInfo.Tip.Tipper, data.SignDoc.Tip.Tipper) - } - } w.SetMemo(body.Memo) w.SetTimeoutHeight(body.TimeoutHeight) @@ -520,7 +499,6 @@ func (w *wrapper) AddAuxSignerData(data tx.AuxSignerData) error { if err != nil { return err } - w.SetTip(data.GetSignDoc().GetTip()) // Get the aux signer's index in GetSigners. signerIndex := -1 diff --git a/x/auth/tx/legacy_amino_json.go b/x/auth/tx/legacy_amino_json.go index 3d7f1efcae0..0c76158e5d2 100644 --- a/x/auth/tx/legacy_amino_json.go +++ b/x/auth/tx/legacy_amino_json.go @@ -63,20 +63,6 @@ func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode, return nil, errorsmod.Wrapf(sdkerrors.ErrInvalidRequest, "got empty address in %s handler", signingtypes.SignMode_SIGN_MODE_LEGACY_AMINO_JSON) } - tip := protoTx.GetTip() - isTipper := tip != nil && tip.Tipper == addr - - // We set a convention that if the tipper signs with LEGACY_AMINO_JSON, then - // they sign over empty fees and 0 gas. - if isTipper { - return legacytx.StdSignBytes( - data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(), - // The tipper signs over 0 fee and 0 gas, no feepayer, no feegranter by convention. - legacytx.StdFee{}, - tx.GetMsgs(), protoTx.GetMemo(), tip, - ), nil - } - return legacytx.StdSignBytes( data.ChainID, data.AccountNumber, data.Sequence, protoTx.GetTimeoutHeight(), legacytx.StdFee{ @@ -85,6 +71,6 @@ func (s signModeLegacyAminoJSONHandler) GetSignBytes(mode signingtypes.SignMode, Payer: protoTx.tx.AuthInfo.Fee.Payer, Granter: protoTx.tx.AuthInfo.Fee.Granter, }, - tx.GetMsgs(), protoTx.GetMemo(), tip, + tx.GetMsgs(), protoTx.GetMemo(), ), nil } diff --git a/x/auth/tx/legacy_amino_json_test.go b/x/auth/tx/legacy_amino_json_test.go index cbe8def252d..dcfbe319069 100644 --- a/x/auth/tx/legacy_amino_json_test.go +++ b/x/auth/tx/legacy_amino_json_test.go @@ -14,7 +14,6 @@ import ( cdctypes "github.com/cosmos/cosmos-sdk/codec/types" "github.com/cosmos/cosmos-sdk/testutil/testdata" sdk "github.com/cosmos/cosmos-sdk/types" - "github.com/cosmos/cosmos-sdk/types/tx" signingtypes "github.com/cosmos/cosmos-sdk/types/tx/signing" "github.com/cosmos/cosmos-sdk/x/auth/migrations/legacytx" "github.com/cosmos/cosmos-sdk/x/auth/signing" @@ -46,7 +45,6 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) { chainID = "test-chain" accNum uint64 = 7 seqNum uint64 = 7 - tip = &tx.Tip{Tipper: addr1.String(), Amount: coins} ) testcases := []struct { @@ -58,22 +56,18 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) { { "signer which is also fee payer (no tips)", addr1.String(), func(w *wrapper) {}, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also fee payer (with tips)", addr2.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo), }, + { "explicit fee payer", addr1.String(), func(w *wrapper) { w.SetFeePayer(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee granter", addr1.String(), func(w *wrapper) { w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee payer and fee granter", addr1.String(), @@ -81,12 +75,7 @@ func TestLegacyAminoJSONHandler_GetSignBytes(t *testing.T) { w.SetFeePayer(addr2) w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also tipper", addr1.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, } @@ -151,7 +140,6 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) { chainID = "test-chain" accNum uint64 seqNum uint64 = 7 - tip = &tx.Tip{Tipper: addr1.String(), Amount: coins} ) modeHandler := aminojson.NewSignModeHandler(aminojson.SignModeHandlerOptions{}) @@ -169,22 +157,18 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) { { "signer which is also fee payer (no tips)", addr1.String(), func(w *wrapper) {}, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also fee payer (with tips)", addr2.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas}, []sdk.Msg{msg}, memo), }, + { "explicit fee payer", addr1.String(), func(w *wrapper) { w.SetFeePayer(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee granter", addr1.String(), func(w *wrapper) { w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, { "explicit fee payer and fee granter", addr1.String(), @@ -192,12 +176,7 @@ func TestLegacyAminoJSONHandler_AllGetSignBytesComparison(t *testing.T) { w.SetFeePayer(addr2) w.SetFeeGranter(addr2) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo, nil), - }, - { - "signer which is also tipper", addr1.String(), - func(w *wrapper) { w.SetTip(tip) }, - legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{}, []sdk.Msg{msg}, memo, tip), + legacytx.StdSignBytes(chainID, accNum, seqNum, timeout, legacytx.StdFee{Amount: coins, Gas: gas, Payer: addr2.String(), Granter: addr2.String()}, []sdk.Msg{msg}, memo), }, } diff --git a/x/authz/msgs_test.go b/x/authz/msgs_test.go index a3075002c88..ea634fd3952 100644 --- a/x/authz/msgs_test.go +++ b/x/authz/msgs_test.go @@ -111,7 +111,7 @@ func TestAminoJSON(t *testing.T) { for i, tt := range tests { t.Run(fmt.Sprintf("case %d", i), func(t *testing.T) { tx.Msgs = []sdk.Msg{tt.msg} - legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo", nil)) + legacyJSON := string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{tt.msg}, "memo")) require.Equal(t, tt.exp, legacyJSON) legacyAny, err := cdctypes.NewAnyWithValue(tt.msg) diff --git a/x/feegrant/msgs_test.go b/x/feegrant/msgs_test.go index cee135b5ddb..a0c19d0ff1c 100644 --- a/x/feegrant/msgs_test.go +++ b/x/feegrant/msgs_test.go @@ -34,13 +34,13 @@ func TestAminoJSON(t *testing.T) { tx.Msgs = []sdk.Msg{msg} require.Equal(t, `{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgGrantAllowance","value":{"allowance":{"type":"cosmos-sdk/BasicAllowance","value":{"spend_limit":[{"amount":"100","denom":"foo"}]}},"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`, - string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo", nil)), + string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")), ) msg = &feegrant.MsgRevokeAllowance{Granter: "cosmos1abc", Grantee: "cosmos1def"} tx.Msgs = []sdk.Msg{msg} require.Equal(t, `{"account_number":"1","chain_id":"foo","fee":{"amount":[],"gas":"0"},"memo":"memo","msgs":[{"type":"cosmos-sdk/MsgRevokeAllowance","value":{"grantee":"cosmos1def","granter":"cosmos1abc"}}],"sequence":"1","timeout_height":"1"}`, - string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo", nil)), + string(legacytx.StdSignBytes("foo", 1, 1, 1, legacytx.StdFee{}, []sdk.Msg{msg}, "memo")), ) } diff --git a/x/tx/decode/decode_test.go b/x/tx/decode/decode_test.go index d226ef0b4da..4d4930e3bc3 100644 --- a/x/tx/decode/decode_test.go +++ b/x/tx/decode/decode_test.go @@ -85,10 +85,6 @@ func TestDecode(t *testing.T) { Payer: "payer", Granter: "", }, - Tip: &txv1beta1.Tip{ - Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, - Tipper: "tipper", - }, }, Signatures: nil, } diff --git a/x/tx/decode/fuzz_test.go b/x/tx/decode/fuzz_test.go new file mode 100644 index 00000000000..38262a20070 --- /dev/null +++ b/x/tx/decode/fuzz_test.go @@ -0,0 +1,140 @@ +package decode + +import ( + "encoding/hex" + "testing" + + "github.com/cosmos/cosmos-proto/anyutil" + fuzz "github.com/google/gofuzz" + "google.golang.org/protobuf/proto" + "google.golang.org/protobuf/types/known/anypb" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + "cosmossdk.io/api/cosmos/crypto/secp256k1" + signingv1beta1 "cosmossdk.io/api/cosmos/tx/signing/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing" +) + +var ( + accSeq = uint64(2) + + signerInfo = []*txv1beta1.SignerInfo{ + { + PublicKey: pkAny, + ModeInfo: &txv1beta1.ModeInfo{ + Sum: &txv1beta1.ModeInfo_Single_{ + Single: &txv1beta1.ModeInfo_Single{ + Mode: signingv1beta1.SignMode_SIGN_MODE_DIRECT, + }, + }, + }, + Sequence: accSeq, + }, + } + + anyMsg, _ = anyutil.New(&bankv1beta1.MsgSend{}) + + pkAny, _ = anyutil.New(&secp256k1.PubKey{Key: []byte("foo")}) +) + +func generateAndAddSeedsFromTx(f *testing.F) { + f.Helper() + // 1. Add some seeds. + tx := &txv1beta1.Tx{ + Body: &txv1beta1.TxBody{ + Messages: []*anypb.Any{anyMsg}, + Memo: "memo", + TimeoutHeight: 0, + }, + AuthInfo: &txv1beta1.AuthInfo{ + SignerInfos: signerInfo, + Fee: &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Amount: "100", Denom: "denom"}}, + GasLimit: 100, + Payer: "payer", + Granter: "", + }, + }, + Signatures: nil, + } + f.Add(mustMarshal(f, tx)) + fz := fuzz.New() + // 1.1. Mutate tx as much and add those as seeds. + for i := 0; i < 1e4; i++ { + func() { + defer func() { + _ = recover() // Catch any panics and continue + }() + fz.Fuzz(tx) + f.Add(mustMarshal(f, tx)) + }() + } +} + +func FuzzInternal_rejectNonADR027TxRaw(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now run the fuzzer. + f.Fuzz(func(t *testing.T, in []byte) { + // Just ensure it doesn't crash. + _ = rejectNonADR027TxRaw(in) + }) +} + +func FuzzDecode(f *testing.F) { + if testing.Short() { + f.Skip("Skipping in -short mode") + } + + // 1. Add some seeds. + generateAndAddSeedsFromTx(f) + + // 2. Now fuzz it. + cdc := new(asHexCodec) + signingCtx, err := signing.NewContext(signing.Options{ + AddressCodec: cdc, + ValidatorAddressCodec: cdc, + }) + if err != nil { + return + } + dec, err := NewDecoder(Options{ + SigningContext: signingCtx, + }) + if err != nil { + return + } + + f.Fuzz(func(t *testing.T, in []byte) { + txr, err := dec.Decode(in) + if err == nil && txr == nil { + t.Fatal("inconsistency: err==nil yet tx==nil") + } + }) +} + +func mustMarshal(f *testing.F, m proto.Message) []byte { + f.Helper() + blob, err := proto.Marshal(m) + if err != nil { + f.Fatal(err) + } + return blob +} + +type asHexCodec int + +func (d asHexCodec) StringToBytes(text string) ([]byte, error) { + return hex.DecodeString(text) +} + +func (d asHexCodec) BytesToString(bz []byte) (string, error) { + return hex.EncodeToString(bz), nil +} diff --git a/x/tx/signing/aminojson/aminojson.go b/x/tx/signing/aminojson/aminojson.go index 5d4c3136f55..6d4c264e5d9 100644 --- a/x/tx/signing/aminojson/aminojson.go +++ b/x/tx/signing/aminojson/aminojson.go @@ -72,31 +72,19 @@ func (h SignModeHandler) GetSignBytes(_ context.Context, signerData signing.Sign return nil, fmt.Errorf("got empty address in %s handler: invalid request", h.Mode()) } - tip := txData.AuthInfo.Tip - if tip != nil && tip.Tipper == "" { - return nil, fmt.Errorf("tipper cannot be empty") - } - isTipper := tip != nil && tip.Tipper == signerData.Address - // We set a convention that if the tipper signs with LEGACY_AMINO_JSON, then // they sign over empty fees and 0 gas. var fee *aminojsonpb.AminoSignFee - if isTipper { - fee = &aminojsonpb.AminoSignFee{ - Amount: nil, - Gas: 0, - } - } else { - f := txData.AuthInfo.Fee - if f == nil { - return nil, fmt.Errorf("fee cannot be nil when tipper is not signer") - } - fee = &aminojsonpb.AminoSignFee{ - Amount: f.Amount, - Gas: f.GasLimit, - Payer: f.Payer, - Granter: f.Granter, - } + + f := txData.AuthInfo.Fee + if f == nil { + return nil, fmt.Errorf("fee cannot be nil when tipper is not signer") + } + fee = &aminojsonpb.AminoSignFee{ + Amount: f.Amount, + Gas: f.GasLimit, + Payer: f.Payer, + Granter: f.Granter, } signDoc := &aminojsonpb.AminoSignDoc{ @@ -107,7 +95,6 @@ func (h SignModeHandler) GetSignBytes(_ context.Context, signerData signing.Sign Memo: body.Memo, Msgs: txData.Body.Messages, Fee: fee, - Tip: tip, } return h.encoder.Marshal(signDoc) diff --git a/x/tx/signing/aminojson/aminojson_test.go b/x/tx/signing/aminojson/aminojson_test.go index f354bda0136..0d137906561 100644 --- a/x/tx/signing/aminojson/aminojson_test.go +++ b/x/tx/signing/aminojson/aminojson_test.go @@ -21,7 +21,6 @@ func TestAminoJsonSignMode(t *testing.T) { handlerOptions := testutil.HandlerArgumentOptions{ ChainID: "test-chain", Memo: "sometestmemo", - Tip: &txv1beta1.Tip{Tipper: "tipper", Amount: []*basev1beta1.Coin{{Denom: "Tip-token", Amount: "10"}}}, Msg: &bankv1beta1.MsgSend{ FromAddress: "foo", ToAddress: "bar", @@ -52,37 +51,14 @@ func TestAminoJsonSignMode(t *testing.T) { }, error: "got empty address in SIGN_MODE_LEGACY_AMINO_JSON handler: invalid request", }, - { - name: "nil tip", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip = nil - return opts - }, - }, - { - name: "empty tipper", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip.Tipper = "" - return opts - }, - error: "tipper cannot be empty", - }, { name: "nil fee", malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip.Tipper = "tipper" opts.Fee = nil return opts }, error: "fee cannot be nil", }, - { - name: "tipper is signer", - malleate: func(opts testutil.HandlerArgumentOptions) testutil.HandlerArgumentOptions { - opts.Tip.Tipper = opts.SignerAddress - return opts - }, - }, } for _, tc := range testCases { diff --git a/x/tx/signing/aminojson/fuzz_test.go b/x/tx/signing/aminojson/fuzz_test.go new file mode 100644 index 00000000000..e5cbe7ccf3f --- /dev/null +++ b/x/tx/signing/aminojson/fuzz_test.go @@ -0,0 +1,75 @@ +package aminojson + +import ( + "context" + "encoding/json" + "testing" + + fuzz "github.com/google/gofuzz" + + bankv1beta1 "cosmossdk.io/api/cosmos/bank/v1beta1" + basev1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" + txv1beta1 "cosmossdk.io/api/cosmos/tx/v1beta1" + "cosmossdk.io/x/tx/signing/testutil" +) + +func FuzzSignModeGetSignBytes(f *testing.F) { + if testing.Short() { + f.Skip("not running in -short mode") + } + + // 1. Create seeds. + fee := &txv1beta1.Fee{ + Amount: []*basev1beta1.Coin{{Denom: "uatom", Amount: "1000"}}, + } + seed := &testutil.HandlerArgumentOptions{ + ChainID: "test-chain", + Memo: "sometestmemo", + + Msg: &bankv1beta1.MsgSend{ + FromAddress: "foo", + ToAddress: "bar", + Amount: []*basev1beta1.Coin{{Denom: "demon", Amount: "100"}}, + }, + AccNum: 1, + AccSeq: 2, + SignerAddress: "signerAddress", + Fee: fee, + } + + gf := fuzz.New() + for i := 0; i < 1e4; i++ { + blob, err := json.Marshal(seed) + if err != nil { + f.Fatal(err) + } + f.Add(blob) + + // 1.5. Mutate the seed for the next iteration. + // gofuzz cannot handle mutating "&bankv1beta1.MsgSend", + // hence why we are mutating fields individually. + gf.Fuzz(&seed.ChainID) + gf.Fuzz(&seed.Memo) + gf.Fuzz(&seed.AccNum) + gf.Fuzz(&seed.AccSeq) + gf.Fuzz(seed.Fee) + gf.Fuzz(&seed.SignerAddress) + } + + ctx := context.Background() + handler := NewSignModeHandler(SignModeHandlerOptions{}) + + // 2. Now run the fuzzers. + f.Fuzz(func(t *testing.T, in []byte) { + opts := new(testutil.HandlerArgumentOptions) + if err := json.Unmarshal(in, opts); err != nil { + return + } + + signerData, txData, err := testutil.MakeHandlerArguments(*opts) + if err != nil { + return + } + _, _ = handler.GetSignBytes(ctx, signerData, txData) + }) +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto index d28008c87dc..8ab6373b864 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.proto @@ -1,10 +1,8 @@ syntax = "proto3"; -import "cosmos_proto/cosmos.proto"; import "amino/amino.proto"; import "cosmos/base/v1beta1/coin.proto"; import "google/protobuf/any.proto"; -import "cosmos/tx/v1beta1/tx.proto"; // AminoSignFee is the legacy amino json sign mode compatible version of txv1beta1.Fee, and differs from that message // by the name of the Gas field (GasLimit in txv1beta.Fee). @@ -27,5 +25,4 @@ message AminoSignDoc { string memo = 5 [(amino.dont_omitempty) = true]; AminoSignFee fee = 6 [(amino.dont_omitempty) = true]; repeated google.protobuf.Any msgs = 7 [(amino.dont_omitempty) = true]; - cosmos.tx.v1beta1.Tip tip = 8; -} \ No newline at end of file +} diff --git a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go index d1f7f2540d3..e8ad14368fd 100644 --- a/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go +++ b/x/tx/signing/aminojson/internal/aminojsonpb/aminojson.pulsar.go @@ -4,9 +4,7 @@ package aminojsonpb import ( _ "cosmossdk.io/api/amino" v1beta1 "cosmossdk.io/api/cosmos/base/v1beta1" - v1beta11 "cosmossdk.io/api/cosmos/tx/v1beta1" fmt "fmt" - _ "github.com/cosmos/cosmos-proto" runtime "github.com/cosmos/cosmos-proto/runtime" protoreflect "google.golang.org/protobuf/reflect/protoreflect" protoiface "google.golang.org/protobuf/runtime/protoiface" @@ -747,7 +745,6 @@ var ( fd_AminoSignDoc_memo protoreflect.FieldDescriptor fd_AminoSignDoc_fee protoreflect.FieldDescriptor fd_AminoSignDoc_msgs protoreflect.FieldDescriptor - fd_AminoSignDoc_tip protoreflect.FieldDescriptor ) func init() { @@ -760,7 +757,6 @@ func init() { fd_AminoSignDoc_memo = md_AminoSignDoc.Fields().ByName("memo") fd_AminoSignDoc_fee = md_AminoSignDoc.Fields().ByName("fee") fd_AminoSignDoc_msgs = md_AminoSignDoc.Fields().ByName("msgs") - fd_AminoSignDoc_tip = md_AminoSignDoc.Fields().ByName("tip") } var _ protoreflect.Message = (*fastReflection_AminoSignDoc)(nil) @@ -870,12 +866,6 @@ func (x *fastReflection_AminoSignDoc) Range(f func(protoreflect.FieldDescriptor, return } } - if x.Tip != nil { - value := protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) - if !f(fd_AminoSignDoc_tip, value) { - return - } - } } // Has reports whether a field is populated. @@ -905,8 +895,6 @@ func (x *fastReflection_AminoSignDoc) Has(fd protoreflect.FieldDescriptor) bool return x.Fee != nil case "AminoSignDoc.msgs": return len(x.Msgs) != 0 - case "AminoSignDoc.tip": - return x.Tip != nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -937,8 +925,6 @@ func (x *fastReflection_AminoSignDoc) Clear(fd protoreflect.FieldDescriptor) { x.Fee = nil case "AminoSignDoc.msgs": x.Msgs = nil - case "AminoSignDoc.tip": - x.Tip = nil default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -979,9 +965,6 @@ func (x *fastReflection_AminoSignDoc) Get(descriptor protoreflect.FieldDescripto } listValue := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(listValue) - case "AminoSignDoc.tip": - value := x.Tip - return protoreflect.ValueOfMessage(value.ProtoReflect()) default: if descriptor.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1018,8 +1001,6 @@ func (x *fastReflection_AminoSignDoc) Set(fd protoreflect.FieldDescriptor, value lv := value.List() clv := lv.(*_AminoSignDoc_7_list) x.Msgs = *clv.list - case "AminoSignDoc.tip": - x.Tip = value.Message().Interface().(*v1beta11.Tip) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1051,11 +1032,6 @@ func (x *fastReflection_AminoSignDoc) Mutable(fd protoreflect.FieldDescriptor) p } value := &_AminoSignDoc_7_list{list: &x.Msgs} return protoreflect.ValueOfList(value) - case "AminoSignDoc.tip": - if x.Tip == nil { - x.Tip = new(v1beta11.Tip) - } - return protoreflect.ValueOfMessage(x.Tip.ProtoReflect()) case "AminoSignDoc.account_number": panic(fmt.Errorf("field account_number of message AminoSignDoc is not mutable")) case "AminoSignDoc.sequence": @@ -1095,9 +1071,6 @@ func (x *fastReflection_AminoSignDoc) NewField(fd protoreflect.FieldDescriptor) case "AminoSignDoc.msgs": list := []*anypb.Any{} return protoreflect.ValueOfList(&_AminoSignDoc_7_list{list: &list}) - case "AminoSignDoc.tip": - m := new(v1beta11.Tip) - return protoreflect.ValueOfMessage(m.ProtoReflect()) default: if fd.IsExtension() { panic(fmt.Errorf("proto3 declared messages do not support extensions: AminoSignDoc")) @@ -1194,10 +1167,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { n += 1 + l + runtime.Sov(uint64(l)) } } - if x.Tip != nil { - l = options.Size(x.Tip) - n += 1 + l + runtime.Sov(uint64(l)) - } if x.unknownFields != nil { n += len(x.unknownFields) } @@ -1227,20 +1196,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { i -= len(x.unknownFields) copy(dAtA[i:], x.unknownFields) } - if x.Tip != nil { - encoded, err := options.Marshal(x.Tip) - if err != nil { - return protoiface.MarshalOutput{ - NoUnkeyedLiterals: input.NoUnkeyedLiterals, - Buf: input.Buf, - }, err - } - i -= len(encoded) - copy(dAtA[i:], encoded) - i = runtime.EncodeVarint(dAtA, i, uint64(len(encoded))) - i-- - dAtA[i] = 0x42 - } if len(x.Msgs) > 0 { for iNdEx := len(x.Msgs) - 1; iNdEx >= 0; iNdEx-- { encoded, err := options.Marshal(x.Msgs[iNdEx]) @@ -1540,42 +1495,6 @@ func (x *fastReflection_AminoSignDoc) ProtoMethods() *protoiface.Methods { return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err } iNdEx = postIndex - case 8: - if wireType != 2 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, fmt.Errorf("proto: wrong wireType = %d for field Tip", wireType) - } - var msglen int - for shift := uint(0); ; shift += 7 { - if shift >= 64 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrIntOverflow - } - if iNdEx >= l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - b := dAtA[iNdEx] - iNdEx++ - msglen |= int(b&0x7F) << shift - if b < 0x80 { - break - } - } - if msglen < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - postIndex := iNdEx + msglen - if postIndex < 0 { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, runtime.ErrInvalidLength - } - if postIndex > l { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, io.ErrUnexpectedEOF - } - if x.Tip == nil { - x.Tip = &v1beta11.Tip{} - } - if err := options.Unmarshal(dAtA[iNdEx:postIndex], x.Tip); err != nil { - return protoiface.UnmarshalOutput{NoUnkeyedLiterals: input.NoUnkeyedLiterals, Flags: input.Flags}, err - } - iNdEx = postIndex default: iNdEx = preIndex skippy, err := runtime.Skip(dAtA[iNdEx:]) @@ -1701,7 +1620,6 @@ type AminoSignDoc struct { Memo string `protobuf:"bytes,5,opt,name=memo,proto3" json:"memo,omitempty"` Fee *AminoSignFee `protobuf:"bytes,6,opt,name=fee,proto3" json:"fee,omitempty"` Msgs []*anypb.Any `protobuf:"bytes,7,rep,name=msgs,proto3" json:"msgs,omitempty"` - Tip *v1beta11.Tip `protobuf:"bytes,8,opt,name=tip,proto3" json:"tip,omitempty"` } func (x *AminoSignDoc) Reset() { @@ -1773,63 +1691,50 @@ func (x *AminoSignDoc) GetMsgs() []*anypb.Any { return nil } -func (x *AminoSignDoc) GetTip() *v1beta11.Tip { - if x != nil { - return x.Tip - } - return nil -} - var File_aminojsonpb_aminojson_proto protoreflect.FileDescriptor var file_aminojsonpb_aminojson_proto_rawDesc = []byte{ 0x0a, 0x1b, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x2f, 0x61, 0x6d, - 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x63, - 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x5f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2f, 0x63, 0x6f, 0x73, 0x6d, - 0x6f, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2f, - 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x63, 0x6f, 0x73, - 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, - 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x19, 0x67, 0x6f, 0x6f, - 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x61, 0x6e, 0x79, - 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x74, - 0x78, 0x2f, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x74, 0x78, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, - 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, - 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, - 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, - 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, - 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, - 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, - 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, - 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, 0x22, 0xc6, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, - 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, - 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, - 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, - 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, - 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, - 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, - 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, - 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, - 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, - 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, - 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, - 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, - 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x12, 0x28, 0x0a, 0x03, 0x74, 0x69, 0x70, 0x18, 0x08, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x74, 0x78, 0x2e, - 0x76, 0x31, 0x62, 0x65, 0x74, 0x61, 0x31, 0x2e, 0x54, 0x69, 0x70, 0x52, 0x03, 0x74, 0x69, 0x70, - 0x42, 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, - 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, - 0x69, 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, - 0x6e, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, - 0x62, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, - 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x11, 0x61, + 0x6d, 0x69, 0x6e, 0x6f, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x1e, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2f, 0x62, 0x61, 0x73, 0x65, 0x2f, 0x76, 0x31, + 0x62, 0x65, 0x74, 0x61, 0x31, 0x2f, 0x63, 0x6f, 0x69, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, + 0x1a, 0x19, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, + 0x66, 0x2f, 0x61, 0x6e, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xa2, 0x01, 0x0a, 0x0c, + 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, 0x65, 0x65, 0x12, 0x49, 0x0a, 0x06, + 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x63, + 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x2e, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x62, 0x65, 0x74, + 0x61, 0x31, 0x2e, 0x43, 0x6f, 0x69, 0x6e, 0x42, 0x16, 0x9a, 0xe7, 0xb0, 0x2a, 0x0c, 0x6c, 0x65, + 0x67, 0x61, 0x63, 0x79, 0x5f, 0x63, 0x6f, 0x69, 0x6e, 0x73, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, + 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x17, 0x0a, 0x03, 0x67, 0x61, 0x73, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x67, 0x61, 0x73, + 0x12, 0x14, 0x0a, 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x70, 0x61, 0x79, 0x65, 0x72, 0x12, 0x18, 0x0a, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, + 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x67, 0x72, 0x61, 0x6e, 0x74, 0x65, 0x72, + 0x22, 0x9c, 0x02, 0x0a, 0x0c, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x44, 0x6f, + 0x63, 0x12, 0x2c, 0x0a, 0x0e, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x5f, 0x6e, 0x75, 0x6d, + 0x62, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x0d, 0x61, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x4e, 0x75, 0x6d, 0x62, 0x65, 0x72, 0x12, + 0x21, 0x0a, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x04, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x08, 0x73, 0x65, 0x71, 0x75, 0x65, 0x6e, + 0x63, 0x65, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x5f, 0x68, 0x65, + 0x69, 0x67, 0x68, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x0d, 0x74, 0x69, 0x6d, 0x65, + 0x6f, 0x75, 0x74, 0x48, 0x65, 0x69, 0x67, 0x68, 0x74, 0x12, 0x20, 0x0a, 0x08, 0x63, 0x68, 0x61, + 0x69, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, + 0x2a, 0x01, 0x52, 0x07, 0x63, 0x68, 0x61, 0x69, 0x6e, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x04, 0x6d, + 0x65, 0x6d, 0x6f, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, + 0x52, 0x04, 0x6d, 0x65, 0x6d, 0x6f, 0x12, 0x26, 0x0a, 0x03, 0x66, 0x65, 0x65, 0x18, 0x06, 0x20, + 0x01, 0x28, 0x0b, 0x32, 0x0d, 0x2e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x53, 0x69, 0x67, 0x6e, 0x46, + 0x65, 0x65, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x03, 0x66, 0x65, 0x65, 0x12, 0x2f, + 0x0a, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x67, + 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x41, + 0x6e, 0x79, 0x42, 0x05, 0xa8, 0xe7, 0xb0, 0x2a, 0x01, 0x52, 0x04, 0x6d, 0x73, 0x67, 0x73, 0x42, + 0x4b, 0x42, 0x0e, 0x41, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x50, 0x72, 0x6f, 0x74, + 0x6f, 0x50, 0x01, 0x5a, 0x37, 0x63, 0x6f, 0x73, 0x6d, 0x6f, 0x73, 0x73, 0x64, 0x6b, 0x2e, 0x69, + 0x6f, 0x2f, 0x78, 0x2f, 0x74, 0x78, 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, + 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x74, 0x65, 0x73, 0x74, 0x70, 0x62, + 0x2f, 0x61, 0x6d, 0x69, 0x6e, 0x6f, 0x6a, 0x73, 0x6f, 0x6e, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, + 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -1850,18 +1755,16 @@ var file_aminojsonpb_aminojson_proto_goTypes = []interface{}{ (*AminoSignDoc)(nil), // 1: AminoSignDoc (*v1beta1.Coin)(nil), // 2: cosmos.base.v1beta1.Coin (*anypb.Any)(nil), // 3: google.protobuf.Any - (*v1beta11.Tip)(nil), // 4: cosmos.tx.v1beta1.Tip } var file_aminojsonpb_aminojson_proto_depIdxs = []int32{ 2, // 0: AminoSignFee.amount:type_name -> cosmos.base.v1beta1.Coin 0, // 1: AminoSignDoc.fee:type_name -> AminoSignFee 3, // 2: AminoSignDoc.msgs:type_name -> google.protobuf.Any - 4, // 3: AminoSignDoc.tip:type_name -> cosmos.tx.v1beta1.Tip - 4, // [4:4] is the sub-list for method output_type - 4, // [4:4] is the sub-list for method input_type - 4, // [4:4] is the sub-list for extension type_name - 4, // [4:4] is the sub-list for extension extendee - 0, // [0:4] is the sub-list for field type_name + 3, // [3:3] is the sub-list for method output_type + 3, // [3:3] is the sub-list for method input_type + 3, // [3:3] is the sub-list for extension type_name + 3, // [3:3] is the sub-list for extension extendee + 0, // [0:3] is the sub-list for field type_name } func init() { file_aminojsonpb_aminojson_proto_init() } diff --git a/x/tx/signing/directaux/direct_aux.go b/x/tx/signing/directaux/direct_aux.go index 9f92222d99a..516797737ae 100644 --- a/x/tx/signing/directaux/direct_aux.go +++ b/x/tx/signing/directaux/direct_aux.go @@ -100,7 +100,6 @@ func (h SignModeHandler) GetSignBytes( ChainId: signerData.ChainID, AccountNumber: signerData.AccountNumber, Sequence: signerData.Sequence, - Tip: txData.AuthInfo.Tip, } return proto.Marshal(signDocDirectAux) } diff --git a/x/tx/signing/directaux/direct_aux_test.go b/x/tx/signing/directaux/direct_aux_test.go index aadd9c0deb1..00c48222aa8 100644 --- a/x/tx/signing/directaux/direct_aux_test.go +++ b/x/tx/signing/directaux/direct_aux_test.go @@ -54,7 +54,6 @@ func TestDirectAuxHandler(t *testing.T) { GasLimit: 20000, Payer: feePayerAddr, } - tip := &txv1beta1.Tip{Amount: []*basev1beta1.Coin{{Denom: "tip-token", Amount: "10"}}} txBody := &txv1beta1.TxBody{ Messages: []*anypb.Any{msg}, @@ -63,7 +62,6 @@ func TestDirectAuxHandler(t *testing.T) { authInfo := &txv1beta1.AuthInfo{ Fee: fee, - Tip: tip, SignerInfos: signerInfo, } @@ -113,7 +111,6 @@ func TestDirectAuxHandler(t *testing.T) { } authInfoWithNoFeePayer := &txv1beta1.AuthInfo{ Fee: feeWithNoPayer, - Tip: tip, SignerInfos: signerInfo, } authInfoWithNoFeePayerBz, err := proto.Marshal(authInfoWithNoFeePayer) @@ -139,7 +136,6 @@ func TestDirectAuxHandler(t *testing.T) { ChainId: chainID, AccountNumber: accNum, Sequence: accSeq, - Tip: tip, } expectedSignBytes, err := proto.Marshal(signDocDirectAux) require.NoError(t, err) diff --git a/x/tx/signing/testutil/util.go b/x/tx/signing/testutil/util.go index ef689ec1e74..ed1444a6574 100644 --- a/x/tx/signing/testutil/util.go +++ b/x/tx/signing/testutil/util.go @@ -17,7 +17,6 @@ type HandlerArgumentOptions struct { Msg proto.Message AccNum uint64 AccSeq uint64 - Tip *txv1beta1.Tip Fee *txv1beta1.Fee SignerAddress string } @@ -57,7 +56,6 @@ func MakeHandlerArguments(options HandlerArgumentOptions) (signing.SignerData, s authInfo := &txv1beta1.AuthInfo{ Fee: options.Fee, - Tip: options.Tip, SignerInfos: signerInfo, } diff --git a/x/tx/signing/textual/internal/testdata/e2e.json b/x/tx/signing/textual/internal/testdata/e2e.json index 49f5c6effdb..2ab0e30f5b9 100644 --- a/x/tx/signing/textual/internal/testdata/e2e.json +++ b/x/tx/signing/textual/internal/testdata/e2e.json @@ -286,13 +286,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -344,8 +337,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -381,8 +372,8 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ], - "cbor": "a101983fa20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a201635469700277302e30322041544f4d2c2033302730303020756f736d6fa2016654697070657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b683574a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278403765613032653866306261656432646239363965326439616534646335316661333131313632353962643432383937353838303732666166306562623464326504f5" + "cbor": "a101983da20168436861696e20696402686d792d636861696ea2016e4163636f756e74206e756d626572026131a2016853657175656e6365026132a301674164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a3016a5075626c6963206b657902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b657904f5a401634b657902785230324542204444374620453446442045423736204443384120323035452046363544203739304320443330452038413337203541354320323532382045423341203932334120463146422034443739203444030104f5a102781f54686973207472616e73616374696f6e206861732032204d65737361676573a3016d4d6573736167652028312f322902781d2f636f736d6f732e617574687a2e763162657461312e4d7367457865630301a301674772616e74656502782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301644d73677302653120416e790302a3016a4d7367732028312f312902781c2f636f736d6f732e62616e6b2e763162657461312e4d736753656e640303a3016c46726f6d206164647265737302782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730304a3016a546f206164647265737302782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b6835740304a30166416d6f756e74026731302041544f4d0304a2026b456e64206f66204d7367730302a3016d4d6573736167652028322f322902762f636f736d6f732e676f762e76312e4d7367566f74650301a3016b50726f706f73616c2069640261310302a30165566f74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e76716138657968730302a301664f7074696f6e026f564f54455f4f5054494f4e5f5945530302a301684d65746164617461027901e34c6f72656d20697073756d20646f6c6f722073697420616d65742c20636f6e73656374657475722061646970697363696e6720656c69742c2073656420646f20656975736d6f642074656d706f7220696e6369646964756e74207574206c61626f726520657420646f6c6f7265206d61676e6120616c697175612e20557420656e696d206164206d696e696d2076656e69616d2c2071756973206e6f737472756420657865726369746174696f6e20756c6c616d636f206c61626f726973206e69736920757420616c697175697020657820656120636f6d6d6f646f20636f6e7365717561742e2044756973206175746520697275726520646f6c6f7220696e20726570726568656e646572697420696e20766f6c7570746174652076656c697420657373652063696c6c756d20646f6c6f726520657520667567696174206e756c6c612070617269617475722e204578636570746575722073696e74206f6363616563617420637570696461746174206e6f6e2070726f6964656e742c2073756e7420696e2063756c706120717569206f666669636961206465736572756e74206d6f6c6c697420616e696d20696420657374206c61626f72756d2e20416c736f20697420656e647320696e2020612073696e676c6520616d70657273616e6420400302a1026e456e64206f66204d657373616765a201644d656d6f0278193e20e29a9befb88f5c7532363942e29a9befb88f2020202020a2016446656573026a302e3030322041544f4da3016946656520706179657202782d636f736d6f7331656a726634637572327779366b667572673966326a707070326833616665356836706b68357404f5a3016b466565206772616e74657202782d636f736d6f7331756c6176336873656e7570737771666b77327933737570356b677471776e767161386579687304f5a30169476173206c696d697402673130302730303004f5a3016e54696d656f7574206865696768740262323004f5a3016c4f74686572207369676e6572026c31205369676e6572496e666f04f5a401724f74686572207369676e65722028312f312902715369676e6572496e666f206f626a656374030104f5a4016a5075626c6963206b65790278292f636f736d6f732e63727970746f2e6d756c74697369672e4c6567616379416d696e6f5075624b6579030204f5a401695468726573686f6c64026132030304f5a4016b5075626c6963206b65797302653220416e79030304f5a401715075626c6963206b6579732028312f322902781f2f636f736d6f732e63727970746f2e736563703235366b312e5075624b6579030404f5a401634b657902785230323537203445424520304246432037353446203539363720334241312031423237203530304620393135382041444532204531374520314130312038324230204341384220433635322034444230203933030504f5a401715075626c6963206b6579732028322f322902781d2f636f736d6f732e63727970746f2e656432353531392e5075624b6579030404f5a401634b657902785230333135203043343720463138412041333237203136413620353437452044413842203733363920303637442043453131204431343120363234352042373738203735364320463833352039363738203737030504f5a30272456e64206f66205075626c6963206b657973030304f5a401694d6f646520696e666f026f4d6f6465496e666f206f626a656374030204f5a401654d756c7469026c4d756c7469206f626a656374030304f5a4016842697461727261790276436f6d706163744269744172726179206f626a656374030404f5a40171457874726120626974732073746f726564026135030504f5a40165456c656d7302623438030504f5a4016a4d6f646520696e666f73026a32204d6f6465496e666f030404f5a401704d6f646520696e666f732028312f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a401704d6f646520696e666f732028322f3229026f4d6f6465496e666f206f626a656374030504f5a4016653696e676c65026d53696e676c65206f626a656374030604f5a401644d6f646502781b5349474e5f4d4f44455f4c45474143595f414d494e4f5f4a534f4e030704f5a30271456e64206f66204d6f646520696e666f73030404f5a4016853657175656e6365026135030204f5a20273456e64206f66204f74686572207369676e657204f5a30171457874656e73696f6e206f7074696f6e7302653120416e7904f5a40177457874656e73696f6e206f7074696f6e732028312f31290278192f636f736d6f732e626173652e763162657461312e436f696e030104f5a30266352041544f4d030204f5a2027818456e64206f6620457874656e73696f6e206f7074696f6e7304f5a301781e4e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7302653120416e7904f5a40178244e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e732028312f312902781b2f636f736d6f732e617574682e763162657461312e506172616d73030104f5a401734d6178206d656d6f206368617261637465727302623130030204f5a2027825456e64206f66204e6f6e20637269746963616c20657874656e73696f6e206f7074696f6e7304f5a3017148617368206f66207261772062797465730278406537626537383038646534393835626436303938313164326133323830356362323333633136386337643234376436316433376634613664643463663361326104f5" } ] diff --git a/x/tx/signing/textual/internal/testdata/tx.json b/x/tx/signing/textual/internal/testdata/tx.json index c071d08eec2..bbafe3b1412 100644 --- a/x/tx/signing/textual/internal/testdata/tx.json +++ b/x/tx/signing/textual/internal/testdata/tx.json @@ -299,13 +299,6 @@ "gas_limit": 100000, "payer": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "granter": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs" - }, - "tip": { - "amount": [ - { "amount": "20000", "denom": "uatom" }, - { "amount": "30000", "denom": "uosmo" } - ], - "tipper": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" } } }, @@ -357,8 +350,6 @@ { "title": "Fees", "content": "0.002 ATOM" }, { "title": "Fee payer", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t", "expert": true }, { "title": "Fee granter", "content": "cosmos1ulav3hsenupswqfkw2y3sup5kgtqwnvqa8eyhs", "expert": true }, - { "title": "Tip", "content": "0.02 ATOM, 30'000 uosmo" }, - { "title": "Tipper", "content": "cosmos1ejrf4cur2wy6kfurg9f2jppp2h3afe5h6pkh5t" }, { "title": "Gas limit", "content": "100'000", "expert": true }, { "title": "Timeout height", "content": "20", "expert": true }, { "title": "Other signer", "content": "1 SignerInfo", "expert": true }, @@ -394,7 +385,7 @@ { "title": "Non critical extension options (1/1)", "content": "/cosmos.auth.v1beta1.Params", "indent": 1, "expert": true }, { "title": "Max memo characters", "content": "10", "indent": 2, "expert": true }, { "content": "End of Non critical extension options", "expert": true }, - { "title": "Hash of raw bytes", "content": "7ea02e8f0baed2db969e2d9ae4dc51fa31116259bd42897588072faf0ebb4d2e", "expert": true } + { "title": "Hash of raw bytes", "content": "e7be7808de4985bd609811d2a32805cb233c168c7d247d61d37f4a6dd4cf3a2a", "expert": true } ] } ] diff --git a/x/tx/signing/textual/internal/textualpb/textual.proto b/x/tx/signing/textual/internal/textualpb/textual.proto index efd8d35275b..cddfc99d6e6 100644 --- a/x/tx/signing/textual/internal/textualpb/textual.proto +++ b/x/tx/signing/textual/internal/textualpb/textual.proto @@ -77,8 +77,6 @@ message Envelope { repeated cosmos.base.v1beta1.Coin fees = 8; string fee_payer = 9; string fee_granter = 10; - repeated cosmos.base.v1beta1.Coin tip = 11; - string tipper = 12; uint64 gas_limit = 13; uint64 timeout_height = 14; repeated cosmos.tx.v1beta1.SignerInfo other_signer = 15; diff --git a/x/tx/signing/textual/tx.go b/x/tx/signing/textual/tx.go index 143726034ec..4a372f8b9d3 100644 --- a/x/tx/signing/textual/tx.go +++ b/x/tx/signing/textual/tx.go @@ -83,10 +83,7 @@ func (vr txValueRenderer) Format(ctx context.Context, v protoreflect.Value) ([]S NonCriticalExtensionOptions: txBody.NonCriticalExtensionOptions, HashOfRawBytes: getHash(textualData.BodyBytes, textualData.AuthInfoBytes), } - if txAuthInfo.Tip != nil { - envelope.Tip = txAuthInfo.Tip.Amount - envelope.Tipper = txAuthInfo.Tip.Tipper - } + // Find all other tx signers than the current signer. In the case where our // Textual signer is one key of a multisig, then otherSigners will include // the multisig pubkey. @@ -243,12 +240,6 @@ func (vr txValueRenderer) Parse(ctx context.Context, screens []Screen) (protoref Granter: envelope.FeeGranter, }, } - if envelope.Tip != nil { - authInfo.Tip = &txv1beta1.Tip{ - Amount: envelope.Tip, - Tipper: envelope.Tipper, - } - } // Figure out the signers in the correct order. signers, err := getSigners(txBody, authInfo)