feat(tier/#3b): raise tier limits via guardian co-sign (/tier-raise) - #390
Conversation
New /tier-raise page (nav 'Raise Limits'): read current tier1/tier2 → enter new limits → modifyTierLimitsGuardianDigestFromChain → collect RECOVERY_THRESHOLD (2) DISTINCT guardian signatures over the digest (injected wallet, eth-prefixed signMessage; dupe signer rejected) → encodeModifyTierLimitsWithGuardians → submit as the account's gasless self-call UserOp (device passkey), same path as profile setup. Browser-safe (/airaccount); /tier-raise chunk has no crypto. i18n en+zh (parity 766). type-check/lint/build green.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
clestons
left a comment
There was a problem hiding this comment.
APPROVE
New /tier-raise page implementing a 3-step guardian co-sign flow: compute change digest on-chain, collect GUARDIAN_QUORUM distinct guardian signatures via injected wallet, submit as gasless self-call UserOp with device passkey.
Flow correctness:
- Duplicate-signer guard:
accounts[0].toLowerCase()normalised beforesigs.some(s => s.signer === signer)— case-insensitive, correct. - Inputs disabled when
!!pending—parseEther(t1)/parseEther(t2)insubmit()re-reads the same frozen string values, no digest/amount mismatch. GUARDIAN_QUORUM = 2matchesRECOVERY_THRESHOLD = 2(compile-time private constant in AirAccountExtension.sol:723, not per-account). ✓sigs.map(s => s.sig)→ SDKencodeModifyTierLimitsWithGuardianstakesHex[]and handles slot-index resolution internally via ecrecover. ✓signMessage({ raw: pending.digest })produces the eth-prefixed sig the contract's_recoverGuardianexpects. ✓- Paymaster path: same
transferAPI.prepare/submittwo-phase ceremony as/tier-setup. ✓
i18n: en.json + zh.json parity (24 keys each). ✓
Nav: ArrowTrendingUpIcon + /tier-raise route added to Layout's Security group. ✓
PK: F1 (GUARDIAN_QUORUM hardcoded) challenged and rejected — constant is compile-time fixed. F2 (signerIdxs ordering) challenged and rejected — SDK abstraction handles internally.
PK Summary | 1 round · 0 confirmed · 2 challenged (both rejected) · 0 missed
Part of #382. New /tier-raise page (nav 'Raise Limits'): enter new tier1/tier2 →
modifyTierLimitsGuardianDigestFromChain→ collect RECOVERY_THRESHOLD (2) distinct guardian signatures over the digest (injected wallet, eth-prefixed signMessage, dupe-signer rejected) →encodeModifyTierLimitsWithGuardians→ submit as the account's gasless self-call UserOp (device passkey), same path as profile setup. Browser-safe (/airaccount; /tier-raise chunk has no crypto), i18n en+zh, type-check/lint/build green. On-chain raise mechanism already proven in scripts/test/onchain/raise-tier-limits.mjs.