fix: prevent geth re-init on restart and harden compose defaults#31
Open
crazywriter1 wants to merge 1 commit into
Open
fix: prevent geth re-init on restart and harden compose defaults#31crazywriter1 wants to merge 1 commit into
crazywriter1 wants to merge 1 commit into
Conversation
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.
Summary
Fixes several reliability issues that can break node operation on restart or misconfigure data paths.
geth initonly whenchaindatadoes not exist yet, with an explicit--datadir. Previously, init ran on every container start and failed on restart when a datadir was already present (set -ewould exit the container).CLIENTandDATA_DIRdefaults intodocker-compose.yaml(${CLIENT:-reth},${DATA_DIR:-./reth_data}). The previous.envused shell interpolation (${CLIENT:-reth},./${CLIENT}_data) which Docker Compose does not expand reliably inside.envfiles.[ ! -s ... ]instead of[ ! -f ... ]so an empty JWT file is regenerated, not treated as valid.--max-outbound-peersfromGETH_MAXPEERSinstead of hardcoding100.Notes on rollup halt
rollup.haltis an op-geth flag (GETH_ROLLUP_HALT). op-reth v1.11.0 does not expose an equivalent CLI flag.For reth deployments, protocol-version halt is enforced by op-node via
OP_NODE_ROLLUP_HALT(already configured in.env.sepolia).Test plan
Automated (
./scripts/test-package-a.sh):docker-compose.yamlparses as valid YAML.envhas no shell-default interpolationCLIENT=reth,DATA_DIR=./reth_data-s)chaindataexistsGETH_MAXPEERS(50) and defaults to 100docker compose configsucceedsreth_data→/app/dataNot run (source build is 30–60 min; out of scope for entrypoint/config fix):
docker compose builddocker compose up(requires build + L1 RPC)geth usage
When switching to geth, pass both variables explicitly: