Skip to content

fix(pxe): widen tracked sender tagging ranges with onchain discovery evidence#24655

Draft
vezenovm wants to merge 10 commits into
merge-train/fairies-v5from
mv/fix-sender-tag-sync-partial-revert
Draft

fix(pxe): widen tracked sender tagging ranges with onchain discovery evidence#24655
vezenovm wants to merge 10 commits into
merge-train/fairies-v5from
mv/fix-sender-tag-sync-partial-revert

Conversation

@vezenovm

@vezenovm vezenovm commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Fixes the sender tag sync conflict from https://gist.github.com/nventuro/0aa690736b1d2865e27197723a814e9d, including the "Window straddle" residual edge.

Discovery could re-derive a different index range for an already tracked (secret, txHash) pair and hit the Conflicting range throw in storePendingIndexes, permanently wedging the secret. Two triggers:

  • A same-PXE tx partially reverts: the chain only shows the surviving non-revertible sub-range of the prove-time entry, and the throw fired before the finalized receipt step could resolve it.
  • A tx straddles a sync window boundary: the window loop assembles its range piecewise, so window 2 stores a different range than window 1 (latent regardless of reverts).

Fix: discovery passes mergeExisting to storePendingIndexes, which widens the stored entry to the union of both ranges (grow-only, driven by onchain evidence). The finalized receipt step still resolves partial reverts. The only other writer of pending ranges, persistSenderTaggingIndexRangesForTx (records the indexes a tx sent from this PXE used, at prove time), does not pass the flag and still throws on a mismatch: there it indicates a bug, not partial onchain evidence.

Red-green (all fail on the base with the Conflicting range throw):

  • partial revert repro: finalizes the surviving index, frees the squashed ones, repeat sync is a no-op
  • cross-sync widen: an entry tracked from an earlier sync grows when discovery evidences further indexes
  • window straddle: drives the actual window advance loop, asserts per window queried tags and that the widened entry later finalizes cleanly

Store-level tests pin the union semantics: a sub-range keeps the entry, a range beyond it widens it, an untracked tx still stores.

@vezenovm vezenovm added ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure ci-draft Run CI on draft PRs. labels Jul 13, 2026
vezenovm added 2 commits July 13, 2026 15:52
…evidence (#24663)

Stacked on #24655. Found while reviewing #24655. This is the "Window
straddle" residual edge flagged in
https://gist.github.com/nventuro/0aa690736b1d2865e27197723a814e9d
(latent regardless of reverts); the fix takes the gist's suggested
"extend an entry monotonically" option.

#24655 made discovery skip a differing range for an already tracked
(secret, txHash) pair instead of throwing.
Before #24655 this same scenario hit the "Conflicting range" throw and
permanently wedged the secret, so it was broken either way.

Fix: replace `skipExisting` with `mergeExisting`. On a range mismatch,
discovery widens the stored entry to the union of both ranges
(grow-only, driven by onchain evidence). The partial revert case is
unchanged: the discovered sub-range unions to the existing prove-time
entry, and the finalized receipt step still resolves it. The prove-time
persist path keeps the strict conflict throw.

Red-green:
- "widens a tracked pending range when discovery evidences further
indexes for the same tx" fails on the base branch with lastUsed 10
instead of 11, and passes with the merge.
- "assembles a pending range piecewise when a tx straddles the sync
window boundary" drives the actual window-advance loop: a tx with tags
on both sides of the window boundary gets stored as [83, 83] by window 1
and widened by window 2. It throws "Conflicting range existing [83, 83]
vs new [84, 84]" on fairies-v5, under-reports lastUsed as 83 on the base
branch, and passes with the merge (including a follow-up sync that
finalizes the widened entry cleanly).

Store-level tests pin the union semantics: a sub-range keeps the entry,
a range beyond it widens it, an untracked tx still stores.
@vezenovm vezenovm changed the title fix(pxe): sender tag sync crash on partially reverted txs sent from same PXE fix(pxe): widen tracked sender tagging ranges with onchain discovery evidence Jul 13, 2026
vezenovm added 5 commits July 13, 2026 16:13
storePendingIndexes is strict-only again: no opt can disable the
conflicting-range bug detector the prove-time path relies on. Discovery
opts into the grow-only union by calling the new mergePendingIndexes,
which shares the same transaction body. Also folds the untracked-tx
merge store test into the basic insert test as a parameterized case.
@vezenovm vezenovm added the claudebox Owned by claudebox. it can push to this PR. label Jul 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-draft Run CI on draft PRs. ci-no-fail-fast Sets NO_FAIL_FAST in the CI so the run is not aborted on the first failure claudebox Owned by claudebox. it can push to this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant