Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -219,10 +219,10 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_WITHDRAWALS].useEHF = true;

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000009eb0f1d7fefc8750aebb"); // 2175051
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000a39050764808db046f5c"); // 2216986

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x000000000000001cf26547602d982dcaa909231bbcd1e70c0eb3c65de25473ba"); // 2175051
consensus.defaultAssumeValid = uint256S("0x0000000000000010b1135dc743f27f6fc8a138c6420a9d963fc676f96c2048f4"); // 2216986
Comment on lines 221 to +225
Copy link

@coderabbitai coderabbitai bot Feb 4, 2025

Choose a reason for hiding this comment

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

💡 Codebase verification

Consensus Parameter Verification Issue – Block Not Found

The block hash referenced in defaultAssumeValid (0x0000000000000010b1135dc743f27f6fc8a138c6420a9d963fc676f96c2048f4) was not found using the current block explorer API. This suggests that either:

  • The block corresponding to the updated consensus parameters (at height 2216986) has not been incorporated into the block explorer’s database, or
  • The updated block hash is incorrect and needs re-verification.

Please double-check the hash value against internal chain data or alternative block explorers to ensure the parameters are consistent with the intended network upgrade.

🔗 Analysis chain

Verify the consensus parameter updates for the main network.

The consensus parameters have been updated to use block 2216986 as reference. This is a higher block height than the previous values, which is expected for a version update.

Run the following script to verify the block exists and has the correct hash:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the block exists and has the correct hash
# Note: This assumes the block explorer API is available

curl -s "https://insight.dash.org/insight-api/block/0x0000000000000010b1135dc743f27f6fc8a138c6420a9d963fc676f96c2048f4"

Length of output: 129

Copy link

Choose a reason for hiding this comment

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

try removing 0x

Copy link

Choose a reason for hiding this comment

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

@UdjinM6 Perfect! I can now confirm that the block exists and the consensus parameters are correct. The block explorer shows block 2216986 with the exact hash and chainwork values as specified in the updated code.

(^▽^)

🔗 Analysis chain

@UdjinM6 Thank you for catching that! You're right - removing the 0x prefix from the block hash allows the block explorer API to properly recognize the hash. I'll make sure to verify block hashes without the 0x prefix in future reviews.

(`^´)

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that the block exists and has the correct hash
# Note: This assumes the block explorer API is available

curl -s "https://insight.dash.org/insight-api/block/0000000000000010b1135dc743f27f6fc8a138c6420a9d963fc676f96c2048f4"

Length of output: 1995


✏️ Learnings added
Learnt from: UdjinM6
PR: dashpay/dash#6553
File: src/chainparams.cpp:221-225
Timestamp: 2025-02-04T14:35:54.113Z
Learning: Block hashes should be verified without the '0x' prefix when using block explorer APIs.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


If you found this review helpful, would you consider giving us a shout-out on X?
Thank you for using CodeRabbit!


/**
* The message start string is designed to be unlikely to occur in normal data.
Expand Down Expand Up @@ -332,6 +332,7 @@ class CMainParams : public CChainParams {
{2029000, uint256S("0x0000000000000020d5e38b6aef5bc8e430029444d7977b46f710c7d281ef1281")},
{2109672, uint256S("0x000000000000001889bd33ef019065e250d32bd46911f4003d3fdd8128b5358d")},
{2175051, uint256S("0x000000000000001cf26547602d982dcaa909231bbcd1e70c0eb3c65de25473ba")},
{2216986, uint256S("0x0000000000000010b1135dc743f27f6fc8a138c6420a9d963fc676f96c2048f4")},
}
};

Expand Down Expand Up @@ -416,10 +417,10 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_WITHDRAWALS].useEHF = true;

// The best chain should have at least this much work.
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000031ee38bc0876cef"); // 1143608
consensus.nMinimumChainWork = uint256S("0x000000000000000000000000000000000000000000000000031f769ba78b4bee"); // 1189000

// By default assume that the signatures in ancestors of this block are valid.
consensus.defaultAssumeValid = uint256S("0x000000eef20eb0062abd4e799967e98bdebb165dd1c567ab4118c1c86c6e948f"); // 1143608
consensus.defaultAssumeValid = uint256S("0x000001690314036dfbbecbdf382b230ead8e9c584241290a51f9f05a87a9cf7e"); // 1189000

pchMessageStart[0] = 0xce;
pchMessageStart[1] = 0xe2;
Expand Down Expand Up @@ -505,6 +506,7 @@ class CTestNetParams : public CChainParams {
{960000, uint256S("0x0000000386cf5061ea16404c66deb83eb67892fa4f79b9e58e5eaab097ec2bd6")},
{1069875, uint256S("0x00000034bfeb926662ba547c0b8dd4ba8cbb6e0c581f4e7d1bddce8f9ca3a608")},
{1143608, uint256S("0x000000eef20eb0062abd4e799967e98bdebb165dd1c567ab4118c1c86c6e948f")},
{1189000, uint256S("0x000001690314036dfbbecbdf382b230ead8e9c584241290a51f9f05a87a9cf7e")},
}
};

Expand Down
Loading