Skip to content

feat(evm-wallet-experiment): make Pimlico optional for away wallet via peer relay#897

Merged
sirtimid merged 4 commits into
mainfrom
sirtimid/pimlico-optional-away-wallet
Mar 27, 2026
Merged

feat(evm-wallet-experiment): make Pimlico optional for away wallet via peer relay#897
sirtimid merged 4 commits into
mainfrom
sirtimid/pimlico-optional-away-wallet

Conversation

@sirtimid

@sirtimid sirtimid commented Mar 26, 2026

Copy link
Copy Markdown
Member

Summary

Makes the Pimlico bundler optional for the away wallet. When no bundler is configured, delegation redemptions are relayed to the home wallet via CapTP — the home wallet executes them using its own infrastructure (direct 7702 tx or bundler). This requires the home wallet to be online, but eliminates the Pimlico API key requirement on the away device.

  • Add handleRedemptionRequest coordinator method so the home wallet can execute delegations on behalf of the away wallet
  • Branch submitDelegationUserOp and submitBatchDelegationUserOp to relay via E(peerWallet).handleRedemptionRequest() when no bundler is configured
  • Guard against infinite relay loops — handleRedemptionRequest validates the home wallet has bundler or 7702 before processing
  • Validate empty delegations in relay requests
  • Update getCapabilities autonomy label to distinguish relay mode ("relay, requires home online") from offline-capable mode
  • Enable sendBatchTransaction delegation path via peer relay
  • Update setup-away.sh info message to explain relay mode
  • Update docs (README, how-it-works, setup-guide) to document the two away wallet modes

Testing

10 new unit tests (196 total, all passing) cover the relay paths: single and batch delegation relay to peer, handleRedemptionRequest on the home side (single, batch, error cases), sendTransaction flowing through the relay path, empty delegations validation, relay rejection when home has no bundler/7702, and getCapabilities autonomy reporting for relay mode. Manual e2e: set up home + away without --pimlico-key on away, verify delegation redemption works via relay.

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) noreply@anthropic.com


Note

Medium Risk
Changes the delegation redemption submission path by introducing a CapTP relay fallback when no bundler/7702 is configured, which could affect how transactions are executed and how failures surface across peers. Scope is limited to coordinator logic plus tests/docs, with explicit loop-prevention and expanded test coverage reducing risk.

Overview
Enables away wallets to redeem delegations without a Pimlico bundler by relaying redemption requests to the connected home wallet over CapTP when configureBundler() (and direct stateless7702) are not available.

Adds a new peer API handleRedemptionRequest and routes submitDelegationUserOp, submitBatchDelegationUserOp, and delegation-based sendBatchTransaction through the relay path when appropriate, with error propagation and loop-prevention guards; getCapabilities().autonomy now distinguishes offline-capable vs relay, requires home online.

Updates setup/docs to describe the new optional-bundler/relay mode, and adds comprehensive unit tests covering single/batch relay flows, capability reporting, and rejection/error cases.

Written by Cursor Bugbot for commit 9a28660. This will update automatically on new commits. Configure here.

@sirtimid
sirtimid requested a review from a team as a code owner March 26, 2026 18:03
…a peer relay

When the away wallet has no bundler configured, delegation redemptions
are relayed to the home wallet via CapTP instead of throwing. The home
wallet executes the redemption using its own infrastructure (direct 7702
or bundler). This requires the home wallet to be online but eliminates
the Pimlico API key requirement on the away device.

Key changes:
- Add `handleRedemptionRequest` coordinator method for home-side relay
- Branch `submitDelegationUserOp` and `submitBatchDelegationUserOp` to
  relay via peer when no bundler is configured
- Guard against infinite relay loops (home must have bundler or 7702)
- Validate empty delegations in relay requests
- Update `getCapabilities` autonomy to distinguish relay mode from
  offline-capable mode
- Enable `sendBatchTransaction` delegation path via peer relay
- 10 new unit tests (196 total)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sirtimid
sirtimid force-pushed the sirtimid/pimlico-optional-away-wallet branch from 74722ae to 00f6f5d Compare March 26, 2026 18:07
@sirtimid
sirtimid force-pushed the sirtimid/pimlico-optional-away-wallet branch from 00f6f5d to 9d6b09a Compare March 26, 2026 18:11
Comment thread packages/evm-wallet-experiment/src/vats/coordinator-vat.ts
@github-actions

github-actions Bot commented Mar 26, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.1%
⬆️ +0.13%
8135 / 10416
🔵 Statements 77.9%
⬆️ +0.13%
8264 / 10608
🔵 Functions 75.5%
⬆️ +0.01%
1920 / 2543
🔵 Branches 76.28%
⬆️ +0.28%
3420 / 4483
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/evm-wallet-experiment/src/vats/coordinator-vat.ts 88.21%
⬆️ +1.29%
80.06%
⬆️ +1.84%
93.4%
⬆️ +0.07%
88.15%
⬆️ +1.31%
49, 73-75, 113-158, 444-446, 473-476, 504, 560-562, 651-653, 673, 677, 870, 873, 909-911, 919, 934-938, 1101-1103, 1157-1159, 1165, 1180-1182, 1262, 1286-1289, 1298-1300, 1333-1336, 1355-1357, 1385-1388, 1400-1402, 1461, 1474, 1481, 1488, 1552-1554, 1683, 1705-1708, 1781, 1833-1834, 1870, 1975, 2045, 2081-2083, 2097-2099, 2129-2132, 2149, 2167, 2273-2279, 2368, 2442, 2460, 2545, 2562-2565, 2610-2613, 2618, 2632, 2677-2678, 2720, 2728, 2731-2733, 2749, 2769, 2866-2867, 2881-2884, 2919, 2928
Generated in workflow #4080 for commit 9a28660 by the Vitest Coverage Report Action

Comment thread packages/evm-wallet-experiment/src/vats/coordinator-vat.ts Outdated
@sirtimid
sirtimid force-pushed the sirtimid/pimlico-optional-away-wallet branch from 90ecc46 to 6771ddb Compare March 26, 2026 18:52
Comment thread packages/evm-wallet-experiment/src/vats/coordinator-vat.ts Outdated
@sirtimid
sirtimid force-pushed the sirtimid/pimlico-optional-away-wallet branch from 6771ddb to bf15c41 Compare March 26, 2026 19:57

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Comment thread packages/evm-wallet-experiment/src/vats/coordinator-vat.ts Outdated
…D / SDK calldata

Move the peer relay check in `submitDelegationUserOp` and
`submitBatchDelegationUserOp` before `resolveChainId()` and
`buildSdkRedeemCallData()`. The relay path forwards raw delegations and
execution to the home wallet and does not need local chain ID or SDK
calldata — computing them first blocks the relay when the provider is
temporarily unreachable.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sirtimid
sirtimid force-pushed the sirtimid/pimlico-optional-away-wallet branch from ffd9a42 to e017df7 Compare March 26, 2026 20:21
@sirtimid
sirtimid enabled auto-merge March 26, 2026 21:22
@sirtimid
sirtimid added this pull request to the merge queue Mar 27, 2026
Merged via the queue into main with commit aa5e10b Mar 27, 2026
32 checks passed
@sirtimid
sirtimid deleted the sirtimid/pimlico-optional-away-wallet branch March 27, 2026 14:45
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.

2 participants