Introducing a new way to review your PRs.

Read the announcement

lfdt-ibc / ibc

The Inter-Blockchain Communication Protocol (IBC) is a neutral, open standard for secure cross-ledger interoperability

View on GitHub

18 documents · Updated Nov 23, 2026

docs / end-to-end-validation

End-to-end validation

End-to-end validation proves that the deployed IBC CLI can operate across a complete temporary network. It drives the real CLI, relayer, attestors, and prover through public process and service boundaries, then compares reported packet state with chain and application state. The child pages E2E harness and test matrix, E2E relayer scenarios, and E2E load testing describe the harness model, scenario groups, and load runs.

Validation model

The validation model treats each test as a small production-like network. A run joins EVM chains, IBC protocol state, client pairs, trust services, applications, and a relayer so that one user action can be checked from submission to final chain effect.

The tests do not call CLI handlers in process. They use public command output, configuration files, readiness signals, and service APIs. Independent chain reads provide a second view, so a reported relayer state is not accepted without the chain and application effect that it claims to represent.

This diagram shows how scenario needs become end-to-end evidence.

flowchart LR
    S[Scenario needs] --> P[Provider and topology]
    P --> E[Chains and IBC resources]
    E --> A[Applications and routes]
    E --> C[CLI configuration]
    C --> R[CLI relayer and trust services]
    A --> T[Packet traffic]
    T --> R
    R --> W[Packet status]
    R --> V[Chain and application state]
    W --> X[Validation evidence]
    V --> X

References: e2e/…/start.go• L260-287 e2e/…/traffic_setup.go• L133-185 e2e/…/traffic_setup.go• L394-473

Environment realization

The environment is a declared graph of chains, IBC instances, reciprocal clients, connections, and runtime authorities. The harness validates this graph and its runtime bindings before it acquires resources. It then starts or attaches to chains, creates or attaches to protocol state, prepares clients, and starts the attestors required by those clients.

The graph supports two ownership models:

  • Managed chains belong to the test. They provide startup, funding, mining, node fault control, and cleanup.
  • Attached chains provide an existing RPC endpoint. The caller keeps control of mining, funding, node lifecycle, and shutdown. The declaration supplies its own wait timing because the harness cannot assume local chain timing.

Provider selection follows scenario needs rather than fixed provider names. Anvil supports controlled mining and node lifecycle faults. Besu supplies QBFT and IBFT 2.0 consensus paths. A scenario that needs Anvil controls cannot silently run on Besu.

The standard attested mesh creates one IBC instance per chain and one reciprocal attestation connection for each chain pair. Besu mesh scenarios use Besu light clients and no attestors. Mixed connections can use one client kind at each end. Chain-pair naming is stable even when the mesh sorts chain IDs internally.

Graph checks reject unknown resources, duplicate identities, invalid ownership, incompatible client and counterparty kinds, incomplete quorums, and non-reciprocal clients. Client preparation also checks authority, counterparty identity, registration vacancy, and initial trust state before deployment. An attached IBC instance resolves the existing core router and access control surface rather than claiming ownership of application resources.

The environment owns only acquired local resources. Its close operation waits for active work, releases resources in reverse order, and can retry unfinished cleanup after a failed attempt.

References: e2e/…/start.go• L246-257 e2e/…/environment.go• L13-29 e2e/…/environment.go• L123-145 e2e/…/protocol.go• L21-76 e2e/…/protocol.go• L78-129 e2e/…/types.go• L17-78 e2e/…/start.go• L26-36 e2e/…/start.go• L60-114 e2e/…/start.go• L159-265

CLI process boundary

The process boundary makes the result apply to the executable that users run. One-shot commands use temporary homes and protected signer files. Long-running relayer and attestor processes announce readiness, pass health checks, and expose the public services used by the test.

Attestor startup proves more than process creation. It validates the configured local or remote signer, waits for a valid loopback endpoint, checks health, and probes the public height service. Restarts keep the attestor identity and endpoint stable so an existing relayer configuration remains usable. Process groups are stopped and reaped as one unit, with escalation when a process does not exit within its grace period.

The relayer configuration maps each route to its chain pair, client ends, signer, attestors, and optional remote prover. Each client end can declare its own client kind and automatic relay policy. Automatic client updates can continue even when no packet flows. Manual relay uses the same public status and relay services with an explicit packet request. The harness binds chain endpoints to the CLI for the lifetime of the environment and rejects new work after that environment closes.

