From f6cc6e3ed1343721891091b77b2d3d9ca001a550 Mon Sep 17 00:00:00 2001 From: Jamie Lokier Date: Wed, 26 May 2021 16:05:18 +0100 Subject: [PATCH] Transaction: EIP-2930 (Berlin): Per-transaction extra access list Add `accessList` to the `runComputation` API for EIP-2930 transactions. Signed-off-by: Jamie Lokier --- nimbus/transaction/call_common.nim | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/nimbus/transaction/call_common.nim b/nimbus/transaction/call_common.nim index 0f0ad53e7..5fc933602 100644 --- a/nimbus/transaction/call_common.nim +++ b/nimbus/transaction/call_common.nim @@ -26,6 +26,7 @@ type isCreate*: bool # True if this is a contract creation. value*: HostValue # Value sent from sender to recipient. input*: seq[byte] # Input data. + accessList*: AccessList # EIP-2930 (Berlin) tx access list. # Standard call result. (Some fields are beyond what EVMC can return, # and must only be used from tests because they will not always be set). @@ -70,6 +71,12 @@ proc initialAccessListEIP2929(call: CallParams) = for c in activePrecompiles(): db.accessList(c) + # EIP2930 optional access list. + for account in call.accessList: + db.accessList(account.address) + for key in account.storageKeys: + db.accessList(account.address, UInt256.fromBytesBE(key)) + proc setupCall(call: CallParams, useIntrinsic: bool): TransactionHost = let vmState = call.vmState vmState.setupTxContext(