Crate massa_ledger_worker
source ·Expand description
§General description
This crate implements a ledger matching addresses to balances, executable bytecode and data. It also provides tools to manipulate ledger entries.
FinalLedger is used as part of FinalState that represents the latest final state of the node
(see massa-final-state crate for more details).
FinalLedger representing a ledger at a given slot that was executed as final
(see the massa-execution-worker crate for details on execution).
Only the execution worker writes into the final ledger.
§Architecture
§ledger.rs
Defines the FinalLedger that matches an address to a LedgerEntry (see ledger_entry.rs),
and can be manipulated using LedgerChanges (see ledger_changes.rs).
The FinalLedger is bootstrapped using tooling available in bootstrap.rs
§ledger_entry.rs
Represents an entry in the ledger for a given address. It contains balances, executable bytecode and an arbitrary datastore.
§ledger_changes.rs
Represents a list of changes to ledger entries that can be modified, combined or applied to the final ledger.
§bootstrap.rs
Provides serializable structures and tools for bootstrapping the final ledger.
§Test exports
When the crate feature test-exports is enabled, tooling useful for test-exports purposes is exported.
See test_exports/mod.rs for details.
Modules§
- ledger 🔒This file defines the final ledger associating addresses to their balances, bytecode and data.
- Copyright (c) 2022 MASSA LABS info@massa.net Module to interact with the disk ledger
Structs§
- Represents a final ledger associating addresses to their balances, bytecode and data. The final ledger is part of the final state which is attached to a final slot, can be bootstrapped and allows others to bootstrap. The ledger size can be very high: it can exceed 1 terabyte. To allow for storage on disk, the ledger uses trees and has
O(log(N))access, insertion and deletion complexity.