From e689423dcca811d68b98ec3b8ef6a3f1046beac0 Mon Sep 17 00:00:00 2001 From: Bruno Deferrari Date: Thu, 28 Mar 2024 19:26:16 -0300 Subject: [PATCH] Add a TODO comment in the genesis ledger loading code mentioning that the hash validation is mostly a no-op right now --- .../genesis/transition_frontier_genesis_config.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs b/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs index 1e03b415f..c530ae78f 100644 --- a/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs +++ b/node/src/transition_frontier/genesis/transition_frontier_genesis_config.rs @@ -110,6 +110,10 @@ impl GenesisConfig { let (mut mask, total_currency) = Self::build_ledger_from_accounts_and_hashes(accounts, hashes); let ledger_hash = ledger_hash(&mut mask); + + // TODO(tizoc): currently this doesn't really do much, because now we load the hashes + // from the bin_prot data too to speed up the loading. Maybe add some flag + // to force the rehashing and validation of the loaded ledger hashes. if let Some(expected_hash) = expected_hash.filter(|h| h != &ledger_hash) { anyhow::bail!("ledger hash mismatch after building the mask! expected: '{expected_hash}', got '{ledger_hash}'"); }