Commit Graph

602 Commits

Author SHA1 Message Date
Luke Dashjr
07464b1321 Merge mining_priority 2025-03-05 03:27:08 +00:00
Luke Dashjr
fcb36072f9 Merge 19117 via rpc_getrpcwhitelist 2025-03-05 03:27:08 +00:00
Luke Dashjr
612e113fcd Merge 17958 via rpc_getgeneralinfo 2025-03-05 03:27:08 +00:00
Luke Dashjr
f6400ffc58 Merge 15218 via postibd_flush-28 2025-03-05 03:27:08 +00:00
Luke Dashjr
647dcf1fe7 Merge 9152 via sweepprivkeys 2025-03-05 03:27:08 +00:00
Luke Dashjr
ffec05ceed Merge 8751 via sort-multisigs-28+knots 2025-03-05 03:27:08 +00:00
Luke Dashjr
7a279182b1 Merge 30860 via bashcomp_bcli_generate-28 2025-03-05 03:27:08 +00:00
Luke Dashjr
ad863b5a7b Merge 30793 via rpc_getorphantxs-28+knots 2025-03-05 03:27:08 +00:00
Luke Dashjr
9165f95006 Merge 30708 via rpc_getdescriptoractivity-28 2025-03-05 03:27:08 +00:00
Luke Dashjr
64f3666c9e Merge 27351 via codex32-28+knots 2025-03-05 03:27:08 +00:00
Luke Dashjr
f20be3bb5b Merge 23387 via rpc_savefeeestimates 2025-03-05 03:27:08 +00:00
Luke Dashjr
34b69da316 Merge 20702 via rpc_getblocklocations 2025-03-05 03:27:08 +00:00
Luke Dashjr
b891a04599 Merge 15836 via fee_histogram+pr15836_api 2025-03-05 03:27:08 +00:00
Luke Dashjr
efeece9f03 Merge lint_relaxer-28+knots 2025-03-05 03:27:08 +00:00
Luke Dashjr
5faa5027fa QA: Allow test_runner to pass without full RPC coverage 2025-02-25 19:38:14 +00:00
Luke Dashjr
e13f3fd693 QA: mining_coin_age_priority: Test both GBT and RPC in one pass 2025-02-21 23:41:44 +00:00
Luke Dashjr
069415f466 Test: Add test for coin-age priority mining 2025-02-21 23:41:44 +00:00
Kiminuo
1d566c067c test: Add mempool fee histogram test coverage
Original commit: 0b6ba66238

Co-authored-by: João Barbosa <joao.paulo.barbosa@gmail.com>
Co-authored-by: Jon Atack <jon@atack.com>

Github-Pull: #21422
Rebased-From: c5e53d0d21
2025-02-21 23:31:39 +00:00
Harris
2c172d3a0d RPC: Add getrpcwhitelist method 2025-02-21 16:34:12 +00:00
Luke Dashjr
12c22b8235 rpc: implement getgeneralinfo 2025-02-21 16:33:26 +00:00
Andrew Toth
bbcec3aed7 test: add test for SyncCoinsTipAfterChainSync
Github-Pull: #15218
Rebased-From: 8887d28a014420668801d7e4c5d1bf45c5e93684
2025-02-21 16:31:20 +00:00
Luke Dashjr
05c676d090 QA: Functional test for sweepprivkeys 2025-02-21 16:29:15 +00:00
Luke Dashjr
9a8e02f531 Merge branch 'rpc_getblocklocations' into sweepprivkeys 2025-02-21 16:28:29 +00:00
Thomas Kerin
c22a69eed1 RPC: addmultisigaddress / createmultisig: parameterize _createmultisig_redeemScript to allow sorting of public keys (BIP67) 2025-02-21 16:26:25 +00:00
Lawrence Nahum
df969b672f add support to save fee estimates without shutting down the node 2025-02-21 16:15:34 +00:00
Roman Zeyde
620e79b72f RPC: Add getblocklocations call
This RPC allows the client to retrieve the file system locations
of the confirmed blocks and their undo data, to allow building
efficient indexes outside of Bitcoin Core.

An example usage is described here:
https://github.com/romanz/electrs/issues/308

By using the new RPC, it is possible to build an address-based
index taking ~24GB and a txindex taking ~6GB (as of Dec. 2020).
2025-02-21 16:15:05 +00:00
Martin Zumsande
a0585b6087
test: add functional test for -port behavior
Github-Pull: bitcoin/bitcoin#31223
Rebased-From: 997757dd2b
2024-12-13 21:15:26 -05:00
James O'Beirne
5343de23c4 rpc: add getdescriptoractivity
Github-Pull: #30708
Rebased-From: 811f76f3a5
2024-11-27 20:36:06 +00:00
Brandon Odiwuor
7dd6f5b7fc test: keeps bitcoin-cli autocomplete in sync
Adds a functional test which parses available RPC commands, generates
the associated bitcoin-cli autcomplete file and checks that the current
autocomplete matches the file
An outdated autcomplete file can be updated using the --overwrite parameter

Co-authored-by: pierrenn <git@pnn.sh>

Github-Pull: #30860
Rebased-From: 7c8b021fee3b528ff28b85ec2e8933ebc5b2b488
2024-11-15 15:40:11 +00:00
tdb3
700c917c6d refactor: rename rpc_getorphantxs to rpc_orphans
Generalizes the test to accommodate additional
orphan-related RPCs

Github-Pull: #31043
Rebased-From: 56bf302714
2024-11-15 05:18:58 +00:00
tdb3
4e9d1d5b8e test: add getorphantxs tests
Adds functional tests for getorphantxs

Github-Pull: #30793
Rebased-From: 98c1536852
2024-11-15 05:18:58 +00:00
Andrew Poelstra
de53d61a18 codex32: add functional test for seed import
Github-Pull: #27351
Rebased-From: 91771366a3df22b9e8b4b7152d368d739bfeda94
2024-11-13 20:51:48 +00:00
Sebastian Falbesoner
faa1b9b0e6 test: add functional test for XORed block/undo files (-blocksxor) 2024-08-14 17:38:28 +02:00
Ava Chow
c51c694ede
Merge bitcoin/bitcoin#29431: test/BIP324: disconnection scenarios during v2 handshake
c9dacd958d test: Check that non empty version packet is ignored and no disconnection happens (stratospher)
997cc00b95 test: Check that disconnection happens when AAD isn't filled (stratospher)
b5e6238fdb test: Check that disconnection happens when garbage sent/received are different (stratospher)
ad1482d5a2 test: Check that disconnection happens when wrong garbage terminator is sent (stratospher)
e351576862 test: Check that disconnection happens when >4095 garbage bytes is sent (stratospher)
e075fd131d test: Introduce test types and modify v2 handshake function accordingly (stratospher)
7d07daa623 log: Add V2 handshake timeout (stratospher)
d4a1da8543 test: Make global TRANSPORT_VERSION variable an instance variable (stratospher)
c642b08c4e test: Log when the garbage is actually sent to transport layer (stratospher)
86cca2cba2 test: Support disconnect waiting for add_p2p_connection (stratospher)
bf9669af9c test: Rename early key response test and move random_bitflip to util (stratospher)

Pull request description:

  Add tests for the following v2 handshake scenarios:
  1. Disconnection happens when > `MAX_GARBAGE_LEN` bytes garbage is sent
  2. Disconnection happens when incorrect garbage terminator is sent
  3. Disconnection happens when garbage bytes are tampered with
  4. Disconnection happens when AAD of first encrypted packet after the garbage terminator is not filled
  5. bitcoind ignores non-empty version packet and no disconnection happens

  All these tests require a modified v2 P2P class (different from `EncryptedP2PState` used in `v2_p2p.py`) to implement our custom handshake behaviour based on different scenarios and have been kept in a single test file (`test/functional/p2p_v2_misbehaving.py`). Shifted the test in `test/functional/p2p_v2_earlykeyresponse.py` which is of the same pattern to this file too.

ACKs for top commit:
  achow101:
    ACK c9dacd958d
  mzumsande:
    ACK c9dacd958d
  theStack:
    Code-review ACK c9dacd958d

