perf(trie): storage multiproof overallocation (#12959)

This commit is contained in:
Roman Krasiuk
2024-12-02 11:07:32 +01:00
committed by GitHub
parent c2ab690ad1
commit 04f8c58485
2 changed files with 13 additions and 5 deletions

View File

@ -203,7 +203,11 @@ where
account.encode(&mut account_rlp as &mut dyn BufMut);
hash_builder.add_leaf(Nibbles::unpack(hashed_address), &account_rlp);
storages.insert(hashed_address, storage_multiproof);
// We might be adding leaves that are not necessarily our proof targets.
if targets.contains_key(&hashed_address) {
storages.insert(hashed_address, storage_multiproof);
}
}
}
}