Skip to content

test(evm-wallet-experiment): Add local docker e2e test#912

Draft
grypez wants to merge 21 commits intomainfrom
grypez/dock-stack-c-evm-wallet
Draft

test(evm-wallet-experiment): Add local docker e2e test#912
grypez wants to merge 21 commits intomainfrom
grypez/dock-stack-c-evm-wallet

Conversation

@grypez
Copy link
Copy Markdown
Contributor

@grypez grypez commented Apr 1, 2026

Add a Docker Compose stack for isolated E2E testing with five services:

  • evm: Anvil chain with EIP-7702 support + contract deployment
  • bundler: Pimlico Alto ERC-4337 bundler
  • llm: lightweight proxy forwarding to an upstream LLM
  • home: home kernel node (EOA + DeleGator smart account)
  • away: away kernel node (delegation recipient)

Supports three delegation modes via DELEGATION_MODE env var:
bundler-7702, bundler-hybrid, and peer-relay.

image

@grypez grypez changed the title Grypez/dock stack c evm wallet test(evm-wallet-experiment): Add local docker e2e test Apr 1, 2026
@grypez grypez force-pushed the grypez/dock-stack-b-turbo branch from c77a70b to c21c392 Compare April 1, 2026 17:03
@grypez grypez force-pushed the grypez/dock-stack-c-evm-wallet branch from c4d8613 to ca1a2c5 Compare April 1, 2026 17:03
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.28%
⬇️ -0.01%
8504 / 10863
🔵 Statements 78.1%
⬇️ -0.01%
8640 / 11062
🔵 Functions 75.84%
⬇️ -0.01%
1981 / 2612
🔵 Branches 76.04%
⬇️ -0.03%
3647 / 4796
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/evm-wallet-experiment/src/index.ts 100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
100%
🟰 ±0%
packages/evm-wallet-experiment/src/lib/sdk.ts 83.6%
⬇️ -4.86%
82.6%
⬇️ -3.11%
85%
⬇️ -3.88%
84.48%
⬇️ -5.31%
54, 101-105, 118-119, 400-419, 450
packages/evm-wallet-experiment/src/vats/coordinator-vat.ts 88.16%
⬇️ -0.05%
79.84%
⬇️ -0.22%
93.47%
⬆️ +0.07%
88.11%
⬇️ -0.04%
51, 75-77, 115-160, 357, 455-457, 484-487, 515, 571-573, 662-664, 684, 688, 881, 884, 920-922, 930, 945-949, 1112-1114, 1168-1170, 1176, 1191-1193, 1273, 1297-1300, 1309-1311, 1344-1347, 1366-1368, 1396-1399, 1411-1413, 1477, 1490, 1497, 1504, 1568, 1587-1589, 1718, 1753-1756, 1831, 1883-1884, 1920, 2025, 2101, 2137-2139, 2153-2155, 2185-2188, 2205, 2223, 2329-2335, 2424, 2498, 2516, 2601, 2618-2621, 2666-2669, 2674, 2688, 2738-2739, 2781, 2789, 2792-2794, 2810, 2830, 2927-2928, 2942-2945, 2980, 2989
Generated in workflow #4164 for commit eda0887 by the Vitest Coverage Report Action

Base automatically changed from grypez/dock-stack-b-turbo to main April 1, 2026 17:53
@grypez grypez force-pushed the grypez/dock-stack-c-evm-wallet branch 2 times, most recently from 8a2f74e to ce8d6ee Compare April 1, 2026 20:36
grypez and others added 17 commits April 1, 2026 17:18
Add a Docker Compose stack for isolated E2E testing with five services:

- `evm`: Anvil chain with EIP-7702 support + contract deployment
- `bundler`: Pimlico Alto ERC-4337 bundler
- `llm`: lightweight proxy forwarding to an upstream LLM
- `home`: home kernel node (EOA + DeleGator smart account)
- `away`: away kernel node (delegation recipient)

Supports three delegation modes via DELEGATION_MODE env var:
bundler-7702, bundler-hybrid, and peer-relay.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Made-with: Cursor
…ion-aware

Configure LLM provider via env in setup paths. Extend setup-away.sh with delegation
modes (bundler-7702, bundler-hybrid, peer-relay) and Anvil chain ID resolution.
Tidy setup-home.sh, home-interactive.mjs, and resolve-chain.sh for compose usage;
adjust package.json scripts for the Docker workflow.
… coordinator vat

Add coordinator vat methods for redeeming delegations via direct EIP-1559
transactions instead of ERC-4337 UserOps:

