Skip to content

[r3.4] execution/state: use index-based range over log topics to avoid copy#20372

Merged
AskAlexSharov merged 2 commits intorelease/3.4from
alex/topic_range_idx_34
Apr 7, 2026
Merged

[r3.4] execution/state: use index-based range over log topics to avoid copy#20372
AskAlexSharov merged 2 commits intorelease/3.4from
alex/topic_range_idx_34

Conversation

@AskAlexSharov
Copy link
Copy Markdown
Collaborator

Summary

  • Replace for _, topic := range lg.Topics with for i := range lg.Topics in applyLogsAndTraces4
  • Avoids copying each common.Hash (32 bytes) on every iteration; uses index access instead

Test plan

  • go test ./execution/state/...

@AskAlexSharov AskAlexSharov merged commit 42cb391 into release/3.4 Apr 7, 2026
22 checks passed
@AskAlexSharov AskAlexSharov deleted the alex/topic_range_idx_34 branch April 7, 2026 07:51
AskAlexSharov added a commit that referenced this pull request Apr 8, 2026
…d copy (#20372)

## Summary
- Replace `for _, topic := range lg.Topics` with `for i := range
lg.Topics` in `applyLogsAndTraces4`
- Avoids copying each `common.Hash` (32 bytes) on every iteration; uses
index access instead

## Test plan
- [ ] `go test ./execution/state/...`
github-merge-queue bot pushed a commit that referenced this pull request Apr 10, 2026
## Summary
Cherry-pick of release/3.4 PRs:
- #20368 rpc: use synctest for TestClientCancelHTTP to fix CI flakiness
- #20373 integrity: blk/sec fix
- #20372 execution/state: use index-based range over log topics to avoid
copy
- #20367 fix: preserve stored chain config when genesis hash doesn't
match known chain
- #20374 ParseVersion: optimize
- #20369 batchSize: more precise estimate
- #20399 hive: pin more things

---------

Co-authored-by: erigon-copilot[bot] <265817861+erigon-copilot[bot]@users.noreply.github.com>
Co-authored-by: root <giulio.rebuffo@gmail.com>
Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-authored-by: Muzry <muzrry@gmail.com>
Co-authored-by: muzry.li <muzry.li1@ambergroup.io>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: info@weblogix.biz <admin@10gbps.weblogix.it>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants