Page MenuHomePhabricator

Refactor EraseLastKElements to be a special case of EraseLastKElementsIf
ClosedPublic

Authored by PiRK on Feb 3 2022, 15:20.

Details

Summary

This combines EraseLastKElementsIf (introduced in D9863) with the existing EraseLastKElements function by using a default return true predicate.

This is a backport of core#20197 [5/6]
https://github.com/bitcoin/bitcoin/pull/20197/commits/8f1a53eb027727a4c0eaac6d82f0a8279549f638
Depends on D10978

Test Plan

ninja all check-all

Diff Detail

Repository
rABC Bitcoin ABC
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

PiRK requested review of this revision.Feb 3 2022, 15:20

Failed tests logs:

====== Bitcoin ABC functional tests: feature_config_args.py ======

------- Stdout: -------
2022-02-03T15:44:28.802000Z TestFramework (INFO): Initializing test directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25
2022-02-03T15:44:29.814000Z TestFramework (INFO): Test config args logging
2022-02-03T15:44:30.069000Z TestFramework (INFO): Test seed peers
2022-02-03T15:44:34.373000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 132, in main
    self.run_test()
  File "/work/test/functional/feature_config_args.py", line 247, in run_test
    self.test_seed_peers()
  File "/work/test/functional/feature_config_args.py", line 207, in test_seed_peers
    self.start_node(0, extra_args=['-dnsseed=0', '-fixedseeds=1'])
  File "/usr/lib/python3.7/contextlib.py", line 119, in __exit__
    next(self.gen)
  File "/work/test/functional/test_framework/test_node.py", line 523, in assert_debug_log
    str(expected_msgs), print_log))
  File "/work/test/functional/test_framework/test_node.py", line 211, in _raise_assertion_error
    raise AssertionError(self._node_msg(msg))
AssertionError: [node 0] Expected messages "['Loaded 0 addresses from peers.dat', 'DNS seeding disabled', 'Adding fixed seeds as -dnsseed=0, -addnode is not provided and all -seednode(s) attempted\n']" does not partially match log:

 - 
 - 
 - 
 - 
 - 
 - 2022-02-03T15:44:32.880055Z [../../src/init.cpp:1710] [InitLogging] Bitcoin ABC version v0.24.11-eea1adeac (release build)
 - 2022-02-03T15:44:32.880062Z [../../src/init.cpp:1579] [InitParameterInteraction] InitParameterInteraction: parameter interaction: -bind set -> setting -listen=1
 - 2022-02-03T15:44:32.880115Z [../../src/init.cpp:1936] [AppInitParameterInteraction] Checkpoints will be verified.
 - 2022-02-03T15:44:32.880120Z [../../src/init.cpp:1948] [AppInitParameterInteraction] Validating signatures for all blocks.
 - 2022-02-03T15:44:32.880125Z [../../src/init.cpp:1965] [AppInitParameterInteraction] Setting nMinimumChainWork=0000000000000000000000000000000000000000000000000000000000000000
 - 2022-02-03T15:44:32.880163Z [../../src/init.cpp:2148] [AppInitSanityChecks] Using the 'sse4(1way),sse41(4way),avx2(8way)' SHA256 implementation
 - 2022-02-03T15:44:32.880169Z [../../src/random.cpp:105] [ReportHardwareRand] Using RdSeed as additional entropy source
 - 2022-02-03T15:44:32.880172Z [../../src/random.cpp:108] [ReportHardwareRand] Using RdRand as an additional entropy source
 - 2022-02-03T15:44:32.886381Z [../../src/dummywallet.cpp:24] [Construct] No wallet support compiled in!
 - 2022-02-03T15:44:32.886440Z [../../src/init.cpp:2222] [AppInitMain] Default data directory /root/.bitcoin
 - 2022-02-03T15:44:32.886447Z [../../src/init.cpp:2223] [AppInitMain] Using data directory /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/regtest
 - 2022-02-03T15:44:32.886457Z [../../src/init.cpp:2229] [AppInitMain] Config file: /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/bitcoin.conf
 - 2022-02-03T15:44:32.886465Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: regtest="1"
 - 2022-02-03T15:44:32.886471Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] bind="127.0.0.1"
 - 2022-02-03T15:44:32.886477Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] discover="0"
 - 2022-02-03T15:44:32.886482Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] dnsseed="0"
 - 2022-02-03T15:44:32.886488Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] fallbackfee="200"
 - 2022-02-03T15:44:32.886494Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] fixedseeds="0"
 - 2022-02-03T15:44:32.886499Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] keypool="1"
 - 2022-02-03T15:44:32.886504Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] listenonion="0"
 - 2022-02-03T15:44:32.886510Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] peertimeout="999999999"
 - 2022-02-03T15:44:32.886515Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] port="20300"
 - 2022-02-03T15:44:32.886523Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] rpcport="25300"
 - 2022-02-03T15:44:32.886529Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] server="1"
 - 2022-02-03T15:44:32.886534Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] shrinkdebugfile="0"
 - 2022-02-03T15:44:32.886539Z [../../src/util/system.cpp:1102] [logArgsPrefix] Config file arg: [regtest] usecashaddr="1"
 - 2022-02-03T15:44:32.886545Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: datadir="/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0"
 - 2022-02-03T15:44:32.886551Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: debug=""
 - 2022-02-03T15:44:32.886556Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: debugexclude="libevent"
 - 2022-02-03T15:44:32.886561Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: debugexclude="leveldb"
 - 2022-02-03T15:44:32.886566Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: dnsseed="0"
 - 2022-02-03T15:44:32.886571Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: fixedseeds="1"
 - 2022-02-03T15:44:32.886577Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: logsourcelocations=""
 - 2022-02-03T15:44:32.886582Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: logthreadnames=""
 - 2022-02-03T15:44:32.886588Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: logtimemicros=""
 - 2022-02-03T15:44:32.886593Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: printtoconsole=false
 - 2022-02-03T15:44:32.886598Z [../../src/util/system.cpp:1102] [logArgsPrefix] Command-line arg: uacomment="testnode-0"
 - 2022-02-03T15:44:32.886604Z [../../src/init.cpp:2246] [AppInitMain] Using at most 4096 automatic connections (1048576 file descriptors available)
 - 2022-02-03T15:44:32.898202Z [../../src/script/sigcache.cpp:88] [InitSignatureCache] Using 32 MiB out of 32 requested for signature cache, able to store 1048576 elements
 - 2022-02-03T15:44:32.902122Z [../../src/script/scriptcache.cpp:95] [InitScriptExecutionCache] Using 32 MiB out of 32 requested for script execution cache, able to store 1048576 elements
 - 2022-02-03T15:44:32.902162Z [../../src/init.cpp:2280] [AppInitMain] Script verification uses 11 additional threads
 - 2022-02-03T15:44:32.905428Z [../../src/./util/system.h:470] [TraceThread] scheduler thread start
 - 2022-02-03T15:44:32.905850Z [../../src/httpserver.cpp:198] [InitHTTPAllowList] Allowing HTTP connections from: 127.0.0.0/8 ::1/128 
 - 2022-02-03T15:44:32.905933Z [../../src/httpserver.cpp:349] [HTTPBindAddresses] Binding RPC on address ::1 port 25300
 - 2022-02-03T15:44:32.906026Z [../../src/httpserver.cpp:349] [HTTPBindAddresses] Binding RPC on address 127.0.0.1 port 25300
 - 2022-02-03T15:44:32.906064Z [../../src/httpserver.cpp:437] [InitHTTPServer] Initialized HTTP server
 - 2022-02-03T15:44:32.906071Z [../../src/httpserver.cpp:440] [InitHTTPServer] HTTP: creating work queue of depth 16
 - 2022-02-03T15:44:32.906077Z [../../src/rpc/server.cpp:344] [StartRPC] Starting RPC
 - 2022-02-03T15:44:32.906086Z [../../src/httprpc.cpp:449] [StartHTTPRPC] Starting HTTP RPC server
 - 2022-02-03T15:44:32.906092Z [../../src/httprpc.cpp:403] [InitRPCAuthentication] Using random cookie authentication.
 - 2022-02-03T15:44:32.906172Z [../../src/rpc/request.cpp:104] [GenerateAuthCookie] Generated RPC authentication cookie /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/regtest/.cookie
 - 2022-02-03T15:44:32.906182Z [../../src/httpserver.cpp:681] [RegisterHTTPHandler] Registering HTTP handler for / (exactmatch 1)
 - 2022-02-03T15:44:32.906189Z [../../src/httpserver.cpp:467] [StartHTTPServer] Starting HTTP server
 - 2022-02-03T15:44:32.906195Z [../../src/httpserver.cpp:470] [StartHTTPServer] HTTP: starting 4 worker threads
 - 2022-02-03T15:44:32.906981Z [../../src/httpserver.cpp:308] [ThreadHTTP] Entering http event loop
 - 2022-02-03T15:44:32.907131Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Loading banlist...
 - 2022-02-03T15:44:32.907186Z [../../src/banman.cpp:36] [BanMan] Loaded 0 banned node ips/subnets from banlist.dat  0ms
 - 2022-02-03T15:44:32.907445Z [../../src/net.cpp:2089] [SetTryNewOutboundPeer] net: setting try another outbound peer=false
 - 2022-02-03T15:44:32.907455Z [../../src/net.cpp:2764] [SetNetworkActive] SetNetworkActive: true
 - 2022-02-03T15:44:32.907904Z [../../src/init.cpp:2522] [AppInitMain] Using /16 prefix for IP bucketing
 - 2022-02-03T15:44:32.907946Z [../../src/init.cpp:2584] [AppInitMain] Cache configuration:
 - 2022-02-03T15:44:32.907963Z [../../src/init.cpp:2586] [AppInitMain] * Using 2.0 MiB for block index database
 - 2022-02-03T15:44:32.907970Z [../../src/init.cpp:2597] [AppInitMain] * Using 8.0 MiB for chain state database
 - 2022-02-03T15:44:32.907977Z [../../src/init.cpp:2601] [AppInitMain] * Using 1014.0 MiB for in-memory UTXO set (plus up to 286.1 MiB of unused mempool space)
 - 2022-02-03T15:44:32.907985Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Loading block index...
 - 2022-02-03T15:44:32.907993Z [../../src/validation.cpp:6044] [InitializeChainstate] Switching active chainstate to Chainstate [ibd] @ height -1 (null)
 - 2022-02-03T15:44:32.908037Z [../../src/dbwrapper.cpp:140] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/regtest/blocks/index
 - 2022-02-03T15:44:33.115951Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45058
 - 2022-02-03T15:44:33.116339Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getblockcount user=__cookie__
 - 2022-02-03T15:44:33.368534Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45060
 - 2022-02-03T15:44:33.368637Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getblockcount user=__cookie__
 - 2022-02-03T15:44:33.619381Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45062
 - 2022-02-03T15:44:33.619462Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getblockcount user=__cookie__
 - 2022-02-03T15:44:33.870307Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45064
 - 2022-02-03T15:44:33.870389Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getblockcount user=__cookie__
 - 2022-02-03T15:44:34.121305Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45066
 - 2022-02-03T15:44:34.121371Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getblockcount user=__cookie__
 - 2022-02-03T15:44:34.269736Z [../../src/dbwrapper.cpp:145] [CDBWrapper] Opened LevelDB successfully
 - 2022-02-03T15:44:34.269752Z [../../src/dbwrapper.cpp:174] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/regtest/blocks/index: 0000000000000000
 - 2022-02-03T15:44:34.270079Z [../../src/validation.cpp:4770] [LoadBlockIndexDB] LoadBlockIndexDB: last block file = 0
 - 2022-02-03T15:44:34.270095Z [../../src/validation.cpp:4775] [LoadBlockIndexDB] LoadBlockIndexDB: last block file info: CBlockFileInfo(blocks=1, size=293, heights=0...0, time=2011-02-02T23:16:42Z...2011-02-02T23:16:42Z)
 - 2022-02-03T15:44:34.270102Z [../../src/validation.cpp:4786] [LoadBlockIndexDB] Checking all blk files are present...
 - 2022-02-03T15:44:34.270136Z [../../src/dbwrapper.cpp:140] [CDBWrapper] Opening LevelDB in /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/regtest/chainstate
 - 2022-02-03T15:44:34.286009Z [../../src/dbwrapper.cpp:145] [CDBWrapper] Opened LevelDB successfully
 - 2022-02-03T15:44:34.286052Z [../../src/dbwrapper.cpp:174] [CDBWrapper] Using obfuscation key for /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/node0/regtest/chainstate: 6650376dfc00173c
 - 2022-02-03T15:44:34.286093Z [../../src/validation.cpp:4850] [LoadChainTip] Loaded best chain: hashBestChain=0f9188f13cb7b2c71f2a335e3a4fc328bf5beb436012afca590b1a11466e2206 height=0 date=2011-02-02T23:16:42Z progress=1.000000
 - 2022-02-03T15:44:34.286107Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Verifying blocks...
 - 2022-02-03T15:44:34.286127Z [../../src/init.cpp:2814] [AppInitMain]  block index            1379ms
 - 2022-02-03T15:44:34.286273Z [../../src/init.cpp:2968] [AppInitMain] block tree size = 1
 - 2022-02-03T15:44:34.286283Z [../../src/init.cpp:2984] [AppInitMain] nBestHeight = 0
 - 2022-02-03T15:44:34.286323Z [../../src/net.cpp:2694] [BindListenPort] Bound to 127.0.0.1:20300
 - 2022-02-03T15:44:34.286344Z [../../src/net.cpp:2690] [BindListenPort] Unable to bind to 127.0.0.1:18445 on this computer. Bitcoin ABC is probably already running.
 - 2022-02-03T15:44:34.286358Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Loading P2P addresses...
 - 2022-02-03T15:44:34.286497Z [../../src/net.cpp:2868] [Start] Loaded 0 addresses from peers.dat  0ms
 - 2022-02-03T15:44:34.286529Z [../../src/addrdb.cpp:175] [ReadAnchors] Loaded 0 addresses from "anchors.dat"
 - 2022-02-03T15:44:34.286551Z [../../src/./util/system.h:470] [TraceThread] loadblk thread start
 - 2022-02-03T15:44:34.286570Z [../../src/net.cpp:2886] [Start] 0 block-relay-only anchors will be tried for connections.
 - 2022-02-03T15:44:34.286581Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Starting network threads...
 - 2022-02-03T15:44:34.286646Z [../../src/validation.cpp:5911] [LoadMempool] Imported mempool transactions from disk: 0 succeeded, 0 failed, 0 expired, 0 already there, 0 waiting for initial broadcast
 - 2022-02-03T15:44:34.286659Z [../../src/./util/system.h:472] [TraceThread] loadblk thread exit
 - 2022-02-03T15:44:34.286742Z [../../src/net.cpp:2922] [Start] DNS seeding disabled
 - 2022-02-03T15:44:34.286771Z [../../src/./util/system.h:470] [TraceThread] net thread start
 - 2022-02-03T15:44:34.286828Z [../../src/noui.cpp:56] [noui_InitMessage] init message: Done loading
 - 2022-02-03T15:44:34.287056Z [../../src/./util/system.h:470] [TraceThread] opencon thread start
 - 2022-02-03T15:44:34.287153Z [../../src/./util/system.h:470] [TraceThread] addcon thread start
 - 2022-02-03T15:44:34.287367Z [../../src/./util/system.h:470] [TraceThread] msghand thread start
 - 2022-02-03T15:44:34.372275Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45068
 - 2022-02-03T15:44:34.372313Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getblockcount user=__cookie__
 - 2022-02-03T15:44:34.372716Z [../../src/httpserver.cpp:259] [http_request_cb] Received a POST request for / from 127.0.0.1:45068
 - 2022-02-03T15:44:34.372752Z [../../src/rpc/request.cpp:183] [parse] ThreadRPCServer method=getmempoolinfo user=__cookie__