Deployment is also tested through this boundary. The CLI provisions core and application resources, writes manifests, opens public relay access, and renders relayer configuration. A second deployment run skips completed work while preserving the state needed for later relay tests. The deployment surface covers attestation clients, Besu clients, mixed client pairs, invalid trust settings, and a complete IFT transfer.

Local and remote signing are separate acceptance paths. Remote signing requires a public key lookup and a key ID. The harness checks that the process signer address matches the authority declared by the environment. Remote proving moves proof work to a separate service without changing the packet outcome.

References: e2e/…/attestor.go• L49-70 e2e/…/attestor.go• L90-169 e2e/…/attestor.go• L192-239 e2e/…/attestor.go• L307-381 e2e/…/process_handle.go• L15-27 e2e/…/process_handle.go• L63-123 e2e/…/relayer_config.go• L17-45 e2e/…/relayer_config.go• L47-89 e2e/…/relayer_config.go• L111-206 e2e/…/traffic_setup.go• L148-185

Validation lifecycle

The validation lifecycle turns a scenario declaration into evidence about a deployment or packet. Setup makes the network ready. Application bindings create traffic on a directed route. The CLI relayer observes and submits the required packet transactions. Assertions compare the public result with chain and application state.

When a test runs, it follows this sequence:

  1. Resolve a provider that satisfies the scenario requirements.
  2. Start or attach to chains and verify their identity and readiness.
  3. Realize IBC instances, clients, connections, and trust services.
  4. Deploy test applications and bind them to directed routes.
  5. Write temporary CLI state and relayer configuration.
  6. Start the relayer and verify every declared chain is connected.
  7. Submit a deployment action or packet-producing application request.
  8. Relay packets automatically or through an explicit public request.
  9. Wait for a stable packet state and verify the related chain effect.
  10. Stop processes and release only environment-owned resources.

Wait budgets come from the resolved chain timing. They do not assume Anvil's fast block cadence, so the same acceptance meaning applies to managed, attached, and production-like chains. Matrix discovery validates and records the resolved topology without starting traffic or acquiring the environment.

References: e2e/…/start.go• L143-181 e2e/…/start.go• L229-287 e2e/…/traffic_setup.go• L148-230 e2e/…/traffic_setup.go• L394-508 e2e/…/start.go• L60-114

Packet evidence

Packet evidence links a relayer result to one packet emitted by one source transaction. The packet locator includes its directed route, source chain, source client, source transaction, and sequence. The source transaction is checked against the relayer status before the result is accepted.

Transfer checks compare protocol state and token state. They record source and destination values before submission. They then check escrow or burn, delivery or rejection, acknowledgement or timeout, refund behavior, commitments, and receipts. A source transaction can emit several packets, so status reads consume every page and match each packet by client and sequence.

The accepted outcomes are:

OutcomeEvidenceState effect
SucceededReceive and acknowledgement transactionsThe destination records the packet and the application delivers its value or call.
RejectedReceive and acknowledgement transactionsThe destination records an error and the application applies its rejection or refund rule.
Timed outTimeout transaction with no receive or acknowledgementThe source restores the value and the destination creates no voucher.
PendingNo terminal packet effectThe destination remains unchanged until a later relay or timeout.

The harness first waits for the requested state. It then watches that state for a route-specific stability window. This prevents a short-lived status from becoming final evidence.

References: e2e/…/traffic.go• L16-86 e2e/…/traffic_relayer.go• L55-185 e2e/…/daemon_test.go• L91-147 e2e/…/daemon_test.go• L298-324 e2e/transfer_test.go• L23-149

Route and application behavior

A route is a directed packet path from a source chain and client to a destination chain and client. It gives relay policy, packet identity, and wait timing a stable scope. Reciprocal routes can share a connection while keeping their packet behavior separate.

The acceptance surface uses three application behaviors:

  • ICS20 transfer moves a token between chains and proves escrow, delivery, acknowledgement, timeout, or refund.
  • ICS27 GMP, or General Message Passing, sends a call to a destination application and proves execution or an error acknowledgement.
  • IFT, or Interchain Fungible Token transfer, burns on the source and mints on the destination. It also proves batching, multiple token pairs, rate limits, and refund behavior.

Applications expose the packet emitted by each send and retain the state needed for later checks. This lets one source transaction produce several independently tracked packets. Manual relay can select some packets from a batch while leaving the others pending. Cross-route tests use equal sequences on different routes to prove that route scope remains part of packet tracking.

