// Copyright (c) Aptos
// SPDX-License-Identifier: Apache-2.0
//! # The VM runtime
//!
//! ## Transaction flow
//!
//! This is the path taken to process a single transaction.
//!
//! ```text
//! 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 |
//! | |
//! +-----------------------------+
//! ```
extern crate mirai_annotations;
pub use crate AptosVM;
use StateView;
use ;
use ;
/// This trait describes the VM's validation interfaces.
/// This trait describes the VM's execution interface.
/// Get the AccessPath to a resource stored under `address` with type name `tag`