Skip to content

Conversation

@willcl-ark
Copy link
Owner

test webhook on a pr

sdaftuar and others added 30 commits October 14, 2025 14:03
This takes the same amount of space as CTransaction pointers, and saves a map
lookup in many common uses.
Effectively this is treating all transactions in txgraph as being in a cluster
of size 1.
Preparatory commit to the rbf functional test, before changes are made to the
rbf rules as part of cluster mempool.
Include an adjustment to mempool_tests.cpp due to the additional memory used by
txgraph.

Includes a temporary change to the mempool_ephemeral_dust.py functional test,
due to validation checks being reordered. This change will revert once the RBF
rules are changed in a later commit.
Rather than evicting the transactions with the lowest descendant feerate,
instead evict transactions that have the lowest chunk feerate.

Once mining is implemented based on choosing transactions with highest chunk
feerate (see next commit), mining and eviction will be opposites, so that we
will evict the transactions that would be mined last.
The addition of a cluster size limit makes the CPFP carveout rule useless,
because carveout cannot be used to bypass the cluster size limit. Remove this
policy rule and update tests to no longer rely on the behavior.
With a total ordering on mempool transactions, we are now able to calculate a
transaction's mining score at all times. Use this to improve the RBF logic:

- we no longer enforce a "no new unconfirmed parents" rule

- we now require that the mempool's feerate diagram must improve in order
  to accept a replacement

- the topology restrictions for conflicts in the package rbf setting have been
  eliminated

Revert the temporary change to mempool_ephemeral_dust.py that were previously
made due to RBF validation checks being reordered.

Co-authored-by: Gregory Sanders <[email protected]>, glozow <[email protected]>
Previously, transaction batches were first sorted by ancestor count and then
feerate, to ensure transactions are announced in a topologically valid order,
while prioritizing higher feerate transactions. Ancestor count is a crude
topological sort criteria, so replace this with linearization order so that the
highest feerate transactions (as would be observed by the mining algorithm) are
relayed before lower feerate ones, in a topologically valid way.

This also fixes a test that only worked due to the ancestor-count-based sort
order.
The mempool clusters and linearization permit sorting the mempool topologically
without making use of ancestor counts (as long as the graph is not oversized).

Co-authored-by: Pieter Wuille <[email protected]>
In preparation for removing ancestor data from CTxMemPoolEntry, recalculate the
ancestor statistics on demand wherever needed.
The cluster limits should be sufficient.

Co-Authored-By: Gregory Sanders <[email protected]>
sdaftuar and others added 20 commits October 14, 2025 14:03
Changes AddToMempool() helper to only apply changes if the mempool limits are
respected.

Fix package_rbf fuzz target to handle mempool policy violations
Add benchmarks for:

  - mempool update time when blocks are found
  - adding a transaction
  - performing the mempool's RBF calculation
  - calculating mempool ancestors/descendants
Including test coverage for mempool eviction and expiry
This is in preparation for eliminating the block template building happening in
mini_miner, in favor of directly using the linearizations done in the mempool.
…ScoreWithTopology()

We use CompareMiningScoreWithTopology() for sorting transaction announcements
during tx relay, and we use GetSortedScoreWithTopology() in
CTxMemPool::check().
Calculating mempool ancestors for a new transaction should not be done until
after cluster size limits have been enforced, to limit CPU DoS potential.

Achieve this by reworking TRUC and RBF validation logic:

- TRUC policy enforcement is now done using only mempool parents of
  new transactions, not all mempool ancestors.
- RBF replacement checks are performed earlier (which allows for checking
  cluster size limits earlier, because cluster size checks cannot happen until
  after all conflicts are staged for removal).
- Verifying that a new transaction doesn't conflict with an ancestor now
  happens later, in AcceptSingleTransaction() rather than in PreChecks(). This
  means that the test is not performed at all in AcceptMultipleTransactions(),
  but in package acceptance we already disallow RBF in situations where a
  package transaction has in-mempool parents.

