mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
perf: do not fetch proofs for selfdestructed accounts (#14486)
This commit is contained in:
@ -2806,8 +2806,14 @@ where
|
|||||||
MultiProofTargets::with_capacity_and_hasher(res.state.len(), Default::default());
|
MultiProofTargets::with_capacity_and_hasher(res.state.len(), Default::default());
|
||||||
let mut storage_targets = 0;
|
let mut storage_targets = 0;
|
||||||
for (addr, account) in res.state {
|
for (addr, account) in res.state {
|
||||||
// if account was not touched, do not fetch for it
|
// if the account was not touched, or if the account was selfdestructed, do not
|
||||||
if !account.is_touched() {
|
// fetch proofs for it
|
||||||
|
//
|
||||||
|
// Since selfdestruct can only happen in the same transaction, we can skip
|
||||||
|
// prefetching proofs for selfdestructed accounts
|
||||||
|
//
|
||||||
|
// See: https://eips.ethereum.org/EIPS/eip-6780
|
||||||
|
if !account.is_touched() || account.is_selfdestructed() {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user