feat(pxe): speculatively sync predicted contract call trees - #25252
Merged
Conversation
## Why we are doing this Port of #25126 and #25164 to the v5 line. PXE syncs contracts serially as execution reaches them: each nested call discovers the next contract only after the previous sync completes, so multi-contract transactions pay one sync round trip per hop. ## Our fix PXE learns a per-function call graph from the calls each committed job observed (`ContractCallGraph`). When a sync request arrives, the sync service speculatively starts the syncs of every contract the invoked function is predicted to call, recursing through each callee's own predictions, and also speculates from each contract's `sync_state`, which runs during the sync itself (#25164). A per-job set of already-speculated functions stops the recursion when the predicted graph has a cycle. Mispredicting is cheap: the extra node requests batch into round trips the job already makes, and the synced data goes unused. Beyond the straight port, `settle` changes semantics vs #25126: it tracks only the speculative syncs and rejects with an `AggregateError` when any failed, so the job discards its staged writes instead of committing them. A speculative failure might not be surfaced by any request, and a sync that fails midway can leave partial staged writes. Stacked on #25208, whose `allToCompletion` runs the parallel staged-write branches to completion on failure. The feature is gated behind `PXE_CONCURRENT_CONTRACT_SYNC_ENABLED` (default off, experimental).
nchamo
approved these changes
Aug 18, 2026
nchamo
marked this pull request as ready for review
August 18, 2026 07:57
nchamo
enabled auto-merge (squash)
August 18, 2026 07:58
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.
Port of #25214 onto
merge-train/fairies.Note on the two-commit request: The cherry-pick applied cleanly with no conflicts, so there's nothing to split into a separate resolution commit. Single squashed commit only — happy to redo it as a two-commit stack if you'd rather see an explicit empty-resolution commit, but that would just be a no-op.
Original description:
Cherry-pick of merge commit
cee7f40ca9c7d53b0d6af2d0175139606cc48f7c(git cherry-pick -m 1), applied cleanly on top ofmerge-train/fairies.Created by claudebox · group:
slackbot· requested by Nico Chamo · Slack thread