You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 53cac74
Browse filesBrowse the repository at this point in the historyBrowse files
perf(evm): key transientAccounts by address (#4723)
## Summary
`TemporaryState.transientAccounts` was keyed by `acc.Hex()`, so every
`MarkAccount` and `HasSelfDestructed` call computed an EIP-55 checksum
(a Keccak-256 hash) and allocated a string, and the self-destruct sweeps
in `Finalize` parsed the keys back with `HexToAddress`. This keys the
map
by `common.Address` in both `x/evm/state` and `giga/deps/xevm/state`.
- Share the destructed-account scan between the two `Finalize` sweeps
- Use `uint256.IsZero` for the residual balance check
- Drop a redundant nil assignment in `MarkAccount`
- Add `MarkAccount`/`HasSelfDestructed` benchmarks and a self-destruct
sweep test
## Benchmarks
Apple M5, 8 runs × 500k iterations, benchstat (p=0.000):
| Benchmark | Before | After |
|---------------------|------------------|------------------|
| `MarkAccount` | 645 ns, 6 allocs | 35 ns, 1 alloc |
| `HasSelfDestructed` | 302 ns, 2 allocs | 7 ns, 0 allocs |
0 commit comments