Module: evmgov
Description
The evmgov module interacts with EVM-based governance entry points to convert and execute governance messages (software upgrades, parameter changes, etc.) originating from the EVM into Cosmos SDK messages.
In summary, the functions performed by the evmgov module can be outlined as follows:
Receiving EVM events (the
MsgExecuteevent from ConsensusGovernanceEntrypoint)Converting messages extracted from EVM events into Cosmos SDK type messages then executing the relevant message handler to perform the actual governance action
Event processing
The evmgov module's event handler processes events emitted by the ConsensusGovernanceEntrypoint contract on the EVM and performs the following key functions:
Event filtering. The FilterParams function only processes events from a specific contract address (govEntrypointContractAddr) and with a specific event ID (MsgExecute). It improves system efficiency by preventing unnecessary event processing.
Event delivery and handling. The Deliver function is the main function that receives and handles EVM log events. It uses a cached context to ensure atomicity of state changes and contains logic to either ignore or propagate errors based on their severity.
EVM event-execution processing. The processMsgExecute function executes governance messages passed from the EVM. Each message goes through the following steps.
ParseMessage: This parses the incoming message. The incoming message must comply with the Cosmos SDK message type.ExecuteMessage: This executes the parsed message. The predefined message handler will be executed.