Subject: Re: [bitcoin-dev] Fee estimates and RBF

From: ZmnSCPxj <[email-masked]>
Date: Tue, 18 May 2021 13:10:12 +0000

Good morning Prayank,

>  But it will involve lot of exception handling.

Yes, that is precisely the problem here.

If you select a fixed feerate and then just broadcast-and-forget, you have no real exceptions you have to handle --- but that means not using RBF at all.

Testing the handling of reorgs in particular is important, as a reorg might use an older version of an RBFed transaction rather than a newer version.
This also implies that further follow-up transactions might need to be recreated in such a case.

As this is financial code, we need a lot of testing, and code that has a lot of branches due to having to handle a lot of possible exceptions and so forth is a headache to completely cover in testing.

C-lightning supposedly supports RBF, in the sense that every transaction it makes always signals RBF, but I am almost certain there are edge cases where it might mishandle a replaced transaction and lose track of onchain funds, and it is difficult to support both "we can spend unconfirmed change outputs" (a very common feature of nearly every onchain wallet) with "we can change the feerate of unconfirmed transactions" (which changes the txid and therefore the UTXO id of the change output spent by use of the previous feature).

Regards,
ZmnSCPxj