fix(bifrost/utxo): pin BTC min-relay-fee floor to a fixed 1000 sat
Problem
bifrost/pkg/chainclients/utxo/client_internal.go updateNetworkInfo stores the daemon's getnetworkinfo.relayfee (a BTC/kvB rate) as minRelayFeeSats. That value affects signing consensus because it shapes the outbound in four places:
client_internal.gosendNetworkFee(the network fee reported to THORChain),signer_internal.go:716andapplyFeeLimits(:778): the outbound fee floor.
The fee floor sets the change output. The change output sets the sighash, and the sighash sets the TSS message id. Bitcoin Core <=29.0 reports relayfee 0.00001 BTC/kvB (1000 sat). Core 29.1+ and 30.x default to 0.000001 (100 sat). Most small swaps at 3-4 sat/vB have a gas_rate x vsize below 1000 sat. For those outbounds, nodes on the two Core lines build different change outputs and sign different messages. The minority node is left out of the majority's keysign party, and it gets blamed and jailed with no error in its own log.
Fix
Pin BTC's minRelayFeeSats to a fixed 1000 sat (btcFixedMinRelayFeeSats) so every node computes the same fee whatever its Core version. 1000 sat is the historical Core default, and the network majority runs it.
- In
updateNetworkInfo, BTC stores the fixed constant and returns before callingGetNetworkInfo. The pin therefore doesn't depend on the RPC either: an RPC failure can't leave the BTC floor at 0. NewClientsets the BTC floor to the same constant when the client is constructed, so it is never 0 before the firstupdateNetworkInfotick.
Other UTXO chains (LTC/DOGE/BCH/ZEC) keep their daemon-derived relay fee. A comment on the constant says it must not be configurable per node, because a config knob would bring back the split.
Test
TestUpdateNetworkInfo now asserts:
- After
NewClient, the BTC floor already equals the fixed constant, with noupdateNetworkInfocall yet. - With the mock
getnetworkinfo.relayfeeset to1e-6(the 100-sat value 29.1+/30.x report) and a sentinel stored first,updateNetworkInfostill pins BTC to the fixed constant. The fixture's default1e-5equals 1000 sat, so a test using it would pass even without the pin; with1e-6the test fails if the pin is removed.
Tradeoff / note
Pinning to exactly 1000 sat has one edge case. A node whose daemon is set to a higher local minrelaytxfee could in principle reject its own tx locally. Even so, a fixed protocol value is the only choice that is the same on every node, and such a node is already an outlier. Operators on 29.1+/30.x are now safe, because the pin applies whatever their 100-sat default says.
This is a draft until it is reviewed and a decision is made on cherry-picking it to the 3.21.1 release branch. It does NOT touch node-launcher: the Core 29.1 daemon bump is deliberately held until this ships.