Skip to content

Espresso 2a: derivation pipeline, kona#449

Closed
QuentinI wants to merge 1 commit into
celo-org:celo-rebase-17from
EspressoSystems:ag/kona-derivation-pipeline-upstream
Closed

Espresso 2a: derivation pipeline, kona#449
QuentinI wants to merge 1 commit into
celo-org:celo-rebase-17from
EspressoSystems:ag/kona-derivation-pipeline-upstream

Conversation

@QuentinI

@QuentinI QuentinI commented May 28, 2026

Copy link
Copy Markdown

Companion PR to #445: adds derivation pipeline scanning for batch authentication events, gated by Espresso hardfork.

…henticator

Companion to celo-org#445 (which lands the equivalent op-node
changes against celo-rebase-17).

Introduces an L1-origin-timestamp hardfork (espresso_time) gating all
post-fork derivation semantics. Pre-fork, derivation behaves exactly as
upstream Optimism: batches are accepted based on the L1 transaction
sender matching the SystemConfig batcher address. Post-fork, batches
are authenticated via BatchInfoAuthenticated(bytes32) events emitted by
the BatchAuthenticator contract, and sender-based authorization is
rejected.

The pipeline scans L1 receipts over a configurable lookback window
(DEFAULT_BATCH_AUTH_LOOKBACK_WINDOW = 100 blocks) to build the set of
authenticated batch commitment hashes for each L1 block being derived.
Results are cached in two reorg-safe (block-hash-keyed) LRU caches: one
for receipt-derived event sets, one for header parent-hash resolution.
For consecutive L1 blocks the lookback windows overlap, so only one new
block's receipts need to be fetched on each call.

New RollupConfig fields:
  - batch_authenticator_address: Option<Address>
  - batch_auth_lookback_window:  Option<u64>

New HardForkConfig field:
  - espresso_time: Option<u64>

New RollupConfig methods:
  - is_batch_auth_enabled
  - batch_auth_lookback_window (with DEFAULT_BATCH_AUTH_LOOKBACK_WINDOW fallback)
  - is_espresso_active (gated on L1 origin timestamp at the data-source layer)

Calldata and blob data sources gain a BatchAuthConfig and an
'espresso_active' branch that requires an event-based authentication
match; pre-fork their behaviour is unchanged.

Unit tests cover the event scanner, calldata/blob hash semantics,
post-fork authentication across calldata, blob, and altda data sources,
and pre-fork passthrough.

Co-authored-by: OpenCode <noreply@opencode.ai>
@QuentinI QuentinI changed the title feat(rust/kona/derive): event-based batch authentication via BatchAuthenticator Espresso 2a: derivation pipeline, kona May 28, 2026
@piersy

piersy commented May 28, 2026

Copy link
Copy Markdown

Hi @QuentinI these changes should be made in https://github.com/celo-org/celo-kona. Our approach to modifications for the rust stuff is to wrap elements from the upstream repos. For instance inside celo-kona we have the celo-reth implementation that depends on components from op-reth and reth but we don't actually modify those components at source, we wrap them or duplicate them (if we have to) in celo-kona.

@palango palango requested review from karlb and seolaoh June 2, 2026 09:23
@seolaoh

seolaoh commented Jun 2, 2026

Copy link
Copy Markdown

Hi @QuentinI ! Just a friendly reminder about #449 (comment). We'd appreciate it if you could move these changes over to https://github.com/celo-org/celo-kona and reopen the corresponding PR. Thanks!

@QuentinI

QuentinI commented Jun 2, 2026

Copy link
Copy Markdown
Author

@piersy @seolaoh sorry for not acking the first comment, I'm currently working on it - it requires some changes to fit into the model you described.

QuentinI added a commit to EspressoSystems/celo-kona that referenced this pull request Jun 4, 2026
Add the `celo-derive` crate implementing the Rust (kona) companion to the
op-node Espresso batch-authentication changes (celo-org/optimism#445),
relocated from the vendored-kona PR celo-org/optimism#449 to follow
celo-kona's wrap/duplicate-don't-patch model.

Post-fork, batches are authorized by scanning L1 receipts for
`BatchInfoAuthenticated` events from the configured `BatchAuthenticator`
contract within a lookback window, instead of by transaction sender.
Pre-fork (or when the fork is not yet active) derivation is byte-identical
to upstream OP Stack.

- `CeloEthereumDataSource` / `CeloCalldataSource` / `CeloBlobSource`:
  duplicates of kona's data sources with the auth branch folded in
  (kona's `CalldataSource`/`BlobSource`/`BlobData` internals are
  `pub(crate)` and cannot be wrapped).
- `BatchAuthConfig` bundles the authenticator address, fork time and
  lookback window so the "fork scheduled but no authenticator" state is
  unrepresentable; `CeloRollupConfig::batch_auth_params` validates it and
  hard-errors on misconfiguration (otherwise derivation would silently
  stall at the fork boundary).
- `CeloRollupConfig` gains the Espresso settings (parsed from the same
  rollup.json) and `CeloBootInfo` carries them through boot.
- Point the hokulea git dep at celo-org/hokulea fccc98c (celo-org/hokulea#2),
  which generalizes `EigenDADataSource` over `DataAvailabilityProvider` so
  the eigenda path can wrap `CeloEthereumDataSource`.

Co-authored-by: OpenCode <noreply@opencode.ai>
@QuentinI

QuentinI commented Jun 4, 2026

Copy link
Copy Markdown
Author

@piersy @seolaoh Opened a PR at celo-org/celo-kona#206
It ended up requiring a fair bit of duplication of existing kona code due to visibility rules unfortunately.

@QuentinI QuentinI closed this Jun 4, 2026
@piersy

piersy commented Jun 4, 2026

Copy link
Copy Markdown

@piersy @seolaoh Opened a PR at celo-org/celo-kona#206 It ended up requiring a fair bit of duplication of existing kona code due to visibility rules unfortunately.

Yep, that's unfortunately the price we pay for the modularity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants