Closed sergefdrv closed 1 year ago
Notes about Block-STM implementation in Diem:
Notes about Block-STM implementation in Aptos:
aptos-move/block-executor
.task::Transaction
defines the key type specific to Aptos notions of account address
and access path; therefore, the implementation would need to be
adjusted for FVM.task::Transaction
- defines the Key
and Value
types,task::TransactionOutput
- execution result of a single
transaction,TStateView
- read-only snapshot of the global state,task::ExecutorTask
- single-threaded transaction executor.Notes about FMV/FEVM:
/// DAG-CBOR tuple-encoded.
pub struct State {
/// The EVM contract bytecode
pub bytecode: Cid,
/// The EVM contract bytecode hash keccak256(bytecode)
pub bytecode_hash: [u8; 20],
/// The EVM contract state dictionary.
pub contract_state: Cid,
/// The EVM nonce used to track how many times CREATE or
/// CREATE2 have been called.
pub nonce: u64,
/// Possibly a tombstone if this actor has been self-destructed.
pub tombstone: Option<Tombstone>
}
EVM storage (state dictionary, u256 => u256 map) is backed by a Filecoin HAMT with special optimizations to be more mechanically sympathetic to EVM read and write patterns. SLOAD and SSTORE opcodes map to reads and writes, respectively, on this HAMT, and ultimately to ipld syscalls.
Notes about Block-STM: