Skip to content

feat(circle): Base mainnet gate PASSED + 7702 bootstrap fix + DEFER hardening#17

Merged
cipherwebllc merged 4 commits into
mainfrom
feat/circle-paymaster-base-gate
May 30, 2026
Merged

feat(circle): Base mainnet gate PASSED + 7702 bootstrap fix + DEFER hardening#17
cipherwebllc merged 4 commits into
mainfrom
feat/circle-paymaster-base-gate

Conversation

@cipherwebllc
Copy link
Copy Markdown
Owner

Summary

Circle Paymaster Phase 1 の Base mainnet 投入ゲート通過と、関連 hardening。

1. Base mainnet 実機ゲート通過 (2026-05-30)

SMOKE_CHAIN=base で 3 leg (Circle → Pimlico → Circle) 全 PASS。pristine EOA が leg1/circle で 7702 委任を bootstrap (delegateBefore=nulldelegateAfter=0xe6Cae83…)、circle paymaster = mainnet 0x0578…700Ec、実徴収 USDC ≪ permit 上限 (C4 fee 整合 OK)。→ Base に限り NEXT_PUBLIC_ENABLE_CIRCLE_PAYMASTER=1 有効化可 (他 chain は fee 実測前で flag OFF 維持)。

leg provider paymaster 実徴収 USDC tx
1 circle 0x0578…700Ec 0.012117 0x527224…b0e5e
2 pimlico 0x8888…2402 0.003822 0x355306…1aaddd
3 circle 0x0578…700Ec 0.009384 0xb31b6f…73fc5e

2. smoke 7702 bootstrap 修正 (e7274bf)

viem/permissionless は prepareUserOperation 段階で 7702 authorization を stub 署名のまま送るため bundler が recovered signer != sender で弾く。spike 実証済の通り owner.signAuthorization() を明示署名し estimate/send に渡すよう修正 + Circle leg 先頭化で委任 bootstrap。SMOKE_CHAIN=base 対応 (SoT アドレス・SMOKE_MAINNET_OK opt-in・paymaster code guard・専用 RPC auto-pickup)。製品コードは無影響 (Circle 経路は既委任 EOA 前提)。

3. DEFER hardening (e250958)

  • circleReceiptVerifier: 構造化 UnreconciledKind + pulled===0 no-charge guard (net=0 を verified と誤報告しない)。
  • /api/log/payment: 実 body byte 長 cap (content-length 偽装 bypass を塞ぐ) + circleVerificationExclude<CircleVerificationStatus,'verified'> で型同期。

🔜 残 hardening #121 (pre-submit 孤児 GC + unreconciled UI バッジ) を本 PR の同ブランチに追って push 予定。

Test

  • typecheck clean / 対象 vitest 119 passing (verifier + log route + paymentLog)。
  • Base mainnet 実機 3 leg PASS (上表)。

📊 Note

実測で Base の Circle ガス徴収 ≈ Pimlico の 3〜4倍 (Circle 10% surcharge + Circle fee)。絶対額セント単位だが「Circle 優先は信頼性/公式サポート理由でコスト最適ではない」事実を runbook/memory に記録。

🤖 Generated with Claude Code

cipherwebllc and others added 2 commits May 30, 2026 21:13
…pe sync

DEFER hardening (#119/#120):
- circleReceiptVerifier: structured UnreconciledKind (event-absent/binding-
  sender/binding-paymaster/reverted/no-charge) + pulled===0 no-charge guard so
  net=0 is never silently reported as verified. useBatchPayment branches on kind.
- /api/log/payment: byte-size cap on actual parsed body (not just content-length
  header) to close chunked-transfer bypass; circleVerification typed via derived
  ClientReportedCircleVerification = Exclude<CircleVerificationStatus,'verified'>.
- tests: +kind/no-charge cases, +body-cap cases (119 passing).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
- smoke-circle-crossswitch: SMOKE_CHAIN=base (Base mainnet USDC/Circle PM from
  SoT) with SMOKE_MAINNET_OK opt-in gate, on-chain paymaster code guard, and
  NEXT_PUBLIC_BASE_RPC_URL auto-pickup (public RPC rate-limit warning).
- Fix pristine-EOA 7702 bootstrap: explicitly owner.signAuthorization() and pass
  to estimate/sendUserOperation (viem/permissionless only stub-sign → bundler
  rejects "recovered signer != sender"). Legs reordered circle→pimlico→circle so
  the spike-proven viem path bootstraps delegation first.
- runbook: Base mainnet gate PASSED 2026-05-30 (3 leg, tx evidence); Base flag
  enable unblocked; Circle≈3-4x Pimlico gas cost observation recorded.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
openpay Ready Ready Preview, Comment May 30, 2026 12:41pm

DEFER hardening #121:
- circlePending.gcStalePreSubmit(olderThanMs, now, excludeKey): abandons stale
  pre-submit orphans (reserved/awaiting_signature/signed never advanced to
  submitting) that linger in the live set; excludeKey protects the in-flight
  attempt; submitting/terminal untouched (recovery info preserved). Wired (with
  pruneTerminal) into executeCirclePayment start as best-effort housekeeping
  (TERMINAL_RETENTION_MS=24h ≫ CONFIRMED_DEDUP_WINDOW). Neither helper had a
  caller before.
- HistoryRow: Circle verification badge (verified/client-reported/unreconciled)
  next to Circle gas, with tooltip; shows even when netUsdc is null. +6 i18n keys
  (ja/en parity).
- tests: gcStalePreSubmit (stale→abandoned, excludeKey/submitting/terminal guard,
  storage-unavailable) + HistoryRow badge cases.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Adversarial review HIGH: gcStalePreSubmit reused the guard's PRE_SUBMIT_STALE_MS
(3min), so a concurrent payment in another tab could abandon a legitimately-slow
(>3min at the wallet popup) in-flight pre-submit from a DIFFERENT attempt/callHash,
breaking it via a markSigned CAS failure (no double-spend — both pre-submit, never
broadcast — but a UX break). Fix: dedicated PRE_SUBMIT_GC_MS=1h for GC (capacity
management; longer than any legitimate signing flow); the guard keeps 3min for
same-callHash blocking decisions. +2 regression tests (slow different-callHash
in-flight survives; >1h orphan collected).

Note: review MEDIUM (concurrent broadcast relies on EntryPoint nonce uniqueness)
is the pre-existing, documented, prior-accepted design (circleSend ll.230-233), not
a #121 regression. LOW was self-dismissed by the reviewer.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@cipherwebllc cipherwebllc merged commit 21e34a2 into main May 30, 2026
6 checks passed
@cipherwebllc cipherwebllc deleted the feat/circle-paymaster-base-gate branch May 30, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant