cp: cherry-pick batch from release/3.4 to main#20349
Merged
AskAlexSharov merged 7 commits intomainfrom Apr 6, 2026
Merged
Conversation
…d configuration field in `agg` (#20281)
…mem history reads (#20245) (#20262) Cherry-pick of #20245 to `release/3.4`. **Conflict resolution**: `execution/execmodule/executor.go` doesn't exist in `release/3.4` (the `PipelineExecutor` abstraction was introduced in `main` after the branch point). The equivalent change — adding the `ERIGON_IN_MEM_HISTORY` env flag and wiring it to `SetInMemHistoryReads` — was applied to `execution/stagedsync/stageloop/stageloop.go` which is the relevant call site in `release/3.4`.
problem: `sha.Read(h[:])` escaping to heap
- in RLP `func rlpHash` used new `sha.Sum256()` method - to prevent
heap-escaping caused by `sha.Read(h[:])` intereface-method:
```
if h, ok := sha.(*keccak.Hasher); ok {
return h.Sum256()
}
```
- in `crypto.HashData()`: used new `keccak.Sum256()` method - which
doesn't use `sync.Pool` and doesn't alloc (`-20ns`)
```
┌─────────────────────────────────┬───────┬──────┬───────────┐
│ Branch │ ns/op │ B/op │ allocs/op │
├─────────────────────────────────┼───────┼──────┼───────────┤
│ release/3.4 (pool + Read(h[:])) │ 272 │ 32 │ 1 │
├─────────────────────────────────┼───────┼──────┼───────────┤
│ current (keccak.Sum256 direct) │ 240 │ 0 │ 0 │
└─────────────────────────────────┴───────┴──────┴───────────┘
```
---------
Co-authored-by: awskii <awskii@users.noreply.github.com>
Co-authored-by: Giulio rebuffo <giulio.rebuffo@gmail.com>
…ry (#20194) ## Summary Backport of main commit `94a02c2bbb` to `release/3.4`, adapted for r3.4's `*VersionedWrite` pointer map. ### The bug `SetCode` writes three versioned entries (`CodePath`, `CodeHashPath`, `CodeSizePath`) to `versionedWrites`, but `codeChange.revert()` only cleaned up `CodePath` and `CodeHashPath`. The stale `CodeSizePath` caused `GetCodeSize` to return the pre-revert value after a parent frame reverted a child `CREATE`/`CREATE2`, making `EXTCODESIZE` report wrong results. **Concrete impact**: contracts checking `extcodesize(addr) > 0` after a failed deployment see a non-zero size instead of 0, taking a different code path and computing different gas. This produces arbitrary gas under-counts that fail block validation with `"gas used by execution: X, in header: Y"`. **Observed in production**: - Mainnet node (r3.4, build `cd4cc8e1`) stuck at block 24741565 with `-61,560` gas diff - Hoodi node previously exhibited similar pattern at block 2486302 ### The fix Add `CodeSizePath` cleanup to both branches of `codeChange.revert()`: - `wasCommited == true`: `Delete(CodeSizePath)` alongside the existing `Delete` calls - `wasCommited == false`: restore `v.Val = len(ch.prevcode)` (r3.4 uses `*VersionedWrite` pointers, not `UpdateVal`) ### Adaptation from main Main uses `WriteSet.UpdateVal()` (added in the IBS 2-cache refactor which is main-only). r3.4's `WriteSet` stores `*VersionedWrite` pointers, so direct `v.Val = ...` assignment modifies the map entry in place — consistent with all other `wasCommited == false` revert handlers in r3.4's `journal.go`. ## Test plan - [x] `make erigon` builds cleanly - [x] `make lint` clean (0 issues) - [ ] Mainnet node at block 24741565 unblocked after deploying this fix Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
sudeepdino008
approved these changes
Apr 6, 2026
sudeepdino008
approved these changes
Apr 6, 2026
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Cherry-pick from release/3.4 to main.
Original PRs:
COMPRESS_WORKERSvariable and configuration field inagg#20281 — pagedWriter and compressor to use same COMPRESS_WORKERS variable[]bytetype #20114 — crypto: zero-alloc, syncpool-free method to hash []byte type20 candidates checked total; 15 were already effectively on main.