Page MenuHomePhabricator

Disable the chained-tx limit after wellington
ClosedPublic

Authored by Fabien on Feb 24 2023, 19:53.

Details

Reviewers
PiRK
sdulfari
Group Reviewers
Restricted Project
Commits
rABC07715ddb4d61: 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`

Event Timeline

Fabien requested review of this revision.Feb 24 2023, 19:53
PiRK requested changes to this revision.Feb 27 2023, 14:34
PiRK added a subscriber: PiRK.
PiRK added inline comments.
src/txmempool.h
683 ↗(On Diff #38041)
This revision now requires changes to proceed.Feb 27 2023, 14:34

Rebase, fix upgrade name

Failed tests logs:

====== Bitcoin ABC functional tests with the next upgrade activated: rpc_deprecated.py ======

------- Stdout: -------
2023-02-27T15:28:21.079000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20230227_152636/rpc_deprecated_28
2023-02-27T15:28:21.476000Z TestFramework (INFO): Check isfinaltransaction returns false when looking for unknown transactions
2023-02-27T15:28:21.480000Z TestFramework (INFO): Check isfinalblock and isfinaltransaction returns false when the quorum is not established
2023-02-27T15:28:26.443000Z TestFramework (INFO): Check the getblocktemplate output with and without -deprecatedrpc=getblocktemplate_sigops
2023-02-27T15:28:29.710000Z TestFramework (INFO): Check the getblockchaininfo output with and without -deprecatedrpc=softforks
2023-02-27T15:28:29.745000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 136, in main
    self.run_test()
  File "/work/test/functional/rpc_deprecated.py", line 151, in run_test
    assert 'ancestorcount' in utxo
AssertionError
2023-02-27T15:28:29.796000Z TestFramework (INFO): Stopping nodes
2023-02-27T15:28:29.948000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20230227_152636/rpc_deprecated_28
2023-02-27T15:28:29.948000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20230227_152636/rpc_deprecated_28/test_framework.log
2023-02-27T15:28:29.948000Z TestFramework (ERROR): 
2023-02-27T15:28:29.948000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-diff/test/tmp/test_runner_₿₵_  _20230227_152636/rpc_deprecated_28' to consolidate all logs
2023-02-27T15:28:29.948000Z TestFramework (ERROR): 
2023-02-27T15:28:29.948000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2023-02-27T15:28:29.948000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2023-02-27T15:28:29.948000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests with the next upgrade activated: rpc_deprecated.py

This revision is now accepted and ready to land.Feb 27 2023, 18:06
sdulfari requested changes to this revision.Feb 27 2023, 20:43
sdulfari added a subscriber: sdulfari.

Does not matter now that this patch has been reviewed a couple times but lots of little things could have been their own diffs like making some things const, moving nNoLimit, etc.

Everything looks fine except for the test comment.

src/txmempool.cpp
38

nit: comments like this should be marked TODO so they receive special rendering in many editors. but there are a lot of these in this diff so up to you.

test/functional/abc_mempool_chainedtx.py
82–111

We should test well beyond just max + 1

This revision now requires changes to proceed.Feb 27 2023, 20:43

Reorg more than a single block in the test

This revision is now accepted and ready to land.Feb 27 2023, 21:41