Open Zshan0 opened 2 years ago
A simple test for cpfp
has been written, I'm not sure what other kinds of tests are required. Please let me know
I am unable to figure out a simple way of testing CPFPing multiple SpendTransactions, if there is a simpler scheme that I can follow please let me know.
The Current CPFP is able to terminate invalid txid
with an RpcError
but it fails to terminate for txid
that is valid but is unknown, rather than relying on direct database functions to fetch the given txid and then throw an error if it is unable to find, is there a function that is specifically designed to check if a txid
exists in the database that I can use for sanity checking before passing it further?
Is this ready for review?
Untested, but i think you can use this to externally fund the CPFP wallet:
diff --git a/tests/test_framework/revault_network.py b/tests/test_framework/revault_network.py
index 0a840f8..8dfa68e 100644
--- a/tests/test_framework/revault_network.py
+++ b/tests/test_framework/revault_network.py
@@ -3,6 +3,7 @@ import logging
import os
import random
+from bip380.descriptors import Descriptor
from ephemeral_port_reserve import reserve
from nacl.public import PrivateKey as Curve25519Private
from test_framework import serializations
@@ -541,6 +542,13 @@ class RevaultNetwork:
return created_vaults
+ def fund_cpfp(self, amount):
+ """Send a coin worth this value to the CPFP descriptor"""
+ der_desc = Descriptor.from_str(str(self.cpfp_desc))
+ der_desc.derive(0)
+ decoded = self.bitcoind.rpc.decodescript(der_desc.script_pubkey.hex())
+ self.bitcoind.rpc.sendtoaddress(decoded["address"], amount)
+
def secure_vault(self, vault):
"""Make all stakeholders share signatures for all revocation txs"""
deposit = f"{vault['txid']}:{vault['vout']}"
This should fix the unit tests CI, and also fixes the configuration of the functional tests CI (thanks for reporting it!): https://github.com/revault/revaultd/pull/423.
This PR is to maintain code corresponding to the RFC that is being discussed for the addition of manual CPFP command as a JSONRPC API in revaultd. RFC is present here. #411 is the corresponding milestone tracker