03Sheet 03.02 · Tools

Verify

make verify: strkey test vectors, then every entry against the schema, its hashes, a byte-for-byte round trip through native rs-stellar-xdr, the focus transaction and every fact; then every mined ledger.

make verify
# node tools/strkey.test.mjs && node tools/verify.mjs && node tools/mined-verify.mjs
node tools/verify.mjs --write   # also rewrite manifest.json

What it checks

Strkeys

Every SEP-0023 test vector must decode and re-encode (valid), or be rejected (invalid). This covers XDRProof's own strkey codec, which the schema walker uses.

The entry

The entry is validated against schema/v1/entry.schema.json (ajv, strict mode). Its id must match its directory, and every hazard id must exist in the registry. Variant keys must be unique, and each file name must start with its key.

The bytes and the round trip

Size and sha256 must match; .zst variants are checked on their decompressed bytes. The native reader (rs-stellar-xdr 30.0.0, depth limit 1500) decodes the bytes, renders SEP-0051 JSON and encodes them again. The result must be identical, byte for byte.

The focus and the facts

The focus transaction hash must be in the ledger, as an outer or fee-bump inner hash. Every fact that applies to the variant must hold at its JSON Pointer path. If the entry's change order is unstable, the order-normalised hash must match, and the shipped bytes must be one of the orderings seen.

A second reader

The WASM build @stellar/stellar-xdr-json 30.0.0 decodes each variant again, with no fallback. If it renders different JSON, the run fails. If it cannot decode a variant at all (for example at its depth limit), verify lists it and records fails in the manifest, and the run still passes. Today 468 of 481 variants agree.

The manifest

manifest.json is rebuilt from the entries. Without --write, verify fails if the committed file has drifted.

The mined ledgers

tools/mined-verify.mjs checks every mined ledger. It must match its hash and size, round-trip through the native reader, and carry the recorded sequence and protocol. Every finding's transaction and JSON path must be present.

Output

A table with one row per variant: entry@variant, protocol, source, round trip, facts, WASM reader. Then a summary of the counts (entries, variants, hazards targeted), an OK line, and the mined-ledger report.

On this page