From 6559b066297fea2f3d6eb1394777be5eafd07238 Mon Sep 17 00:00:00 2001 From: yongkangc Date: Tue, 23 Dec 2025 05:01:39 +0000 Subject: [PATCH] revert(trie): restore prefilled storage multiproofs --- crates/trie/trie/src/proof/mod.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/trie/trie/src/proof/mod.rs b/crates/trie/trie/src/proof/mod.rs index fb6fcefc36..c0b9012355 100644 --- a/crates/trie/trie/src/proof/mod.rs +++ b/crates/trie/trie/src/proof/mod.rs @@ -133,9 +133,10 @@ where .with_proof_retainer(retainer) .with_updates(self.collect_branch_node_masks); - // Lazily populate storage multiproofs only for accounts that are actual proof targets. + // Initialize all storage multiproofs as empty. + // Storage multiproofs for non-empty tries will be overwritten if necessary. let mut storages: B256Map<_> = - B256Map::with_capacity_and_hasher(targets.len(), Default::default()); + targets.keys().map(|key| (*key, StorageMultiProof::empty())).collect(); let mut account_rlp = Vec::with_capacity(TRIE_ACCOUNT_RLP_MAX_SIZE); let mut account_node_iter = TrieNodeIter::state_trie(walker, hashed_account_cursor); while let Some(account_node) = account_node_iter.try_next()? {