You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
op-batcher: integrate TEE batcher and Espresso submission loop
Add the Espresso TEE batcher write-path on top of the fallback batcher:
- op-batcher/batcher/espresso.go: Espresso submission loop (peeks the
channel manager, converts each L2 block to an EspressoBatch, submits
it to Espresso, waits for inclusion, and then posts the batch txs to
L1 with TEE-attested BatchAuthenticator.authenticateBatchInfo calls).
- op-batcher/batcher/espresso_service.go: EspressoBatcherConfig,
initEspresso (Espresso client / light-client construction, optional
TEE attestation gathering), and the initChainSigner hook that wraps
the txmgr into a opcrypto.ChainSigner.
- op-batcher/batcher/espresso_helpers_test.go and
espresso_transaction_submitter_test.go: unit tests for the helpers and
the TEE transaction submitter.
Extends the existing fallback wiring:
- op-batcher/batcher/espresso_driver.go: adds EspressoDriverSetup
fields (Client/LightClient/ChainSigner/SequencerAddress/Attestation),
batcherL1Adapter, setupEspressoStreamer, startEspressoLoops,
resetEspressoStreamer; extends dispatchAuthenticatedSendTx with the
TEE branch (always authenticates when Espresso.Enabled).
- op-batcher/batcher/espresso_active.go: adds isBatcherActive
(queries BatchAuthenticator.activeIsEspresso to gate publishing
against this batcher's role).
- op-batcher/batcher/driver.go: extends DriverSetup with the Espresso
EspressoDriverSetup field; adds espressoSubmitter / espressoStreamer /
teeVerifierAddress / degradedLog fields on BatchSubmitter; calls
setupEspressoStreamer in NewBatchSubmitter; branches
StartBatchSubmitting on Espresso.Enabled to call startEspressoLoops;
calls resetEspressoStreamer in clearState.
- op-batcher/batcher/service.go: BatcherConfig.Espresso field;
EspressoClient / EspressoLightClient / ChainSigner / Attestation
runtime fields; initEspresso / initChainSigner /
applyEspressoDriverSetup call-outs.
- op-batcher/batcher/config.go: thread Espresso espresso.CLIConfig
through CLIConfig.
- op-batcher/flags/flags.go: register espresso.CLIFlags (TEE-only
flags; the --espresso.fallback-auth-lead-time flag added by the
fallback PR continues to live in op-batcher/flags/flags.go).
Also adds op-service/log/repeat_state.go (RepeatStateLogger) and its
test, used by the Espresso submission loop's tick-driven warnings.
A safeTestRecorder helper is inlined into the test to avoid pulling
in the unrelated debouncer.
Adds the github.com/hf/nitrite dependency (transitively required by
hf/nsm for attestation document parsing).
Co-authored-by: OpenCode <noreply@opencode.ai>
l.Log.Warn("Throttling loop is DISABLED due to 0 throttle-threshold. This should not be disabled in prod.")
201
219
}
202
220
203
-
l.wg.Add(3)
204
-
gol.receiptsLoop(l.wg, receiptsCh) // ranges over receiptsCh channel
205
-
gol.publishingLoop(l.killCtx, l.wg, receiptsCh, publishSignal) // ranges over publishSignal, spawns routines which send on receiptsCh. Closes receiptsCh when done.
206
-
gol.blockLoadingLoop(l.shutdownCtx, l.wg, unsafeBytesUpdated, publishSignal) // sends on unsafeBytesUpdated (if throttling enabled), and publishSignal. Closes them both when done
gol.receiptsLoop(l.wg, receiptsCh) // ranges over receiptsCh channel
228
+
gol.publishingLoop(l.killCtx, l.wg, receiptsCh, publishSignal) // ranges over publishSignal, spawns routines which send on receiptsCh. Closes receiptsCh when done.
229
+
gol.blockLoadingLoop(l.shutdownCtx, l.wg, unsafeBytesUpdated, publishSignal) // sends on unsafeBytesUpdated (if throttling enabled), and publishSignal. Closes them both when done
0 commit comments