2022-02-03T15:44:34.425000Z TestFramework (INFO): Stopping nodes
2022-02-03T15:44:34.626000Z TestFramework (WARNING): Not cleaning up dir /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25
2022-02-03T15:44:34.626000Z TestFramework (ERROR): Test failed. Test logging available at /work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25/test_framework.log
2022-02-03T15:44:34.626000Z TestFramework (ERROR): 
2022-02-03T15:44:34.626000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/abc-ci-builds/build-without-wallet/test/tmp/test_runner_₿₵_  _20220203_154342/feature_config_args_25' to consolidate all logs
2022-02-03T15:44:34.626000Z TestFramework (ERROR): 
2022-02-03T15:44:34.626000Z TestFramework (ERROR): If this failure happened unexpectedly or intermittently, please file a bug and provide a link or upload of the combined log.
2022-02-03T15:44:34.626000Z TestFramework (ERROR): https://github.com/Bitcoin-ABC/bitcoin-abc/issues
2022-02-03T15:44:34.626000Z TestFramework (ERROR):

Each failure log is accessible here:
Bitcoin ABC functional tests: feature_config_args.py

Fabien added a subscriber: Fabien.

See D10984 for failure

This revision is now accepted and ready to land.Feb 4 2022, 09:53
This revision was landed with ongoing or failed builds.Feb 4 2022, 11:01
This revision was automatically updated to reflect the committed changes.