- `resolveChainId()` — resolves chain ID from bundler config, cache, or RPC
- `useDirect7702Tx()` — determines whether to use direct tx vs UserOp path
- `buildAndSubmitDirect7702Tx()` — signs and broadcasts self-call txs with
  SDK-encoded DeleGator calldata
- `pollTransactionReceipt()` — polls for tx mining with configurable timeout
- `handleRedemptionRequest` on PeerWalletFacet for peer-relay delegation mode

Also adds `setSdkLogger()` to sdk.ts for environment resolution visibility,
and re-exports it from the package index.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add a vitest suite that exercises the Docker Compose stack:

- Home wallet: accounts, balance, message signing, EIP-712 typed data
- Away wallet: local keys, message signing, provider queries
- Delegation redemption: create, transfer, list, and redeem delegations
  with mode-specific capability assertions

Includes test helpers for Docker exec, health checks, log collection,
and daemon socket communication.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Made-with: Cursor
…ainers with host-driven orchestration

Containers now boot a generic kernel (entrypoint-kernel.mjs) and expose an
RPC socket — all wallet configuration is driven from the host via composable
helpers (wallet-setup.ts, scenarios.ts) that call `docker compose exec`.

- Replace entrypoint-home.mjs + entrypoint-away.mjs with shared entrypoint-kernel.mjs
- Rename Dockerfile.node-base → Dockerfile.kernel-base with multi-stage build (kernel + interactive)
- Add docker-compose.interactive.yml override for OpenClaw/LLM profile
- Add host-side wallet-setup primitives and named scenario compositions
- Add setup-wallets.ts script with 1000 ETH NativeTokenTransferAmount caveat
- Update docker-e2e.test.ts to use host-driven beforeAll orchestration

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Made-with: Cursor
…gent

Replace the bespoke fetch loop and tool-dispatch logic with makeChatAgent
from @ocap/kernel-agents, which provides the same JSON-based capability
invocation pattern. The LLM_API=ollama path now uses Ollama's OpenAI-
compatible /v1/chat/completions endpoint so the response format matches
ChatResult.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ollama-agent.mjs

The ollama-agent.mjs wrapper is unnecessary now that the caller can pass
capabilities directly to makeChatAgent and read agent.experiences after
the task completes. Capability definitions and experience inspection now
live in run-agent-loop-tests.mjs where they're actually used.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…abilities.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Default Vitest inherits root setupFiles including vitest-fetch-mock, which stubs global fetch. Docker E2E calls Anvil on localhost:8545 with real fetch; under the mock, responses were empty and evmRpc failed parsing JSON.

Exclude test/e2e/docker from the main evm-wallet Vitest project and run those tests with yarn test:e2e:docker (vitest.config.docker.ts uses no fetch mock).

Refresh yarn.lock workspace metadata for @ocap/kernel-agents on this package.

Made-with: Cursor
…tart

Home and away wallets hit the bundler during E2E setup; starting kernels
only after evm was healthy allowed a race where Alto was still booting.
depend_on bundler with service_healthy aligns Compose startup order.

Made-with: Cursor
- Drop Dockerfile.evm HEALTHCHECK; Compose already gates on contracts.json.
- Bundler: require eth_supportedEntryPoints with a non-empty result (ERC-4337).
- LLM proxy: probe / and treat 5xx (e.g. upstream down) as unhealthy.

Made-with: Cursor
- Use Alto OCI index digest so CI and laptops resolve the same image.
- Pin openclaw@2026.4.1 instead of @latest.
- Pin viem and smart-accounts-kit in Dockerfile.evm to match yarn.lock.

Made-with: Cursor
…d errors

Remove || true and the silent node-gyp fallback so broken
node-datachannel or better-sqlite3 builds cannot produce a green image
that fails at runtime.

Made-with: Cursor
Local stack uses Foundry Anvil (Prague) for AA/delegation E2E, not Hardhat.
Update comments and resolve_chain primary name; keep `hardhat` as a silent
alias for existing shell callers.

Made-with: Cursor
The wallet setup script runs on the host via yarn tsx (pinned devDependency).
Kernel Docker images do not install tsx; OpenClaw loads plugins with jiti.
… image

Yarn install runs with lifecycle scripts stripped, so the node-datachannel N-API
addon (pulled in via libp2p/webrtc) was never built and kernel-cli build failed
with MODULE_NOT_FOUND. Rebuild it explicitly before better-sqlite3 and workspace builds.

Made-with: Cursor
@grypez grypez force-pushed the grypez/dock-stack-c-evm-wallet branch from ce8d6ee to f036a65 Compare April 1, 2026 21:41
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