Skip to content

fix(cicd): derive network ID from genesis - #2529

Closed
loglapa wants to merge 1 commit into
XinFinOrg:mainfrom
loglapa:fix/1887-networkid-single-source
Closed

fix(cicd): derive network ID from genesis#2529
loglapa wants to merge 1 commit into
XinFinOrg:mainfrom
loglapa:fix/1887-networkid-single-source

Conversation

@loglapa

@loglapa loglapa commented Aug 20, 2026

Copy link
Copy Markdown

Proposed changes

Remove the redundant --networkid arguments from the mainnet, testnet, and devnet container start scripts.

The scripts initialize their data directories from genesis.json, and the node already derives a zero-valued network ID from the stored chain ID. Keeping the values in the scripts duplicates the genesis configuration and allows them to drift apart.

Addresses #1887.

Types of changes

  • build: Changes that affect the build system or external dependencies
  • ci: Changes to CI configuration files and scripts
  • chore: Changes that don't change source code or tests
  • docs: Documentation only changes
  • feat: A new feature
  • fix: A bug fix
  • perf: A code change that improves performance
  • refactor: A code change that neither fixes a bug nor adds a feature
  • revert: Revert something
  • style: Changes that do not affect the meaning of the code
  • test: Adding missing tests or correcting existing tests

Impacted Components

  • Consensus
  • Account
  • Network
  • Geth
  • Smart Contract
  • External components
  • Not sure (Please specify below)

Verification

  • bash -n cicd/mainnet/start.sh cicd/testnet/start.sh cicd/devnet/start.sh
  • make all quick-test test tidy generate
  • Initialized three temporary data directories from genesis/mainnet.json, genesis/testnet.json, and genesis/devnet.json.
  • Started each built node without --networkid and queried net_version: mainnet returned 50, testnet 51, and devnet 5551.

make lint still reports the same 75 pre-existing findings as main; this shell-only change introduces no new lint findings.

End-to-end test plan

  1. Build the XDC container for each network.
  2. Start it with a fresh volume and the corresponding genesis.json.
  3. Query net_version and confirm it matches the genesis chain ID.
  4. Restart the container with the initialized volume and confirm it reports the same network ID and resumes from the existing database.

Checklist

  • This PR has sufficient test coverage (unit/integration test) OR I have provided reason in the PR description for not having test coverage
  • Tested on a private network from the genesis block and monitored the chain operating correctly for multiple epochs.
  • Provide an end-to-end test plan in the PR description on how to manually test it on the devnet/testnet.
  • Tested the backwards compatibility.
  • Tested with XDC nodes running this version co-exist with those running the previous version.
  • Relevant documentation has been updated as part of this PR
  • N/A

Signed-off-by: Vladislav Lapin <v.lapin@scalablesolutions.io>
@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@loglapa, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 59 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: df532164-7dc4-4f3b-8d9c-c3b13584db33

📥 Commits

Reviewing files that changed from the base of the PR and between 2d30685 and 21750ac.

📒 Files selected for processing (3)
  • cicd/devnet/start.sh
  • cicd/mainnet/start.sh
  • cicd/testnet/start.sh

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@loglapa
loglapa marked this pull request as ready for review August 20, 2026 12:38
@loglapa

loglapa commented Aug 20, 2026

Copy link
Copy Markdown
Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 20, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Review rate limited.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@gzliudan
gzliudan self-requested a review August 21, 2026 02:43

@gzliudan gzliudan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please use dev-upgrade branch

@loglapa

loglapa commented Aug 21, 2026

Copy link
Copy Markdown
Author

Closing this as superseded on the current development line. dev-upgrade has unrelated history, the three legacy cicd/{devnet,mainnet,testnet}/start.sh scripts changed here no longer exist there, and their replacement cicd/local/start.sh already starts XDC without a hardcoded --networkid. Therefore issue #1887 is already satisfied on dev-upgrade, and retargeting this PR would produce no meaningful patch.

@loglapa loglapa closed this Aug 21, 2026
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.

2 participants