diff --git a/state/executor.go b/state/executor.go index 54b5ace14f..4de1b28a5d 100644 --- a/state/executor.go +++ b/state/executor.go @@ -1361,7 +1361,13 @@ func (t *Transition) RevertToSnapshot(snapshot int) error { } // PopulateAccessList populates access list based on the provided access list -func (t *Transition) PopulateAccessList(acl types.TxAccessList) { +func (t *Transition) PopulateAccessList(from types.Address, to *types.Address, acl types.TxAccessList) { + t.AddAddressToAccessList(from) + + if to != nil { + t.AddAddressToAccessList(*to) + } + for _, accessInfo := range acl { t.AddAddressToAccessList(accessInfo.Address) diff --git a/tests/evm_benchmark_test.go b/tests/evm_benchmark_test.go index d7540fc9db..bb07e74dd8 100644 --- a/tests/evm_benchmark_test.go +++ b/tests/evm_benchmark_test.go @@ -54,7 +54,7 @@ func BenchmarkEVM(b *testing.B) { for idx, postStateEntry := range postState { err := runBenchmarkTest(b, tc, fc, postStateEntry) - require.NoError(b, err, fmt.Sprintf("test %s (case#%d) execution failed", getTestName(file), idx)) + require.NoError(b, err, fmt.Sprintf("test %s (case#%d) execution failed", name, idx)) } } } @@ -134,11 +134,7 @@ func runBenchmarkTest(b *testing.B, c testCase, fc *forkConfig, p postEntry) err for n := 0; n < b.N; n++ { snapshotID := transition.Snapshot() if currentForks.Berlin { - transition.PopulateAccessList(msg.AccessList()) - transition.AddAddressToAccessList(msg.From()) - if msg.To() != nil { - transition.AddAddressToAccessList(*msg.To()) - } + transition.PopulateAccessList(msg.From(), msg.To(), msg.AccessList()) } b.StartTimer()