[pull] main from erigontech:main#6
Merged
Merged
Conversation
…_EXECUTION_TESTS is set (#20928) **[SharovBot]** ## Problem Both `execution/tests` and `execution/tests/eest_blockchain` packages were timing out on the `macos-15` CI runner (20 minute timeout) because the `ERIGON_SKIP_EXECUTION_TESTS` guard only lived inside `testutil.TemporalDBWithDirs`, which is called lazily per test. The `TestMain`-level `RunTestMain` had no such check, so all the slow state/blockchain spec-test suites would still start and run until the timeout fired. Failing CI: https://github.com/erigontech/erigon/actions/runs/25155380978/job/73735755547 Error: ``` panic: test timed out after 20m0s running tests: TestState/stMemoryTest/buffer.json (1m27s) ... FAIL github.com/erigontech/erigon/execution/tests 1203.232s panic: test timed out after 20m0s running tests: TestExecutionSpecBlockchain/osaka/eip7825_transaction_gas_limit_cap/... FAIL github.com/erigontech/erigon/execution/tests/eest_blockchain 1200.375s ``` ## Fix Add an early `os.Exit(0)` at the top of `RunTestMain` when `ERIGON_SKIP_EXECUTION_TESTS` is set. This makes all 6 execution test packages exit cleanly and instantly on macOS/Windows CI runners: - `execution/tests` - `execution/tests/eest_blockchain` - `execution/tests/eest_cancun_blobs` - `execution/tests/eest_frontier_scenarios` - `execution/tests/eest_osaka_clz` - `execution/tests/eest_prague_calldata` The macOS matrix entry already sets `skip_execution_tests: 'true'` which maps to the env var — the per-test skip inside `TemporalDBWithDirs` was just too late; tests were already allocated and running. ## Testing - `go build ./execution/tests/testutil/...` ✅ - `go vet ./execution/tests/testutil/...` ✅ - No `*_test.go` files modified --------- Co-authored-by: erigon-copilot[bot] <erigon-ci-bot@erigontech.io> Co-authored-by: Giulio Rebuffo <giulio.rebuffo@gmail.com> Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This PR optimizes the `GetEffectiveGasTip` calculation to drastically
reduce heap allocations during block assembly and RPC fee processing
loops.
Previously, `GetEffectiveGasTip` returned a pointer (`*uint256.Int`),
forcing Go's escape analysis to allocate dynamically computed effective
tips onto the heap for every single transaction. This was a massive
garbage collection bottleneck in loops processing hundreds of
transactions per block.
Instead of patching callers with repetitive inline math logic, this PR
fixes the root cause by updating the core `Transaction` interface to
return `uint256.Int` **by value**.
Because `uint256.Int` is a fixed 32-byte struct, passing it by value is
extremely cheap and completely bypasses the heap; allocations are
drastically reduced from O(N) (every transaction) to O(K) (only the kept
items).
```
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/rpc/jsonrpc
cpu: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
│ old_bench_1.txt │ new_bench_1.txt │
│ sec/op │ sec/op vs base │
DelegateBlockFees/txs=1 334.8n ± 3% 137.4n ± 2% -58.95% (p=0.000 n=10)
DelegateBlockFees/txs=50 9.698µ ± 7% 1.363µ ± 4% -85.95% (p=0.000 n=10)
DelegateBlockFees/txs=200 37.105µ ± 5% 5.626µ ± 5% -84.84% (p=0.000 n=10)
geomean 4.939µ 1.018µ -79.40%
│ old_bench_1.txt │ new_bench_1.txt │
│ B/op │ B/op vs base │
DelegateBlockFees/txs=1 232.00 ± 0% 96.00 ± 0% -58.62% (p=0.000 n=10)
DelegateBlockFees/txs=50 6552.00 ± 0% 96.00 ± 0% -98.53% (p=0.000 n=10)
DelegateBlockFees/txs=200 25752.00 ± 0% 96.00 ± 0% -99.63% (p=0.000 n=10)
geomean 3.316Ki 96.00 -97.17%
│ old_bench_1.txt │ new_bench_1.txt │
│ allocs/op │ allocs/op vs base │
DelegateBlockFees/txs=1 9.000 ± 0% 3.000 ± 0% -66.67% (p=0.000 n=10)
DelegateBlockFees/txs=50 206.000 ± 0% 3.000 ± 0% -98.54% (p=0.000 n=10)
DelegateBlockFees/txs=200 806.000 ± 0% 3.000 ± 0% -99.63% (p=0.000 n=10)
geomean 114.3 3.000 -97.38%
```
```
goos: linux
goarch: amd64
pkg: github.com/erigontech/erigon/execution/execmodule
cpu: Intel(R) Core(TM) i7-8565U CPU @ 1.80GHz
│ old_bench.txt │ new_bench.txt │
│ sec/op │ sec/op vs base │
TotalFees/txs=1 68.93n ± 8% 65.36n ± 23% ~ (p=0.853 n=10)
TotalFees/txs=50 2.075µ ± 7% 1.196µ ± 3% -42.35% (p=0.000 n=10)
TotalFees/txs=200 8.668µ ± 6% 4.775µ ± 4% -44.92% (p=0.000 n=10)
geomean 1.074µ 720.0n -32.98%
│ old_bench.txt │ new_bench.txt │
│ B/op │ B/op vs base │
TotalFees/txs=1 64.00 ± 0% 32.00 ± 0% -50.00% (p=0.000 n=10)
TotalFees/txs=50 1632.00 ± 0% 32.00 ± 0% -98.04% (p=0.000 n=10)
TotalFees/txs=200 6432.00 ± 0% 32.00 ± 0% -99.50% (p=0.000 n=10)
geomean 875.8 32.00 -96.35%
│ old_bench.txt │ new_bench.txt │
│ allocs/op │ allocs/op vs base │
TotalFees/txs=1 2.000 ± 0% 1.000 ± 0% -50.00% (p=0.000 n=10)
TotalFees/txs=50 51.000 ± 0% 1.000 ± 0% -98.04% (p=0.000 n=10)
TotalFees/txs=200 201.000 ± 0% 1.000 ± 0% -99.50% (p=0.000 n=10)
geomean 27.37 1.000 -96.35%
```
---------
Co-authored-by: yperbasis <andrey.ashikhmin@gmail.com>
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Andrew Ashikhmin <34320705+yperbasis@users.noreply.github.com>
Co-authored-by: Alex Sharov <AskAlexSharov@gmail.com>
Cherry-pick of #20943 to main.
possible solution to fix #20878 --------- Co-authored-by: Alexey Sharov <AskAlexSharov@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )