[r3.6] db/kv/membatchwithdb: surface DomainReader read errors instead of swallowing them - #22960
Merged
AskAlexSharov merged 3 commits intoAug 4, 2026
Merged
Conversation
Three tests for the overlay receipt-read path, none of which exists on this branch today: - TestDomainReadErrorsPropagate — a DomainReader error must reach the caller instead of falling through to the committed tx. Fails on release/3.6 as it stands: #22893 is not here, so the error is swallowed and the read silently answers with stale data. Covers both MemoryMutation and OverlayTemporalReadView. - TestReceiptAsOf_InFlightBlockLogIndex — ReceiptAsOf through the overlay read view must return the in-flight block's LogIndexAfterTx. Passes already (#22511 is here); adds coverage of the production key and accessor, which the storage-level test shipped with #22511 does not touch. - TestGetReceiptLogIndexThroughOverlay — pins the production wiring: the overlay is seeded with a log index the committed tx does not hold, so only a read routed through Filters.WithTemporalOverlay can produce it. Drop that call from GetReceipt and this test fails; nothing else in the tree does.
…llowing them (#22893) Independent correctness fix split out of #21414 (per the request to break it up). Stands alone on `main`. `MemoryMutation` and `OverlayTemporalReadView` `GetAsOf`/`HistorySeek` gated the `DomainReader` result with `err == nil && ok`, so a reader error fell through to the committed tx and was silently hidden. This propagates the error and keeps the `ok`-based committed fallback (a tombstone is `ok=true`, so it is not resurrected). No dependency on the background-commit work; part of the split recorded on #21414. (cherry picked from commit 8324709)
pull Bot
pushed a commit
to Dustin4444/erigon
that referenced
this pull request
Aug 3, 2026
…erlay (erigontech#22961) Port of the tests added in the release-branch backports erigontech#22951 (`release/3.5`) and erigontech#22960 (`release/3.6`). All three pass on `main` — both erigontech#22511 and erigontech#22893 are here — so they land as regression coverage. Each was written against the branch where its fix was missing and verified red there first: | Test | Verified red on | Without | |---|---|---| | `TestReceiptAsOf_InFlightBlockLogIndex` | `release/3.5` | erigontech#22511 — returns `0x7` instead of `0x3` | | `TestDomainReadErrorsPropagate` | `release/3.6` | erigontech#22893 — error swallowed, `but got nil` | | `TestGetReceiptLogIndexThroughOverlay` | `main` | the `WithTemporalOverlay` call in `GetReceipt` | The third one is the reason this is worth having on `main` regardless of the backports: `Filters.WithOverlay` / `WithTemporalOverlay` had **no test coverage anywhere in the tree**. Remove `tx = g.filters.WithTemporalOverlay(tx)` from `GetReceipt` and the bug reported on erigontech#22106 returns in production while CI stays green — verified, that test now fails. The other two also add coverage the upstream fixes did not ship: erigontech#22511's own test works at storage level with a synthetic key, so nothing exercised `LogIndexAfterTxKey` through `rawtemporaldb.ReceiptAsOf`; erigontech#22893 shipped with no test at all. One adaptation from the release branches: `AppendReceipt` is named `AppendReceiptMetadata` here.
lupin012
marked this pull request as ready for review
August 3, 2026 19:38
AskAlexSharov
approved these changes
Aug 4, 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 of #22893 to
release/3.6.#22511 routed receipt-domain reads through the overlay
DomainReaderand is already on this branch. #22893 is its follow-up: the code #22511 added gated theDomainReaderresult onerr == nil && ok, so a reader error fell through to the committed tx and silently reopened the same stale-read window. All four sites still have the old gating here:Worth landing before GA: shipping #22511 without #22893 is the one combination where the fix looks complete but the error path is not.
The same pair is being backported to
release/3.5in #22951, where #22511 is missing too.Tests
The tests are committed below the fix, so the history shows the cycle — check out
19feda4356to see red,HEADto see green.TestDomainReadErrorsPropagate— new. Fails without the fix (Expected error ... but got nil, both subtests), passes with it. CoversMemoryMutationandOverlayTemporalReadView.TestReceiptAsOf_InFlightBlockLogIndex— passes already, since db/state: route receipt domain GetAsOf/HistorySeek through overlay DomainReader #22511 is here. Adds coverage of the production key (LogIndexAfterTxKey) and accessor (rawtemporaldb.ReceiptAsOf), which the storage-level test shipped with db/state: route receipt domain GetAsOf/HistorySeek through overlay DomainReader #22511 does not touch.TestGetReceiptLogIndexThroughOverlay— passes already. Pins the production wiring: the overlay is seeded with a log index the committed tx does not hold, so only a read routed throughFilters.WithTemporalOverlaycan produce it. Drop that call fromGetReceiptand this test fails — nothing else in the tree catches it.No conflicts in either cherry-pick; the APIs on 3.6 match what the tests were written against.
Context
Both fixes address wrong
logIndexvalues served for a block whose commit is in flight — reported on #22106. The values are never persisted, so no resync or DB rewind is involved.