Skip to content

Espresso 3a follow-ups: fallback-batcher cleanups#463

Open
palango wants to merge 5 commits into
espresso/batcher-fallbackfrom
palango/espresso-fallback-cleanups
Open

Espresso 3a follow-ups: fallback-batcher cleanups#463
palango wants to merge 5 commits into
espresso/batcher-fallbackfrom
palango/espresso-fallback-cleanups

Conversation

@palango

@palango palango commented Jun 24, 2026

Copy link
Copy Markdown

Stacked on #458 (espresso/batcher-fallback). Addresses the LOW/NIT items from the review of the fallback-batcher auth path. Each issue is its own commit; one test added where it earned its place. No behavior change except removing dead code and an errgroup→WaitGroup swap.

Change Why
L1 Drop unused bind.ContractBackend from L1Client (+ fakeL1Client embed and bind imports) Nothing instantiates a bound contract; the only ABI use is the package-level GetAbi(). YAGNI interface widening.
L2 computeCommitment delegates to derive.ComputeCalldataBatchHash / ComputeBlobBatchHash The batcher reimplemented the verifier's security-critical batch hash, so the two could drift and silently drop post-fork batches. Now provably identical. Adds TestComputeCommitment_Parity (calldata incl. empty/nil; blobs ×1 and ×3, checked against the real tx.BlobHashes() via txmgr.MakeSidecar).
L3 Fix two comments espresso_active.go referenced a non-existent DataSourceConfig.isEspressoEnforcement (real gate: rollupCfg.IsEspresso(l1OriginTime)); espresso_driver.go justified the fork gate with a misleading activeIsEspresso=true clause that conflates the guardian switch with the fork.
L4 authGroup errgroup.Groupsync.WaitGroup Watcher goroutines always returned nil (failures go via receiptsCh), so the error branch in waitForAuthGroup was dead. Also corrects the field comment (watchers are back-pressured by, not hard-bounded by, MaxPendingTransactions) and documents the receipts-loop-outlives-authGroup invariant.
L5 Extract newTxRef(txdata, isCancel) The txRef{…} literal was duplicated at three sites that must stay in sync.

Verification

go build, go vet, gofmt -l (clean), and the full ./op-batcher/... test suite all pass.

🤖 Generated with Claude Code

palango and others added 5 commits June 24, 2026 14:01
Nothing instantiates a bound contract from L1Client; the fallback-auth
path only uses the package-level BatchAuthenticatorMetaData.GetAbi(),
which needs no backend. Removing the requirement narrows the interface
and lets fakeL1Client drop its nil ContractBackend embed.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
computeCommitment reimplemented the verifier's batch-hash logic, so the
two could drift and silently drop post-fork batches. Delegate to
derive.ComputeCalldataBatchHash / ComputeBlobBatchHash instead, and add
a parity test that checks both paths against those functions — the blob
path using the real versioned hashes from txmgr.MakeSidecar (what the
verifier reads from tx.BlobHashes()).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Reference the real verifier gate rollupCfg.IsEspresso(l1OriginTime)
instead of the non-existent DataSourceConfig.isEspressoEnforcement, and
drop the misleading claim that authenticateBatchInfo is gated because it
'would revert against the default activeIsEspresso=true contract state'.
That activeIsEspresso switch is an independent guardian-set mode, not a
fork invariant; the verifier-gate reason alone is the correct one.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
authGroup was an errgroup.Group whose goroutines always returned nil
(failures are reported via receiptsCh, not the group error), so the
error branch in waitForAuthGroup was unreachable. Switch to a plain
sync.WaitGroup, drop the dead error handling, and correct the field
comment: watcher creation is back-pressured by, not hard-bounded by,
MaxPendingTransactions. Also document the receipts-loop-outlives-authGroup
invariant that keeps the final receiptsCh send from blocking.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The txRef literal (id/isCancel/isBlob/daType/size from a txData) was
duplicated across sendTx, the fallback-auth gate error path, and the
fallback-auth submission. Extract newTxRef(txdata, isCancel) so the
three sites stay in sync.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@palango palango requested a review from QuentinI June 24, 2026 12:58
@palango palango changed the title Espresso 3a follow-ups: fallback-batcher cleanups (L1–L5) Espresso 3a follow-ups: fallback-batcher cleanups Jun 24, 2026
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.

1 participant