Repository navigation
Use a placeholder leaf for empty recovery trees and move recovery to rc6 - #1048
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 28122e8f8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
ScreamingHawk
left a comment
There was a problem hiding this comment.
LGTM! Left some comments, mostly confirming they're intentional.
The guards in the WDK are solid. address(0) signers can still be constructed directly via the SDK. Integrators at this level are responsible for their own configuration, forcing migration would break this responsibility model. Legacy trees also have to stay decodable so keeping validation in fromRecoveryLeaves is the right split.
One suggestion: Consider emitting a note via console.warn when an address(0) leaf is detected (fromGenericTree?) to alert primitive integrators without forcing anything.
setRecoveryLeaves now runs the same tree check as assertConfiguration on the tree it saves, so a caller that skips assertConfiguration still can't end up with an unreadable tree or a zero address leaf Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When the last recovery signer goes away (logging out the only device, a remote logout, removing the last login or recovery signer) the WDK left a recovery leaf for the zero address in the tree. That leaf should never be there, so now the tree holds a placeholder leaf instead
The placeholder signer is the last 20 bytes of
keccak256("Sequence recovery placeholder signer"), so nobody has a key for it, and itsminTimestampis the max uint64, so it can never queue a payload. The recovery module stays in the config, which keeps the current behavior: the next device or recovery signer replaces the placeholder, and wallets created without recovery stay without itrecovery.addSignerrejects the zero address and the placeholder signerPLACEHOLDER_LEAF,PLACEHOLDER_SIGNERandisPlaceholderLeaf;fromRecoveryLeavesrejects zero address signersIt also moves the WDK to the rc6 Recovery module (
0x0000000002BEFBcfaF3a7Cd665AbBbe234672b2F). Only the recovery module changes; sessions, passkeys and the context stay on rc5. New wallets get rc6 in their initial config (so their counterfactual address changes), and existing wallets move on their next config update:Note that config updates now fail if a recovery tree is missing from the state provider, and anything reading raw recovery trees sees the placeholder signer instead of
0x0(getSignersstill returns[])Tested with the new
recovery-config.test.ts, which goes through every flow that updates the config, including configs that already have a zero address leaf and configs on an earlier recovery module, plus an on-chain test that queues payloads before and after a wallet moves to rc6. rc6 isn't deployed on Arbitrum yet, so the fork tests put the rc5 code at the rc6 address; I also ran them against the real rc6 bytecode deployed on a fork. I also ran the placeholder change end to end against the dev guard and the keymachine: logging out the only device and logging in from a new one both get co-signed, and the keymachine serves the placeholder tree