Expand description
Integration of the Revm EVM runtime with Linera.
This module provides the glue between Linera’s blockchain infrastructure and the Revm EVM interpreter, enabling Ethereum smart contracts to run on Linera chains.
§Architecture
The integration consists of several key components:
-
Database Trait Implementations: Adapts Linera’s storage layer to Revm’s
DatabaseandDatabaseReftraits (seedatabase.rs). -
Inspector Pattern: Intercepts EVM operations like contract creation and calls to bridge between Revm’s execution model and Linera’s runtime requirements.
-
Precompiles: Extends standard Ethereum precompiles with Linera-specific functionality accessible from EVM contracts.
-
Contract/Service Modules: Provides both contract (mutable) and service (read-only query) execution modes for EVM bytecode.
§Cross-Contract Communication
EVM contracts running on Linera can interact with each other using fictional
selectors (see GET_ACCOUNT_INFO_SELECTOR, etc.) that don’t correspond to real
EVM functions but enable internal protocol operations like querying state from
other contracts or committing changes across contract boundaries.
Structs§
Enums§
- EvmContract
Module - EvmService
Module - A user service in a compiled EVM module.
Constants§
- ALREADY_
CREATED_ CONTRACT_ SELECTOR - Fictional selector for creating a contract from a pre-populated account.
- COMMIT_
CONTRACT_ CHANGES_ SELECTOR - Fictional selector for internal cross-contract calls to commit state changes.
- GET_
ACCOUNT_ INFO_ SELECTOR - Fictional selector for internal cross-contract calls to retrieve account information.
- GET_
CONTRACT_ STORAGE_ SELECTOR - Fictional selector for internal cross-contract calls to retrieve storage values.
- JSON_
EMPTY_ VECTOR - The JSON serialization of an empty vector:
[].