Skip to content

feat(tier/#3b): raise tier limits via guardian co-sign (/tier-raise) - #390

Merged
jhfnetboy merged 1 commit into
masterfrom
feat/tier-raise-3b
Jun 29, 2026
Merged

feat(tier/#3b): raise tier limits via guardian co-sign (/tier-raise)#390
jhfnetboy merged 1 commit into
masterfrom
feat/tier-raise-3b

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

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.

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.
@jhfnetboy
jhfnetboy requested a review from fanhousanbu as a code owner June 29, 2026 01:54
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@clestons clestons left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 before sigs.some(s => s.signer === signer) — case-insensitive, correct.
  • Inputs disabled when !!pendingparseEther(t1)/parseEther(t2) in submit() re-reads the same frozen string values, no digest/amount mismatch.
  • GUARDIAN_QUORUM = 2 matches RECOVERY_THRESHOLD = 2 (compile-time private constant in AirAccountExtension.sol:723, not per-account). ✓
  • sigs.map(s => s.sig) → SDK encodeModifyTierLimitsWithGuardians takes Hex[] and handles slot-index resolution internally via ecrecover. ✓
  • signMessage({ raw: pending.digest }) produces the eth-prefixed sig the contract's _recoverGuardian expects. ✓
  • Paymaster path: same transferAPI.prepare/submit two-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

@jhfnetboy
jhfnetboy merged commit c697568 into master Jun 29, 2026
14 checks passed
@jhfnetboy
jhfnetboy deleted the feat/tier-raise-3b branch June 29, 2026 02:21
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 29, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants