ethereum-optimism / ethereum-optimism/optimism

kona pure derivation — Phase 2: carve sync cores into src/core/

Open
#20,697 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
6.5k
Forks
4k
Avg merge
2d 38m
Merged PRs (30d)
164

Description

Lift IO-free logic from existing async stages into a new `crates/protocol/derive/src/core/{channel,batch,attributes}/` module (`pub(crate)`). Async stages refactor to delegate to `core::*`. **Holocene paths only** — pre-Holocene code stays in `stages/` until Phase 6b deletes it wholesale.

## Deliverables

- `core::channel` — Holocene single-channel assembler (carved from `stages/channel/channel_assembler.rs`).
- `core::batch` — sync batch decoding, channel → batches, span batch → singular batches (carved from `stages/batch/batch_stream.rs` + `kona_protocol::batch::raw`).
- `core::attributes` — IO-free portion of `prepare_payload_attributes` (everything that doesn't call `header_by_hash` or `system_config_by_number`).
- Holocene batch validator sync core (parts of `stages/batch/batch_validator.rs` that don't touch the L2 fetcher; lookups that need L2 stay in the deriver for Phase 3 to issue via `NeedSpanBatchOverlap`).
- `attributes/stateful.rs` split: IO wrapper (gated `async`) + sync math (in `core::attributes`).
- Existing stage unit tests pass unchanged (carve-out is behavior-preserving).
- New sync-core unit tests for channel assembly, batch decoding, attributes math.
- `core/` is `no_std`-clean — `cargo build -p kona-derive --no-default-features --target=riscv64gc-unknown-none-elf` succeeds.

Builds on Phase 1.
Part of #20695.

🤖 *Generated by Claude Code*

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.