L1: Add Maybe LeiosCert on DijkstraBody (Dijkstra-only)
Introduce 'Maybe LeiosCert' (mirrored after the existing 'Maybe PerasCert')
as an optional field on the Dijkstra-era 'BlockBody'. Other eras are
unaffected — this is the entire Leios-related ledger change per the
rebase plan's decision #3 (no 'Body'/'BodyInline'/'BodyCertificate' sum,
no early-era touch).
The change spans four pieces, all kept together so the type, codec,
hashing, and lens story land coherent:
- 'LeiosCert' / 'PerasCert' placeholders encode as @encodeListLen 0@
rather than @encCBOR ()@ — the latter is 'encodeNull' (0xf6), which
collides with the null-tag of 'encodeNullStrictMaybe' and made
'SJust LeiosCert' indistinguishable from 'SNothing' on the wire.
Adds a regression test in 'BaseTypesSpec' covering both certs.
- 'DijkstraBlockBody' carries pre-encoded bytes for body / wits /
aux-data / is-valid / Leios cert / Peras cert, six slots total
(numSegComponents = 6). The Leios and Peras cert slots always emit
a CBOR token (null when absent) so the on-wire layout is fixed.
- Lens setters ('txSeqBlockBodyL', 'leiosCertBlockBodyL',
'perasCertBlockBodyL') rebuild via the bidirectional
'DijkstraBlockBody' pattern. The previous setters only updated the
structural field and silently kept the stale pre-encoded bytes, so
e.g. setting txs left 'dbbTxsBodyBytes' as the empty list and the
block on the wire had no transactions even though the in-memory
rep was correct. Mirrors the Alonzo idiom
@lens abbTxs (\_ s -> AlonzoBlockBody s)@.
- 'Arbitrary' and 'TreeDiff' instances for the body extended to
generate / show the new cert slot.
Co-Authored-By: Claude <[email protected]>