sigil-node · engine
Source declarations, signatures and documentation for engine.
Source: sigil/node/sigil-node/src/engine.rs. SHA-256: 0734c0e521c5d0f4818d219f3e816df9a552f716afa4e8e284ca4012136f22e8.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
engine::BlockEngine
Block production and execution engine.
Runs in a loop, draining the mempool and producing blocks at the target
interval. Uses AtomicU64 for the current height so run(&self) can
be called on a shared reference from multiple tasks.
pub struct BlockEngine {
}Source line: 53.
engine::BlockEngine::new
Create a new block engine from bootstrap results, genesis config, and an optional bootstrap agent team.
When a BootstrapTeam is provided, block production uses agent-driven
proposer rotation. Without one, it falls back to the single validator
DID from the bootstrap result.
pub fn new(
bootstrap: BootstrapResult,
mempool: Arc<RwLock<Mempool>>,
genesis: &GenesisConfig,
bootstrap_team: Option<BootstrapTeam>,
) -> Result<Self, NodeError>;Source line: 108.
engine::BlockEngine::height
Current block height (atomic read — safe from any thread).
pub fn height(&self) -> u64;Source line: 940.
engine::BlockEngine::chain_id
The chain ID this engine is producing blocks for.
pub fn chain_id(&self) -> &str;Source line: 945.
engine::BlockEngine::genesis_accounts
Number of genesis accounts loaded.
pub fn genesis_accounts(&self) -> usize;Source line: 950.
engine::BlockEngine::genesis_supply
Total initial supply loaded from genesis.
pub fn genesis_supply(&self) -> u64;Source line: 955.
engine::BlockEngine::target_block_time
Target block time in whole seconds, rounded up for legacy callers.
pub fn target_block_time(&self) -> u64;Source line: 960.
engine::BlockEngine::target_block_time_ms
Target block time in milliseconds.
pub fn target_block_time_ms(&self) -> u64;Source line: 965.
engine::BlockEngine::target_block_time_seconds
Target block time in seconds, preserving sub-second precision.
pub fn target_block_time_seconds(&self) -> f64;Source line: 970.
engine::BlockEngine::validator_summary
Validator set summary.
pub fn validator_summary(&self) -> &str;Source line: 975.
engine::BlockEngine::has_bootstrap_team
Whether this engine has a bootstrap agent team.
pub fn has_bootstrap_team(&self) -> bool;Source line: 980.
engine::BlockEngine::tower_genesis_params
Return the Tower consensus parameters loaded from genesis.
Used by diagnostics endpoints, the P2P gossip layer, and future Tower slot-scheduling logic that needs epoch/committee configuration.
pub fn tower_genesis_params(&self) -> &sigil_core::genesis::TowerParams;Source line: 988.
engine::BlockEngine::governance_genesis_params
Return the governance parameters loaded from genesis.
Used by RPC chain_getGenesisConfig and the governance execution
path that needs deposit minimums, voting periods, and quorum thresholds.
pub fn governance_genesis_params(&self) -> &sigil_core::genesis::GovernanceParams;Source line: 996.
engine::BlockEngine::execution_state
Return a shared reference to the execution state.
Used to wire the RPC server so query methods (sigil_getBalance,
sigil_getIdentity, sigil_getValidator, sigil_getValidatorSet)
can read live chain state.
pub fn execution_state(&self) -> Arc<dyn ExecutionState>;Source line: 1005.
engine::BlockEngine::block_store
Returns a shared reference to the block store.
The store is always present — BlockEngine::new is fatal if it cannot be opened.
pub fn block_store(&self) -> Arc<dyn BlockStore>;Source line: 1012.
engine::BlockEngine::parent_hash_for_current_height
Hash of the block that should be used as the parent for the current height. At height 1 the parent is the genesis state commitment; after a restart it is the hash of the latest persisted canonical block.
pub fn parent_hash_for_current_height(&self) -> Result<SigilHash, NodeError>;Source line: 1019.
engine::BlockEngine::take_attestation_rx
Take the Tower attestation receiver channel, if present.
Must be called exactly once after BlockEngine::new to wire the
outbound attestation queue to the gossip transport. Returns None
for non-validator nodes (no tower runtime).
pub fn take_attestation_rx(&self) -> Option<crate::tower_runtime::AttestationReceiver>;Source line: 1097.
engine::BlockEngine::on_tower_attestation_received
Process an inbound Tower attestation received from a peer via gossip.
Verifies the signature, persists via commit_tower_tx, and advances
Casper FFG finality state. Call this from the gossip handler task
when a MessagePayload::TowerAttestation arrives on
GossipTopic::TowerAttestations.
pub fn on_tower_attestation_received(
&self,
msg: sigil_network::message::TowerAttestationMessage,
) -> Result<(), crate::error::NodeError>;Source line: 1110.
engine::BlockEngine::run
Run the block production loop. Takes &self — uses AtomicU64 for height.
When a bootstrap team is present, the proposer rotates each block via round-robin among block producers. Each block is signed by the proposer agent's Ed25519 key.
pub async fn run(&self) -> Result<(), NodeError>;Source line: 1133.
engine::MemoryExecutionState::install_nft_durable
Install a durable NFT store backed by AkashaKV. After this call all
NFT reads and writes are routed through the store; the in-memory
HashMap fields remain available as the test/fallback path when no
durable store has been installed.
Called from BlockEngine::new on startup so the production node has
durable NFT state from the very first block; tests may also call this
explicitly with a tempfile-backed store.
pub fn install_nft_durable(
&self,
store: crate::nft_durable::ArcNftStore,
) -> Result<(), NodeError>;Source line: 2580.
engine::MemoryExecutionState::install_dex_durable
Install a durable native DEX store. After this call all DEX reads and writes use AkashaKV; the in-memory maps remain only as dev/test fallbacks and snapshot mirrors.
pub fn install_dex_durable(
&self,
store: crate::dex_durable::ArcDexStore,
) -> Result<(), NodeError>;Source line: 2604.
engine::MemoryExecutionState::install_storage_market_durable
pub fn install_storage_market_durable(
&self,
store: crate::storage_market_durable::ArcStorageMarketStore,
) -> Result<(), NodeError>;Source line: 2672.
engine::MemoryExecutionState::install_nova_durable
Install a durable Nova store. After this call all Nova reads and writes use AkashaKV; the in-memory maps remain mirrors for validation snapshots and state-root computation.
pub fn install_nova_durable(
&self,
store: crate::nova_durable::ArcNovaStore,
) -> Result<(), NodeError>;Source line: 2796.
engine::MemoryExecutionState::install_contract_durable
Install a durable Agent Contract Zone store backed by AkashaKV. After
this call all contract reads and writes are routed through the store.
Called from BlockEngine::new on startup so the production node has
durable contract state from the very first block.
#[cfg(feature = "contracts")]
pub fn install_contract_durable(
&self,
store: crate::contract_durable::ArcContractStore,
) -> Result<(), NodeError>;Source line: 2862.
engine::MemoryExecutionState::install_tower_durable
Install a durable Tower finality store backed by AkashaKV. After this
call all Tower reads and writes are routed through the store and survive
process restart. Called from BlockEngine::new on startup so the
production node has durable Tower state from the very first block.
pub fn install_tower_durable(
&self,
store: crate::tower_durable::ArcTowerStore,
) -> Result<(), NodeError>;Source line: 2945.
engine::MemoryExecutionState::install_gal_durable
#[cfg(feature = "tower")]
pub fn install_gal_durable(
&self,
store: crate::gal_durable::ArcGalStore,
) -> Result<(), NodeError>;Source line: 2967.
engine::MemoryExecutionState::install_governance_durable
Wire in the durable AkashaKV-backed Governance store. Called from
BlockEngine::new so proposal creation, voting, and timelock operations
survive process restart. Failure to install is fatal.
pub fn install_governance_durable(
&self,
store: crate::governance_durable::ArcGovernanceStore,
) -> Result<(), NodeError>;Source line: 3031.
engine::MemoryExecutionState::install_labor_durable
Wire in the durable AkashaKV-backed Labor Marketplace store. Called from
BlockEngine::new so contract creation, milestone release, worker
indexes, and audit events survive process restart. Failure to install is fatal.
pub fn install_labor_durable(
&self,
store: crate::labor_durable::ArcLaborStore,
) -> Result<(), NodeError>;Source line: 3068.
engine::MemoryExecutionState::install_crucible_durable
Wire in the durable AkashaKV-backed Crucible training store. The store is opened on startup even though the execution policy remains disabled by default, so governance activation later cannot lose prior anchors.
pub fn install_crucible_durable(
&self,
store: crate::crucible_durable::ArcCrucibleStore,
) -> Result<(), NodeError>;Source line: 3092.
engine::MemoryExecutionState::install_crucible_policy
pub fn install_crucible_policy(
&self,
policy: sigil_crucible::CruciblePolicy,
) -> Result<(), NodeError>;Source line: 3159.
engine::MemoryExecutionState::install_username_durable
Wire in the durable AkashaKV-backed username registry. Called from
BlockEngine::new so register/transfer/release transactions survive
process restart. Failure to install is fatal.
pub fn install_username_durable(
&self,
store: crate::username_durable::ArcUsernameStore,
) -> Result<(), NodeError>;Source line: 3183.
engine::MemoryExecutionState::install_mail_durable
pub fn install_mail_durable(
&self,
store: crate::mail_durable::ArcMailStore,
) -> Result<(), NodeError>;Source line: 3243.
engine::MemoryExecutionState::install_username_params
Replace the live UsernameParams policy (e.g. genesis bootstrap or a
future governance param-change hook).
pub fn install_username_params(
&self,
params: sigil_core::username::UsernameParams,
) -> Result<(), NodeError>;Source line: 3473.
engine::MemoryExecutionState::install_recovery_durable
Wire in the durable AkashaKV-backed recovery store. Called from
BlockEngine::new so initiated recovery ceremonies survive restart
during their multi-day timelock window. Failure to install is fatal.
#[allow(dead_code)]
pub fn install_recovery_durable(
&self,
store: crate::recovery_durable::ArcRecoveryStore,
) -> Result<(), NodeError>;Source line: 3488.