laconicd-deprecated/x/evm/spec/04_messages.md
Federico Kunze 6e1c16627a
evm: module specification (#538)
* evm: module specification

* params and events

* readme and messages

* minor updates

* concepts

* genesis state concept

* begin and end block

* update parameters and genesis

* state objects

* state table

* use permalink

* init and export genesis

* update abci

* extra eips param

* review comments

* precision

* link to photon doc
2020-12-09 20:11:15 +01:00

1.6 KiB

Messages

MsgEthereumTx

An EVM state transition can be achieved by using the MsgEthereumTx. This message encapsulates an Ethereum transaction as an SDK message and contains the necessary transaction data fields.

One remark about the MsgEthereumTx is that it implements both the sdk.Msg and sdk.Tx interfaces (generally SDK messages only implement the former, while the latter is a group of messages bundled together). The reason of this, is because the MsgEthereumTx must not be included in a auth.StdTx (SDK's standard transaction type) as it performs gas and fee checks using the Ethereum logic from Geth instead of the Cosmos SDK checks done on the auth module AnteHandler.

+++ https://github.com/cosmos/ethermint/blob/v0.3.1/x/evm/types/msg.go#L117-L124

+++ https://github.com/cosmos/ethermint/blob/v0.3.1/x/evm/types/tx_data.go#L12-L29

This message validation is expected to fail if:

  • Data.Price (i.e gas price) is ≤ 0.
  • Data.Amount is negative

The transaction execution is expected to fail if:

  • Any of the custom AnteHandler Ethereum decorators checks fail:
    • Minimum gas amount requirements for transaction
    • Tx sender account doesn't exist or hasn't enough balance for fees
    • Account sequence doesn't match the transaction Data.AccountNonce
    • Message signature verification fails
  • EVM contract creation (i.e evm.Create) fails, or evm.Call fails