- each chain’s contracts are tested on their own
- shared scenario files make both chains run the same cases and reach the same result
- end-to-end runs start both chains locally, deploy everything, and push real trades through the relayer from start to finish
Contract tests on each chain
The contracts live in the public proofbridge-contracts repository.
Both suites build the real zero-knowledge circuit and prove with it, so the
Verifier is tested against real proofs. On Ethereum, CI also checks that
the Verifier contract matches the circuit it was generated from.
The invariant campaigns on Ethereum make random sequences of calls
(file, rule, settle, cancel, claim, pause) and check after every step that
certain things always hold:
- funds are conserved: what each escrow holds equals exactly what it owes. A surplus fails the check as surely as a shortfall.
- the dispute module can always pay its bonds
- no finished order keeps an open dispute
The same scenarios on both chains
Two hand-written implementations can drift apart without either one failing its own tests. To catch that, both chains read the same scenario files and must produce the same result.- Order hashing. Both chains must compute the same hash for the same order, from shared test vectors.
- Agent policy. Both chains must allow and refuse the same agent actions, with the same cap math.
- Disputes. A shared scenario file lists the steps of each dispute. Each chain runs them and must reach the same final status, record the same event, and send the bond to the same place.
- Joint outcomes. Both legs of one trade run side by side: the ad chain decides how the trade ends, and the order chain follows by proof. Each of 13 scenarios must end in the recorded outcome on both legs, and every scenario ends with a funds-conservation check. The scenarios include a normal settlement, a cancel, a cancel racing an unlock, a settled trade that is then disputed, each dispute ruling, a dispute with no ruling, and a replayed leaf.
The chaos pack
The chaos pack deliberately breaks things and checks that nobody’s money goes anywhere it shouldn’t. Every scenario runs on both chains, against the real escrow, agent account, policy and dispute contracts. Each new test was also checked the other way round: the guard it relies on was removed from the contract, and the test had to fail before it counted.
The full list, the test names on each chain, and the pack’s known limits
are in
CHAOS.md.
The chaos tests stub the signature and proof checks so they can focus on
the escrow, policy and dispute logic. The real cryptography is covered by
the joint-outcome sweep and the end-to-end runs below.
End-to-end runs
These runs start a local Stellar network and a local Ethereum node, deploy every contract fresh, and drive real trades. Every run covers both bridge directions: an ad on Stellar with the order on Ethereum, and an ad on Ethereum with the order on Stellar.Contracts across chains
The cross-chain run uses the contracts directly, with no relayer. Both parties register their settlement keys on both chains, a trade is created and locked, both parties co-sign, the proofs are built, and each side unlocks on its own chain. It reads token balances on both chains to check the payouts.The relayer
The relayer run starts the relayer and its database in containers, seeds them, and drives each flow through the relayer’s API, the way the app does. Several flows read balances and contract state on-chain, not only the relayer’s records.
More flows can be run on demand: a relayer killed mid-trade (the trade
still settles), a long Stellar outage during key registration (the
registration lands afterwards with no re-sign), a cancel when nobody
co-signs, and the order-chain side of each dispute outcome.
How CI runs them
- Contracts. Both contract workflows run on every pull request and every
push to
mainin the public repository: formatting, build, contract size budget, the full test suites, the parity checks, the chaos pack as its own named step, and gas and compute-cost baselines for unlocks. The runs are public on the contracts Actions page. - Everything else. In the main repository, a pull request’s checks start when a maintainer labels it. Each stage runs only if the pull request touches what it tests. The fast stages run in parallel: the contracts, the circuits, the scenario-file check, and the relayer, agent runtime, frontend and pod service tests. The two end-to-end runs wait for those and run only if none failed.
- On
main. Merges tomainrun the end-to-end workflows again when the contracts, circuits or relayer change.