0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-02-08 10:31:50 -05:00
bitcoin-bitcoin-core/test/functional/test_framework
Ava Chow 1e0c5bd74a
Merge bitcoin/bitcoin#30125: test: improve BDB parser (handle internal/overflow pages, support all page sizes)
d45eb3964f test: compare BDB dumps of test framework parser and wallet tool (Sebastian Falbesoner)
01ddd9f646 test: complete BDB parser (handle internal/overflow pages, support all page sizes) (Sebastian Falbesoner)

Pull request description:

  This PR adds missing features to our test framework's BDB parser with the goal of hopefully being able to read all legacy wallets that are created with current and past versions of Bitcoin Core. This could be useful both for making review of https://github.com/bitcoin/bitcoin/pull/26606 easier and to also possibly improve our functional tests for the wallet BDB-ro parser by additionally validating it with an alternative implementation. The second commits introduces a test that create a legacy wallet with huge label strings (in order to create overflow pages, i.e. pages needed for key/value data than is larger than the page size) and compares the dump outputs of wallet tool and the extended test framework BDB parser.
  It can be exercised via `$ ./test/functional/tool_wallet.py --legacy`. BDB support has to be compiled in (obviously).

  For some manual tests regarding different page sizes, the following patch can be used:
  ```diff
  diff --git a/src/wallet/bdb.cpp b/src/wallet/bdb.cpp
  index 38cca32f80..1bf39323d3 100644
  --- a/src/wallet/bdb.cpp
  +++ b/src/wallet/bdb.cpp
  @@ -395,6 +395,7 @@ void BerkeleyDatabase::Open()
                               DB_BTREE,                                 // Database type
                               nFlags,                                   // Flags
                               0);
  +            pdb_temp->set_pagesize(1<<9); /* valid BDB pagesizes are from 1<<9 (=512) to <<16 (=65536) */

               if (ret != 0) {
                   throw std::runtime_error(strprintf("BerkeleyDatabase: Error %d, can't open database %s", ret, strFile));
  ```
  I verified that the newly introduced test passes with all valid page sizes between 512 and 65536.

ACKs for top commit:
  achow101:
    ACK d45eb3964f
  furszy:
    utACK d45eb3964f
  brunoerg:
    code review ACK d45eb3964f

Tree-SHA512: 9f8ac80452545f4fcd24a17ea6f9cf91b487cfb1fcb99a0ba9153fa4e3b239daa126454e26109fdcb72eb1c76a4ee3b46fd6af21dc318ab67bd12b3ebd26cfdd
2025-01-29 15:56:36 -05:00
..
crypto crypto: add NUMS_H const 2024-05-14 10:24:31 +02:00
__init__.py
address.py test: check that keyless P2A 'signing' via signrawtransactionwithkey succeeds 2024-08-02 20:13:07 +02:00
authproxy.py test: report failure during utf8 response decoding 2024-11-11 10:45:01 -05:00
bdb.py test: complete BDB parser (handle internal/overflow pages, support all page sizes) 2024-10-24 14:23:54 +02:00
bip340_test_vectors.csv
blockfilter.py Merge bitcoin/bitcoin#28605: Fix typos 2023-11-16 10:35:49 +00:00
blocktools.py test: check difficulty adjustment using alternate mainnet 2025-01-22 12:31:46 +01:00
coverage.py test: fix PEP484 no implicit optional argument types errors 2023-06-29 16:14:07 -06:00
descriptors.py
key.py test: Rename early key response test and move random_bitflip to util 2024-03-11 12:58:20 +05:30
mempool_util.py assert_mempool_contents: assert not duplicates expected 2024-11-20 13:49:41 -05:00
messages.py test: Avoid F541 (f-string without any placeholders) 2024-12-05 08:39:09 +01:00
netutil.py test: avoid generating non-loopback traffic from p2p_seednode.py 2025-01-14 09:20:58 +01:00
p2p.py test: Avoid logging error when logging error 2024-12-03 09:40:18 +01:00
psbt.py test: PSBT: eliminate magic numbers for global unsigned tx key (0) 2023-03-04 12:43:38 +01:00
script.py test: Make leaf_script mandatory when scriptpath is set in TaprootSignatureMsg 2024-07-31 09:57:42 +02:00
script_util.py test: Add anchor mempool acceptance test 2024-07-30 14:06:58 -04:00
segwit_addr.py
socks5.py test: Avoid F541 (f-string without any placeholders) 2024-12-05 08:39:09 +01:00
test_framework.py Merge bitcoin/bitcoin#31620: test: Remove --noshutdown flag, Tidy startup failures 2025-01-28 10:11:18 +00:00
test_node.py Merge bitcoin/bitcoin#31620: test: Remove --noshutdown flag, Tidy startup failures 2025-01-28 10:11:18 +00:00
test_shell.py test: fix TestShell initialization (late follow-up for #30463) 2024-08-25 20:57:22 +02:00
util.py qa: Limit -maxconnections in tests 2024-12-19 15:04:22 +00:00
v2_p2p.py test: Check that disconnection happens when >4095 garbage bytes is sent 2024-06-21 19:37:13 +05:30
wallet.py test: raise an error when target_vsize is below tx virtual size 2025-01-08 09:35:02 -05:00
wallet_util.py Fix typos in description.md and wallet_util.py 2024-04-25 16:14:10 +08:00