EIP-2929: add tx sender and address into the access list (#360)

This commit is contained in:
Wei Tang 2021-04-15 17:41:33 +02:00 committed by GitHub
parent 582bca385f
commit 6ce6666cbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1145,6 +1145,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
let mut access_list = AccessList::new(schedule.eip2929); let mut access_list = AccessList::new(schedule.eip2929);
if schedule.eip2929 { if schedule.eip2929 {
access_list.insert_address(sender);
for (address, _) in self.machine.builtins() { for (address, _) in self.machine.builtins() {
access_list.insert_address(*address); access_list.insert_address(*address);
} }
@ -1232,6 +1233,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
&nonce, &nonce,
&t.tx().data, &t.tx().data,
); );
access_list.insert_address(new_address);
let params = ActionParams { let params = ActionParams {
code_address: new_address.clone(), code_address: new_address.clone(),
code_hash: code_hash, code_hash: code_hash,
@ -1255,6 +1257,7 @@ impl<'a, B: 'a + StateBackend> Executive<'a, B> {
(res, out) (res, out)
} }
Action::Call(ref address) => { Action::Call(ref address) => {
access_list.insert_address(address.clone());
let params = ActionParams { let params = ActionParams {
code_address: address.clone(), code_address: address.clone(),
address: address.clone(), address: address.clone(),