refactor(recovery-queue): scan calldata with per-payload windows#63
Open
mithatakbulut wants to merge 2 commits intoreview/remove-wallet-wdkfrom
Open
refactor(recovery-queue): scan calldata with per-payload windows#63mithatakbulut wants to merge 2 commits intoreview/remove-wallet-wdkfrom
mithatakbulut wants to merge 2 commits intoreview/remove-wallet-wdkfrom
Conversation
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.
Summary
Why
Queue payloads were being listed (metadata is on-chain) but
payload.payloadwas alwaysundefined, leaving the Execute button permanently disabled. On Polygon, the listing itself took 6+ minutes (HAR: ~437s wall time, 95% in publicnode RPC).Five issues stacked on top of each other:
decodeQueuedPayloadInputvalidated againstExtensions.Recovery.hashRecoveryPayload(...)(recovery-flag domain — used for signing), but the contract stores queued payloads keyed byPayload.hash(wallet, chainId, payload)(no recovery flag — storage key). Every candidate tx was rejected even when the calldata matched.eth_getLogstimed out on publicnode Polygon outside very small windows (~10s timeout × 3 viem retries = 30s of dead time per chunk).min..max queuedAtwindow, then sequential chunking on top of publicnode's 10000-block cap → 21 sequential chunks × ~10s.getBlockcalls per chain).Architecture context
The recovery extension contract stores only the payload hash + timestamp on-chain (gas optimization). The actual call body (
to,value,data, …) is never written to storage — it only exists in the calldata of the originalqueuePayloadtx.Sequence's hosted UI presumably side-channels the body to its own state service when queueing. This app explicitly does not use Sequence services (
State.Sequence.Provider,keymachine.sequence.app, hosted state APIs are out of scope by design — the app must work with Sequence services down). Arweave reads are still allowed for wallet config / topology, but Arweave does not contain queued payload bodies, and the reader filters by Sequence's owner key, so any "fallback to Arweave" was always going to miss.That leaves chain calldata as the only source of truth for queued payload bodies.