Implementation Roadmap
Concrete engineering tasks to turn the framework spec and differential testing design into working code.
Update: the Rust reference implementation (
runtime/) now has real, tested code for the canonical event ABI and most of the builder pipeline (Phase 1.2's Rust half, partially) plus the cryptographic commitment primitive (Phase 5). Status per item below has been updated accordingly β everything not explicitly marked done is still not started.
Phase 1 β Canonical Type System & Serialization
The serialization layer needs to be settled before client logic begins, to prevent format drift.
- 1.1 Define the strict SSZ schema. Draft the official SSZ definitions for
CanonicalSSRand its sub-containers. Enforce little-endian byte ordering for integers and explicit padding rules forUint256(32-byte arrays). - 1.2 Implement serialization libraries.
- Go: integrate an SSZ library (e.g.
fastssz) to generate static encoder/decoder methods for the Go-side SSR types. - Rust: configure an SSZ crate (e.g.
sszorlighthouse_types) to derive encoding logic on the Rust structs. Not started βruntime/sszis still an empty stub crate. The canonical event types that would eventually be serialized do exist (runtime/cse), but nothing encodes them to SSZ bytes yet.
- Go: integrate an SSZ library (e.g.
Phase 1.5 β Rust Builder Pipeline (new, not in the original phase breakdown)
The event-to-certificate compiler pipeline that consumes a validated CanonicalSemanticEvent stream (from runtime/cse) and produces canonical per-account certificates. This sits logically between Phase 1 (types) and Phase 2 (extractors) β it's what a real extractor's output would eventually flow into, but it doesn't extract from a real client itself (see Phase 2 status, unchanged).
- Canonical Semantic Event ABI (
runtime/cse) β frozen event/payload types, execution context, sequence/transaction-boundary validation. - Partition + terminal projection (
runtime/builder/src/partition.rs,ir/timeline.rs) β flattens an event stream into relational,CanonicalKey-keyed tables; reduces per-key timelines to verified terminal transitions. - Lifecycle resolution + canonicalization (
runtime/builder/src/lifecycle/{resolve,canonicalize}.rs) β resolves account creation/destruction into identity "generations," with formal invariant verification (uniqueness, temporal well-formedness, chronological adjacency). - Certificate hydration + assembly (
runtime/builder/src/lifecycle/{certificate,hydration}.rs) β cross-references real state facts (balance/nonce/code) to resolved generations to buildCanonicalAccountCertificates, with a real (if unimplemented)AccountSnapshotSource/StorageRootDeriverextension point for prior-state and Phase-5 storage-trie data. - Storage subtree/trie derivation β
StorageRootDerivertrait exists, no implementation. Every certificate'sstorage_rootis currentlyAwaitingDerivation. - Access-list tracking β
CsePayload::AccessListTouchedevents are parsed but not recorded anywhere in the pipeline.
21 passing unit tests across runtime/cse + runtime/builder. See docs/semantic_architecture_spec.md for the full stage-by-stage contract writeup and honest gap list.
Phase 2 β Client Extractor Modules
Geth extractor (Go)
- 2.1 Locate lifecycle hooks. Isolate the injection point in
core/state/state_processor.go, immediately following theApplyTransactionexecution loop. - 2.2 Extract state journal elements. Iterate the internal dirty-account map (
sdb.GetDirtyAddresses()); sortAccountMutationsby address (sort.Slice) before invoking the SSZ encoder. - 2.3 Access transient memory state. Read
sdb.TransientStorage()immediately prior to execution-state finalization.
Reth extractor (Rust)
- 3.1 Intercept execution outputs. Inject the extraction module where
BlockExecutionResultyields its finalized in-memoryBundleState. Not started β nothing inruntime/reads from a real RethBundleStateyet; the builder pipeline (Phase 1.5) consumes already-abstractedCanonicalSemanticEvents, which still need to be produced by a real extractor hook. - 3.2 Map BundleState structural diffs. Map state maps to
AccountMutationvectors; usesort_by_keyto enforce the same lexicographic ordering as the Go side over addresses and slots.
Phase 3 β Infrastructure & Differential Testing CI
[ Pull Request Pipeline ]
β
βΌ
βββββββββββββββββββββββββββββββ
β Generate Test Vector JSON β
ββββββββββββββββ¬βββββββββββββββ
β
βββββββββββββββββββββββββ΄ββββββββββββββββββββββββ
βΌ βΌ
βββββββββββββββββββββββββ βββββββββββββββββββββββββ
β Run Geth Extractor β β Run Reth Extractor β
β Output: geth_ssr.bin β β Output: reth_ssr.bin β
βββββββββββββ¬ββββββββββββ βββββββββββββ¬ββββββββββββ
β β
βββββββββββββββββββββββββ¬βββββββββββββββββββββββββ
β
βΌ
βββββββββββββββββββββββββββββββ
β scripts/verify_ssr.py β
β - Enforce Binary Identity β
βββββββββββββββββββββββββββββββ
- 4.1 Deploy the verification harness.
scripts/verify_ssr.pyis already in the repo root'sscripts/folder. - 4.2 Build the test runner environment. A script that spins up ephemeral, lightweight test harnesses for both Geth and Reth, feeds them the same raw transaction/pre-state input, and captures their respective
.binoutputs. - 4.3 Automate CI. A GitHub Actions workflow that runs the full test matrix on every pull request, and fails the build on any binary drift or size mismatch between the two extractor outputs.
Phase 4 β Fuzzing & Production Benchmarking (future, not started)
Depends entirely on Phase 1 and Phase 2 being complete β there's no extractor to compare or benchmark yet, so nothing here should be built before that.
-
fuzz_seeds/β high-entropy multi-account fuzzing inputs (irregular address/slot access patterns) to stress-test that Go's map iteration and Rust'sBTreeMapalways converge on the same sorted SSZ tree. -
production_traces/β real historical block extractions (e.g. via a tool likecryoagainst an archive RPC endpoint), used to validate the O(N) complexity claim indocs/framework.mdsection 7 against real-world block sizes.
See the companion dataset repo: Sahek/kaysentinel-fixtures for the curated Phase 3 test fixtures that exist today.
Phase 5 β Cryptographic Commitment (new, not in the original phase breakdown)
- Domain-separated BLAKE3 commitment primitive (
runtime/hash) βderive_commitment(domain, canonical_bytes) -> Digest, perdocs/hash_specification.md(RC1). 8 passing tests, including real computed-and-pinned vectors per domain. - Cross-language (Python/Go) differential verification of vectors β no Python/Go implementation exists yet, so nothing in
runtime/hash/vectors/candidate.jsonhas been promoted tonormative.json. - Wire real commitments into
VerifiedGeneration.state_table_proof_rootandCanonicalAccountCertificate.storage_rootβ both are still placeholder/AwaitingDerivationvalues in the builder pipeline.
Current status summary
| Phase | Item | Status |
|---|---|---|
| 1 | SSZ schema definition | Not started |
| 1 | Go/Rust serialization libs | Not started |
| 1.5 | Canonical Semantic Event ABI (runtime/cse) |
Done |
| 1.5 | Builder pipeline: partition + terminal projection | Done |
| 1.5 | Builder pipeline: lifecycle resolution + canonicalization | Done |
| 1.5 | Builder pipeline: certificate hydration + assembly | Done |
| 1.5 | Storage subtree/trie derivation | Not started (StorageRootDeriver trait only) |
| 2 | Geth extractor | Not started |
| 2 | Reth extractor | Not started |
| 3 | Verification harness (verify_ssr.py) |
Done (comparison logic only β see script docstring) |
| 3 | Test runner environment | Not started |
| 3 | CI automation | Not started |
| 5 | BLAKE3 commitment primitive (runtime/hash) |
Done |
| 5 | Cross-language vector verification | Not started |
| 5 | Real commitments wired into builder pipeline | Not started |