feat: run L1 anvil as a Docker compose service#15
Merged
Conversation
Move the L1 anvil chain from a detached host process (plus a 100ms evm_mine heartbeat) into an `l1` Docker compose service so teardown via `docker compose down` is reliable — no orphaned anvil/heartbeat processes survive. - add `l1` compose service (foundry image) publishing 8545 so both host tooling (127.0.0.1:8545) and Nitro containers (host.docker.internal) reach it; state bind-mounted to config/anvil-state so snapshots work - replace startAnvilWithState() with startL1Container() (composeUp) - drop the pkill anvil/heartbeat calls from stop/clean/resetRuntime and the host pgrep check in status; compose down handles teardown
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the L1-in-Docker migration onto
main, branched fresh frommain(not from the divergenttestnode-workspace-migration).Context
The earlier migration work (rollup creator #9, runtime cleanup) was already squash-merged into
mainvia #6/#11. The only piece never merged tomainwas the L1-in-Docker change (it had only been merged into the long-livedtestnode-workspace-migrationbranch, which had diverged frommain). This branch cherry-picks just that remaining commit onto currentmain, so the diff is exactly the L1 change with no duplicated/conflicting history.What
Moves the L1 anvil chain from a detached host process (plus a 100ms
evm_mineheartbeat) into anl1Docker compose service sodocker compose downtears it down reliably.docker/docker-compose.yaml— newl1service (stock foundry image, no custom entrypoint). Publishes 8545 for both host tooling (127.0.0.1:8545) and Nitro containers (host.docker.internal:8545); state bind-mounted toconfig/anvil-stateso snapshots keep working.runtime.ts—startAnvilWithState()→startL1Container()(composeUp); drops the now-deadpkill anvil/pkill heartbeatfromresetRuntime.stop/clean— droppkill;compose downhandles teardown.status— L1 check uses the compose service instead ofpgrep anvil.Anvil's arg list (block-time/accounts/balance/mnemonic/chain-id/
--state) is unchanged, so chain behavior is identical. Snapshot capture is unaffected: every capture path callsstopRuntime(compose down → anvil dumps state on SIGTERM) before copyingconfig/anvil-state.Verification
typecheck ✅ · build ✅ · lint ✅ ·
docker compose config✅ · 142/142 tests pass ✅