Also to ensure that all RBF validation logic is applied in both the single
transaction and multiple transaction cases, remove the optimization that skips
the PackageMempoolChecks() in the case of a single transaction being validated
in AcceptMultipleTransactions().
Repository owner deleted a comment from guix-builder Oct 15, 2025
@guix-builder
Copy link

guix-builder commented Oct 15, 2025

Guix build:

  • CPU: 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz (16 cores, 16 build jobs)
  • RAM: 62 GB
  • OS: NixOS 25.11
  • Arch: x86_64

Hashes:

536c5bf2d90c72f13f26225cab899ac9e9ec97fc2e422ad358a1a946e669bc27  guix-build-d3f8b6380f16/output/aarch64-linux-gnu/SHA256SUMS.part
0e4427634ed6fcdc859c63787fa1158111359def94676f8983a5faf3ac765768  guix-build-d3f8b6380f16/output/aarch64-linux-gnu/bitcoin-d3f8b6380f16-aarch64-linux-gnu-debug.tar.gz
d52f96a2dd5d21bbd380449a04ffe304b01e15e7f08648948ce155e2ba688b90  guix-build-d3f8b6380f16/output/aarch64-linux-gnu/bitcoin-d3f8b6380f16-aarch64-linux-gnu.tar.gz
519c7a8b6c0fbf508abf983679aba5569b47fcb3c7f9e6db6eff6ff06968713e  guix-build-d3f8b6380f16/output/arm-linux-gnueabihf/SHA256SUMS.part
2c26f320f7f53eef06378881e4a83080731b61583cbb4b4a60bce9bac32bffdc  guix-build-d3f8b6380f16/output/arm-linux-gnueabihf/bitcoin-d3f8b6380f16-arm-linux-gnueabihf-debug.tar.gz
cb1b9842812c6b2f57751daee23fd51cd92b99275bc45908ab8f1db5029ad378  guix-build-d3f8b6380f16/output/arm-linux-gnueabihf/bitcoin-d3f8b6380f16-arm-linux-gnueabihf.tar.gz
9cd112aaa4efb5b47ea45ca5b72d117172f8b4034703657c2f4775a50086e28a  guix-build-d3f8b6380f16/output/arm64-apple-darwin/SHA256SUMS.part
48308737c69ee9b1ca91f09f3f2c8e47cead66b2beeef38e188cb46a004e5d94  guix-build-d3f8b6380f16/output/arm64-apple-darwin/bitcoin-d3f8b6380f16-arm64-apple-darwin-codesigning.tar.gz
c05bd6569aa0bbc928f500bb4d0efd17678dd6facb0a5743e638ad6778c90361  guix-build-d3f8b6380f16/output/arm64-apple-darwin/bitcoin-d3f8b6380f16-arm64-apple-darwin-unsigned.tar.gz
09eba43b78b5c51012409bfb5926b9386186980d0c0c8acda5977512c9dbc7b0  guix-build-d3f8b6380f16/output/arm64-apple-darwin/bitcoin-d3f8b6380f16-arm64-apple-darwin-unsigned.zip
756dbb0d7c1405b8f96c06900c4280c0cab1e73740b82e98505ea8fae658249c  guix-build-d3f8b6380f16/output/dist-archive/bitcoin-d3f8b6380f16.tar.gz
74f259754297f3a06c237a427e2a8bf0074bd3338f2443899aa118078dfb374f  guix-build-d3f8b6380f16/output/powerpc64-linux-gnu/SHA256SUMS.part
b215af5f1a065a30c4528980e8afec59a6a5d8273fd82e258dd4e64430525eda  guix-build-d3f8b6380f16/output/powerpc64-linux-gnu/bitcoin-d3f8b6380f16-powerpc64-linux-gnu-debug.tar.gz
955d541a2c5636a3e45f7f45bc5304e390b70b8492b79871e55c6df024068712  guix-build-d3f8b6380f16/output/powerpc64-linux-gnu/bitcoin-d3f8b6380f16-powerpc64-linux-gnu.tar.gz
3774485118a6f94b0125213117711e58d8c42b7e219a19f31ad5187d3bd9d7f4  guix-build-d3f8b6380f16/output/riscv64-linux-gnu/SHA256SUMS.part
fe1405c1548f5f90b6b1432f038c6a4d490460fefa030b42a84f4a82e4372d07  guix-build-d3f8b6380f16/output/riscv64-linux-gnu/bitcoin-d3f8b6380f16-riscv64-linux-gnu-debug.tar.gz
39d7e9ca35a4ba3c5829bff484a0db26de04608b33d15f1883cc6efa3595a39f  guix-build-d3f8b6380f16/output/riscv64-linux-gnu/bitcoin-d3f8b6380f16-riscv64-linux-gnu.tar.gz
1dab0172d36885d7c654f62c4d7fa7317e7ba96aea4c3e62edaf613773e2ddf5  guix-build-d3f8b6380f16/output/x86_64-apple-darwin/SHA256SUMS.part
38f478a38946e354af806391e8291aa6ce8355f45209d7506dc5fe22a2c57626  guix-build-d3f8b6380f16/output/x86_64-apple-darwin/bitcoin-d3f8b6380f16-x86_64-apple-darwin-codesigning.tar.gz
4c44b7095e1fd281abc667d7372a54295b7aa8f0cc122a3d469989c92e71eca4  guix-build-d3f8b6380f16/output/x86_64-apple-darwin/bitcoin-d3f8b6380f16-x86_64-apple-darwin-unsigned.tar.gz
b184457525810706e01ceaab47af1a685c219ccecbd129140ea5e2a21406f4aa  guix-build-d3f8b6380f16/output/x86_64-apple-darwin/bitcoin-d3f8b6380f16-x86_64-apple-darwin-unsigned.zip
52d136cf492d58ef954c6cfcec469645d9575c9168adb3f8dee61438026d42f6  guix-build-d3f8b6380f16/output/x86_64-linux-gnu/SHA256SUMS.part
cdb885bbc8da73d4dc4c99f93cad0bc79a3f483540e575e3b9c78cb739c05022  guix-build-d3f8b6380f16/output/x86_64-linux-gnu/bitcoin-d3f8b6380f16-x86_64-linux-gnu-debug.tar.gz
f83ef875c08b5ee8a236e074dc3eec123313aba96b518750d16afe1dfa63603a  guix-build-d3f8b6380f16/output/x86_64-linux-gnu/bitcoin-d3f8b6380f16-x86_64-linux-gnu.tar.gz
94c1cb345af5bb9223c525582c6d097892d3c466cb07b9f0cd0b5ab77f49c92b  guix-build-d3f8b6380f16/output/x86_64-w64-mingw32/SHA256SUMS.part
7e1f2a15bece4b737e2dd60f4d17e00b942806f5663844fc5491c499ca95d15b  guix-build-d3f8b6380f16/output/x86_64-w64-mingw32/bitcoin-d3f8b6380f16-win64-codesigning.tar.gz
5bb1485b37272414ea018e349cf800a3a572765990c9a85af4d1e249b224eaca  guix-build-d3f8b6380f16/output/x86_64-w64-mingw32/bitcoin-d3f8b6380f16-win64-debug.zip
14230be3562d58169d791635f770532d57d5c09f409f6fea9d7fe1f7329a47de  guix-build-d3f8b6380f16/output/x86_64-w64-mingw32/bitcoin-d3f8b6380f16-win64-setup-unsigned.exe
d336f5c11b671247b1475aaea1d03289f73c987b2bfb93c7fabe26fc20fa498b  guix-build-d3f8b6380f16/output/x86_64-w64-mingw32/bitcoin-d3f8b6380f16-win64-unsigned.zip

Repository owner deleted a comment from guix-builder Oct 15, 2025
Repository owner deleted a comment from guix-builder Oct 15, 2025
Repository owner deleted a comment from guix-builder Oct 15, 2025
@github-actions github-actions bot force-pushed the master branch 3 times, most recently from 97ed557 to e472e80 Compare October 28, 2025 23:54
@willcl-ark willcl-ark force-pushed the master branch 2 times, most recently from 3108440 to 2370337 Compare October 30, 2025 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants