Skip to content

test(GRD): Guard-write e2e scaffold (fixme — guard-account deploy/render blockers)#371

Merged
jhfnetboy merged 3 commits into
masterfrom
test/s4-guard-writes
Jun 24, 2026
Merged

test(GRD): Guard-write e2e scaffold (fixme — guard-account deploy/render blockers)#371
jhfnetboy merged 3 commits into
masterfrom
test/s4-guard-writes

Conversation

@jhfnetboy

Copy link
Copy Markdown
Member

GRD — Guard-write e2e scaffold (fixme), reusing the proven S4 chain. The guard-write mechanism already ships in #362 (/guard page + GuardClient); this adds the e2e for it.

What's here (reusable)

  • e2e/guard.spec.ts (GRD-04): register(dailyLimit>0 → guard) → fund → deploy → /guard toggle strict mode → assert strictMode flips on-chain via GuardClient.getConfig.
  • helpers: registerAccount(page, {dailyLimit}), getGuardAddress/hasGuard/getStrictMode, deployAccount(page, address).

Why fixme (two divergences a guard account shows vs a plain one — need debugging)

  1. UI doesn't render the account after create — the dashboard shows "No Smart Account Yet" for a counterfactual dailyLimit account (a plain counterfactual account renders fine in S4). Likely the account/context state treats a guard account differently.
  2. Deploy UserOp → AA21 "didn't pay prefund" on the Pimlico bundler, despite ample funding: required prefund ≈ 0.002 ETH, funded 0.2 ETH, and a 30s propagation wait didn't clear it. The guard deploy's high verificationGasLimit (~1.35M) seems to trip the bundler's balance/prefund view.

Verification

Suite: 6 passed, 1 fixme-skipped (the other 5 L3 + GRD's scaffold compiles/lints). docs/TEST_RESULTS.md S4 documents the blockers.

Follow-up to make GRD pass: resolve the guard-account UI rendering + the deploy AA21 (likely route the guard-account deploy through the paymaster — gasless — instead of self-pay, sidestepping the prefund check).

GRD-04 (toggle Guard strict mode via the account's passkey UserOp): scaffold is
complete and reuses the proven S4 chain — register(dailyLimit>0 → account gets a
guard) → fund → deploy → /guard toggle → verify strictMode flips on-chain.

Marked test.fixme: a dailyLimit (guard) account has two divergences from a plain
account that need dedicated debugging — (1) it doesn't render in the dashboard/
transfer UI after create ('No Smart Account Yet'), and (2) its first/deploy UserOp
fails AA21 'didn't pay prefund' on the Pimlico bundler despite ample funding
(needs ~0.002 ETH, funded 0.2; a 30s propagation wait didn't clear it) — a
bundler balance-view issue tied to the high-gas guard deploy (~1.35M verGas).

Helpers added (reusable): register(dailyLimit), getGuardAddress/hasGuard/
getStrictMode, deployAccount. The guard-write mechanism itself ships in #362
(/guard page + GuardClient). Suite: 6 passed, 1 fixme-skipped.
@jhfnetboy jhfnetboy requested a review from fanhousanbu as a code owner June 24, 2026 12:22
@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.

… AA24 remains

Pushed the guard-write e2e further. The guard-account deploy hits a chain of
guard-specific issues in its first UserOp; fixed two:
- (1) UI render race — deployAccount now retries the dashboard/transfer load until
  DashboardContext shows the account (a guard account raced the first render).
- (2) AA21 'didn't pay prefund' — depositToEntryPoint() pre-funds the account's
  EntryPoint deposit. Proven not an amount issue: 0.2 ETH balance + ~0.002 ETH
  prefund still hit AA21; a guard account can't pay prefund from plain balance, but
  the deposit covers it.
- (3) AA24 'signature error' — OPEN. The guard account's first deploy+transfer
  fails signature validation (sig prefix 0x02 = Tier-2 P256+BLS) — a protocol-level
  interaction between tiered signing and the not-yet-deployed guard's validation.
  Needs backend/contract investigation, not a test-side fix.

Helper added: depositToEntryPoint. test.fixme kept (suite 6 passed / 1 skipped).
docs/TEST_RESULTS.md S4 documents the full chain + the two fixes.

@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.

clestons review — #371 [2-round, APPROVE]

test(GRD): Guard-write e2e scaffold (fixme — guard-account deploy/render blockers) — 5 files (+205/-3). E2e test scaffold + helpers + docs. No production code changes.

Content ✅

  • e2e/guard.spec.ts (GRD-04): scaffold for guard strict-mode toggle via passkey UserOp. test.fixme correctly applied — three-layer blocker documented: (1) UI render race ✅ fixed; (2) AA21 prefund ✅ fixed (depositToEntryPoint); (3) AA24 signature error — protocol-level, requires backend/contract investigation, not testable here. Keeps suite green.
  • e2e/helpers/account.ts — new deployAccount helper with retry logic.
  • e2e/helpers/fund.ts — extended with getGuardAddress, hasGuard, getStrictMode on-chain reads.
  • e2e/helpers/register.ts — minor update.
  • TEST_EOA_PRIVATE_KEY / ETH_RPC_URL read from .env.test (not hardcoded). ✅

Secret scan clean.

APPROVE. Merge is the maintainer's call.

…artifact undetermined)

The guard-account first UserOp never succeeded in automation (AA21 fixed via
EntryPoint deposit, AA24 remains), so the guard never actually deployed and AA24
could be a real bug OR a CDP/KMS harness artifact — undetermined. Added
docs/test-manual/GRD-04-guard-write.md: a step-by-step real-device manual repro
(register → create with dailyLimit → fund → first transfer/deploy → /guard write)
with decision criteria (real-device success ⇒ harness artifact; real-device AA24
⇒ real bug). User runs it + reports; results get filed back here.
@jhfnetboy jhfnetboy merged commit 4cb8248 into master Jun 24, 2026
1 check passed
@jhfnetboy jhfnetboy deleted the test/s4-guard-writes branch June 24, 2026 12:52
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 24, 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