Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update assumed chain params #20263

Merged
merged 1 commit into from
Nov 2, 2020
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
40 changes: 20 additions & 20 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1230767999; // December 31, 2008

consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000e1ab5ec9348e9f4b8eb8154");
consensus.defaultAssumeValid = uint256S("0x0000000000000000000f2adce67e49b0b6bdeb9de8b7c3d7e93b21e7fc1e819d"); // 623950
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000001533efd8d716a517fe2c5008");
consensus.defaultAssumeValid = uint256S("0x0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72"); // 654683
Copy link
Contributor

Choose a reason for hiding this comment

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

The mainnet nMinimumChainWork and defaultAssumeValid consensus params match up for me

$ ./src/bitcoin-cli getblockheader 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72
{
 "hash": "0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72",
 "height": 654683,
 "chainwork": "00000000000000000000000000000000000000001533efd8d716a517fe2c5008",
}


/**
* The message start string is designed to be unlikely to occur in normal data.
Expand All @@ -105,8 +105,8 @@ class CMainParams : public CChainParams {
pchMessageStart[3] = 0xd9;
nDefaultPort = 8333;
nPruneAfterHeight = 100000;
m_assumed_blockchain_size = 320;
m_assumed_chain_state_size = 4;
m_assumed_blockchain_size = 350;
m_assumed_chain_state_size = 6;
Copy link
Member

Choose a reason for hiding this comment

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

6 seems a bit aggressive (my chainstate is 3.9), but it doesn't matter that much, as this is only used for the intro dialog.

Copy link
Member Author

Choose a reason for hiding this comment

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

Mine is almost 5 🤷‍♂️

$ du -sh ./chainstate/
4.8G	./chainstate/

Copy link
Member

Choose a reason for hiding this comment

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

Mine is 4, fwiw.

Copy link
Contributor

Choose a reason for hiding this comment

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

3.9 here like @fanquake

Copy link
Contributor

Choose a reason for hiding this comment

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

Having 4.0G here for chainstate.

Copy link
Member

Choose a reason for hiding this comment

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

$ du -sh .bitcoin/chainstate/
4.0G .bitcoin/chainstate/

Copy link
Member

Choose a reason for hiding this comment

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

Mine is 5.2G


genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
Expand Down Expand Up @@ -162,10 +162,10 @@ class CMainParams : public CChainParams {
};

chainTxData = ChainTxData{
// Data from RPC: getchaintxstats 4096 0000000000000000000f2adce67e49b0b6bdeb9de8b7c3d7e93b21e7fc1e819d
/* nTime */ 1585764811,
/* nTxCount */ 517186863,
/* dTxRate */ 3.305709665792344,
// Data from RPC: getchaintxstats 4096 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72
/* nTime */ 1603995752,
/* nTxCount */ 582083445,
/* dTxRate */ 3.508976121410527,
Copy link
Contributor

Choose a reason for hiding this comment

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

Mainnet chaintxdata seem good:

$ ./src/bitcoin-cli getchaintxstats 4096 0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72
{
  "time": 1603995752,
  "txcount": 582083445,
  "window_final_block_hash": "0000000000000000000b9d2ec5a352ecba0592946514a92f14319dc2b367fc72",
  "window_final_block_height": 654683,
  "window_block_count": 4096,
  "window_tx_count": 8995148,
  "window_interval": 2563468,
  "txrate": 3.508976121410527
}

};
}
};
Expand Down Expand Up @@ -204,8 +204,8 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nStartTime = 1199145601; // January 1, 2008
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1230767999; // December 31, 2008

consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000001495c1d5a01e2af8a23");
consensus.defaultAssumeValid = uint256S("0x000000000000056c49030c174179b52a928c870e6e8a822c75973b7970cfbd01"); // 1692000
consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000001db6ec4ac88cf2272c6");
consensus.defaultAssumeValid = uint256S("0x000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0"); // 1864000
Copy link
Contributor

Choose a reason for hiding this comment

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

Testnet nMinimumChainWork and defaultAssumeValid consensus params match up for me

$ ./src/bitcoin-cli -testnet getblockheader 000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0
{
  "hash": "000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0",
  "height": 1864000,
  "chainwork": "0000000000000000000000000000000000000000000001db6ec4ac88cf2272c6",
}


