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::aptos_vm::AptosVM;

Modules

Scratchpad for on chain values during the execution.

Names of modules, functions, and types used by Aptos System.

Traits

This trait describes the VM’s execution interface.

This trait describes the VM’s validation interfaces.