Skip to content

Commit

Permalink
Merge bitcoin#30658: kernel: pre-28.x chainparams and headerssync update
Browse files Browse the repository at this point in the history
221809b headerssync: Update headerssync configuration (Ava Chow)
c270744 params: Update assumevalid and minimum chainwork (Ava Chow)
255d451 params: Update chainTxData (Ava Chow)
6a5bdae params: Update assumed blockchain and chainstate sizes (Ava Chow)

Pull request description:

  Update chainparams and headerssync parameters for the pre-28.x branching, per https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-branch-off

ACKs for top commit:
  fjahr:
    re-ACK 221809b
  Sjors:
    re-ACK 221809b
  glozow:
    ACK 221809b
  marcofleon:
    ACK 221809b

Tree-SHA512: 5106d59f46dbe167fffa339519e52975ae5bfd7e52202d76ec058da0d4e8bf87355e90678f7ace7c8c402a2f7264050a0355680b9f727c7962ff60e8fcdb3a90
  • Loading branch information
glozow committed Aug 22, 2024
2 parents 338b9d8 + 221809b commit 55d663c
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
4 changes: 2 additions & 2 deletions contrib/devtools/headerssync-params.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
# Parameters:

# Aim for still working fine at some point in the future. [datetime]
TIME = datetime(2026, 10, 5)
TIME = datetime(2027, 4, 1)

# Expected block interval. [timedelta]
BLOCK_INTERVAL = timedelta(seconds=600)

# The number of headers corresponding to the minchainwork parameter. [headers]
MINCHAINWORK_HEADERS = 804000
MINCHAINWORK_HEADERS = 856760

# Combined processing bandwidth from all attackers to one victim. [bit/s]
# 6 Gbit/s is approximately the speed at which a single thread of a Ryzen 5950X CPU thread can hash
Expand Down
4 changes: 2 additions & 2 deletions src/headerssync.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
// contrib/devtools/headerssync-params.py.

//! Store one header commitment per HEADER_COMMITMENT_PERIOD blocks.
constexpr size_t HEADER_COMMITMENT_PERIOD{606};
constexpr size_t HEADER_COMMITMENT_PERIOD{615};

//! Only feed headers to validation once this many headers on top have been
//! received and validated against commitments.
constexpr size_t REDOWNLOAD_BUFFER_SIZE{14441}; // 14441/606 = ~23.8 commitments
constexpr size_t REDOWNLOAD_BUFFER_SIZE{14621}; // 14621/615 = ~23.8 commitments

// Our memory analysis assumes 48 bytes for a CompressedHeader (so we should
// re-calculate parameters if we compress further)
Expand Down
59 changes: 30 additions & 29 deletions src/kernel/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ class CMainParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1628640000; // August 11th, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 709632; // Approximately November 12th, 2021

consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000063c4ebd298db40af57541800"};
consensus.defaultAssumeValid = uint256{"000000000000000000026811d149d4d261995ec5b3f64f439a0a10e1a464af9a"}; // 824000
consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000088e186b70e0862c193ec44d6"};
consensus.defaultAssumeValid = uint256{"000000000000000000011c5890365bdbe5d25b97ce0057589acaef4f1a57263f"}; // 856760

