massa_execution_exports/
lib.rs

1// Copyright (c) 2022 MASSA LABS <info@massa.net>
2
3//! # Overview
4//!
5//! This crate provides all the facilities to interact with a running execution worker (massa-execution-worker crate)
6//! that is in charge of executing operations in a virtual machine,
7//! and applying the effects of the execution to a ledger.
8//!
9//! # Usage
10//!
11//! When an execution worker is launched to run in a separate thread for the whole duration of the process,
12//! an instance of `ExecutionManager` is returned (see the documentation of `start_execution_worker` in `massa-execution-worker`),
13//! as well as an instance of `ExecutionController`.
14//!
15//! The non-cloneable `ExecutionManager` allows stopping the execution worker thread.
16//!
17//! The cloneable `ExecutionController` allows sending updates on the latest blockclique changes to the execution worker
18//! for it to keep track of them and execute the operations present in blocks.
19//! It also allows various read-only queries such as executing bytecode
20//! while ignoring all the changes it would cause to the consensus state (read-only execution),
21//! or reading the state at the output of the executed blockclique blocks.
22//!
23//! # Architecture
24//!
25//! ## `config.rs`
26//! Contains configuration parameters for the execution system.
27//!
28//! ## `controller_traits.rs`
29//! Defines the `ExecutionManager` and `ExecutionController` traits for interacting with the execution worker.
30//!
31//! ## `errors.rs`
32//! Defines error types for the crate.
33//!
34//! ## `event_store.rs`
35//! Defines an indexed, finite-size storage system for execution events.
36//!
37//! ## `types.rs`
38//! Defines useful shared structures.
39//!
40//! ## Test exports
41//!
42//! When the crate feature `test-exports` is enabled, tooling useful for test-exports purposes is exported.
43//! See `test_exports/mod.rs` for details.
44//!
45//! # Execution trace
46//!
47//! See documentation in types_trace_info.rs file.
48
49#![warn(missing_docs)]
50#![warn(unused_crate_dependencies)]
51mod channels;
52mod controller_traits;
53mod error;
54mod event_store;
55/// mapping grpc
56pub mod mapping_grpc;
57mod settings;
58mod types;
59
60pub use channels::ExecutionChannels;
61#[cfg(feature = "test-exports")]
62pub use controller_traits::MockExecutionController;
63pub use controller_traits::{ExecutionController, ExecutionManager};
64pub use error::{ExecutionError, ExecutionQueryError};
65pub use event_store::EventStore;
66pub use massa_sc_runtime::{CondomLimits, GasCosts};
67use massa_serialization as _;
68#[cfg(test)]
69use mockall as _;
70pub use settings::{ExecutionConfig, StorageCostsConstants};
71use tracing as _;
72pub use types::{
73    ExecutedBlockInfo, ExecutionAddressInfo, ExecutionBlockMetadata, ExecutionOutput,
74    ExecutionQueryCycleInfos, ExecutionQueryExecutionStatus, ExecutionQueryRequest,
75    ExecutionQueryRequestItem, ExecutionQueryResponse, ExecutionQueryResponseItem,
76    ExecutionQueryStakerInfo, ExecutionStackElement, ReadOnlyCallRequest, ReadOnlyExecutionOutput,
77    ReadOnlyExecutionRequest, ReadOnlyExecutionTarget, SlotExecutionOutput,
78};
79
80#[cfg(any(feature = "test-exports", feature = "gas_calibration"))]
81pub mod test_exports;
82
83/// types for execution-trace
84pub mod types_trace_info;
85
86/// types for execution-info
87pub mod execution_info;
88
89#[cfg(feature = "execution-trace")]
90pub use types_trace_info::{
91    AbiTrace, SCRuntimeAbiTraceType, SCRuntimeAbiTraceValue, SlotAbiCallStack, Transfer,
92};