HomePhabricator

add RPC (-regtest only) for testing package policy

Description

add RPC (-regtest only) for testing package policy

Summary:

It would be nice for LN/wallet/app devs to test out package policy, package RBF, etc., but the only interface to do so right now is through unit tests. This PR adds a -regtest only RPC interface so people can test by submitting raw transaction data. It is regtest-only, as it would be unsafe/confusing to create an actual mainnet interface while package relay doesn't exist.

Note that the functional tests are there to ensure the RPC interface is working properly; they aren't for testing policy itself. See src/test/txpackage_tests.cpp.

Backport of core#24836.

Depends on D16389.

Note 1: Because the RPCs return size (aka serialization size) or vsize (aka max(size, sigchecks bytes)), the test is technically incorrect but works because the sigchecks are never bumping the value in the test.
The RPCs need to be updated to return both values and/or the relay policy need to be updated to use vsize.

Note 2: The functional test changes the coinbases being spend and we need to change the amount due to halving.

Test Plan:

./test/functional/test_runner.py rpc_packages

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Subscribers: PiRK

Differential Revision: https://reviews.bitcoinabc.org/D16390

Details

Provenance
glozow <gloriajzhao@gmail.com>Authored on Jul 20 2021, 10:45
FabienCommitted on Mon, Jul 1, 20:06
FabienPushed on Mon, Jul 1, 20:06
Reviewer
Restricted Project
Differential Revision
D16390: add RPC (-regtest only) for testing package policy
Parents
rABC8dded22b93ac: validation: followups for de-duplication of packages
Branches
Unknown
Tags
Unknown