RFC 001: Transaction Validation
- 2023-03-12: Proposed
Transation Validation is crucial to a functioning state machine. Within the Cosmos SDK there are two validation flows, one is outside the message server and the other within. The flow outside of the message server is the
ValidateBasic function. It is called in the antehandler on both
DeliverTx. There is an overhead and sometimes duplication of validation within these two flows. This extra validation provides an additional check before entering the mempool.
With the deprecation of
GetSigners we have the optionality to remove sdk.Msg and the
With the separation of CometBFT and Cosmos-SDK, there is a lack of control of what transactions get broadcasted and included in a block. This extra validation in the antehandler is meant to help in this case. In most cases the transaction is or should be simulated against a node for validation. With this flow transactions will be treated the same.
The acceptance of this RFC would move validation within
ValidateBasic to the message server in modules, update tutorials and docs to remove mention of using
ValidateBasic in favour of handling all validation for a message where it is executed.
We can and will still support the
Validatebasic function for users and provide an extension interface of the function once
sdk.Msg is depreacted.
Note: This is how messages are handled in VMs like Ethereum and CosmWasm.
The consequence of updating the transaction flow is that transaction that may have failed before with the
ValidateBasic flow will now be included in a block and fees charged.