Skip to content

Espresso: drop dead calldata-source authentication + guard espresso_time >= ecotone_time#466

Merged
palango merged 3 commits into
celo-rebase-18from
espresso/remove-calldata-source
Jul 3, 2026
Merged

Espresso: drop dead calldata-source authentication + guard espresso_time >= ecotone_time#466
palango merged 3 commits into
celo-rebase-18from
espresso/remove-calldata-source

Conversation

@piersy

@piersy piersy commented Jul 1, 2026

Copy link
Copy Markdown

Summary

Follow-up to #457. Removes the Espresso-specific batch-authentication code that #457 folded into the calldata data source, and adds a genesis-config guard that keeps the removal safe.

This is the Go-side counterpart to the celo-kona changes:

  • refactor(derive): drop dead Espresso calldata source, use upstream CalldataSource (celo-kona 332d6d2)
  • feat(genesis): reject espresso_time scheduled before ecotone_time (celo-kona b02f68b)

Why the calldata Espresso path is dead

DataSourceFactory.OpenData routes to the blob source whenever ecotone is active (ref.Time >= ecotone_time) and to the calldata source only pre-ecotone. Every Celo chain sets ecotone_time = 0, and Espresso (espresso_time) activates strictly later, so:

  • IsEspresso(ref.Time) true ⟹ ecotone active ⟹ blob source selected.
  • The window [espresso_time, ecotone_time) where the calldata source could see an Espresso-active block is empty.

So the if IsEspresso { CollectAuthenticatedBatches } branch inside DataFromEVMTransactions could never fire on a real chain. The blob source already handles calldata txs post-ecotone and retains full Espresso event-based authentication, so no behaviour is lost.

Changes

1. Drop the dead Espresso calldata path (refactor)

  • DataFromEVMTransactions / CalldataSource revert to the upstream sender-based path: isValidBatchTx + isAuthorizedBatchSender, no lookback-window event scan, fetcher back to L1TransactionFetcher.
  • Delete espresso_calldata_source_test.go (tested an unreachable path); relocate its shared mockAuthEvents helper to espresso_batch_authenticator_test.go.

2. Guard espresso_time >= ecotone_time (feat)

  • Removing the calldata Espresso path makes espresso_time >= ecotone_time a silent correctness invariant. Config.Check() now returns ErrEspressoBeforeEcotone when espresso_time is set but ecotone_time is unset or later — failing fast instead of silently bypassing event-based authorization for blocks in [espresso_time, ecotone_time).
  • Every real Celo chain sets ecotone_time = 0, so this only ever fires on a misconfiguration.

Testing

  • go build ./op-node/..., go vet, gofmt clean.
  • go test ./op-node/rollup/... ./op-node/rollup/derive/... pass, including the new TestConfig_Check_EspressoBeforeEcotone and the existing blob/altDA/batch-authenticator suites (which exercise the relocated mockAuthEvents).

@piersy piersy force-pushed the espresso/remove-calldata-source branch 2 times, most recently from 8e698ef to be91044 Compare July 1, 2026 12:15
piersy added 2 commits July 2, 2026 12:10
The calldata data source is only reached pre-ecotone: OpenData routes to the
blob source whenever ecotone is active (ref.Time >= ecotone_time). Every Celo
chain sets ecotone_time = 0, and Espresso (espresso_time) activates strictly
later, so the Espresso event-based batch-authentication branch that #457 folded
into DataFromEVMTransactions could never fire on a real chain.

Restore the calldata data source to its pre-Espresso form. calldata_source.go is
byte-identical to before #457; #457 had split isValidBatchTx into a type/To-only
check plus isAuthorizedBatchSender to serve the blob source's event-based path,
which rippled a needless change into the calldata source. Reinstate the original
5-arg isValidBatchTx (composed from isBatchTxToInbox + isAuthorizedBatchSender)
and point the blob source at isBatchTxToInbox. calldata_source_test.go is also
restored except for one line: DataSourceConfig gained fields (rollupCfg,
batchAuthCaches), so its literal must use named fields instead of positional.

The blob source keeps Espresso event-based authentication and also handles plain
calldata-carrying batcher txs post-ecotone, so no behaviour is lost. Delete the
now-dead Espresso calldata test and move its shared mockAuthEvents helper into
the blob data source test, its only user.

Mirrors the celo-kona removal (drop CeloCalldataSource, use upstream CalldataSource).
Dropping the Espresso-aware calldata source made "espresso_time >= ecotone_time"
a silent correctness invariant: Espresso event-based authentication now lives
only on the post-ecotone blob path, so a block in the [espresso_time,
ecotone_time) window would route to the pre-ecotone calldata source and silently
fall back to sender-based authorization.

Guard the invariant in Config.Check(): error with ErrEspressoBeforeEcotone when
espresso_time is set but ecotone_time is unset or scheduled later than
espresso_time. Every real Celo chain sets ecotone_time = 0, so this only fires on
a misconfiguration -- but now it fails fast instead of corrupting derivation.

Mirrors the celo-kona validate_espresso guard (EspressoBeforeEcotone).
@piersy piersy force-pushed the espresso/remove-calldata-source branch from be91044 to 1e5dde9 Compare July 2, 2026 11:10
@piersy piersy marked this pull request as ready for review July 2, 2026 21:29
@piersy piersy requested review from lukeiannucci and palango July 2, 2026 21:31

@lukeiannucci lukeiannucci left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This all seems good to me! May also be nice for Paul to take a pass

- add mixed-block and multi-commitment subtests to
  TestDataAndHashesFromTxsEventAuth, restoring per-tx commitment
  matching coverage lost with espresso_calldata_source_test.go
- drop stale comment reference to the deleted
  TestDataFromEVMTransactionsForkBoundary
- reuse u64ptr instead of a local ptr closure in
  TestConfig_Check_EspressoBeforeEcotone
@palango palango merged commit 0957033 into celo-rebase-18 Jul 3, 2026
41 checks passed
@palango palango deleted the espresso/remove-calldata-source branch July 3, 2026 09:50
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