Tree-SHA512: 90df81f0c7f4ecf0a47762d290a618ded92cde9f83d3ef3cc70e1b005ecb16125ec39a9d80ce95f99e695d29abd63443240cb5490aa57c5bc8fa2e52149a0672
2024-07-09 16:37:27 -04:00
glozow
089b5757df rename mempool_accept_v3.py to mempool_truc.py 2024-07-02 11:57:59 +01:00
Ava Chow
41544b8f96
Merge bitcoin/bitcoin#28984: Cluster size 2 package rbf
94ed4fbf8e Add release note for size 2 package rbf (Greg Sanders)
afd52d8e63 doc: update package RBF comment (Greg Sanders)
6e3c4394cf mempool: Improve logging of replaced transactions (Greg Sanders)
d3466e4cc5 CheckPackageMempoolAcceptResult: Check package rbf invariants (Greg Sanders)
316d7b63c9 Fuzz: pass mempool to CheckPackageMempoolAcceptResult (Greg Sanders)
4d15bcf448 [test] package rbf (glozow)
dc21f61c72 [policy] package rbf (Suhas Daftuar)
5da3967815 PackageV3Checks: Relax assumptions (Greg Sanders)

Pull request description:

  Allows any 2 transaction package with no in-mempool ancestors to do package RBF when directly conflicting with other mempool clusters of size two or less.

  Proposed validation steps:
  1) If the transaction package is of size 1, legacy rbf rules apply.
  2) Otherwise the transaction package consists of a (parent, child) pair with no other in-mempool ancestors (or descendants, obviously), so it is also going to create a cluster of size 2. If larger, fail.
  3) The package rbf may not evict more than 100 transactions from the mempool(bip125 rule 5)
  4) The package is a single chunk
  5) Every directly conflicted mempool transaction is connected to at most 1 other in-mempool transaction (ie the cluster size of the conflict is at most 2).
  6) Diagram check: We ensure that the replacement is strictly superior, improving the mempool
  7) The total fee of the package, minus the total fee of what is being evicted, is at least the minrelayfee * size of the package (equivalent to bip125 rule 3 and 4)

  Post-cluster mempool this will likely be expanded to general package rbf, but this is what we can safely support today.

ACKs for top commit:
  achow101:
    ACK 94ed4fbf8e
  glozow:
    reACK 94ed4fbf8e via range-diff
  ismaelsadeeq:
    re-ACK 94ed4fbf8e
  theStack:
    Code-review ACK 94ed4fbf8e
  murchandamus:
    utACK 94ed4fbf8e

Tree-SHA512: 9bd383e695964f362f147482bbf73b1e77c4d792bda2e91d7f30d74b3540a09146a5528baf86854a113005581e8c75f04737302517b7d5124296bd7a151e3992
2024-06-17 17:22:43 -04:00
tdb3
ad06e68399
test: write functional test results to csv
Adds argument --resultsfile to test_runner.py.
Writes comma-separated functional test name, status,
and duration to the file provided with the argument.
Also fixes minor typo in test_runner.py
2024-06-16 22:51:12 -04:00
glozow
4d15bcf448 [test] package rbf 2024-06-13 09:52:59 -04:00
Sebastian Falbesoner
b2f0a9f8b0 test: add framework functional test for MiniWallet's tx padding 2024-05-31 00:12:00 +02:00
merge-script
5acdc2b97d
Merge bitcoin/bitcoin#26606: wallet: Implement independent BDB parser
d51fbab4b3 wallet, test: Be able to always swap BDB endianness (Ava Chow)
0b753156ce test: Test bdb_ro dump of wallet without reset LSNs (Ava Chow)
c1984f1282 test: Test dumping dbs with overflow pages (Ava Chow)
fd7b16e391 test: Test dumps of other endian BDB files (Ava Chow)
6ace3e953f bdb: Be able to make byteswapped databases (Ava Chow)
d9878903fb Error if LSNs are not reset (Ava Chow)
4d7a3ae78e Berkeley RO Database fuzz test (TheCharlatan)
3568dce9e9 tests: Add BerkeleyRO to db prefix tests (Ava Chow)
70cfbfdadf wallettool: Optionally use BERKELEY_RO as format when dumping BDB wallets (Ava Chow)
dd57713f6e Add MakeBerkeleyRODatabase (Ava Chow)
6e50bee67d Implement handling of other endianness in BerkeleyRODatabase (Ava Chow)
cdd61c9cc1 wallet: implement independent BDB deserializer in BerkeleyRODatabase (Ava Chow)
ecba230979 wallet: implement BerkeleyRODatabase::Backup (Ava Chow)
0c8e728476 wallet: implement BerkeleyROBatch (Ava Chow)
756ff9b478 wallet: add dummy BerkeleyRODatabase and BerkeleyROBatch classes (Ava Chow)
ca18aea5c4 Add AutoFile::seek and tell (Ava Chow)

