Skip to content

Conversation

@t-bast
Copy link
Member

@t-bast t-bast commented Apr 15, 2024

The initiator of open_channel2, tx_init_rbf and splice_init can request funding from the remote node. The non-initiator node will:

  • let the open-channel-interceptor plugin decide whether to provide liquidity for new channels or not, and how much
  • always honor liquidity requests on existing channels (RBF and splice) when funding rates have been configured

Liquidity ads are included in the node_announcement message, which lets buyers compare sellers and connect to sellers that provide rates they are comfortable with. They are also included in the init message which allows providing different rates to specific peers.

This implements lightning/bolts#1153. We currently use the temporary tlv tag 1339 while we're waiting for
feedback on the spec proposal.

@t-bast t-bast force-pushed the liquidity-ads-official branch from f1c6334 to cb2183e Compare May 14, 2024 09:03
@t-bast t-bast changed the title Add extensible liquidity ads format Extensible Liquidity Ads Jun 3, 2024
@t-bast t-bast force-pushed the liquidity-ads-official branch from cb2183e to 1f9048e Compare June 4, 2024 14:28
@t-bast t-bast force-pushed the liquidity-ads-official branch 3 times, most recently from 6fc8334 to e23a6f5 Compare June 14, 2024 11:24
@t-bast t-bast force-pushed the liquidity-ads-official branch 5 times, most recently from e83eaea to ff2f88b Compare June 25, 2024 06:59
@t-bast t-bast force-pushed the liquidity-ads-official branch from ff2f88b to 3474de7 Compare June 27, 2024 15:09
@t-bast t-bast force-pushed the liquidity-ads-official branch from 3474de7 to c3f5e61 Compare July 5, 2024 08:47
@t-bast t-bast marked this pull request as ready for review July 8, 2024 14:56
@t-bast t-bast force-pushed the liquidity-ads-official branch from c3f5e61 to 347adf4 Compare July 17, 2024 12:35
This was referenced Jul 19, 2024
@t-bast t-bast force-pushed the liquidity-ads-official branch from 347adf4 to 738604c Compare July 22, 2024 09:04
@t-bast t-bast force-pushed the liquidity-ads-official branch from 738604c to 4e1db8d Compare July 31, 2024 15:09
@t-bast t-bast force-pushed the liquidity-ads-official branch 2 times, most recently from b52d01f to a31bca3 Compare August 28, 2024 07:55
@t-bast t-bast requested a review from pm47 August 28, 2024 07:55
@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 93.81443% with 24 lines in your changes missing coverage. Please review.

Project coverage is 86.06%. Comparing base (14a4ea4) to head (c77ff37).
Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...re/src/main/scala/fr/acinq/eclair/NodeParams.scala 50.00% 9 Missing ⚠️
...inq/eclair/channel/fsm/ChannelOpenDualFunded.scala 90.00% 5 Missing ⚠️
...a/fr/acinq/eclair/wire/protocol/LiquidityAds.scala 92.18% 5 Missing ⚠️
.../main/scala/fr/acinq/eclair/db/DualDatabases.scala 0.00% 4 Missing ⚠️
...main/scala/fr/acinq/eclair/db/DbEventHandler.scala 50.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2848      +/-   ##
==========================================
+ Coverage   85.98%   86.06%   +0.08%     
==========================================
  Files         219      220       +1     
  Lines       18538    19015     +477     
  Branches      786      818      +32     
==========================================
+ Hits        15939    16365     +426     
- Misses       2599     2650      +51     
Files with missing lines Coverage Δ
...r-core/src/main/scala/fr/acinq/eclair/Eclair.scala 56.61% <100.00%> (+0.18%) ⬆️
.../src/main/scala/fr/acinq/eclair/PluginParams.scala 66.66% <ø> (ø)
...in/scala/fr/acinq/eclair/channel/ChannelData.scala 100.00% <ø> (ø)
.../scala/fr/acinq/eclair/channel/ChannelEvents.scala 100.00% <100.00%> (ø)
...c/main/scala/fr/acinq/eclair/channel/Helpers.scala 94.20% <100.00%> (-0.12%) ⬇️
...in/scala/fr/acinq/eclair/channel/fsm/Channel.scala 85.40% <100.00%> (+0.20%) ⬆️
...inq/eclair/channel/fund/InteractiveTxBuilder.scala 92.18% <100.00%> (+0.51%) ⬆️
...cinq/eclair/channel/fund/InteractiveTxFunder.scala 92.90% <100.00%> (+0.42%) ⬆️
...c/main/scala/fr/acinq/eclair/db/pg/PgAuditDb.scala 99.73% <100.00%> (+0.04%) ⬆️
...cala/fr/acinq/eclair/db/sqlite/SqliteAuditDb.scala 99.71% <100.00%> (+0.04%) ⬆️
... and 19 more

... and 5 files with indirect coverage changes

@t-bast t-bast force-pushed the liquidity-ads-official branch from 629ce61 to 5ab74ba Compare September 5, 2024 12:57
@t-bast t-bast force-pushed the liquidity-ads-official branch 4 times, most recently from c77ff37 to f63f175 Compare September 13, 2024 14:27
The initiator of `open_channel2`, `tx_init_rbf` and `splice_init` can
request funding from the remote node. The non-initiator node will:

- let the open-channel-interceptor plugin decide whether to provide
  liquidity for new channels or not, and how much
- always honor liquidity requests on existing channels (RBF and splice)
  when funding rates have been configured

Liquidity ads are included in the `node_announcement` message, which
lets buyers compare sellers and connect to sellers that provide rates
they are comfortable with. They are also included in the `init` message
which allows providing different rates to specific peers.

This implements lightning/bolts#1153. We
currently use the temporary tlv tag 1339 while we're waiting for
feedback on the spec proposal.
Creating a new channel has an additional cost compared to adding
liquidity to an existing channel: the channel will be closed in the
future, which will require paying on-chain fees. Node operators can
include a `channel-creation-fee-satoshis` in their liquidity ads to
cover some of that future cost.
Whenever liquidity is purchased, we store it in the `AuditDb`. This lets
node operators gather useful statistics on their peers, and which ones
are actively using the liquidity that is purchased.

We store minimal information about the liquidity ads itself to be more
easily compatible with potential changes in the spec.
@t-bast t-bast force-pushed the liquidity-ads-official branch from f63f175 to c6a1199 Compare September 24, 2024 01:42
@t-bast t-bast merged commit cfdb088 into master Sep 24, 2024
1 check passed
@t-bast t-bast deleted the liquidity-ads-official branch September 24, 2024 08:50
t-bast added a commit that referenced this pull request Dec 4, 2024
This release introduces a few API changes:

- `channelstats` now takes optional parameters `--count` and `--skip`
  to control pagination. By default, it will return the first 10
  entries (#2890)
- `createinvoice` now takes an optional `--privateChannelIds` parameter
  that can be used to add routing hints through private channels (#2909)
- `nodes` allows filtering nodes that offer liquidity ads (#2848)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants