From 41f0f01982306084defbff6ddb16250e5d6429ca Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Mon, 17 Feb 2025 16:26:36 +0100 Subject: [PATCH] chore: allow missing total difficulty when loading node head (#14533) --- crates/node/core/src/node_config.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/node/core/src/node_config.rs b/crates/node/core/src/node_config.rs index fef518c60..ff36528dc 100644 --- a/crates/node/core/src/node_config.rs +++ b/crates/node/core/src/node_config.rs @@ -323,7 +323,9 @@ impl NodeConfig { let total_difficulty = provider .header_td_by_number(head)? - .expect("the total difficulty for the latest block is missing, database is corrupt"); + // total difficulty is effectively deprecated, but still required in some places, e.g. + // p2p + .unwrap_or_default(); let hash = provider .block_hash(head)?