Pull request description:

  Split from #26596

  This PR adds `BerkeleyRODatabase` which is an independent implementation of a BDB file parser. It provides read only access to a BDB file, and can therefore be used as a read only database backend for wallets. This will be used for dumping legacy wallet records and migrating legacy wallets without the need for BDB itself.

  Wallettool's `dump` command is changed to use `BerkeleyRODatabase` instead of `BerkeleyDatabase` (and `CWallet` itself) to demonstrate that this parser works and to test it against the existing wallettool functional tests.

ACKs for top commit:
  josibake:
    reACK d51fbab4b3
  TheCharlatan:
    Re-ACK d51fbab4b3
  furszy:
    reACK d51fbab4b3
  laanwj:
    re-ACK d51fbab4b3
  theStack:
    ACK d51fbab4b3

Tree-SHA512: 1e7b97edf223b2974eed2e9eac1179fc82bb6359e0a66b7d2a0c8b9fa515eae9ea036f1edf7c76cdab2e75ad994962b134b41056ccfbc33b8d54f0859e86657b
2024-05-21 10:05:09 +01:00
Ava Chow
d51fbab4b3 wallet, test: Be able to always swap BDB endianness 2024-05-16 15:03:13 -04:00
Ava Chow
70cfbfdadf wallettool: Optionally use BERKELEY_RO as format when dumping BDB wallets
In order to ease the transition to not having BDB, make the dump tool
use DatabaseFormmat::BERKELEY_RO when -withinternalbdb is set.
2024-05-16 15:03:13 -04:00
Ava Chow
012e540ace
Merge bitcoin/bitcoin#29122: test: adds outbound eviction functional tests, updates comment in ConsiderEviction
d53d848347 test: adds outbound eviction tests for non outbound-full-relay peers (Sergi Delgado Segura)
a8d9a0edc7 test: adds outbound eviction functional tests, updates comment in ConsiderEviction (Sergi Delgado Segura)

Pull request description:

  ## Motivation

  While checking the outbound eviction code I realized a case was not considered within the comments, which in turn made me realize we had no functional tests for the outbound eviction case (when I went to check/add the test case).

  This PR updates the aforementioned comment and adds functional tests to cover the outbound eviction logic, in addition to the existing unit tests found at `src/test/denialofservice_tests.cpp`.

ACKs for top commit:
  davidgumberg:
    reACK d53d848347
  tdb3:
    Re ACK for d53d848347
  achow101:
    ACK d53d848347
  cbergqvist:
    ACK d53d848347

Tree-SHA512: 633b84bb1229fe21e2f650c1beada33ca7f190b64eafd64df2266516d21175e5d652e019ff7114f00cb8bd19f5817dc19e65adf75767a88e24dc0842ce40c63e
2024-05-09 16:20:43 -04:00
Ava Chow
8a45f572b9
Merge bitcoin/bitcoin#29335: test: Handle functional test disk-full error
357ad11054 test: Handle functional test disk-full error (Brandon Odiwuor)

Pull request description:

  Fixes: https://github.com/bitcoin/bitcoin/issues/23099

  Handle disk-full more gracefully in functional tests

ACKs for top commit:
  itornaza:
    re-ACK 357ad11054
  achow101:
    reACK 357ad11054
  cbergqvist:
    reACK 357ad11054. Looks good!
  tdb3:
    re ACK for 357ad11054

Tree-SHA512: 9bb0d3fbe84600c88873b9f55d4b5d1443f79ec303467680c301be2b4879201387f203d9d1984169461f321037189b5e10a6a4b9d61750de638f072d2f95d77e
2024-05-08 18:11:35 -04:00
Ava Chow
d813ba1bc4
Merge bitcoin/bitcoin#28970: p2p: opportunistically accept 1-parent-1-child packages
e518a8bf8a [functional test] opportunistic 1p1c package submission (glozow)
87c5c524d6 [p2p] opportunistically accept 1-parent-1-child packages (glozow)
6c51e1d7d0 [p2p] add separate rejections cache for reconsiderable txns (glozow)
410ebd6efa [fuzz] break out parent functions and add GetChildrenFrom* coverage (glozow)
d095316c1c [unit test] TxOrphanage::GetChildrenFrom* (glozow)
2f51cd680f [txorphanage] add method to get all orphans spending a tx (glozow)
092c978a42 [txpackages] add canonical way to get hash of package (glozow)
c3c1e15831 [doc] restore comment about why we check if ptx HasWitness before caching rejected txid (glozow)
6f4da19cc3 guard against MempoolAcceptResult::m_replaced_transactions (glozow)

