Expand description
The VM runtime
Transaction flow
This is the path taken to process a single transaction.
SignedTransaction
+
|
+--------------------------|-------------------+
| Validate +--------------+--------------+ |
| | | |
| | check signature | |
| | | |
| +--------------+--------------+ |
| | |
| | |
| v |
| +--------------+--------------+ |
| | | |
| | check size and gas | |
| | | +---------------------------------+
| +--------------+--------------+ | validation error |
| | | |
| | | |
| v | |
| +--------------+--------------+ | |
| | | | |
| | run prologue | | |
| | | | |
| +--------------+--------------+ | |
| | | |
+--------------------------|-------------------+ |
| |
+--------------------------|-------------------+ |
| v | |
| Verify +--------------+--------------+ | |
| | | | |
| | deserialize script, | | |
| | verify arguments | | |
| | | | |
| +--------------+--------------+ | |
| | | |
| | | v
| v | +----------------+------+
| +--------------+--------------+ | | |
| | | +------------------->+ discard, no write set |
| | deserialize modules | | verification error | |
| | | | +----------------+------+
| +--------------+--------------+ | ^
| | | |
| | | |
| v | |
| +--------------+--------------+ | |
| | | | |
| | verify scripts and modules | | |
| | | | |
| +--------------+--------------+ | |
| | | |
+--------------------------|-------------------+ |
| |
+--------------------------|-------------------+ |
| v | |
| Execute +--------------+--------------+ | |
| | | | |
| | execute main | | |
| | | | |
| +--------------+--------------+ | |
| | | |
| success or failure | | |
| v | |
| +--------------+--------------+ | |
| | | +---------------------------------+
| | run epilogue | | invariant violation (internal panic)
| | | |
| +--------------+--------------+ |
| | |
| | |
| v |
| +--------------+--------------+ | +-----------------------+
| | | | execution failure | |
| | make write set +------------------------>+ keep, only charge gas |
| | | | | |
| +--------------+--------------+ | +-----------------------+
| | |
+--------------------------|-------------------+
|
v
+--------------+--------------+
| |
| keep, transaction executed |
| + gas charged |
| |
+-----------------------------+
Re-exports
pub use crate::diem_vm::DiemVM;
Modules
- Scratchpad for on chain values during the execution.
- Module containing remapping information between script hashes and their remapped script function
- Names of modules, functions, and types used by Diem System.
Macros
Traits
- This trait describes the VM’s execution interface.
- This trait describes the VM’s validation interfaces.