pipe num-validators through local-env cli - #2008
Conversation
Signed-off-by: Justin Frevert <justinfrevert@gmail.com>
…idators Signed-off-by: Justin Frevert <justinfrevert@gmail.com> # Conflicts: # local-environment/README.md # local-environment/package.json # local-environment/src/index.ts
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a0aa824fe8
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Signed-off-by: Justin Frevert <justinfrevert@gmail.com>
Signed-off-by: Justin Frevert <justinfrevert@gmail.com>
Assisted-by: Claude:claude-opus-4.8 Signed-off-by: Justin Frevert <justinfrevert@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba8a5ea247
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Resolves three collisions between the num-validators work and main: - package.json: keep the branch's `src/commands/*.test.ts` glob, which covers main's `run.test.ts` plus any later command test. - run.ts: both sides added to `runWellKnownNetwork`. Main's NODE_IMAGE guard runs first so it still fails before the snapshot restore, then the mock validator selection. - imageUpgrade.ts: union of the two import groups; `discoverValidators`, `writeForkManifest` and `readMockValidatorSelection` are all used. Assisted-by: AI <noreply@ai-assistant> Signed-off-by: Justin Frevert <justinfrevert@gmail.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Signed-off-by: Justin Frevert <justinfrevert@gmail.com>
2d09914
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d808ab6aef
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
Overview
--num-validators <count>lets a well-known network fork come up with fewer mockvalidators than the network's Compose topology defines, instead of always
materializing the full set. Smaller forks start faster and fit on a laptop, which
is what most fork testing actually needs.
The flag is threaded through every local-env command that brings up or rolls a
forked network:
run,image-upgrade,full-upgrade, and the runtime-upgradepath, plus the
fork-networkCI workflow.mock-authorities convert(howmany validator keysets get synthesized) and a generated Compose override that
starts only the selected
node*services, parking the rest behind a profilethis tooling never activates.
(
x-midnight-mock), so later restarts can omit the flag and reuse it, andverify-finalityprobes the validators that are actually running rather thanthe full configured topology.
mock.validatorServices.Changing it requires
--from-snapshotso the authority set and seeds can beregenerated; it is rejected on reuse runs, in
--from-genesismode, and forthe standalone
local-envstack, whose topology and keys are fixed.Also fixes a GRANDPA finality stall found while testing this: the fork tooling
defaulted to
mock-authoritiesimages that predate the client-side aux-storagerewrite, which deadlocks the GRANDPA voter on a >=2.0.0 runtime. Details in
changes/node/changed/local-env-fork-grandpa-finality-fix.md. That stall was notcaused by the reduced validator set.
🗹 TODO before merging
📌 Submission Checklist
git commit -s) for the DCO🧪 Testing Evidence
Unit tests cover the selection resolver, the persisted-selection round trip, the
disabled-service profile, and the stale-override cleanup
(
local-environment/src/lib/mockValidatorSelection.test.ts).Manually verified by forking devnet (
2.0.0-rc.3) from a snapshot with--num-validators 3: all three validators author and finalize, and the clientand runtime GRANDPA set-ids match.
🔱 Fork Strategy
Links
Consumer of this tooling: midnightntwrk/midnight-indexer#1364