Skip to content

The coordination harness is test-only: the documented multi-contract scenarios cannot be exercised against the real contract #446

Description

@usmanimamu17-create

Problem

src/coordination_harness.rs is a #[cfg(test)] module (its only content is mod coordination_harness_tests) documenting six scenarios — clean deployment, staged upgrade, incompatible rollback, correlation across boundaries, paused-in-group, safety rollback — and testing them against build_negotiation_info/negotiate_contract_versions/CrossContractSafety directly. No contract method exposes negotiation or safety (companion issues), so the harness exercises the libraries, not the deployed contract.

Consequences:

  • The scenarios certify library functions, not the contract: a regression in get_version_info's real response (e.g. the VersionInfo shape) would not fail any harness scenario, because the harness never calls it.
  • The documented multi-contract guarantees are unverifiable on-chain: "Staged upgrade" and "incompatible rollback" are the exact situations operators face during deployment, but the only thing that can be run is a unit test over in-memory structs.
  • The harness creates false confidence: CI passing on these scenarios suggests the deployment story is validated when the real integration surface is untested.

Root cause

The harness was written as unit tests for the library modules before the contract surface exposed them; the "integration" framing in the module doc outran the wiring.

Why this is architecturally hard

  1. Making the scenarios exercise the real contract requires the negotiation/safety/correlation surfaces to be exposed (companion issues) — or, failing that, requires the harness to be re-scoped as a pure library test and the module doc corrected.
  2. True multi-contract testing needs multiple registered contracts in one Env (Soroban supports this) with the SLA calculator actually invoking peers — which the safety wiring (companion issue) has not landed.
  3. The deliverable here is partly documentation: a clear statement of what is tested (libraries) vs. what is not (deployed multi-contract flows), plus a migration path to real integration tests.

Acceptance criteria

  • The module doc states the harness's actual scope (library-level vs. contract-level).
  • Each scenario that can be run against the real contract surface is run that way; others are explicitly marked future-facing.
  • CI output distinguishes library tests from integration scenarios.

Out of scope

Wiring negotiation/safety/correlation into the contract (companion issues) and building the escrow peer.

Getting started

just test

Good first files to read: apexchainx_calculator/src/coordination_harness.rs, apexchainx_calculator/src/version_negotiation.rs.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardStellar WaveIssues in the Stellar wave programThird CampaignCampaign: Third Campaignarea/testingImported campaign issue labelpriority/mediumImported campaign issue label

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions