EVM/Kernel+Node: the validation should return the transaction object
Adding a transaction to the pool has the following workflow:
- The transaction is validated (check that the transaction will not be rejected for "simple" reasons) by the kernel.
- If valid, the node decodes the nonce, the gas and the gas price from the raw transaction (to replace an existing one).
This implies that the node duplicates some decoding of each transaction kind (Legacy, EIP1559, EIP2930), which is error prone and implies that we have to reimplement an encoding on both the kernel and the node if a new transaction kind needs to be supported (it will be the case soon).
The solution would be the following workflow:
- The transaction is validated, and the validation returns the TransactionObject, which is already supported by both the node and the kernel as it is needed by the RPCs, and is a normalized version of the raw transactions.
- If valid, the nonce, gas and gas price are extracted from this transaction object.
Bonus: the transaction object can be reused by the txpool_content
RPC.
Edited by Pierrick Couderc