pchMessageStart[0] = 0x0b;
pchMessageStart[1] = 0x11;
Expand Down Expand Up @@ -251,10 +251,10 @@ class CTestNetParams : public CChainParams {
};

chainTxData = ChainTxData{
// Data from RPC: getchaintxstats 4096 000000000000056c49030c174179b52a928c870e6e8a822c75973b7970cfbd01
/* nTime */ 1585561140,
/* nTxCount */ 13483,
/* dTxRate */ 0.08523187013249722,
// Data from RPC: getchaintxstats 4096 000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0
/* nTime */ 1603359686,
/* nTxCount */ 58090238,
/* dTxRate */ 0.1232886622799463,
Copy link
Contributor

Choose a reason for hiding this comment

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

Testnet3 chaintxdata seem good:

$ ./src/bitcoin-cli -testnet getchaintxstats 4096 000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0
{
  "time": 1603359686,
  "txcount": 58090238,
  "window_final_block_hash": "000000000000006433d1efec504c53ca332b64963c425395515b01977bd7b3b0",
  "window_final_block_height": 1864000,
  "window_block_count": 4096,
  "window_tx_count": 143148,
  "window_interval": 1161080,
  "txrate": 0.1232886622799463
}

};
}
};
Expand All @@ -274,15 +274,15 @@ class SigNetParams : public CChainParams {
vSeeds.emplace_back("2a01:7c8:d005:390::5");
vSeeds.emplace_back("ntv3mtqw5wt63red.onion:38333");

consensus.nMinimumChainWork = uint256S("0x0000000000000000000000000000000000000000000000000000000d145533ce");
consensus.defaultAssumeValid = uint256S("0x00000128807d9175c494e24d805fc7854f7d79aa965cbb128342ad8b70cecfa5"); // 5348
consensus.nMinimumChainWork = uint256S("0x00000000000000000000000000000000000000000000000000000019fd16269a");
consensus.defaultAssumeValid = uint256S("0x0000002a1de0f46379358c1fd09906f7ac59adf3712323ed90eb59e4c183c020"); // 9434
m_assumed_blockchain_size = 1;
m_assumed_chain_state_size = 0;
chainTxData = ChainTxData{
// Data from RPC: getchaintxstats 4096 00000128807d9175c494e24d805fc7854f7d79aa965cbb128342ad8b70cecfa5
/* nTime */ 1601382000,
/* nTxCount */ 5435,
/* dTxRate */ 0.001898346323372538,
// Data from RPC: getchaintxstats 4096 0000002a1de0f46379358c1fd09906f7ac59adf3712323ed90eb59e4c183c020
/* nTime */ 1603986000,
/* nTxCount */ 9582,
/* dTxRate */ 0.00159272030651341,
};
Copy link
Contributor

@jonatack jonatack Nov 1, 2020

Choose a reason for hiding this comment

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

I have different Signet chaintxdata:

$ ./src/bitcoin-cli -signet getchaintxstats 4096 00000128807d9175c494e24d805fc7854f7d79aa965cbb128342ad8b70cecfa5
{
  "time": 1601382000,
  "txcount": 5435,
  "window_final_block_hash": "00000128807d9175c494e24d805fc7854f7d79aa965cbb128342ad8b70cecfa5",
  "window_final_block_height": 5348,
  "window_block_count": 4096,
  "window_tx_count": 4182,
  "window_interval": 2202970,
  "txrate": 0.001898346323372538
}

(and so different getblockheader data as well)

$ ./src/bitcoin-cli -signet getblockheader "00000128807d9175c494e24d805fc7854f7d79aa965cbb128342ad8b70cecfa5"
{
  "hash": "00000128807d9175c494e24d805fc7854f7d79aa965cbb128342ad8b70cecfa5",
  "height": 5348,
  "chainwork": "0000000000000000000000000000000000000000000000000000000d145533ce",
}

Copy link
Member Author

Choose a reason for hiding this comment

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

The comment has not been updated https://github.com/bitcoin/bitcoin/pull/20263/files#r515620099 . Nice find.

} else {
const auto signet_challenge = args.GetArgs("-signetchallenge");
Expand Down