Skip to content

feat: add networkId validation on node boot#1265

Merged
gilescope merged 6 commits into
mainfrom
ozgb-extra-chainspec-validation
Apr 10, 2026
Merged

feat: add networkId validation on node boot#1265
gilescope merged 6 commits into
mainfrom
ozgb-extra-chainspec-validation

Conversation

@ozgb

@ozgb ozgb commented Apr 8, 2026

Copy link
Copy Markdown
Contributor

Overview

Adds validation to ensure the networkId set in the chainspec matches the networkId used to generate the genesis state.

A mismatch can occur if the ledger genesis state was created using a different network id to the setting in the chainspec.

Fixes: #1266

🗹 TODO before merging

  • Ready

📌 Submission Checklist

  • Changes are backward-compatible (or flagged if breaking)
  • Pull request description explains why the change is needed
  • Self-reviewed the diff
  • I have included a change file, or skipped for this reason:
  • If the changes introduce a new feature, I have bumped the node minor version
  • Update documentation (if relevant)
  • Updated AGENTS.md if build commands, architecture, or workflows changed
  • No new todos introduced

🧪 Testing Evidence

Please describe any additional testing aside from CI:

  • Additional tests are provided (if possible)

🔱 Fork Strategy

  • Node Runtime Update
  • Node Client Update
  • Other:
  • N/A

Links

ozgb added 2 commits April 8, 2026 14:42
Prevents the node from starting up if the configured network id in the
chainspec does not equal the network id in the ledger genesis state.
@ozgb ozgb requested a review from a team as a code owner April 8, 2026 13:47
@gilescope gilescope enabled auto-merge April 9, 2026 10:55
Comment thread ledger/src/versions/common/storage.rs Outdated
Comment thread ledger/src/versions/common/storage.rs Outdated
@gilescope gilescope added this pull request to the merge queue Apr 10, 2026
Merged via the queue into main with commit ef38a85 Apr 10, 2026
30 of 32 checks passed
@gilescope gilescope deleted the ozgb-extra-chainspec-validation branch April 10, 2026 12:31
m2ux added a commit that referenced this pull request Apr 23, 2026
* feat: add extra validation when parsing genesis state on node startup

Prevents the node from starting up if the configured network id in the
chainspec does not equal the network id in the ledger genesis state.

* docs: add change file

* docs: add pr link to change file

* fix: remove unwraps from get_root()
Signed-off-by: Mike Clay <mike.clay@shielded.io>
m2ux added a commit that referenced this pull request Apr 23, 2026
* feat: add extra validation when parsing genesis state on node startup

Prevents the node from starting up if the configured network id in the
chainspec does not equal the network id in the ledger genesis state.

* docs: add change file

* docs: add pr link to change file

* fix: remove unwraps from get_root()
Signed-off-by: Mike Clay <mike.clay@shielded.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add validation on node startup to ensure network ID matches chainspec's network ID

3 participants