Skip to main content

Module tempo

Module tempo 

Source
Expand description

Tempo consensus owned by the canonical in-memory chain.

Mining checks consensus metadata before committing execution and signs the final header in the same storage write guard that publishes its block. Cache commits and state-root computation do not hold the storage lock, so readers can still access the published chain.

Imports that change canonical history start an unsigned signing segment. Database snapshots remain usable, but reverting across that import boundary starts a new segment at the restored height. Snapshots within the current segment restore consensus exactly.

All live consensus mutations, including rotation RPCs, must acquire the database write lock before the storage lock. Mining retains that database guard from preparation through publication, preventing snapshots, rewinds, resets, imports, or rotations from changing the prepared height or key schedule. Only initialization before the backend is shared and private staged copies are exempt; publishing a staged copy still requires the database write lock. Consensus readers acquire the database read lock before storage.

Historical queries can use the trusted fork provider at or below its pinned height. They snapshot the provider, root, and known canonical hash together with local history, then release all guards before network I/O. Upstream blocks must match that canonical hash when known. An overlapping reset can complete while the request returns the old snapshot; upstream responses are never cached into the replacement chain. Upstream committees remain independent of the local development identity. Height-bounded forwarding does not establish an authenticated committee or ancestry chain from upstream history to locally signed blocks.

Locally mined fork headers seal the same partial account and storage trie used by proofs. Its snapshots live in a separate bounded history cache, sharing the execution history’s cache settings but preserving local trie membership through disk round trips. Only a canonical local certificate can select a snapshot. Rewinds remove orphaned proof states. Resets clear proof history before a replacement signing history starts.

Re-exportsΒ§

use super::Backend; πŸ”’
use super::state::StateRootCache; πŸ”’
use super::storage::BlockchainStorage; πŸ”’
use super::storage::InMemoryBlockStates; πŸ”’
use crate::eth::backend::db::MaybeFullDatabase; πŸ”’
use crate::eth::backend::tempo_consensus::TempoConsensus; πŸ”’
use crate::eth::backend::tempo_consensus::TempoConsensusIdentity; πŸ”’
use crate::eth::backend::tempo_consensus::TempoFinalization; πŸ”’
use crate::eth::error::BlockchainError; πŸ”’
use crate::eth::tempo_consensus::TempoCertifiedBlock; πŸ”’
use alloy_consensus::BlockHeader; πŸ”’
use alloy_consensus::Sealable; πŸ”’
use alloy_consensus::proofs::calculate_transaction_root; πŸ”’
use alloy_network::Network; πŸ”’
use alloy_primitives::Address; πŸ”’
use alloy_primitives::B256; πŸ”’
use alloy_primitives::U256; πŸ”’
use alloy_primitives::map::AddressMap; πŸ”’
use alloy_primitives::map::HashMap; πŸ”’
use alloy_provider::Provider; πŸ”’
use alloy_rpc_types::EIP1186AccountProofResponse as AccountProof; πŸ”’
use anvil_core::eth::block::Block; πŸ”’
use anvil_core::eth::block::canonical_block; πŸ”’
use anvil_rpc::error::ErrorCode; πŸ”’
use anvil_rpc::error::RpcError; πŸ”’
use parking_lot::Mutex; πŸ”’
use parking_lot::RwLock; πŸ”’
use parking_lot::RwLockUpgradableReadGuard; πŸ”’
use revm::database::DbAccount; πŸ”’
use std::fmt; πŸ”’
use std::num::NonZeroU64; πŸ”’
use std::sync::Arc; πŸ”’
use tempo_hardfork::TempoHardfork; πŸ”’
use tempo_primitives::TempoHeader; πŸ”’

StructsΒ§

TempoChain πŸ”’
Local certificates, key schedule, and consensus snapshots for the current signing history.
TempoSnapshot πŸ”’
Consensus and the sealed head trie retained by an explicit EVM snapshot.

FunctionsΒ§

certified_block πŸ”’
consensus_unavailable πŸ”’
latest_finalization πŸ”’
tempo_chain πŸ”’
tempo_unavailable πŸ”’