Skip to content

Commit d463e0e

Browse files
committed
fix
1 parent fa30ad2 commit d463e0e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/access_list.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ pub struct AccessListInspector {
2020
access_list: HashMap<Address, BTreeSet<B256>>,
2121
}
2222

23+
impl From<AccessList> for AccessListInspector {
24+
fn from(access_list: AccessList) -> Self {
25+
Self::new(access_list)
26+
}
27+
}
28+
2329
impl AccessListInspector {
2430
/// Creates a new inspector instance
2531
///
@@ -55,14 +61,18 @@ impl AccessListInspector {
5561
AccessList(items.collect())
5662
}
5763

58-
/// Collects addresses which should be excluded from the access list.
64+
/// Collects addresses which should be excluded from the access list. Must be called before the
65+
/// top-level call.
5966
///
6067
/// Those include caller, callee and precompiles.
6168
fn collect_excluded_addresses<DB: Database>(&mut self, context: &EvmContext<DB>) {
6269
let from = context.env.tx.caller;
6370
let to = if let TxKind::Call(to) = context.env.tx.transact_to {
6471
to
6572
} else {
73+
// We need to exclude the created address if this is a CREATE frame.
74+
//
75+
// This assumes that caller has already been loaded but nonce was not increased yet.
6676
let nonce = context.journaled_state.account(from).info.nonce;
6777
from.create(nonce)
6878
};

0 commit comments

Comments
 (0)