Skip to content

Commit

Permalink
Address comments (part 1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Stefan-Ethernal committed Mar 5, 2024
1 parent 5b101bd commit 4afb72d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
8 changes: 7 additions & 1 deletion state/executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
8 changes: 2 additions & 6 deletions tests/evm_benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
}
}
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 4afb72d

Please sign in to comment.