Skip to content

Espresso 4: e2e tests - #475

Draft
lukeiannucci wants to merge 19 commits into
espresso/batcherfrom
espresso/e2e-tests-2
Draft

Espresso 4: e2e tests#475
lukeiannucci wants to merge 19 commits into
espresso/batcherfrom
espresso/e2e-tests-2

Conversation

@lukeiannucci

Copy link
Copy Markdown
Collaborator

No description provided.

@philippecamacho

Copy link
Copy Markdown
Collaborator

Great! Can we start adding the E2E tests?

@lukeiannucci

lukeiannucci commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator Author

Great! Can we start adding the E2E tests?

@philippecamacho

The code is in here, I need to ask celo about potentially running it in their CI. Not sure the cost / runners they have.

Update i am trying some of them on what should be free runners.

@lukeiannucci lukeiannucci changed the title Espresso/e2e tests 2 4: Espresso e2e tests Jul 21, 2026
@lukeiannucci lukeiannucci changed the title 4: Espresso e2e tests Espresso 4: e2e tests Jul 21, 2026
@lukeiannucci
lukeiannucci force-pushed the espresso/e2e-tests-2 branch from b924a1d to 1bc3c45 Compare July 28, 2026 21:26
QuentinI and others added 17 commits July 31, 2026 08:28
… into RollupConfig

Add the optional L2GenesisEspressoTimeOffset deploy-config field and its
EspressoTime() accessor, plus a BatchAuthenticatorAddress L1 dependency,
and wire both into DeployConfig.RollupConfig so generated rollup configs
carry the Espresso fork time and the BatchAuthenticator address used by
event-based derivation. Espresso is not a core OP Stack fork, so it is
excluded from the ForkTimeOffset/SetForkTimeOffset fork-iteration helpers.

