Disable the chained-tx limit after wellington
Summary:
The packages limits remain applicable, and will be removed in a follow up.
This is inspired by bchn#1130 with several differences:
- The ancestors statistics are not removed
- There are more tests to update
- A functional test is added for the feature
The code is full of comments regarding wellington to make it easier to clean after activation.
Depends on D13170.
Test Plan:
ninja check-extended ninja check-upgrade-activated-extended
ninja bitcoin-bench
src/bench/bitcoin-bench -filter='(Genera.*)|(MempoolAcc.*)|(EvictChained.*)|(Reorg.*)'
Check there is no quadratic behavior anymore. Here are the results on my machine:
Before: | ns/op | op/s | err% | ins/op | bra/op | miss% | total | benchmark |--------------------:|--------------------:|--------:|----------------:|---------------:|--------:|----------:|:---------- | 1,082,634,091.00 | 0.92 | 0.2% |8,027,110,995.00 |1,672,131,951.50 | 1.1% | 2.17 | `EvictChained50Tx` | 1,394,596,966.00 | 0.72 | 6.5% |8,087,892,514.00 |1,684,665,595.00 | 1.1% | 2.79 | :wavy_dash: `EvictChained50TxRev` (Unstable with ~1.0 iters. Increase `minEpochIterations` to e.g. 10) | 4,056,632.00 | 246.51 | 2.3% | 21,687,986.00 | 1,564,891.00 | 0.5% | 0.05 | `GenerateBlock500ChainedTxs` | 450,976.50 | 2,217.41 | 2.4% | 2,372,603.50 | 190,319.00 | 0.4% | 0.01 | `GenerateBlock50ChainedTxs` | 51,856,375.00 | 19.28 | 0.2% | 337,807,820.00 | 67,738,060.00 | 2.8% | 0.57 | `MempoolAcceptance500ChainedTxs` | 1,221,865.00 | 818.42 | 0.6% | 8,063,425.00 | 1,243,847.00 | 0.8% | 0.01 | `MempoolAcceptance50ChainedTxs` | 11,463,754.00 | 87.23 | 0.3% | 70,869,524.00 | 9,700,730.00 | 0.9% | 0.13 | `MempoolAcceptance511TxTree` | 1,317,141.00 | 759.22 | 0.7% | 8,171,715.00 | 1,075,824.00 | 0.5% | 0.01 | `MempoolAcceptance63TxTree` | 2,252,318,988.00 | 0.44 | 0.4% |14,564,639,076.00 |3,321,158,220.00 | 2.9% | 24.78 | `Reorg10BlocksWith500TxChain` | 608,165,999.00 | 1.64 | 0.1% |3,852,606,493.00 | 720,219,640.00 | 2.7% | 6.70 | `Reorg10BlocksWith500TxChainSkipMempool` | 33,319,719.00 | 30.01 | 0.1% | 242,495,645.00 | 44,436,669.00 | 1.2% | 0.37 | `Reorg10BlocksWith50TxChain` | 20,680,306.00 | 48.36 | 0.1% | 132,733,995.00 | 17,851,116.00 | 0.8% | 0.23 | `Reorg10BlocksWith50TxChainSkipMempool` After: | ns/op | op/s | err% | ins/op | bra/op | miss% | total | benchmark |--------------------:|--------------------:|--------:|----------------:|---------------:|--------:|----------:|:---------- | 521,422,122.50 | 1.92 | 0.1% |3,135,478,132.50 | 589,743,862.50 | 0.6% | 1.04 | `EvictChained50Tx` | 536,796,211.50 | 1.86 | 0.1% |3,148,530,934.00 | 592,990,588.50 | 0.4% | 1.07 | `EvictChained50TxRev` | 4,017,258.00 | 248.93 | 0.4% | 21,659,814.00 | 1,560,929.00 | 0.4% | 0.04 | `GenerateBlock500ChainedTxs` | 452,572.00 | 2,209.59 | 0.9% | 2,374,021.50 | 190,352.50 | 0.4% | 0.01 | `GenerateBlock50ChainedTxs` | 9,329,149.00 | 107.19 | 0.2% | 55,918,423.00 | 6,974,450.00 | 0.3% | 0.10 | `MempoolAcceptance500ChainedTxs` | 913,204.00 | 1,095.05 | 0.5% | 5,509,681.00 | 680,681.00 | 0.2% | 0.01 | `MempoolAcceptance50ChainedTxs` | 9,979,850.00 | 100.20 | 0.3% | 61,774,853.00 | 7,748,727.00 | 0.4% | 0.11 | `MempoolAcceptance511TxTree` | 1,201,866.00 | 832.04 | 0.2% | 7,519,332.00 | 936,880.00 | 0.3% | 0.01 | `MempoolAcceptance63TxTree` | 1,361,330,892.00 | 0.73 | 0.6% |8,837,815,749.00 |2,077,543,576.00 | 2.8% | 14.96 | `Reorg10BlocksWith500TxChain` | 164,340,138.00 | 6.08 | 0.2% |1,031,228,147.00 | 112,500,054.00 | 0.3% | 1.81 | `Reorg10BlocksWith500TxChainSkipMempool` | 26,622,969.00 | 37.56 | 0.1% | 190,309,093.00 | 32,721,848.00 | 1.0% | 0.29 | `Reorg10BlocksWith50TxChain` | 17,343,691.00 | 57.66 | 0.2% | 107,193,450.00 | 12,211,816.00 | 0.4% | 0.19 | `Reorg10BlocksWith50TxChainSkipMempool`
Reviewers: #bitcoin_abc, PiRK, sdulfari
Reviewed By: #bitcoin_abc, PiRK, sdulfari
Subscribers: sdulfari, PiRK
Differential Revision: https://reviews.bitcoinabc.org/D13171