When the broadcast mode SYNC, the codespace field is omitted.
Is it intended?
If the failure is from the module, such as msg.ValidateBasic(), the codespace is significant for recognizing the errors.
Messages are not executed during sync/async -- only the ante-handler. Thus it makes no sense to have a codespace. You'll notice, ResultBroadcastTx doesn't have a codespace field.
@alexanderbez
validateBasicTxMsgs is also executed.ResultBroadcastTx doesn't have a codespace field -> yesGetCheckTx has a codespace field https://github.com/tendermint/tendermint/blob/18d44a01863faf427e420ed9c61669a982bee0fc/rpc/core/mempool.go#L44Right, so I'm having trouble following the proposal exactly...?
I mean,
The codespace is also needed to SYNC mode.
If an error occurs in validateBasicTxMsgs, codespace + code guarantees the error uniqueness.
I made an example as below.
cosmos-sdk/MsgCreateValidatorcommission.rate to -1json
{
"height": "0",
"txhash": "DF2FC489D5EA6F60FA0DC651A5D2C3F62A7947C2845AA608F1C176D80DD5B6BE",
"code": 9,
"raw_log": "commission must be positive"
}
ErrUnknownAddressErrInvalidProposalAmountErrCommissionNegativeClients can not recognize the exact error by code only.
Totally, I agree! But wouldn't ResultBroadcastTx need to support and include codespace? If so, that's a change required in Tendermint first. Then we can support it here 馃憤
codespace was added to ResultBroadcastTx in the latest tendermint version(v0.33.4)
https://github.com/tendermint/tendermint/blob/master/CHANGELOG.md#features
Could you update the issue status?
Most helpful comment
Totally, I agree! But wouldn't
ResultBroadcastTxneed to support and include codespace? If so, that's a change required in Tendermint first. Then we can support it here 馃憤