docs: fix e2e test port ranges in docs/testing.md - #458
Open
erkancamli wants to merge 2 commits into
Open
erkancamli wants to merge 2 commits into
erkancamli wants to merge 2 commits into
Conversation
The Prerequisites list in docs/testing.md does not match what the e2e bins bind, in three ways. Reth RPC counts down from 8545, not up. Each instance is spawned with `.instance(x + 1)`, which reth maps to `8545 - N + 1`, so 8546-8548 are never bound while 8542-8544 are. docs/running-local-network.md and the header comment in node/src/bin/testnet.rs already say this. The Summit and P2P ranges were sized for the four genesis nodes. The flags are derived as `3030 + node * 10`, `3031 + node * 10` and `26600 + node * 10`; stake-and-checkpoint, stake-and-join-with-outdated -checkpoint and sync-from-genesis add a fifth node, and observer runs at `OBSERVER_SLOT = NUM_NODES + 1`, reaching 3080/3081 and 26650. Following the current text, a reader frees ports nothing uses and leaves ports the tests need occupied. The run then fails as a node that never reaches its stop height rather than as a bind error. Filed against fa436b4.
erkancamli
force-pushed
the
docs/fix-e2e-port-ranges
branch
from
September 13, 2026 12:01
72031b9 to
986fd73
Compare
The previous revision narrowed the reth range to 8540-8545 and said 8546-8548 are never bound. That is wrong: reth's --instance N shifts the WS port up by 2 per instance (8546, 8548, 8550, ...) and the auth port by 100, and types/src/reth.rs always passes --ws and blocks until reth reports both the WS and the auth server started. Discovery, metrics and the enclave mock server are bound too. List them all and state the --instance mapping so the prerequisite is checkable against the code rather than approximated.
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.
The port ranges in the E2E "Prerequisites" section do not match what the test bins bind, and the first revision of this PR got the correction half wrong. This revision lists every port and states the mapping the numbers come from.
Reth's
--instance Nmoves four different ports, in three different directions. Each instance is spawned with.instance(x + 1)(node/src/bin/stake_and_checkpoint.rs:134, and the same in the other e2e bins). Reth'sadjust_instance_portsthen applies:and
NetworkArgs::adjust_instance_portsshifts the discovery port byinstance - 1. Instances 1 through 6 are used (four genesis nodes, a fifth node in three bins, andobserveratOBSERVER_SLOT = NUM_NODES + 1 = 5,node/src/bin/observer.rs:62,251), so:HTTP counts down, as
docs/running-local-network.md:35and the header ofnode/src/bin/testnet.rssay. WS and auth count up, which neither doc mentions.types/src/reth.rsalways passes--ws(line 515) andspawn()blocks until reth reports bothRPC WS server startedandRPC auth server started, so those ports are provably bound on every e2e run.Each bin also passes
--metrics 0.0.0.0:{9001 + node}and--enclave.endpoint-port 1744{node}explicitly, so 9001-9006 and 17440-17445 are bound too.The Summit and P2P ranges were sized for the four genesis nodes.
get_node_flagsderives3030 + node * 10(RPC),3031 + node * 10(admin RPC) and26600 + node * 10(P2P). With the fifth node and the observer these reach 3080/3081 and 26650.Following the current text, a reader frees ports nothing uses and leaves ports the tests need occupied. The run then fails as a node that never reaches its stop height rather than as a clear bind error.
Documentation only, no code change. Same class of fix as #441, which corrected this in
docs/running-local-network.mdbut did not touchdocs/testing.md. Filed against fa436b4.Correcting the record on my own first revision: it said "so 8546-8548 are never bound while 8542-8544 are". That is wrong. 8546 and 8548 are the WS ports of instances 1 and 2, and
types/src/reth.rswaits for them before returning. Only 8547 is unbound. The narrowed8540-8545range it proposed would have caused exactly the failure this PR is meant to prevent. Fixed in ab0f360.