Page MenuHomePhabricator

test: MiniWallet: skip mempool check if `mempool_valid=False`
ClosedPublic

Authored by Fabien on Dec 2 2022, 14:14.

Details

Summary
MiniWallet's core method for creating txs (`create_self_transfer`)
right now always executes the `testmempoolaccept` RPC to check for
mempool validity or invalidity. In some test cases where we use
MiniWallet to create a huge number of transactions this can lead
to performance issues (e.g. feature_fee_estimation.py where the
execution time after MiniWallet usage almost doubled). Providing
the possibility to skip the mempool checks is a mitigation for
this.

Backport of core#24941.

The first commit is not backported because we diverged a lot from the core test and didn't convert it to MiniWallet yet, and the sign_tx function (which is not in our codebase yet) trivially needs the rehash anyway. So only this commit is relevant:
https://github.com/bitcoin/bitcoin/pull/24941/commits/a498acce4514d83d8dafcebaad522a89b6dc70fa

Test Plan
ninja check-functional

Diff Detail

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

Event Timeline

Fabien requested review of this revision.Dec 2 2022, 14:14
sdulfari requested changes to this revision.Dec 2 2022, 16:59
sdulfari added a subscriber: sdulfari.
sdulfari added inline comments.
test/functional/test_framework/wallet.py
120 ↗(On Diff #36901)

This line should match Core even though it is technically valid.

This revision now requires changes to proceed.Dec 2 2022, 16:59
sdulfari added inline comments.
test/functional/test_framework/wallet.py
120 ↗(On Diff #36901)

nevermind D12733 removes this so there is no reason to stay strictly matching

This revision is now accepted and ready to land.Dec 2 2022, 17:10
This revision was landed with ongoing or failed builds.Dec 2 2022, 19:43
This revision was automatically updated to reflect the committed changes.