refactor(contracts): remove completed #575 PKP-owner backfill machinery - #590
refactor(contracts): remove completed #575 PKP-owner backfill machinery#590clawdbot-glitch003 wants to merge 1 commit into
Conversation
The one-time backfill is complete on Base mainnet (all pre-existing PKPs bound; verified 0 unbound, 0 conflicts). Remove the now-spent migration machinery in this facet upgrade: - WritesFacet: drop backfillPkpOwners() and the PkpOwnerBackfilled event. - ViewsFacet.getWalletDerivation: remove the `owner == 0` compatibility fallback so ownership enforcement is unconditional (fail-closed). registerWalletDerivation always sets the owner when it writes pkpData and the backfill bound every legacy PKP, so a non-zero derivation always has a non-zero owner; owner == 0 now reverts instead of serving the path. - Delete the tasks/backfill-pkp-owners.ts hardhat task + its registration. - Keep getPkpOwnerMaster (ongoing audit) and the core first-owner binding. - Update Foundry tests + DiamondDeploy selectors, regenerate alloy bindings, update CHANGELOG. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🔒 Automated Security Review (differential)Base:
Overall risk: LOW — no exploitable regressions found. This PR removes the completed #575 PKP-owner backfill migration (
F1 (INFO): the removed admin migration tool can no longer recover a PKP if the #575 backfill missed it — that would only cause a fail-closed revert (availability impact for the legitimate owner), not a security bypass. Recommend confirming operationally that the backfill ran against every pre-existing pkpId before deploying. Full report: |
Codex reviewRan an independent [P1] The diamondCut must include an explicit Remove — the deployer won't generate itConfirmed. The Rust deployer's Impact is low security-wise ( The Follow-up worth filing separately: the deployer can't remove any selector today. A general fix (compute Removes for vanished managed-facet selectors) is valuable but delicate — it must not touch the core DiamondCut/Loupe selectors — so it deserves its own tested PR, not this one. [P2] Foundry
|
The one-time #575 PKP-owner backfill is complete on Base mainnet — all pre-existing PKPs are bound (verified 0 unbound, 0 multi-account conflicts, 0 bound-to-non-owner across all accounts). This removes the spent migration machinery in the next facet upgrade. Contract-only; none of the operational backfill tooling lands in the repo.
Changes
backfillPkpOwners()and thePkpOwnerBackfilledevent.owner == 0compatibility fallback — ownership enforcement is now unconditional (fail-closed).registerWalletDerivationalways sets the owner when it writespkpData, and the backfill bound every legacy PKP, so a non-zero derivation always has a non-zero owner; anowner == 0now reverts instead of serving the path.tasks/backfill-pkp-owners.tshardhat task and its registration (its on-chain target no longer exists).getPkpOwnerMaster(ongoing audits) and the core first-owner binding inregisterWalletDerivation.owner == 0test now asserts fail-closed),DiamondDeployselectors, CHANGELOG, and regenerated the alloy bindings.Supersedes #579 (closed — it also carried the operational Safe/EOA tooling, which we don't want in the repo now that the migration is done).
Verification
forge test50/50 ·cargo checkclean ·tscclean (only the pre-existing unrelatedverify-diamond-facets.tswarning) · no stray references to the removed function.Deploy note
This is a diamondCut that replaces WritesFacet and ViewsFacet (
getWalletDerivationbehavior change — a normal Replace, same selector).The
backfillPkpOwnersremoval needs an explicit Remove cut — the Rust deployer's auto-diff (get_facet_cuts) only emits Replace/Add, never Remove, sopropose-update/updatealone leaves0x41275609routed to the old facet and still callable. Add to the proposal:Do it after the diamond's
configOperatoris restored from the temporary migration EOA back to the original, and after retiring that temp key.🤖 Generated with Claude Code