Skip to content

feat(pxe): speculatively sync the predicted callees of sync_state - #25164

Open
nchamo wants to merge 1 commit into
nchamo/rpc-optimizations-2from
nchamo/speculative-sync-state-deps
Open

feat(pxe): speculatively sync the predicted callees of sync_state#25164
nchamo wants to merge 1 commit into
nchamo/rpc-optimizations-2from
nchamo/speculative-sync-state-deps

Conversation

@nchamo

@nchamo nchamo commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Motivation

Every contract sync executes the contract's sync_state, whose own nested calls are learned by the call graph from #25126 but were never predicted: sync_state is only ever invoked by PXE, so its selector never appears as a sync request's invoked function. Almost all contracts make at least one external call during sync (the handshake registry), so a dependency that always started syncing serially now overlaps — a big win.

The change

#startSyncIfNeeded now also fires the speculative sync of the predicted callees of the contract's own sync_state, keyed under a hardcoded SYNC_STATE_SELECTOR. The selector is safe to hardcode because the macro fixes sync_state's signature for every contract; a test derives the expected value from a compiled artifact, so a macro signature change fails loudly instead of silently disabling these predictions.

@nchamo nchamo self-assigned this Aug 10, 2026
@nchamo nchamo added 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 labels Aug 10, 2026
@nchamo
nchamo marked this pull request as ready for review August 10, 2026 17:54
@nchamo
nchamo requested a review from nventuro August 10, 2026 17:54
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant