deployment: add N_NODES flag to run multiple nodes in local monitoring stack#14224
Conversation
PR SummaryLow Risk Overview
Docs add Reviewed by Cursor Bugbot for commit f6051eb. Bugbot is set up for automated code reviews on this repo. Configure here. |
08e1346 to
a1eb4e4
Compare
261a8e1 to
0a0acfb
Compare
a1eb4e4 to
bde4843
Compare
0a0acfb to
0c86666
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 0c86666. Configure here.
bde4843 to
a64b7ca
Compare
8fb59bc to
e8ad99b
Compare
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 4 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on sirandreww-starkware).
deployments/monitoring/deploy_local_stack.sh line 12 at r1 (raw file):
export SEQUENCER_ROOT_DIR=${SEQUENCER_ROOT_DIR:-$(git -C "$(dirname -- "$(readlink -f -- "${BASH_SOURCE[0]}")")" rev-parse --show-toplevel)} # Number of sequencer nodes to run in real consensus, each in its own container (max 5). Default 1.
Consider making 5 the default and even erasing the option to set something different than 5
deployments/monitoring/deploy_local_stack.sh line 22 at r1 (raw file):
# profiled nodes survive `down`). if [ "$1" == "down" ]; then export COMPOSE_PROFILES="node1,node2,node3,node4"
What about node0/node5? I see 4 nodes here
e8ad99b to
f6051eb
Compare
9422407 to
c3e4a89
Compare
sirandreww-starkware
left a comment
There was a problem hiding this comment.
@sirandreww-starkware made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on ShahakShama).
deployments/monitoring/deploy_local_stack.sh line 12 at r1 (raw file):
Previously, ShahakShama wrote…
Consider making 5 the default and even erasing the option to set something different than 5
I am working on it with claude at the moment, but it does not seem to be worth it. I had AI implement it then asses the change and it found this:
Good question to stop on. Let me give you an honest accounting rather than defend the change I already started.
**What hardcoding actually removed** (all in shell/YAML, no Rust):
- `deploy_local_stack.sh`: the `export N_NODES`, the 4-line `[1-5]` validation block, and the `up`/`down` `if/else` (which collapsed to one `COMPOSE_PROFILES=...` line because every node now always starts). Plus the `node_services` loop → an explicit list. ~13 lines.
- `docker-compose.yml` config_injector: dropped the `N_NODES=` line, changed `seq 0 $((N_NODES-1))` → `seq 0 4`, and unwrapped the `if N_NODES > 1` guard (always true now). ~4 lines.
- README: removed the `N_NODES` doc paragraph + the `N_NODES=3` example prefixes.
So roughly **~17-20 lines of shell** gone, and they happen to be the *easiest* lines to review (a variable, a regex guard, a branch).
**What it did NOT touch** — and this is the key point. The actual weight of this PR is:
- 5 service definitions (`sequencer-node-0..4`) + the `x-sequencer-node` anchor
- the config_injector **loop is still a loop** (`seq 0 4` instead of `seq 0 N-1`) — the jq mesh-rewrite, the per-node DNS substitution, all unchanged
- 5 Prometheus scrape targets
None of that got simpler. The hard-to-review parts are identical.
**What it cost:** single-node mode is gone. That's a genuinely useful capability — running one node for a quick local smoke test where you don't care about consensus. The original `default 1` was almost certainly chosen for exactly that fast-iteration path.
**My honest verdict:** it was a marginal, arguably net-negative trade. We shaved ~20 lines of the most trivial plumbing while leaving the real complexity in place, and paid for it by deleting a feature. The reviewer's wording ("consider... *even* erasing") was tentative — their core ask is really just "5 should be the default."
Interpretation **(A)** — keep `N_NODES`, change the default to 5 — gets the reviewer's actual intent in a **~3 line change**, keeps single-node mode, and doesn't require this rewrite-and-delete at all.
I have these (B) edits sitting uncommitted in the working tree. I'd recommend reverting them and doing (A) instead. Want me to switch to (A)?
So overall it denies the ability to run only 1 node (what we have now) or 3 nodes if you want to use less resources as you're working on somebody else
deployments/monitoring/deploy_local_stack.sh line 22 at r1 (raw file):
Previously, ShahakShama wrote…
What about node0/node5? I see 4 nodes here
added comment
ShahakShama
left a comment
There was a problem hiding this comment.
@ShahakShama reviewed 1 file and all commit messages, made 1 comment, and resolved 2 discussions.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on sirandreww-starkware).


No description provided.