From 7d9cc6c9efc0307cc5916949a90aaa3df2f38f47 Mon Sep 17 00:00:00 2001 From: Daniel Liu Date: Fri, 31 May 2024 11:35:19 +0800 Subject: [PATCH] core/statedb: always clear out access list when setting a new one (#24515) --- core/state/statedb.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/state/statedb.go b/core/state/statedb.go index bac5106f5b964..db57aa2a75ded 100644 --- a/core/state/statedb.go +++ b/core/state/statedb.go @@ -655,7 +655,6 @@ func (self *StateDB) Prepare(thash, bhash common.Hash, ti int) { self.thash = thash self.bhash = bhash self.txIndex = ti - self.accessList = newAccessList() } // DeleteSuicides flags the suicided objects for deletion so that it @@ -740,6 +739,9 @@ func (s *StateDB) Commit(deleteEmptyObjects bool) (root common.Hash, err error) // // This method should only be called if Yolov3/Berlin/2929+2930 is applicable at the current number. func (s *StateDB) PrepareAccessList(sender common.Address, dst *common.Address, precompiles []common.Address, list types.AccessList) { + // Clear out any leftover from previous executions + s.accessList = newAccessList() + s.AddAddressToAccessList(sender) if dst != nil { s.AddAddressToAccessList(*dst)