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.go sendNetworkFee (the network fee reported to THORChain),
  • signer_internal.go:716 and applyFeeLimits (: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 calling GetNetworkInfo. The pin therefore doesn't depend on the RPC either: an RPC failure can't leave the BTC floor at 0.
  • NewClient sets the BTC floor to the same constant when the client is constructed, so it is never 0 before the first updateNetworkInfo tick.

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:

  1. After NewClient, the BTC floor already equals the fixed constant, with no updateNetworkInfo call yet.
  2. With the mock getnetworkinfo.relayfee set to 1e-6 (the 100-sat value 29.1+/30.x report) and a sentinel stored first, updateNetworkInfo still pins BTC to the fixed constant. The fixture's default 1e-5 equals 1000 sat, so a test using it would pass even without the pin; with 1e-6 the 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.

🤖 Generated with Claude Code

Edited by Huginn Ai

Merge request reports

Loading
Loading