lightningdevkit / ldk-node

A ready-to-go node implementation built using LDK.
Other
147 stars 76 forks source link

Allow to override fee rate for on-chain operations #176

Open tnull opened 1 year ago

tnull commented 1 year ago

We should allow to override our fee estimation for methods like Node::send_to_onchain_address.

It would however make sense to expose this as an Option<bitcoin::FeeRate> in the API. To avoid immediately breaking API again, we should therefore wait until we could upgrade to rust-bitcoin 0.30 which introduced FeeRate.

jbesraa commented 8 months ago

hey, I would like to work on this please.

It seems like bdk is using its own FeeRate in the tx builder, if we are using bitcoin::FeeRate I guess we should convert from bitcoin::FeeRate to bdk::FeeRate as well?

tnull commented 8 months ago

It seems like bdk is using its own FeeRate in the tx builder, if we are using bitcoin::FeeRate I guess we should convert from bitcoin::FeeRate to bdk::FeeRate as well?

Mhh, they are planning to drop their implementation for bitcoin::FeeRate for quite a while now and seem like they are close to finally pulling the trigger (see https://github.com/bitcoindevkit/bdk/issues/1136 / https://github.com/bitcoindevkit/bdk/pull/1216). I'd really avoid to introduce too many unnecessary conversions and churn in exposed types, which is why I deferred doing this until the BDK 1.0 upgrade.

I still tend towards this, but if you're eager to pick it up right now we could indeed consider exposing bitcoin::FeeRate in the API, converting from/to bdk::FeeRate.