Pull request description:

  This enables 1p1c packages to propagate in the "happy case" (i.e. not reliable if there are adversaries) and contains a lot of package relay-related code. See https://github.com/bitcoin/bitcoin/issues/27463 for overall package relay tracking.

  Rationale: This is "non-robust 1-parent-1-child package relay" which is immediately useful.
  - Relaying 1-parent-1-child CPFP when mempool min feerate is high would be a subset of all package relay use cases, but a pretty significant improvement over what we have today, where such transactions don't propagate at all. [1]
  - Today, a miner can run this with a normal/small maxmempool to get revenue from 1p1c CPFP'd transactions without losing out on the ones with parents below mempool minimum feerate.
  - The majority of this code is useful for building more featureful/robust package relay e.g. see the code in #27742.

  The first 2 commits are followups from #29619:
  - https://github.com/bitcoin/bitcoin/pull/29619#discussion_r1523094034
  - https://github.com/bitcoin/bitcoin/pull/29619#discussion_r1519819257

  Q: What makes this short of a more full package relay feature?

  (1) it only supports packages in which 1 of the parents needs to be CPFP'd by the child. That includes 1-parent-1-child packages and situations in which the other parents already pay for themselves (and are thus in mempool already when the package is submitted). More general package relay is a future improvement that requires more engineering in mempool and validation - see #27463.

  (2) We rely on having kept the child in orphanage, and don't make any attempt to protect it while we wait to receive the parent. If we are experiencing a lot of orphanage churn (e.g. an adversary is purposefully sending us a lot of transactions with missing inputs), we will fail to submit packages. This limitation has been around for 12+ years, see #27742 which adds a token bucket scheme for protecting package-related orphans at a limited rate per peer.

  (3) Our orphan-handling logic is somewhat opportunistic; we don't make much effort to resolve an orphan beyond asking the child's sender for the parents. This means we may miss packages if the first sender fails to give us the parent (intentionally or unintentionally). To make this more robust, we need receiver-side logic to retry orphan resolution with multiple peers. This is also an existing problem which has a proposed solution in #28031.

  [1]: see this writeup and its links 02ec218c78/bip-0331.mediawiki (propagate-high-feerate-transactions)

ACKs for top commit:
  sr-gi:
    tACK e518a8bf8a
  instagibbs:
    reACK e518a8bf8a
  theStack:
    Code-review ACK e518a8bf8a 📦
  dergoegge:
    light Code review ACK e518a8bf8a
  achow101:
    ACK e518a8bf8a

Tree-SHA512: 632579fbe7160cb763bbec6d82ca0dab484d5dbbc7aea90c187c0b9833b8d7c1e5d13b8587379edd3a3b4a02a5a1809020369e9cd09a4ebaf729921f65c15943
2024-04-30 18:40:53 -04:00
Brandon Odiwuor
357ad11054 test: Handle functional test disk-full error 2024-04-29 13:46:02 +03:00
Sergi Delgado Segura
a8d9a0edc7 test: adds outbound eviction functional tests, updates comment in ConsiderEviction 2024-04-26 11:14:20 -04:00
glozow
e518a8bf8a [functional test] opportunistic 1p1c package submission 2024-04-26 11:27:37 +01:00
tdb3
f19f0a2e5a
test: Run framework unit tests in parallel
Reorganize functional test framework unit tests to run in parallel
with other functional tests.

The option `skipunit` is removed, since unit tests no longer delay
functional test execution.

Unit tests are run by default when running all tests, and can be
run explicitly with `feature_framework_unit_tests.py` when running
a subset of tests.
2024-04-23 20:26:42 -04:00
Sebastian Falbesoner
6d91cb781c test: add unit tests for calculate_input_weight 2024-04-05 01:09:31 +02:00