Module massa_execution_worker::context
source · Expand description
This module represents the context in which the VM executes bytecode. It provides information such as the current call stack. It also maintains a “speculative” ledger state which is a virtual ledger as seen after applying everything that happened so far in the context. More generally, the context acts only on its own state and does not write anything persistent to the consensus state.
Structs§
- An execution context that needs to be initialized before executing bytecode, passed to the VM to interact with during bytecode execution (through ABIs), and read after execution to gather results.
- A snapshot taken from an
ExecutionContextand that represents its current state. TheExecutionContextstate can then be restored later from this snapshot.
Functions§
- Generate the execution trail hash
- Initializes and seeds the PRNG with the given execution trail hash.
- Truncates a string to a maximum byte length, ensuring it remains valid UTF-8 in the process.