Repository: bitcoin/bitcoin
Pull request #31978: kernel: pre-29.x chainparams and headerssync update
Author: login: glozow
Labels: name: Validation
Created: 2025-03-03T21:13:41Z | Merged: 2025-03-06T10:23:09Z

Update chainparams and headerssync config for v29.0 (see [release process](https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md#before-branch-off)).


Diff:
diff --git a/contrib/devtools/headerssync-params.py b/contrib/devtools/headerssync-params.py
index f8e415532a03..4640718cb7e4 100755
--- a/contrib/devtools/headerssync-params.py
+++ b/contrib/devtools/headerssync-params.py
@@ -12,13 +12,13 @@
 # Parameters:
 
 # Aim for still working fine at some point in the future. [datetime]
-TIME = datetime(2027, 4, 1)
+TIME = datetime(2027, 10, 6)
 
 # Expected block interval. [timedelta]
 BLOCK_INTERVAL = timedelta(seconds=600)
 
 # The number of headers corresponding to the minchainwork parameter. [headers]
-MINCHAINWORK_HEADERS = 856760
+MINCHAINWORK_HEADERS = 886157
 
 # 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
diff --git a/src/headerssync.cpp b/src/headerssync.cpp
index b134ef6452da..9e8b1905168f 100644
--- a/src/headerssync.cpp
+++ b/src/headerssync.cpp
@@ -13,11 +13,11 @@
 // contrib/devtools/headerssync-params.py.
 
 //! Store one header commitment per HEADER_COMMITMENT_PERIOD blocks.
-constexpr size_t HEADER_COMMITMENT_PERIOD{615};
+constexpr size_t HEADER_COMMITMENT_PERIOD{624};
 
 //! Only feed headers to validation once this many headers on top have been
 //! received and validated against commitments.
-constexpr size_t REDOWNLOAD_BUFFER_SIZE{14621}; // 14621/615 = ~23.8 commitments
+constexpr size_t REDOWNLOAD_BUFFER_SIZE{14827}; // 14827/624 = ~23.8 commitments
 
 // Our memory analysis assumes 48 bytes for a CompressedHeader (so we should
 // re-calculate parameters if we compress further)
diff --git a/src/kernel/chainparams.cpp b/src/kernel/chainparams.cpp
index 349e14a5d6ea..8df294da8c34 100644
--- a/src/kernel/chainparams.cpp
+++ b/src/kernel/chainparams.cpp
@@ -117,8 +117,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{"000000000000000000000000000000000000000088e186b70e0862c193ec44d6"};
-        consensus.defaultAssumeValid = uint256{"000000000000000000011c5890365bdbe5d25b97ce0057589acaef4f1a57263f"}; // 856760
+        consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000b1f3b93b65b16d035a82be84"};
+        consensus.defaultAssumeValid = uint256{"00000000000000000001b658dd1120e82e66d2790811f89ede9742ada3ed6d77"}; // 886157
 
         /**
          * The message start string is designed to be unlikely to occur in normal data.
@@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 720;
         m_assumed_chain_state_size = 14;
 
         genesis = CreateGenesisBlock(1231006505, 2083236893, 0x1d00ffff, 1, 50 * COIN);
@@ -195,10 +195,10 @@ class CMainParams : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000000000000000011c5890365bdbe5d25b97ce0057589acaef4f1a57263f
-            .nTime    = 1723649144,
-            .tx_count = 1059312821,
-            .dTxRate  = 6.721086701157182,
+            // Data from RPC: getchaintxstats 4096 00000000000000000001b658dd1120e82e66d2790811f89ede9742ada3ed6d77
+            .nTime    = 1741017141,
+            .tx_count = 1161875261,
+            .dTxRate  = 4.620728156243148,
         };
     }
 };
@@ -241,8 +241,8 @@ 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{"000000000000000000000000000000000000000000000f209695166be8b61fa9"};
-        consensus.defaultAssumeValid = uint256{"000000000000000465b1a66c9f386308e8c75acef9201f3f577811da09fc90ad"}; // 2873500
+        consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000015f5e0c9f13455b0eb17"};
+        consensus.defaultAssumeValid = uint256{"00000000000003fc7967410ba2d0a8a8d50daedc318d43e8baf1a9782c236a57"}; // 3974606
 
         pchMessageStart[0] = 0x0b;
         pchMessageStart[1] = 0x11;
@@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 200;
         m_assumed_chain_state_size = 19;
 
         genesis = CreateGenesisBlock(1296688602, 414098458, 0x1d00ffff, 1, 50 * COIN);
@@ -296,10 +296,10 @@ class CTestNetParams : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000000000000465b1a66c9f386308e8c75acef9201f3f577811da09fc90ad
-            .nTime    = 1723613341,
-            .tx_count = 187917082,
-            .dTxRate  = 3.265051477698455,
+            // Data from RPC: getchaintxstats 4096 00000000000003fc7967410ba2d0a8a8d50daedc318d43e8baf1a9782c236a57
+            .nTime    = 1741042082,
+            .tx_count = 475477615,
+            .dTxRate  = 17.15933950357594,
         };
     }
 };
@@ -340,8 +340,8 @@ 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{"00000000000000000000000000000000000000000000005faa15d02e6202f3ba"};
-        consensus.defaultAssumeValid = uint256{"000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd"}; // 39550
+        consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000001d6dce8651b6094e4c1"};
+        consensus.defaultAssumeValid = uint256{"0000000000003ed4f08dbdf6f7d6b271a6bcffce25675cb40aa9fa43179a89f3"}; // 72600
 
         pchMessageStart[0] = 0x1c;
         pchMessageStart[1] = 0x16;
@@ -349,8 +349,8 @@ class CTestNet4Params : public CChainParams {
         pchMessageStart[3] = 0x28;
         nDefaultPort = 48333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 1;
-        m_assumed_chain_state_size = 0;
+        m_assumed_blockchain_size = 11;
+        m_assumed_chain_state_size = 1;
 
         const char* testnet4_genesis_msg = "03/May/2024 000000000000000000001ebd58c244970b3aa9d783bb001011fbe8ea8e98e00e";
         const CScript testnet4_genesis_script = CScript() << "000000000000000000000000000000000000000000000000000000000000000000"_hex << OP_CHECKSIG;
@@ -395,10 +395,10 @@ class CTestNet4Params : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd
-            .nTime    = 1723651702,
-            .tx_count = 757229,
-            .dTxRate  = 0.01570402633472492,
+            // Data from RPC: getchaintxstats 4096 0000000000003ed4f08dbdf6f7d6b271a6bcffce25675cb40aa9fa43179a89f3
+            .nTime    = 1741070246,
+            .tx_count = 7653966,
+            .dTxRate  = 1.239174414591965,
         };
     }
 };
@@ -422,15 +422,15 @@ class SigNetParams : public CChainParams {
             vSeeds.emplace_back("178.128.221.177");
             vSeeds.emplace_back("v7ajjeirttkbnt32wpy3c6w3emwnfr3fkla7hpxcfokr3ysd3kqtzmqd.onion:38333");
 
-            consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000000000000025dbd66e58f"};
-            consensus.defaultAssumeValid = uint256{"0000014aad1d58dddcb964dd749b073374c6306e716b22f573a2efe68d414539"}; // 208800
-            m_assumed_blockchain_size = 2;
-            m_assumed_chain_state_size = 0;
+            consensus.nMinimumChainWork = uint256{"000000000000000000000000000000000000000000000000000002b517f3d1a1"};
+            consensus.defaultAssumeValid = uint256{"000000895a110f46e59eb82bbc5bfb67fa314656009c295509c21b4999f5180a"}; // 237722
+            m_assumed_blockchain_size = 9;
+            m_assumed_chain_state_size = 1;
             chainTxData = ChainTxData{
-                // Data from RPC: getchaintxstats 4096 0000014aad1d58dddcb964dd749b073374c6306e716b22f573a2efe68d414539
-                .nTime    = 1723655233,
-                .tx_count = 5507045,
-                .dTxRate  = 0.06271073277261494,
+                // Data from RPC: getchaintxstats 4096 000000895a110f46e59eb82bbc5bfb67fa314656009c295509c21b4999f5180a
+                .nTime    = 1741019645,
+                .tx_count = 16540736,
+                .dTxRate  = 1.064918879911595,
             };
         } else {
             bin = *options.challenge;


Reviews:
user: login: achow101
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-03T23:38:54Z
user: login: sr-gi
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T00:17:40Z
user: login: Sjors
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T10:04:54Z
user: login: willcl-ark
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T11:34:06Z
user: login: fanquake
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T14:51:12Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T14:54:04Z
user: login: fanquake
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T14:55:54Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T15:04:00Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T15:05:02Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T15:05:09Z
user: login: achow101
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T16:06:55Z
user: login: achow101
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T16:07:58Z
user: login: fanquake
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T16:27:56Z
user: login: Christewart
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T18:00:58Z
user: login: achow101
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T18:01:17Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T19:24:16Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T19:24:30Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T19:24:36Z
user: login: glozow
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T19:25:34Z
user: login: mzumsande
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-04T20:36:22Z
user: login: darosior
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-04T21:19:46Z
user: login: marcofleon
body: Verified all the values for mainnet after syncing with `-assumevalid=0`. Also ran the headers sync script and got the same results.
```
du -csh ./blocks ./chainstate 
681G	./blocks
 11G	./chainstate
692G	total
```
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-05T12:06:36Z
user: login: darosior
body: post-merge ACK 11a2d3a63e90cdc1920ede3c67d52a9c72860e6b

Checked all the parameters but the headersync. Performed an `-assumevalid=0` sync on mainnet.
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-07T16:50:29Z

Review comments:
diff_hunk: @@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 700;
path: src/kernel/chainparams.cpp
user: login: achow101
body: In 13f2815f4caca68a3ab0d0b865f370956308cad6 "[kernel] update assumed blockchain and chainstate sizes for v29"

700 seems a little high, although not too big of a deal I suppose.

One one node, I have 618 GiB, and on 2 others its 626, so I'd expect 680 or 690 here.
created_at: 2025-03-03T23:28:16Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: achow101
body: In 13f2815f4caca68a3ab0d0b865f370956308cad6 "[kernel] update assumed blockchain and chainstate sizes for v29"

This seems excessively high, I'd be surprised if testnet3's datadir size doubled in the past 6 months.

Across my 3 nodes, I see 111 GiB, 112 GiB, and 116 GiB, so I'd expect this to be 127.
created_at: 2025-03-03T23:29:57Z
author_association: MEMBER
diff_hunk: @@ -349,8 +349,8 @@ class CTestNet4Params : public CChainParams {
         pchMessageStart[3] = 0x28;
         nDefaultPort = 48333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 1;
-        m_assumed_chain_state_size = 0;
+        m_assumed_blockchain_size = 6;
path: src/kernel/chainparams.cpp
user: login: achow101
body: In 13f2815f4caca68a3ab0d0b865f370956308cad6 "[kernel] update assumed blockchain and chainstate sizes for v29"

I think this is a bit low.

Across my 3 nodes, I have 7.8 GiB, 6.2 GiB, and 9.2 GiB, so I'd expect this to be 11.
created_at: 2025-03-03T23:31:36Z
author_association: MEMBER
diff_hunk: @@ -340,8 +340,8 @@ 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{"00000000000000000000000000000000000000000000005faa15d02e6202f3ba"};
-        consensus.defaultAssumeValid = uint256{"000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd"}; // 39550
+        consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000001d455d7eda6382f7054"};
+        consensus.defaultAssumeValid = uint256{"00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367"}; // 72513
path: src/kernel/chainparams.cpp
user: login: achow101
body: In 92a6f7b238cd8ff015e242d6a515452c401133a7 "[kernel] update assumevalid and minimumChainWork for v29"

This block appears to have been reorged out. Perhaps we should choose a block with actual work for testnet4.
created_at: 2025-03-03T23:34:37Z
author_association: MEMBER
diff_hunk: @@ -395,10 +395,10 @@ class CTestNet4Params : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd
-            .nTime    = 1723651702,
-            .tx_count = 757229,
-            .dTxRate  = 0.01570402633472492,
+            // Data from RPC: getchaintxstats 4096 00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367
path: src/kernel/chainparams.cpp
user: login: achow101
body: In 70e294c0930a412fb6945eb753d1a39ef52fb324 "[kernel] update chainTxData for v29"

```
$ bitcoin-cli -testnet4 getchaintxstats 4096 00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367
error code: -8
error message:
Block is not in main chain
```
created_at: 2025-03-03T23:37:06Z
author_association: MEMBER
diff_hunk: @@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 700;
path: src/kernel/chainparams.cpp
user: login: sr-gi
body: I think the exact number was 694, but I'm happy to double check it if needed
created_at: 2025-03-04T00:17:40Z
author_association: MEMBER
diff_hunk: @@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 700;
path: src/kernel/chainparams.cpp
user: login: Sjors
body: On my existing node `du -h` returns 681G for the blocks and 12G for the chainstate.
created_at: 2025-03-04T10:04:54Z
author_association: MEMBER
diff_hunk: @@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 700;
path: src/kernel/chainparams.cpp
user: login: willcl-ark
body: > On my existing node du -h returns 681G for the blocks and 12G for the chainstate.

I also have numbers matching these on my nodes too.

<details>
<summary>Details</summary>

```
bitcoin in ~/.bitcoin ➜ du -h | rg chainstate
77M     ./signet/chainstate
12G     ./chainstate
bitcoin in ~/.bitcoin ➜ cd /mnt/data/bitcoin/.bitcoin/
bitcoin in data/bitcoin/.bitcoin ➜ du -h | rg blocks
469M    ./signet/blocks
681G    ./blocks
```

</details>
created_at: 2025-03-04T11:34:06Z
author_association: MEMBER
diff_hunk: @@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 700;
path: src/kernel/chainparams.cpp
user: login: fanquake
body: Yea, `700` or even more here, seems fine here.
created_at: 2025-03-04T14:51:12Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: glozow
body: It is a big jump, but `du .bitcoin/testnet3 -h` gives me 181G. Let's see what other people have?
created_at: 2025-03-04T14:54:04Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: fanquake
body: I have atleast 154GB, and assume it's going to end up around the 180GB mark. Given that, it seems this should be something closer to 200?
created_at: 2025-03-04T14:55:54Z
author_association: MEMBER
diff_hunk: @@ -349,8 +349,8 @@ class CTestNet4Params : public CChainParams {
         pchMessageStart[3] = 0x28;
         nDefaultPort = 48333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 1;
-        m_assumed_chain_state_size = 0;
+        m_assumed_blockchain_size = 6;
path: src/kernel/chainparams.cpp
user: login: glozow
body: Hm, I have 5.9G. IIRC I did a fresh run yesterday, so maybe I don't have as many reorged blocks?

But why do you expect 11 and not 9?
created_at: 2025-03-04T15:04:00Z
author_association: MEMBER
diff_hunk: @@ -340,8 +340,8 @@ 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{"00000000000000000000000000000000000000000000005faa15d02e6202f3ba"};
-        consensus.defaultAssumeValid = uint256{"000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd"}; // 39550
+        consensus.nMinimumChainWork = uint256{"0000000000000000000000000000000000000000000001d455d7eda6382f7054"};
+        consensus.defaultAssumeValid = uint256{"00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367"}; // 72513
path: src/kernel/chainparams.cpp
user: login: glozow
body: Oops I shouldn't have just picked the tip. Now using 72600 which was mined 8 hours ago.
created_at: 2025-03-04T15:05:02Z
author_association: MEMBER
diff_hunk: @@ -395,10 +395,10 @@ class CTestNet4Params : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd
-            .nTime    = 1723651702,
-            .tx_count = 757229,
-            .dTxRate  = 0.01570402633472492,
+            // Data from RPC: getchaintxstats 4096 00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367
path: src/kernel/chainparams.cpp
user: login: glozow
body: fixed
created_at: 2025-03-04T15:05:09Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: achow101
body: > It is a big jump, but `du .bitcoin/testnet3 -h` gives me 181G. Let's see what other people have?

In the past, I've done `du -csh chainstate/ blocks/` so that indexes, debug.log, and wallets, are not included in the size.

```
du -csh ~/.bitcoin/testnet3/chainstate/ ~/.bitcoin/testnet3/blocks/
11G	/home/ava/.bitcoin/testnet3/chainstate/
101G	/home/ava/.bitcoin/testnet3/blocks/
111G	total
```
created_at: 2025-03-04T16:06:55Z
author_association: MEMBER
diff_hunk: @@ -349,8 +349,8 @@ class CTestNet4Params : public CChainParams {
         pchMessageStart[3] = 0x28;
         nDefaultPort = 48333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 1;
-        m_assumed_chain_state_size = 0;
+        m_assumed_blockchain_size = 6;
path: src/kernel/chainparams.cpp
user: login: achow101
body: 10% buffer, as stated in the release process doc. `9.2 * 1.1 = 10.12 ~= 11`
created_at: 2025-03-04T16:07:58Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: fanquake
body: ```bash
du -csh testnet3/blocks/ testnet3/chainstate/        
167G	testnet3/blocks/
 13G	testnet3/chainstate/
180G	total
```
created_at: 2025-03-04T16:27:56Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: Christewart
body: ```
du -csh ~/.bitcoin/testnet3/blocks/ ~/.bitcoin/testnet3/chainstate/
167G    /home/chris/.bitcoin/testnet3/blocks/
13G     /home/chris/.bitcoin/testnet3/chainstate/
179G    total
```

created_at: 2025-03-04T18:00:58Z
author_association: CONTRIBUTOR
diff_hunk: @@ -395,10 +395,10 @@ class CTestNet4Params : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd
-            .nTime    = 1723651702,
-            .tx_count = 757229,
-            .dTxRate  = 0.01570402633472492,
+            // Data from RPC: getchaintxstats 4096 00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367
path: src/kernel/chainparams.cpp
user: login: achow101
body: In 570191a758bc326ae0f0a479b72759f962c0db12 "[kernel] update chainTxData for v29"

Comment needs to be updated for the block that these stats are for.
created_at: 2025-03-04T18:01:13Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: glozow
body: bumped to 200, roughly 10% more than 180
created_at: 2025-03-04T19:24:16Z
author_association: MEMBER
diff_hunk: @@ -349,8 +349,8 @@ class CTestNet4Params : public CChainParams {
         pchMessageStart[3] = 0x28;
         nDefaultPort = 48333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 1;
-        m_assumed_chain_state_size = 0;
+        m_assumed_blockchain_size = 6;
path: src/kernel/chainparams.cpp
user: login: glozow
body: bumped to 11
created_at: 2025-03-04T19:24:30Z
author_association: MEMBER
diff_hunk: @@ -395,10 +395,10 @@ class CTestNet4Params : public CChainParams {
         };
 
         chainTxData = ChainTxData{
-            // Data from RPC: getchaintxstats 4096 000000005be348057db991fa5d89fe7c4695b667cfb311391a8db374b6f681fd
-            .nTime    = 1723651702,
-            .tx_count = 757229,
-            .dTxRate  = 0.01570402633472492,
+            // Data from RPC: getchaintxstats 4096 00000000798bd720800263b69bee01aae57ea376596415a04423da29f000c367
path: src/kernel/chainparams.cpp
user: login: glozow
body: fixed
created_at: 2025-03-04T19:24:36Z
author_association: MEMBER
diff_hunk: @@ -131,7 +131,7 @@ class CMainParams : public CChainParams {
         pchMessageStart[3] = 0xd9;
         nDefaultPort = 8333;
         nPruneAfterHeight = 100000;
-        m_assumed_blockchain_size = 620;
+        m_assumed_blockchain_size = 700;
path: src/kernel/chainparams.cpp
user: login: glozow
body: bumped to 720, roughly 5% more than 680
created_at: 2025-03-04T19:25:34Z
author_association: MEMBER
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: mzumsande
body: ```
168G	/home/martin/.bitcoin/testnet3/blocks/
13G	/home/martin/.bitcoin/testnet3/chainstate/
181G	total
```
with a node that is offline 99% of the time and therefore did not experience many of the reorg shenanigans.
created_at: 2025-03-04T20:36:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -250,7 +250,7 @@ class CTestNetParams : public CChainParams {
         pchMessageStart[3] = 0x07;
         nDefaultPort = 18333;
         nPruneAfterHeight = 1000;
-        m_assumed_blockchain_size = 93;
+        m_assumed_blockchain_size = 181;
path: src/kernel/chainparams.cpp
user: login: darosior
body: Got 180GiB across blocks and chainstate for testnet3 too.
created_at: 2025-03-04T21:19:46Z
author_association: MEMBER

PR comments:
user: login: DrahtBot
created_at: 2025-03-03T21:13:45Z
body: <!--e57a25ab6845829454e8d69fc972939a-->

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

<!--006a51241073e994b41acfe9ec718e94-->
### Code Coverage & Benchmarks
For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/31978.
<!--021abf342d371248e50ceaed478a90ca-->
### Reviews
See [the guideline](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md#code-review) for information on the review process.
| Type | Reviewers |
| ---- | --------- |
| ACK | [achow101](https://github.com/bitcoin/bitcoin/pull/31978#issuecomment-2698708475), [Sjors](https://github.com/bitcoin/bitcoin/pull/31978#issuecomment-2701672307) |

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
<!--174a7506f384e20aa4161008e828411d-->
### Conflicts
Reviewers, this pull request conflicts with the following ones:

* [#26201](https://github.com/bitcoin/bitcoin/pull/26201) (Remove Taproot activation height by Sjors)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

author_association: CONTRIBUTOR
user: login: glozow
created_at: 2025-03-03T21:17:14Z
body: These are from my nodes except for the mainnet `m_assumed_blockchain_size` which is from @sr-gi (thanks!)
author_association: MEMBER
user: login: Sjors
created_at: 2025-03-04T10:18:45Z
body: I did a mainnet sync using 4475d0babc070a19f3a0ac472304a8c9b87b87d7 and `-assumevalid=0` which worked. I verified the chain work for the new assume valid block, as well as the `getchaintxstats` result and `headerssync-params.py`.
 
author_association: MEMBER
user: login: achow101
created_at: 2025-03-04T19:33:41Z
body: ACK 11a2d3a63e90cdc1920ede3c67d52a9c72860e6b
author_association: MEMBER
user: login: sipa
created_at: 2025-03-04T20:27:28Z
body: EDIT: disregard, my filesystem is compressed, so the numbers are lower than would be expected on a normal system.

~~Synced from scratch, on dev-mode build of master on Feb 21, 2025, using `du -h --si` (note that `--si` to produce powers-of-1000 based units):~~

author_association: MEMBER
user: login: sr-gi
created_at: 2025-03-04T22:29:47Z
body: I checked the provided hashes and reported sizes for mainnet, which matches my node's.

```
du -csh ~/.bitcoin/blocks/ ~/.bitcoin/chainstate/
682G	/home/sergi/.bitcoin/blocks/
12G	/home/sergi/.bitcoin/chainstate/
694G	total
```
author_association: MEMBER
user: login: sipa
created_at: 2025-03-05T15:01:30Z
body: Note that `du -h` produces 1024-based units, while `m_assumed_blockchain_size` and `m_assumed_chain_state_size` expect multiples of 10^9 bytes, which means adding 4.8% to `M` results, and 7.4% to `G` results.
author_association: MEMBER
user: login: Sjors
created_at: 2025-03-05T17:55:03Z
body: ACK 11a2d3a63e90cdc1920ede3c67d52a9c72860e6b

Mainnet params same as my last review except a size bump

For the test networks, I resynced all of them with `-assumevalid=0` and verifed the chain work for the new assume valid block and the `getchaintxstats` result. I didn't check the sizes.
author_association: MEMBER
user: login: achow101
created_at: 2025-09-01T22:03:29Z
body: > Note that `du -h` produces 1024-based units, while `m_assumed_blockchain_size` and `m_assumed_chain_state_size` expect multiples of 10^9 bytes, which means adding 4.8% to `M` results, and 7.4% to `G` results.

No? We use multiples of 1024.

***

> EDIT: disregard, my filesystem is compressed, so the numbers are lower than would be expected on a normal system.

For future reference, `du --apparent-size` can get the ~real sizes, at least for ZFS with compression.
author_association: MEMBER