References: e2e/…/traffic_setup.go• L63-115 e2e/…/traffic_setup.go• L133-185 e2e/…/traffic_gmp.go• L33-125 e2e/…/traffic_ift.go• L69-192 e2e/…/traffic_transfer.go• L83-174 e2e/gmp_test.go• L15-136 e2e/ift_test.go• L277-355 e2e/ift_rate_limit_test.go• L29-239 e2e/cross_route_test.go• L16-54

Recovery behavior

Recovery scenarios prove that packet progress survives loss of a process, chain connection, node, or transaction. They first create a known pending state. They then apply one fault and require public relayer state and final chain effect to converge after recovery.

The recovery cases cover:

  • Relayer restart with packets found by startup clearing or retained manual requests.
  • WebSocket subscription loss followed by reconnect and packet discovery.
  • Destination node restart while a transfer is being prepared.
  • Pending receives removed from the mempool, made underpriced by a base-fee increase, or removed by a reorg before finality.
  • Receive replacement with the same nonce and a higher fee, followed by canonical receipt evidence.

Timeout checks use the finalized destination view. Wall-clock time alone does not make a packet timed out when the finalized destination header has not passed the timeout. A packet becomes timed out only after the required chain evidence is available.

The relayer's restart path preserves configured work and can perform a clearing pass for packets that were emitted while it was down. The process handle also makes shutdown and restart safe when a child process exits during signaling.

References: e2e/relayer_lifecycle_test.go• L19-225 e2e/node_recovery_test.go• L17-58 e2e/transaction_recovery_test.go• L24-235 e2e/pending_packet_test.go• L15-52 e2e/…/process_handle.go• L35-123 e2e/…/relayer_config.go• L36-40 e2e/…/daemon_test.go• L168-186 e2e/…/faults.go• L13-56

Signing proving and attestation

Signing, proving, and attestation test the trust path around a packet rather than only its payload. A relayer or attestor can use a local key or a remote signer. The environment keeps signer identities separate across client contexts and checks that each running process uses its declared authority.

Attestation validation checks claim content before the claim reaches the chain. Tests use a valid signature over an altered packet, acknowledgement, or timeout commitment. The relayer rejects the claim and leaves the packet pending. The correct claim then allows delivery or refund to complete.

Attestation clients require an explicit signature quorum. A quorum scenario shows that two of three attestors can deliver a packet while one live attestor leaves it pending. Besu QBFT and IBFT 2.0 scenarios use sealed headers and state proofs instead of attestor signatures. Mixed connections prove that one direction can use a Besu client while the other uses attestation.

Besu misbehaviour scenarios submit validly sealed but conflicting headers or a non-monotonic timestamp pair. The client freezes, rejects later updates, and leaves the next transfer pending. Besu clients can also be configured with short trusting periods and must receive automatic updates often enough to remain usable throughout a run. Fixture generation captures matching header and proof evidence for these accepted and rejected cases.

References: e2e/…/runtime.go• L12-47 e2e/…/start.go• L184-263 e2e/…/protocol.go• L57-76 e2e/…/types.go• L32-78 e2e/…/attestor.go• L90-103 e2e/…/attestor.go• L307-381 e2e/…/relayer_config.go• L61-79 e2e/attestation_validation_test.go• L30-243 e2e/ift_test.go• L26-204 e2e/remote_signer_test.go• L213-269 e2e/remote_prover_test.go• L46-124 e2e/besu_client_update_test.go• L22-94 e2e/besu_misbehaviour_test.go• L29-144 e2e/…/generate_test.go• L41-179

Load validation

Load validation checks service capacity and relay behavior under sustained work. It is disabled by default and runs separately from normal acceptance tests. The local observability stack records process-level measurements for relayer and attestor work.

There are two main load paths:

  • Attestor load sends packet and state attestation requests at target rates. It checks that each response contains the requested attestation and records success, failure, timeout, drop, and latency results over a fixed run window.
  • Relayer load creates IFT traffic in both directions with Catalyst. It discovers every source transaction's packets through relayer status, retries indexing for a bounded period, and waits for all discovered packets with parallel workers.

Burst and long-run profiles vary packet count, packets per block, batching, and completion time. This shows throughput and delay together rather than treating a single completion time as capacity.

References: e2e/…/start.go• L229-243 e2e/load_attestor_test.go• L28-140 e2e/…/catalyst_await.go• L47-111 e2e/…/catalyst_await.go• L114-207 e2e/load_relayer_test.go• L23-187

Provider modes and matrix

