fix(devnet): update chain ID and genesis parameters for Devnet #2307
fix(devnet): update chain ID and genesis parameters for Devnet #2307anunay-xin wants to merge 2 commits intodev-upgradefrom
Conversation
…uration - Changed chain ID from 551 to 5551 in multiple files including genesis.json and flags.go. - Updated TIPV2SwitchBlock to 2700 and dynamicGasLimitBlock to 5000000 in constants.devnet.go. - Adjusted rewards and wallet addresses in the devnet configuration. - Modified genesis block timestamp and extra data for consistency with new parameters. - Ensured all related configurations reflect the new chain ID and settings for improved network stability.
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Updates Devnet network parameters to align a new Devnet identity and consensus/runtime settings (new genesis hash, network ID, fork switch blocks, and reward/address configuration) for a reset/stabilized Devnet.
Changes:
- Bumps Devnet network ID to
5551and updates Devnet genesis hash + genesis block fields. - Adjusts Devnet constants (TIPV2 switch at block
2700, dynamic gas limit activation at block5,000,000). - Simplifies Devnet V2 config and updates Devnet reward + foundation wallet address.
Reviewed changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| params/config.go | Updates Devnet genesis hash and modifies Devnet V2 / reward configuration. |
| core/genesis.go | Updates Devnet genesis ExtraData and Timestamp. |
| common/constants.devnet.go | Changes Devnet fork switch constants (TIPV2 + dynamic gas limit). |
| cmd/utils/flags.go | Updates Devnet default NetworkId and network-id-to-flag mapping. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| MasternodeReward: 63.42, // 57.078 goes to node, 6.34 goes to foundation | ||
| ProtectorReward: 50.27, // 45.243 goes to node, 5.02 goes to foundation | ||
| ObserverReward: 25.13, // 22.671 goes to node, 2.51 goes to foundation | ||
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 0, MaxExponent: 0}, |
There was a problem hiding this comment.
Setting ExpTimeoutConfig.Base to 0 is very likely to break exponential timeout logic (e.g., producing 0-duration timeouts or triggering divisions/log computations that assume a positive base). If the goal is to disable exponential backoff, prefer making that explicit (e.g., a dedicated flag) or use a safe neutral configuration (such as Base=1.0 with MaxExponent=0), or keep the previous non-zero base.
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 0, MaxExponent: 0}, | |
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 1.0, MaxExponent: 0}, |
| Default: { | ||
| SwitchRound: 0, | ||
| CertThreshold: 0.667, | ||
| TimeoutSyncThreshold: 3, | ||
| TimeoutPeriod: 5, | ||
| MinePeriod: 2, | ||
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 2.0, MaxExponent: 5}, | ||
| MaxMasternodes: 108, | ||
| MaxProtectorNodes: 100, | ||
| MaxObverserNodes: 1000, | ||
| MasternodeReward: 5000, | ||
| ProtectorReward: 4000, | ||
| ObserverReward: 1000, | ||
| }, | ||
| 252000: { | ||
| SwitchRound: 250000, | ||
| CertThreshold: 0.667, | ||
| TimeoutSyncThreshold: 3, | ||
| TimeoutPeriod: 5, | ||
| MinePeriod: 2, | ||
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 2.0, MaxExponent: 5}, | ||
| MaxMasternodes: 10, | ||
| MaxProtectorNodes: 3, | ||
| MaxObverserNodes: 1, | ||
| MasternodeReward: 57.06, | ||
| ProtectorReward: 45.25, | ||
| ObserverReward: 22.62, | ||
| }, | ||
| 261000: { | ||
| SwitchRound: 261000, | ||
| CertThreshold: 0.667, | ||
| TimeoutSyncThreshold: 3, | ||
| TimeoutPeriod: 5, | ||
| MinePeriod: 2, | ||
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 2.0, MaxExponent: 5}, | ||
| MaxMasternodes: 12, | ||
| MaxProtectorNodes: 0, | ||
| MaxObverserNodes: 1000, | ||
| MasternodeReward: 63.42, // 57.078 goes to node, 6.34 goes to foundation | ||
| ProtectorReward: 50.27, // 45.243 goes to node, 5.02 goes to foundation | ||
| ObserverReward: 25.13, // 22.671 goes to node, 2.51 goes to foundation | ||
| }, | ||
| 300000: { | ||
| SwitchRound: 300000, | ||
| CertThreshold: 0.667, | ||
| TimeoutSyncThreshold: 3, | ||
| TimeoutPeriod: 5, | ||
| TimeoutPeriod: 10, | ||
| MinePeriod: 2, | ||
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 2.0, MaxExponent: 5}, | ||
| MaxMasternodes: 12, | ||
| MaxProtectorNodes: 2, | ||
| MaxObverserNodes: 2, | ||
| MasternodeReward: 63.42, // 57.078 goes to node, 6.34 goes to foundation | ||
| ProtectorReward: 50.27, // 45.243 goes to node, 5.02 goes to foundation | ||
| ObserverReward: 25.13, // 22.671 goes to node, 2.51 goes to foundation | ||
| ExpTimeoutConfig: ExpTimeoutConfig{Base: 0, MaxExponent: 0}, | ||
| }, |
There was a problem hiding this comment.
This update removes previously explicit Devnet V2 fields (e.g., MaxProtectorNodes/MaxObserverNodes and the various *Reward fields). That means the chain rule now implicitly depends on Go zero-values for these fields, which makes it hard to audit the intended Devnet parameters and increases the chance of accidental behavior changes later. Consider either explicitly setting the intended values (even if 0) or adding an inline comment explaining which omitted fields are intentionally relying on defaults.
| case ctx.Bool(DevnetFlag.Name): | ||
| if !ctx.IsSet(NetworkIdFlag.Name) { | ||
| cfg.NetworkId = 551 | ||
| cfg.NetworkId = 5551 |
There was a problem hiding this comment.
The PR description repeatedly says 'chain ID' is updated, but this change updates cfg.NetworkId (the devp2p network ID), not the EIP-155 chain ID (which typically lives in the chain config/genesis). It would help to either adjust the PR description to say 'network ID' here, or (if chain ID updates are also intended) ensure they’re clearly called out where ChainID is actually changed.
| Difficulty: big.NewInt(1), | ||
| Alloc: DecodeAllocJson(DevnetAllocData), | ||
| Timestamp: 1735513074, | ||
| Timestamp: 1765137783, |
There was a problem hiding this comment.
This raw Unix timestamp is hard to review/verify later. Consider adding a short comment with the human-readable UTC date/time (or generating it via a clearly documented constant) so reviewers/operators can quickly validate the intended genesis time.
…d tipUpgradePenalty to 5000000 in constants.devnet.go
Proposed changes
Types of changes
What types of changes does your code introduce to XDC network?
Put an
✅in the boxes that applyImpacted Components
Which parts of the codebase does this PR touch?
Put an
✅in the boxes that applyChecklist
Put an
✅in the boxes once you have confirmed below actions (or provide reasons on not doing so) that