/**
* The message start string is designed to be unlikely to occur in normal data.
Expand All @@ -129,8 +129,8 @@ class CMainParams : public CChainParams {
pchMessageStart[3] = 0xd9;
nDefaultPort = 8333;
nPruneAfterHeight = 100000;
m_assumed_blockchain_size = 600;
m_assumed_chain_state_size = 10;
m_assumed_blockchain_size = 620;
m_assumed_chain_state_size = 14;

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

chainTxData = ChainTxData{
// Data from RPC: getchaintxstats 4096 000000000000000000026811d149d4d261995ec5b3f64f439a0a10e1a464af9a
.nTime = 1704194835,
.tx_count = 946728933,
.dTxRate = 6.569290261471664,
// Data from RPC: getchaintxstats 4096 000000000000000000011c5890365bdbe5d25b97ce0057589acaef4f1a57263f
.nTime = 1723649144,
.tx_count = 1059312821,
.dTxRate = 6.721086701157182,
};
}
};
Expand Down Expand Up @@ -240,17 +240,17 @@ class CTestNetParams : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = 1628640000; // August 11th, 2021
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay

consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000000000c59b14e264ba6c15db9"};
consensus.defaultAssumeValid = uint256{"000000000001323071f38f21ea5aae529ece491eadaccce506a59bcc2d968917"}; // 2550000
consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000000000f209695166be8b61fa9"};
consensus.defaultAssumeValid = uint256{"000000000000000465b1a66c9f386308e8c75acef9201f3f577811da09fc90ad"}; // 2873500

pchMessageStart[0] = 0x0b;
pchMessageStart[1] = 0x11;
pchMessageStart[2] = 0x09;
pchMessageStart[3] = 0x07;
nDefaultPort = 18333;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 42;
m_assumed_chain_state_size = 3;
m_assumed_blockchain_size = 93;
m_assumed_chain_state_size = 19;

genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN);
consensus.hashGenesisBlock = genesis.GetHash();
Expand Down Expand Up @@ -295,10 +295,10 @@ class CTestNetParams : public CChainParams {
};

chainTxData = ChainTxData{
// Data from RPC: getchaintxstats 4096 000000000001323071f38f21ea5aae529ece491eadaccce506a59bcc2d968917
.nTime = 1703579240,
.tx_count = 67845391,
.dTxRate = 1.464436832560951,
// Data from RPC: getchaintxstats 4096 000000000000000465b1a66c9f386308e8c75acef9201f3f577811da09fc90ad
.nTime = 1723613341,
.tx_count = 187917082,
.dTxRate = 3.265051477698455,
};
}
};
Expand Down Expand Up @@ -339,16 +339,16 @@ class CTestNet4Params : public CChainParams {
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].nTimeout = Consensus::BIP9Deployment::NO_TIMEOUT;
consensus.vDeployments[Consensus::DEPLOYMENT_TAPROOT].min_activation_height = 0; // No activation delay

consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000000000056faca98a0cd9bdf5f"};
consensus.defaultAssumeValid = uint256{};
consensus.nMinimumChainWork = uint256{"00000000000000000000000000000000000000000000005faa15d02e6202f3ba"};
consensus.defaultAssumeValid = uint256{"000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd"}; // 39550

pchMessageStart[0] = 0x1c;
pchMessageStart[1] = 0x16;
pchMessageStart[2] = 0x3f;
pchMessageStart[3] = 0x28;
nDefaultPort = 48333;
nPruneAfterHeight = 1000;
m_assumed_blockchain_size = 0;
m_assumed_blockchain_size = 1;
m_assumed_chain_state_size = 0;

const char* testnet4_genesis_msg = "03/May/2024 000000000000000000001ebd58c244970b3aa9d783bb001011fbe8ea8e98e00e";
Expand Down Expand Up @@ -394,9 +394,10 @@ class CTestNet4Params : public CChainParams {
};

chainTxData = ChainTxData{
.nTime = 0,
.tx_count = 0,
.dTxRate = 0,
// Data from RPC: getchaintxstats 4096 000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd
.nTime = 1723651702,
.tx_count = 757229,
.dTxRate = 0.01570402633472492,
};
}
};
Expand All @@ -420,15 +421,15 @@ class SigNetParams : public CChainParams {
vSeeds.emplace_back("178.128.221.177");
vSeeds.emplace_back("v7ajjeirttkbnt32wpy3c6w3emwnfr3fkla7hpxcfokr3ysd3kqtzmqd.onion:38333");

consensus.nMinimumChainWork = uint256{"00000000000000000000000000000000000000000000000000000206e86f08e8"};
consensus.defaultAssumeValid = uint256{"0000000870f15246ba23c16e370a7ffb1fc8a3dcf8cb4492882ed4b0e3d4cd26"}; // 180000
m_assumed_blockchain_size = 1;
consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000000000000025dbd66e58f"};
consensus.defaultAssumeValid = uint256{"0000014aad1d58dddcb964dd749b073374c6306e716b22f573a2efe68d414539"}; // 208800
m_assumed_blockchain_size = 2;
m_assumed_chain_state_size = 0;
chainTxData = ChainTxData{
// Data from RPC: getchaintxstats 4096 0000000870f15246ba23c16e370a7ffb1fc8a3dcf8cb4492882ed4b0e3d4cd26
.nTime = 1706331472,
.tx_count = 2425380,
.dTxRate = 0.008277759863833788,
// Data from RPC: getchaintxstats 4096 0000014aad1d58dddcb964dd749b073374c6306e716b22f573a2efe68d414539
.nTime = 1723655233,
.tx_count = 5507045,
.dTxRate = 0.06271073277261494,
};
} else {
bin = *options.challenge;
Expand Down

0 comments on commit 55d663c

Please sign in to comment.