Provider modes choose one compatible topology for each discovered test. The matrix records scenario needs and the resolved resources, so skips and coverage changes remain visible instead of being hidden in test code.

ModeProvider orderUnresolved requirement
fastAnvilSkip the test.
completeAnvil, then BesuFail the run.
productionBesu, then AnvilFail the run.

Complete mode checks each test once with the fastest compatible provider. It does not run every provider permutation. Controlled mining and node lifecycle requirements select Anvil in every mode. Portable tests use Anvil in fast and complete modes and Besu in production mode.

Matrix discovery lists the Go tests once per mode. It records provider selections and resolved environment summaries as structured records, then renders the generated table. The generator rejects duplicate records, records for unknown tests, and tests that report neither a matrix result nor a pass in a mode. The current matrix includes Besu client expiry prevention, Besu client variants, recovery paths, and the load scenarios alongside transfer and application coverage.

References: e2e/…/start.go• L80-181 e2e/…/start.go• L260-273 e2e/…/matrix.go• L20-212 e2e/…/main.go• L58-89 e2e/…/main.go• L108-236 e2e/test-matrix.md• L7-68 e2e/…/main_test.go• L32-100

Validation commands

The E2E module provides separate checks for the harness, test applications, acceptance runs, Besu fixtures, and the provider matrix. The normal test target builds the CLI before it starts acceptance tests.

CommandPurpose
make -C e2e doctorCheck local runtime prerequisites.
make -C e2e testRun fast-mode acceptance tests.
make -C e2e test E2E_MODE=completeRun the complete provider plan.
make -C e2e test E2E_MODE=productionRun the production provider plan.
make -C e2e test E2E_FLAGS='-run TestTransfer_AutoRelay -count=1'Focus one scenario.
make -C e2e test E2E_LOAD=trueEnable load scenarios.
make -C e2e test-harnessCheck harness behavior.
make -C e2e generate-besu-fixturesRebuild Besu light-client fixtures.
make -C e2e check-staleCheck generated contract bindings.
make -C e2e generate-matrix / check-matrixRegenerate or verify coverage output.
make -C e2e run-all-checksRun the full local validation sequence.

Managed chains and matrix generation need Docker. Contract binding checks need the Solidity build tools. Load mode starts the local observability stack. After a hard crash, use the clean dry run before cleanup so the resource scan remains visible. Cleanup targets only harness-marked Docker resources and processes using harness-specific config or private-home paths, so unrelated local IBC processes remain outside its scope.

References: e2e/Makefile• L14-24 e2e/Makefile• L32-58 e2e/Makefile• L60-100 e2e/README.md• L15-56 e2e/…/clean.sh• L9-101

Change checklist

When these files or sections are changed, remember to consider these:

  • Keep route client pairs, connection direction, relay policy, packet identity, and wait timing aligned.
  • Keep the declarative graph, runtime endpoint bindings, runtime authorities, and signer isolation aligned before resource acquisition.
  • Keep attached-chain scenarios free of managed funding, mining, restart, and cleanup assumptions.
  • Keep deployment manifests, public relay permissions, rendered configuration, and second-run skip behavior aligned.
  • Keep process readiness, health probes, stable service endpoints, environment lifetime, and teardown ordering aligned.
  • Keep signed claims tied to the commitment type and packet phase being tested. A valid signature must not make altered data acceptable.
  • Keep remote signer endpoint and key ID together, and keep the process-reported signer address equal to the declared authority.
  • Keep remote prover inputs complete for every client end that uses the route, including mixed client-type connections.
  • Keep Besu client scenarios paired with Besu counterparty chains and keep Besu fixture artifacts matched to their consensus and contract inputs.
  • Keep automatic client-update intervals shorter than the configured trusting period in expiry scenarios.
  • Keep rate-limit tests aligned with packet batches, terminal states, and the refill path.
  • Keep transaction recovery checks aligned with nonce reuse, replacement fees, finality, and canonical receipts.
  • Keep load-test packet counts aligned with packets per block and keep discovery and relay budgets above the load profile.
  • Regenerate and check e2e/test-matrix.md after changing test names, topology, or requirements.
  • Keep the pinned Solidity IBC contract revision identical across the Go modules and the contracts workspace.

Important failure modes

