DEVELOPERS · DESIGN GUIDE
Testing & conformance
Connect a protocol requirement to repeatable tests, failure cases and release evidence.
Test what must remain true
An invariant is a property that must hold within a declared scope. For example, invalid authorization must not produce an authorized value transfer, and corrupted snapshot data must not become active state.
The scenario selector illustrates expected assertions and useful evidence. It does not run a protocol test suite or report that these properties have been verified in a released node.
What should a test prove?
Choose a fault and inspect the property it challenges.
- INJECT
- A required signature fails.
- ASSERT
- Invalid authorization cannot produce an authorized state transition.
- Descriptor and witness fixture
- Expected rejection
- Canonical state before / after
This assertion concerns authorization rejection, not all consensus behavior.
Expected behavior, not a test result · this page does not execute a protocol suite.
Use complementary kinds of evidence
| Layer | What it can establish | Limit |
|---|---|---|
| Unit / codec vectors | Exact expected interpretation of known cases | Only the tested cases and chosen format |
| Property and state-machine tests | Invariants across generated inputs or transitions | Depends on generators and the model |
| Integration / fault tests | Behavior across components under controlled failures | Depends on environment coverage |
| Fuzzing | Unexpected input handling and robustness findings | No complete correctness guarantee |
| Formal reasoning | Properties within a specified model and assumptions | Does not automatically prove the deployed implementation |
Positive and negative vectors belong together
Shared vectors must identify their specification and schema versions. Passing them supports conformance to that scope; it does not establish all possible safety, performance or operational properties.
| Vector family | Positive case | Negative case |
|---|---|---|
| Transaction / witness | Canonical encoding and authorized descriptor | Malformed encoding, wrong network or invalid signature |
| Block / certificate | Valid structure and authority context | Invalid vote set or incompatible epoch context |
| State / proof | Correct commitment and anchored proof | Mismatched root or malformed evidence |
| Snapshot | Manifest and chunks reconstruct the expected state | Corruption, scope mismatch or incomplete reconstruction |
High-value properties to protect
Consensus claims depend on the specified network and honest-validator assumptions. A local test must record those assumptions rather than treating one successful run as a universal guarantee.
- Canonical transaction bytes and identity are unambiguous.
- Invalid transitions do not mutate canonical state.
- Amounts and partitions remain consistent with authorized supply and fee rules.
- A validator identity cannot sign conflicting messages in the same protected context.
- Snapshot and proof roots match the declared finalized anchor.
- Version activation cannot create ambiguous interpretation within one execution context.
Make the evidence traceable
Keep failure bundles, negative cases and compatibility decisions with the release record. A change to an invariant requires explicit review of its tests and assumptions; weakening a test to hide a regression is not conformance.
- 01Requirement
Identify the specification section and invariant.
- 02Test
Bind vectors and scenarios to that requirement.
- 03Implementation
Record the tested code and toolchain revision.
- 04Release evidence
Publish scope, results and unresolved findings.