Co-authored-by: OpenCode <noreply@opencode.ai>
Add a deploy-espresso pipeline stage that runs the (PR #455) redesigned
scripts/deploy/DeployEspresso.s.sol for chains whose intent has
EspressoEnabled, deploying the BatchAuthenticator + TEE verifier (mock
verifiers when NITRO_ENCLAVE_VERIFIER_ADDRESS is unset). The opcm wrapper
matches the redesigned script's inputs (espressoOwner + sharedProxyAdmin,
the latter taken from the chain's shared OP Stack ProxyAdmin) and outputs
(batchAuthenticator, teeVerifierProxy, nitroTEEVerifier).

Adds ChainIntent.EspressoEnabled/EspressoBatcher,
ChainState.BatchAuthenticatorAddress, and activates Espresso at genesis
for Espresso-enabled chains in CombineDeployConfig.

Co-authored-by: OpenCode <noreply@opencode.ai>
Add the espresso-enclave / espresso-no-enclave alloc types (config/init.go)
with graceful skip when the mock TEE contracts are unavailable, wire the
Espresso + fallback batchers, System.L1, SystemConfig.L1Allocs and the
EspressoTime/BatchAuthenticatorAddress rollup fields into e2esys, give
StartOption.BatcherMod access to the System, add GethInstance.Fork (and
System.ForkL1) for L1 reorg tests, and add
GetFaultDisputeSystemConfigForEspresso.

Co-authored-by: OpenCode <noreply@opencode.ai>
Generated binding for the EspressoTEEVerifier contract (espresso-tee-contracts
submodule), used by the e2e enclave helpers to register enclave PCR0 hashes.

Co-authored-by: OpenCode <noreply@opencode.ai>
Port the non-Caff Espresso end-to-end tests from
celo-integration-rebase-17 onto the upstreaming stack: liveness, batch
authentication, batch inbox, stateless batcher, L1 reorgs, pipeline
enhancement, soft-confirmation integrity, forced transactions, dispute
game, batcher fallback, the Espresso enforcement hardfork transition, and
the dev-node simple-transaction tests, plus their docker dev-node /
attestation-verifier helpers.

Caff-node tests and helpers are dropped (the Caff node is handled out of
band by espresso-rollup-node-proxy). Adapted to the stack's renames:
EspressoEnforcementTime -> EspressoTime, SwitchBatcher() ->
SetActiveIsEspresso(bool), and the single-sourced FallbackAuthLeadTime.

These tests still launch a real dockerized espresso-dev-node; a mock is a
follow-up.

Co-authored-by: OpenCode <noreply@opencode.ai>
Widen BatcherService.EspressoClient and EspressoDriverSetup.Client from the
concrete *MultipleNodesClient to the SDK's client.EspressoClient interface, and
add the WithEspressoClientOverride DriverSetupOption so tests can inject an
in-memory Espresso fake in place of a real espresso-dev-node. Production code
never sets the override.

Co-authored-by: OpenCode <noreply@opencode.ai>
Add MockEspressoClient, an in-memory implementation of the SDK's
client.EspressoClient interface for e2e tests. It models a HotShot chain as
append-only blocks: SubmitTransaction appends to the pending block, a background
ticker seals a block every tick so the height advances continuously (as the
batcher's verification logic expects), and FetchNamespaceTransactionsInRange /
FetchTransactionByHash / FetchLatestBlockHeight round-trip the payloads. The
streamer performs no cryptographic verification of HotShot data, so the unused
query methods are stubbed.

Co-authored-by: OpenCode <noreply@opencode.ai>
…v node

Replace the dockerized espresso-dev-node with the in-memory MockEspressoClient.
e2esys.System now owns a single shared mock (System.EspressoClient) for Espresso
alloc types, injected into the primary and fallback batchers via
WithEspressoClientOverride and stopped on System.Close. The launcher no longer
starts Docker; EspressoDevNode is backed by mockEspressoDevNode exposing the
shared client via Client(). A fixed dummy light-client address is used when
ESPRESSO_SEQUENCER_LIGHT_CLIENT_PROXY_ADDRESS is unset (the streamer tolerates
the resulting no-contract error).

Tests that built their own client from EspressoUrls() now use
espressoDevNode.Client(). The dead dev-node-docker code (container-info types,
container-launch helpers, EspressoLightClientAddr, the docker smoke test) is
removed; the shared DockerCli infra used by the attestation-verifier and EigenDA
helpers is kept.

Co-authored-by: OpenCode <noreply@opencode.ai>
The in-memory mock Espresso client replaced the dockerized espresso-dev-node,
so the tests and helpers that depend on external Docker services no longer have
a backing service:

- Remove TestE2eDevnetWithInvalidAttestation / TestE2eDevnetWithUnattestedBatcherKey
  (5_batch_authentication_test.go): both gate on the SP1 zk attestation-verifier
  Docker container, which the mock does not emulate.
- Remove attestation_verifier_service_helpers.go (only consumed by those tests)
  and enclave_helpers.go (its sole live dependency was the attestation helper;
  the enclave tests were never ported).
- Remove espresso_docker_helpers.go and the now-unused EigenDA / Docker helpers
  in optitmism_espresso_test_helpers.go (StartEigenDA, StopDockerContainer,
  EIGENDA_* consts, getContainerRemappedHostPort, determineDockerNetworkMode,
  FailedToLaunchDockerContainer, determineFreePort, and the net import).
- TestE2eDevnetWithEspressoAndAltDaSimpleTransactions no longer starts an EigenDA
  proxy container: WithAltDa enables UseAltDA, which wires the system to the
  in-process altda.FakeDAServer, so the proxy was never actually contacted.

Co-authored-by: OpenCode <noreply@opencode.ai>
When restarting a TEE batcher mid-chain, CaffeinationHeightEspresso was set to
espHeight (FetchLatestBlockHeight, i.e. the chain height / block count). The
streamer treats that value as already processed and begins reading from the next
height, so it skipped the HotShot block at espHeight where the restarted batcher
re-submits its batches; safe L2 never advanced and the verifier stalled. Set it
to espHeight-1 (the last already-sealed block) so the streamer reads from
espHeight inclusive. Fixes TestBatcherSwitching and TestEspressoEnforcementHardfork.

Co-authored-by: OpenCode <noreply@opencode.ai>
RunSimpleL2BurnWithTimeout accepted a timeout but routed through
helpers.SendL2TxWithID, which ignores the caller's context and imposes its own
fixed 30s deadline on the verifier receipt wait. After a batcher switch (or with
the fallback batcher posting plain calldata in multi-frame channels) the verifier
can take well over 30s to re-derive, so the wait timed out and
TestBatcherSwitching, TestEspressoEnforcementHardfork, and
TestFallbackMechanismIntegrationTestChannelNotClosed failed.

Add an Espresso-local sendL2TxAndVerify that honours the supplied ctx (otherwise
identical to SendL2TxWithID) and use it from RunSimpleL2BurnWithTimeout, leaving
the shared op-e2e helper untouched.

Co-authored-by: OpenCode <noreply@opencode.ai>
- Inject the in-memory mock Espresso client into the batchers these tests start
  by hand mid-run (WithEspressoClientOverride); without it the restarted/extra
  batcher has no Espresso client and never produces batches.
- Set MaxPendingTransactions=0 (unbounded) for the batchers in these tests so the
  Espresso auth+batch tx pairs (routed through the ordered txmgr queue) publish
  concurrently instead of one-per-L1-block; otherwise L1 data availability lags
  and the verifier cannot derive recent blocks within the tests' windows.
- Make GetBatcherConfig a pure snapshot of the batcher CLIConfig and move the
  channel-tuning (small frames + long channel duration, which force multi-frame
  channels split across L1 blocks) to explicit WithBatcher* options at the call
  sites, so the config mutation is visible and GetBatcherConfig does only what
  its name implies.

Co-authored-by: OpenCode <noreply@opencode.ai>
The test was skipped ("takes a long time to run") but was actually broken: the
hardcoded TEST_ESPRESSO_TRANSACTION fixture was RLP-encoded against an older
3-field EspressoBatch layout, so UnmarshalBatch failed with "rlp: too few
elements" once the SignerAddress field was added. Its final step also waited for
the fixture's L1-info deposit to land on the verifier, which can never happen: a
fixed genesis-era batch is not the next expected batch on a freshly-started
chain, so the batcher never derives it (the source of the long run / timeout).

- Regenerate TEST_ESPRESSO_TRANSACTION in the current 4-field layout (adds the
  trailing SignerAddress element; otherwise byte-identical). Also used by the
  already-passing TestDeterministicDerivationExecutionStateWithInvalidTransaction.
- Replace the impossible deposit-on-verifier assertion with the test's actual
  purpose: the batcher streamer unmarshals the tx and recovers the real batcher
  address from the prepended signature, and the batch carries an L1-info deposit.
- Remove the now-unused espressoTransactionDataSkippingUnmarshal helper and unskip.

Co-authored-by: OpenCode <noreply@opencode.ai>
@lukeiannucci
lukeiannucci force-pushed the espresso/e2e-tests-2 branch from 1bc3c45 to 92c832c Compare July 31, 2026 12:28
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