TriggerConsequenceGuard
A scenario needs controlled mining but resolves to BesuThe test cannot pause or advance the chain as requiredDeclare the capability and let provider resolution select Anvil.
An attached chain lacks funded actors or required timingDeployment or traffic fails even though RPC is reachableFund actors outside the harness and declare explicit wait timing.
The environment graph has an unknown resource, duplicate identity, or incompatible clientRealization fails before traffic can produce evidenceValidate the graph and counterparty relationship before acquisition.
A relayer or attestor has no valid readiness, health, or public service resultThe test may use an unready or dead processRequire structured readiness, health, and public service probes.
An attestor restart changes its endpoint or signer addressThe relayer cannot use its existing configuration or trust identityPreserve the announced endpoint and verify the signer after restart.
A source transaction emits several packets but status is read once or matched only by hashA later packet can look absent or the wrong packet can be acceptedConsume every status page and match source client and sequence.
A signed attestation contains the wrong commitmentThe relayer rejects the claim and the packet stays pendingVerify rejection, then restore the correct claim and verify the final effect.
Attestors do not meet the client quorumDelivery remains pendingAlign registered attestors, runtime identities, and the minimum quorum.
A signer is reused across IBC clientsTrust data can be replayed in the wrong client contextEnforce graph-wide signer isolation.
A Besu client receives conflicting, non-monotonic, or expired sealed-header evidenceThe client freezes or expires and later packets remain pendingSubmit the intended evidence and assert freeze or update behavior.
A receive or refund is dropped, underpriced, or removed by a reorgThe packet can remain pending or point at a non-canonical transactionReuse the nonce with a higher fee when needed and verify the canonical replacement.
A deployment rerun changes recorded parametersIdempotency and manifest reuse failVerify first-run execution and second-run skips.
Environment cleanup races with a bound CLI processA process can outlive its environment or new work can start after closeSerialize process binding with environment lifetime.
Cleanup matches a broad process pattern or unlabeled Docker resourceAn unrelated developer process or resource can be stoppedScope process matches to harness markers and Docker removal to the E2E label.
Matrix discovery omits a record or passThe generated matrix can hide missing coverageFail generation when a test has neither result in a mode.
Load traffic is not indexed before lookup retries endLoad validation reports missing packetsUse discovery polling and relay budgets suited to the profile.

Key files

FileWhy to read it
e2e/README.mdDefines the black-box boundary, provider modes, ownership model, and E2E entry points.
e2e/MakefileDefines the commands that build, run, generate, and check validation.
e2e/test-matrix.mdShows current scenario requirements and provider coverage.
e2e/…/start.goConnects scenario needs, provider choice, load gating, matrix discovery, and environment startup.
e2e/…/traffic_setup.goConnects applications, routes, temporary configuration, timing, and relayer startup.
e2e/…/spec.goDefines the validated graph of chains, IBC instances, clients, connections, and authorities.
e2e/…/start.goShows resource acquisition, ownership, runtime checks, timing, and cleanup.
e2e/…/protocol.go and solidityibc/types.goDefine the public environment view of IBC instances, client kinds, attestor trust, and concrete protocol variants.
e2e/…/attestor.goShows process startup, signer selection, public readiness, height probing, and stable attestor endpoints.
e2e/…/process_handle.goShows safe process-group shutdown and escalation for CLI daemons.
e2e/…/relayer_config.goDefines the mapping from environment routes to client ends, signers, attestors, provers, and relay policy.
e2e/…/traffic_relayer.goDefines packet identity, relay selection, stable status checks, and terminal evidence.
e2e/…/traffic_transfer.goShows the transfer evidence model for escrow, delivery, acknowledgement, timeout, refund, and commitments.
e2e/…/traffic_gmp.go and traffic_ift.goShow GMP calls and IFT delivery, batching, pending state, refund, and supply checks.
e2e/deploy_test.goShows CLI-only deployment, manifests, public relay access, rendered configuration, client variants, and idempotency.
e2e/transfer_test.goShows automatic and manual transfer, timeout refund, Besu proof paths, and validator turnover.
e2e/relayer_lifecycle_test.go and e2e/transaction_recovery_test.goShow process recovery, pending work, replacement transactions, and reorg recovery.
e2e/attestation_validation_test.go, e2e/besu_client_update_test.go, and e2e/besu_misbehaviour_test.goShow invalid attestation rejection, trusting-period updates, and Besu client freeze behavior.
e2e/remote_signer_test.go and e2e/remote_prover_test.goShow process-boundary signing and proving while preserving packet outcomes.
e2e/load_attestor_test.go, e2e/load_relayer_test.go, and e2e/…/catalyst_await.goShow the attestor and relayer load profiles, packet discovery, and completion waits.
e2e/…/clean.shShows how crash cleanup is scoped to harness processes and labeled Docker resources.