Skip to main content
For maintainers of a Stellar SDK or XDR library in Go, JavaScript, Rust or Python. After this page your CI puts every corpus entry through your decoder on each pull request, fails on a new divergence, and tells you when a known one is fixed. Each corpus entry carries bytes stellar-core emitted (or a marked synthetic value) and the values a correct reader decodes from them. The expected values come from the bytes and the pinned oracle (rs-stellar-xdr), never from another SDK. A defect found in one SDK becomes a regression test in yours.
1

Pick the recipe for your language

The recipes need none of this repository’s build. Go, Rust and Python need your SDK’s language and a zstd decoder; JavaScript installs the corpus release’s npm runner.
2

Copy it into your repository

Copy workflow.yml to .github/workflows/xdrcheck.yml and the rest of the recipe where the workflow’s header comment says (xdrcheck/ for Go, Rust and JavaScript; tests/corpus/ for Python). The workflow downloads one corpus release pinned by version and sha256, and stops before reading anything if the archive does not match.
3

Write, review and commit the expected-failure list

Run the test once with XDRCHECK_WRITE_EXPECTED_FAILURES=1 (JavaScript: --write-expected-failures FILE). Read each line, then commit the list with the pinned version. From then on the job fails on a failure the list does not name (NEW-FAILURE) and on a listed failure that now passes (UNEXPECTED-PASS): remove that line in the same change as the fix.
4

Test an unreleased branch

The recipes judge bytes only (decode, consume every byte, re-encode identically; Rust and Python also compare the SEP-51 JSON). For decoded values, transaction parsing and the api operations, run xdrcheck conform run --sdk ../your-sdk-checkout from a checkout of this repository (SDK CI, section 8).

When the job fails

Limits

  • The loaders and the npm runner are not on a package registry. Pin them by commit or vendor them (one file each; Go: two).
  • The recipes judge conformance level L0 (bytes). The levels above it need xdrcheck conform and a driver, which exist for Go, JavaScript, Rust and Python only.
  • Entries of the stress tier are left out of the recipes: they are built to exhaust a reader without limits.

Next