Skip to content

Aztec testnet integration#159

Merged
Martin9204 merged 3 commits intodevfrom
Martin9204/aztec-testnet-fixes
Apr 27, 2026
Merged

Aztec testnet integration#159
Martin9204 merged 3 commits intodevfrom
Martin9204/aztec-testnet-fixes

Conversation

@Martin9204
Copy link
Copy Markdown
Collaborator

@Martin9204 Martin9204 commented Apr 27, 2026

Summary

  • Adds a self-contained Aztec testnet gRPC service (js-aztec-testnet/) implementing all NetworkService RPCs against the Aztec testnet SDK (@aztec/* 4.1.0-rc.2). Mirrors the architectural pattern of Network.Starknet.Grpc: GrpcConfigClient / GrpcEventCollectorClient bridge to Core.Grpc, background TP + RPC log event listener + GasStation workers, Redis-backed state, no Temporal dependency.
  • Introduces a unified SubmitTransaction RPC handler with a payload oneof (lock / redeem / refund / transfer / custom) replacing the legacy per-type RPCs. solverRedeem / userRedeem routing matches the EVM service's actor-based proto convention against Aztec's function-name-based contract builders.
  • New Dockerfile.aztec-testnet-grpc (Node 22, two-stage). AppHost wires the container with TrainSolver__NetworkType=aztec, ChainId=4138294185, Core.Grpc URL, Redis, Azure KV.
  • EF migration 20260418104231_AddAztecTestnetNetwork seeds the aztec-testnet network, native ETH token (Wonderland), Train contract, listener config, and routes.
  • Per-environment Aztec ABIs split (devnet vs testnet) replacing the single Train.aztec.abi.json. AdminPanel ships matching ABIs in wwwroot/abis/ for browser-side Bridge UI interactions.
  • EVM dev-mode local signing path via EmulatedAzureKeyVaultSigner + EmulatedKVTokenCredential + LocalKeySigningService so dev environments can run without a real Azure KV.
  • AdminPanel Bridge updates for Aztec wallet flows (Azguard / Aztec testnet) and refreshed bridge.js helpers.
  • Bumped Network.Common, Network.EVM.Grpc, Core.Grpc references and Workflow.Tests mocks to align with the unified service contract.

Manual setup required after merge

  1. Rebuild the Aztec testnet image (BuildImage is commented out in AppHost.cs:13):
    docker build -t train-solver/aztec-testnet-grpc:local -f Dockerfile.aztec-testnet-grpc .
  2. Enable the event listeners you need — the seed ships them all Enabled=false:
    UPDATE "EventListenerConfigs" SET "Enabled"=true WHERE "Id" IN (1, 38);
    -- 1=eth-sepolia rpc-log-event-listener, 38=aztec-testnet rpc-log-event-listener
  3. Verify the aztec-solver wallet address matches the testnet-SDK derivation. The testnet SDK uses different address derivation than devnet — if the DB row was created under the old SDK, the address won't match what the running service signs as. See PR description for the verification snippet.
  4. Fund the (verified) aztec-solver wallet with the swap token before triggering swaps.

Test plan

  • Build: dotnet build csharp/TrainSolver.slnx
  • Run AppHost; verify network-aztec-testnet-grpc container comes up healthy
  • Apply migration on dev DB
  • Enable eth-sepolia + aztec-testnet listeners in EventListenerConfigs
  • Trigger eth-sepolia → aztec-testnet swap end-to-end (lock, claim on dest, source-side redeem completes)
  • Trigger aztec-testnet → eth-sepolia swap end-to-end
  • AdminPanel Bridge UI loads aztec-testnet networks and ABIs

🤖 Generated with Claude Code

Martin9204 and others added 3 commits April 27, 2026 17:07
- New self-contained Aztec testnet gRPC service (js-aztec-testnet/)
  implementing all NetworkService RPCs against the testnet SDK
  (@aztec/* 4.1.0-rc.2). Reuses the architectural pattern of
  Network.Starknet.Grpc: GrpcConfigClient/GrpcEventCollectorClient
  bridge to Core.Grpc, background TP + RPC log listener + GasStation
  workers, Redis-backed state.
- Unified SubmitTransaction handler with payload oneof (lock/redeem
  /refund/transfer/custom) replacing legacy per-type RPCs. Routing
  for solverRedeem/userRedeem matches EVM's actor-based proto
  convention against Aztec's function-name-based builders.
- New Dockerfile.aztec-testnet-grpc (Node 22, two-stage); AppHost
  wires the container with TrainSolver__NetworkType=aztec,
  ChainId=4138294185, Core.Grpc URL, Redis, KV.
- EF migration 20260418104231_AddAztecTestnetNetwork seeds the
  aztec-testnet network, token, contract addresses, listener config,
  and routes.
- Per-environment Aztec ABIs split (devnet vs testnet) replacing the
  single Train.aztec.abi.json. AdminPanel ships matching ABIs in
  wwwroot/abis/ for browser-side Bridge interactions.
- EVM dev-mode local signing: EmulatedAzureKeyVaultSigner +
  EmulatedKVTokenCredential + LocalKeySigningService allow dev
  environments without a real Azure KV.
- AdminPanel Bridge updates for Aztec wallet flows
  (Azguard/Aztec testnet) and refreshed bridge.js helpers.
- Bumped Network.Common, Network.EVM.Grpc, Core.Grpc references and
  Workflow.Tests mocks to align with the unified service contract.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- WalletEndpoints.CreateAsync now resolves the target network from
  request.NetworkSlug when set (the user's "Network Scope" UI choice),
  falling back to first-of-type only when scope is empty. Previously
  it ignored the scope and always picked the first network of the
  given type, which routed Aztec wallet creation to aztec-devnet
  (which has no gRPC endpoint) instead of aztec-testnet.

- Aztec gRPC service now generates addresses natively using KV instead
  of calling a non-existent treasury HTTP endpoint. The handler reads
  the wallet slug from GenerateAddressRequest, generates fresh
  privateKey/salt/signingKey, derives the account address with the
  testnet SDK, and persists all three secrets to KV under the slug
  via a new AzureKeyVaultKeyStore.storeKeysBySlug helper. Removes the
  axios.post(`${treasuryUrl}/aztec/generate`) path that produced
  "Invalid URL" when no treasury was configured.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors the starknet.yml pattern: a single build-and-push job that
delegates to the shared docker composite action. Watches paths under
js-aztec-testnet/, the Dockerfile.aztec-testnet-grpc at repo root,
and shared protos/ + the workflow itself. Triggers on PR / push to
main and dev, manual dispatch, and release events. Image name:
trainprotocol/solver-aztec-testnet-grpc.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@Martin9204 Martin9204 merged commit 8f72c61 into dev Apr 27, 2026
10 checks passed
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