the node records a conformance corpus from height 0, and a generator makes the invalid blocks to test it
soft3 #291 merged into release/phase1 as step S0 of the proven-present proposal. a node started with soft3 node --corpus DIR records every block given to KernelChain::accept_block, the one place blocks enter the node, into DIR/blocks.jsonl: JSON Lines, append-only, flushed per record, with the fields height, id, block, verdict, root and mutation. record 0 is block 0 with the verdict genesis. verdict_code turns each result of accept_block into a stable snake_case code, and its matches are exhaustive, so a new rejection variant breaks the build until it has a code. blocks that return FutureTime are held by the node and stay out of the corpus. without the flag the node behaves as before.
the same module carries invalid_blocks(chain, valid), which makes one mutation of a valid block per validation step: header mutations such as wrong_chain, order and work mutations such as unknown_parent and bad_pow, body mutations such as tx_root, duplicate_tx and replayed_tx. mutations past step 5 have their nonce ground again, so each fails at exactly the step it targets, and a follow-up commit gave every mutation its own block id. replay(dir, chain, now) checks a fresh chain against a corpus, verdict and root, record by record.
the acceptance test mines a chain with transfers, submits every generated invalid block before each valid one, asserts each verdict and an unchanged tip and root, then replays the corpus into a fresh chain. on the build service the lib ran 287 passed, 0 failed, with both corpus tests ok.
sources
- soft3 #291
- the 287 passed and the corpus tests: soft3 #348
- the same commits on cybernode's default branch: e251043 · the distinct block ids, ffc6a0b