Skip to content

feat(e2e): add Union channel and ERC20 scenario runner - #251

Open
notJoon wants to merge 49 commits into
mainfrom
refactor-union-e2e-scenarios
Open

feat(e2e): add Union channel and ERC20 scenario runner#251
notJoon wants to merge 49 commits into
mainfrom
refactor-union-e2e-scenarios

Conversation

@notJoon

@notJoon notJoon commented Jul 23, 2026

Copy link
Copy Markdown
Member

Summary

This PR adds a resumable Go-based E2E runner for the live
Union–EVM–Gno IBC path.

It manages a pinned Voyager runtime, establishes the IBC topology, runs the
selected packet scenarios, and stores checkpoints and review evidence. Chains,
PostgreSQL, Gno realms, and EVM contracts must already be deployed.

Structure

e2e/union/
├── cmd/channel-e2e/       CLI entrypoint and flags
├── internal/config/       environment validation and Voyager config
├── internal/scenario/     orchestration and scenario acceptance checks
├── internal/state/        checkpoints and evidence persistence
├── internal/voyager/      Voyager lifecycle, clients, and handshakes
├── internal/evm/          EVM transactions, logs, and balances
├── internal/gno/          gnokey/qeval, events, and packet queries
├── internal/union/        Union membership-height queries
├── internal/process/      external command execution seam
├── run-channel-e2e.sh
└── voyager-build.Dockerfile

scenario.Runner owns the execution order. Chain-specific behavior is kept in
the EVM, Gno, Union, and Voyager adapters. All external commands pass through
internal/process, allowing tests to replace them with deterministic fakes.

Execution flow

load and validate .env
  → verify the pinned union-voyager checkout
  → render and start an owned Voyager container
  → create or verify IBC clients
  → create or verify the connection and channel
  → execute enabled scenarios in registry order
  → save checkpoints and sanitized JSON evidence
  → clean up the owned Voyager container
  • Without --apply, a fresh run performs read-only preflight.
  • --apply enables broadcasts.
  • --resume validates state.json against the current topology and continues
    without repeating completed writes.

IBC topology

The base scenario creates four underlying clients:

Host Counterparty Client type
Gno Union cometbls
Union Gno gno
Union EVM trusted/evm/mpt
EVM Union cometbls

It then creates the composed Gno ↔ EVM clients:

Host Counterparty Client type
Gno EVM state-lens/ics23/mpt
EVM Gno proof-lens

After verifying the client relationships and statuses, the runner establishes
the Gno ↔ EVM connection and the ucs03-zkgm-0 channel. Both sides' IDs,
ports, versions, counterparty fields, and OPEN state are checked.

Scenarios

Scenarios execute in the following order:

Flag Behavior
--forged-proof-rejection Mutates a real EVM membership proof, verifies rejection on Gno, then submits the original proof as a control.
--erc20-to-gno Mints and approves ERC20, sends a TokenOrder, then verifies acknowledgements, commitment removal, balances, and refunds.
--amount-boundaries Verifies int64 maximum, maximum-plus-one refund, and cumulative overflow behavior.
--gno-to-evm Verifies wrapped-token initialize, escrow, unescrow, and invalid-quote refund flows.

--amount-boundaries and --gno-to-evm require a successful
--erc20-to-gno scenario.

Checkpoint and resume behavior

state.json stores the environment identity, topology IDs, failed-work
baseline, and packet progress.

Handshake and packet writes are checkpointed as *-submitting and
*-submitted. If a previous write cannot be identified unambiguously, resume
fails instead of broadcasting it again. Connection and channel resumes advance
only when matching external state is visible.

State and evidence files are written atomically with private permissions.
Evidence containing configured private keys or credential-bearing URLs is
rejected.

Supporting changes

  • adds qeval-friendly Gno client/connection/channel queries;
  • adds the admin-gated Gno E2E setup realm;
  • adjusts oversized event-attribute splitting;
  • adds the protected full-cycle GitHub Actions workflow;
  • documents environment preparation and runner usage.

@github-actions github-actions Bot added A-ci CI/CD workflows: lint, test, coverage pipelines A-doc Documentation: README, specs, godoc A-deps Dependency & toolchain pins: .gno-version, go.mod, flake.lock, Cargo.lock T-feature New functionality labels Jul 23, 2026
@notJoon
notJoon force-pushed the refactor-union-e2e-scenarios branch from c805961 to 368e29e Compare July 23, 2026 11:39
@notJoon
notJoon had a problem deploying to union-relayer-e2e July 23, 2026 11:48 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e July 24, 2026 00:22 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e July 24, 2026 02:59 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e July 24, 2026 09:41 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e July 24, 2026 10:47 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e August 3, 2026 04:58 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e August 3, 2026 08:25 — with GitHub Actions Failure
@notJoon
notJoon had a problem deploying to union-relayer-e2e August 3, 2026 09:21 — with GitHub Actions Failure
@github-actions github-actions Bot added the A-tooling Build tooling: Makefile, Nix flake, setup-stdlibs label Aug 5, 2026
@aronpark1007

Copy link
Copy Markdown
Contributor

channel-e2e-artifacts-20260804-164209/bin/gnokey (~36.8MB ELF binary) looks like a stray local artifact accidentally committed on this branch. .gitignore now covers this pattern going forward, but the existing blob should be dropped (git rm + rebase/squash) before this merges into main.

@notJoon

notJoon commented Aug 5, 2026

Copy link
Copy Markdown
Member Author

channel-e2e-artifacts-20260804-164209/bin/gnokey (~36.8MB ELF binary) looks like a stray local artifact accidentally committed on this branch. .gitignore now covers this pattern going forward, but the existing blob should be dropped (git rm + rebase/squash) before this merges into main.

@aronpark1007 thanks for checking. I just dropped that file in this commit 91d091b

notJoon added 14 commits August 6, 2026 11:21
Delay EVM indexing across the local beacon/geth finality boundary, refresh stale EVM state modules, and track exact repaired client events.

Assisted-By: Codex
notJoon added 28 commits August 6, 2026 11:21
Assisted-By: OpenAI Codex
Assisted-By: OpenAI Codex <codex@openai.com>
Assisted-By: OpenAI Codex <codex@openai.com>
Vendor ignored third-party Gno packages before fallback image builds.

Reuse gnokey from the pinned Gno image, resolve images concurrently, and run the suite in one Voyager lifecycle.

Assisted-By: OpenAI Codex
Assisted-By: OpenAI Codex
Assisted-By: OpenAI Codex
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ci CI/CD workflows: lint, test, coverage pipelines A-deps Dependency & toolchain pins: .gno-version, go.mod, flake.lock, Cargo.lock A-doc Documentation: README, specs, godoc A-tooling Build tooling: Makefile, Nix flake, setup-stdlibs T-feature New functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants