Skip to content

Commit

Permalink
docs(bootstrap): Document the snarked ledger service interface
Browse files Browse the repository at this point in the history
  • Loading branch information
tizoc committed Mar 22, 2024
1 parent 2ce3404 commit 2aa788f
Showing 1 changed file with 10 additions and 0 deletions.
Expand Up @@ -3,24 +3,34 @@ use mina_p2p_messages::v2::{LedgerHash, MinaBaseAccountBinableArgStableV2};
use crate::ledger::LedgerAddress;

pub trait TransitionFrontierSyncLedgerSnarkedService: redux::Service {
/// For the given ledger, compute the merkle root hash, forcing
/// all pending hashes to be computed too.
fn compute_snarked_ledger_hashes(
&mut self,
snarked_ledger_hash: &LedgerHash,
) -> Result<(), String>;

/// Creates a new copy of the ledger stored under the `origin` hash
/// and stores it under the `target` hash. If `overwrite` is false,
/// only copy the ledger if the target doesn't exist already.
fn copy_snarked_ledger_contents(
&mut self,
origin: LedgerHash,
target: LedgerHash,
overwrite: bool,
) -> Result<bool, String>;

/// For the given ledger, get the two children hashes at the `parent`
/// address.
fn child_hashes_get(
&mut self,
snarked_ledger_hash: LedgerHash,
parent: &LedgerAddress,
) -> Result<(LedgerHash, LedgerHash), String>;

/// For the given ledger, sets all accounts in `accounts` under
/// the subtree starting at the `parent` address. The result
/// is the hash computed for that subtree.
fn accounts_set(
&mut self,
snarked_ledger_hash: LedgerHash,
Expand Down

0 comments on commit 2aa788f

Please sign in to comment.