Page MenuHomePhabricator

test: fix misleading fee unit in mempool_limit.py
ClosedPublic

Authored by Fabien on Jun 28 2024, 14:31.

Details

Reviewers
roqqit
Group Reviewers
Restricted Project
Commits
rABC66ee3e84ade4: test: fix misleading fee unit in mempool_limit.py
Summary
The helper `send_large_txs` in its current interface has a fee_rate
parameter, implying that it would create a transaction with exactly that
rate. Unfortunately, this fee rate is only passed to MiniWallet's
`create_self_transfer` method, which can't know that we append several
tx outputs after, increasing the tx's vsize and decreasing it's fee rate
accordingly.

In our case, the fee rate is off by several orders of magnitude, as the
tx's vsize changes changes from 96 to 67552 vbytes (>700x), i.e. the
value passed to this function is neither really a fee rate nor an
absolute fee, but something in-between, which is very confusing.

Clarify the interface by passing an absolute fee that is deducted in the end
(and verified, via testmempoolaccept) and also describe how we come up with the
value passed.

Backport of core#22972.

Depends on D16386.

Test Plan
./test/functional/test_runner.py mempool_limit

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Jun 28 2024, 14:31
roqqit requested changes to this revision.Jun 28 2024, 17:23
roqqit added a subscriber: roqqit.
roqqit added inline comments.
test/functional/mempool_limit.py
37 ↗(On Diff #48407)

From test_framework/messages.py

This revision now requires changes to proceed.Jun 28 2024, 17:23

Use XEC constant instead of the magic x100

This revision is now accepted and ready to land.Jul 1 2024, 17:59