Expand description
SputnikVM implementation, traits and structs
§Lifecycle
A VM can be started given a Context and a BlockHeader. The
user can then fire or step to run it. Those functions would
only fail if it needs some information (accounts in the current
block, or block hashes of previous blocks). If this happens, one
can use the function commit_account and commit_blockhash to
commit those information to the VM, and fire or step again
until it succeeds. The current VM status can always be obtained
using the status function.
Re-exports§
pub use self::errors::OnChainError;pub use self::errors::NotSupportedError;pub use self::errors::RequireError;pub use self::errors::CommitError;pub use self::errors::PreExecutionError;
Modules§
- errors
- VM errors
Structs§
- Account
State - A struct that manages the current account state for one EVM.
- Blockhash
State - A struct that manages the current blockhash state for one EVM.
- Context
- A VM context. See the Yellow Paper for more information.
- ContextVM
- A VM that executes using a context and block information.
- ECREC
Precompiled - ECREC precompiled contract.
- Embedded
Account Patch - Mainnet account patch
- Embedded
Byzantium Account Patch - Mainnet account patch
- Embedded
Byzantium Patch - Embedded patch.
- Embedded
Patch - Embedded patch.
- Header
Params - Block header.
- IDPrecompiled
- ID precompiled contract.
- Log
- Machine
- A VM state with PC.
- PC
- Represents a program counter in EVM.
- PCMut
- Represents a mutable program counter in EVM.
- RIP160
Precompiled - RIP160 precompiled contract.
- Runtime
- A VM runtime. Only available in eval.
- SHA256
Precompiled - SHA256 precompiled contract.
- SeqMemory
- A sequencial memory. It uses Rust’s
Vecfor internal representation. - Stack
- Represents an EVM stack.
- State
- A VM state without PC.
- Storage
- Internal representation of an account storage. It will return a
RequireErrorif trying to access non-existing storage. - TransactionVM
- A VM that executes using a transaction and block information.
- Untrusted
Transaction - Represents an untrusted Ethereum transaction.
- VMTest
Patch - Patch sepcific for the
jsontestscrate. - Valid
Transaction - Represents an Ethereum transaction.
- Valids
- Mapping of valid jump destination from code.
Enums§
- Account
Change - Represents an account. This is usually returned by the EVM.
- Account
Commitment - A single account commitment.
- Instruction
- Instructions for the program counter. This is the same as
OpcodeexceptPUSH, which might take longer length. - Machine
Status - Represents the current runtime status.
- Opcode
- Opcode enum. One-to-one corresponding to an
u8value. - Transaction
Action - VMStatus
- VM Status
Statics§
- ECREC_
PRECOMPILED - Static value of ECREC precompiled contract.
- EMBEDDED_
PRECOMPILEDS - Default precompiled collections.
- ID_
PRECOMPILED - Static value of ID precompiled contract.
- RIP160_
PRECOMPILED - Static value of RIP160 precompiled contract.
- SHA256_
PRECOMPILED - Static value of SHA256 precompiled contract.
Traits§
- Account
Patch - Account patch for account related variables.
- Memory
- Represent a memory in EVM. Read should always succeed. Write can fall.
- Patch
- Represents different block range context.
- Precompiled
- Represent a precompiled contract.
- VM
- Represents an EVM. This is usually the main interface for clients to interact with.
Type Aliases§
- SeqContextVM
- A sequencial VM. It uses sequencial memory representation and hash map storage for accounts.
- SeqTransactionVM
- A sequencial transaction VM. This is same as
SeqContextVMexcept it runs at transaction level.