-
Notifications
You must be signed in to change notification settings - Fork 901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
liquidity ads #4639
liquidity ads #4639
Commits on Jul 19, 2021
-
liquidity-ads: import from spec
Import the wires from spec. Here we go!
Configuration menu - View commit details
-
Copy full SHA for 463626d - Browse repository at this point
Copy the full SHA 463626dView commit details -
lease_rates: parse them out of node_announcements
When we get a node announcement out, we can now pull out its offer characteristic
Configuration menu - View commit details
-
Copy full SHA for b5fc2ac - Browse repository at this point
Copy the full SHA b5fc2acView commit details -
gossip/liquidity-ad: node_ann comparison, optional TLV check
Correctly mark whether or not the TLV's are the same/different, given two node announcements
Configuration menu - View commit details
-
Copy full SHA for cdb934e - Browse repository at this point
Copy the full SHA cdb934eView commit details -
gossipd: signal whether node_ann is updated, are we starting up?
If there's a rate-card for liquidity, we don't know about it until after startup (the plugin *should* call us at init to tell us what their current rates are)
Configuration menu - View commit details
-
Copy full SHA for cbfd35e - Browse repository at this point
Copy the full SHA cbfd35eView commit details -
setleaserates: new RPC to pass in lease rates
Changelog-Experimental: JSON-RPC: new RPC `setleaserates`, for passing in the rates to advertise for a channel lease (option_will_fund)
Configuration menu - View commit details
-
Copy full SHA for 1adadee - Browse repository at this point
Copy the full SHA 1adadeeView commit details -
option_will_fund: print out lease rates in listnodes
Note that we use the names from the spec. Changelog-Experimental: JSON-RPC: `listnodes` now includes the `lease_rates`, if available
Configuration menu - View commit details
-
Copy full SHA for de11c5d - Browse repository at this point
Copy the full SHA de11c5dView commit details -
libplugin: add u16_option parsing
A couple of the fields for liquidity_ads are u16
Configuration menu - View commit details
-
Copy full SHA for 0227cd1 - Browse repository at this point
Copy the full SHA 0227cd1View commit details
Commits on Jul 20, 2021
-
gossipd: turn off lease offers if the rates are empty
If received lease rates are empty (all zeroes), turn them off
Configuration menu - View commit details
-
Copy full SHA for e4b4020 - Browse repository at this point
Copy the full SHA e4b4020View commit details -
Configuration menu - View commit details
-
Copy full SHA for d93b193 - Browse repository at this point
Copy the full SHA d93b193View commit details -
funder_policy: set default to 0
As we move to advertising liquidity, set the default to not have any fuzz. This means we won't randomly reject an offer to buy liquidity.
Configuration menu - View commit details
-
Copy full SHA for 5e5987b - Browse repository at this point
Copy the full SHA 5e5987bView commit details -
funder-liqudity-ads: support options + setliquidity ad
Implement support for liquidity ads in `funder` plugin. We set the command line options for the leases, as well as sending the updated ads to lightningd (who then passes them through to gossipd)
Configuration menu - View commit details
-
Copy full SHA for 3e40c83 - Browse repository at this point
Copy the full SHA 3e40c83View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5c5e7a1 - Browse repository at this point
Copy the full SHA 5c5e7a1View commit details -
tests: add test for setting/updating node announce
Make sure everything updates/flows through as expected.
Configuration menu - View commit details
-
Copy full SHA for 8aedc13 - Browse repository at this point
Copy the full SHA 8aedc13View commit details -
Configuration menu - View commit details
-
Copy full SHA for 1dd656c - Browse repository at this point
Copy the full SHA 1dd656cView commit details -
hsmd: method to sign liquidity ad offer
When we accept a bid to create a channel lease, we send back a signature committing to our max channel lease amounts.
Configuration menu - View commit details
-
Copy full SHA for c94b4e6 - Browse repository at this point
Copy the full SHA c94b4e6View commit details -
liquidity-ads: pipe through request to funder, update policy
When a request comes through, we forward it over to the funder who uses the currently set policy to figure out how to handle it. Includes small update to the policy engine which decides whether or not to fund a request. Changelog-Experimental: Plugins: `openchannel2` hook now includes optional fields for a channel lease request
Configuration menu - View commit details
-
Copy full SHA for 03fb9e3 - Browse repository at this point
Copy the full SHA 03fb9e3View commit details -
liquidity-ad: request amount, pass through to dualopend
Changelog-Experimental: EXPERIMENTAL-DUAL-FUND: JSON-RPC: openchannel_init now takes a `requested_amt`, which is an amount to request from peer
Configuration menu - View commit details
-
Copy full SHA for 26e739a - Browse repository at this point
Copy the full SHA 26e739aView commit details -
liquidity-ad: pipe
request_amt
all the way out to fundchannelChangelog-Added: JSON-RPC: `fundchannel` now takes optional `request_amt` parameter
Configuration menu - View commit details
-
Copy full SHA for 25499e0 - Browse repository at this point
Copy the full SHA 25499e0View commit details -
liquidity-ad: fill in acceptance response
Asks HSMD for signed lease termsheet, fills in the details to the accept_channel2 TLV
Configuration menu - View commit details
-
Copy full SHA for 93a848f - Browse repository at this point
Copy the full SHA 93a848fView commit details -
dualopend, openchannel_init: pull out feerate parsing logic
we'll use it again here shortly
Configuration menu - View commit details
-
Copy full SHA for 3210dd8 - Browse repository at this point
Copy the full SHA 3210dd8View commit details -
Undocumented RPC call for asking a peer what their rates are
Configuration menu - View commit details
-
Copy full SHA for a4968b6 - Browse repository at this point
Copy the full SHA a4968b6View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9f3d9ad - Browse repository at this point
Copy the full SHA 9f3d9adView commit details -
Configuration menu - View commit details
-
Copy full SHA for f1b0660 - Browse repository at this point
Copy the full SHA f1b0660View commit details -
Configuration menu - View commit details
-
Copy full SHA for ade8db8 - Browse repository at this point
Copy the full SHA ade8db8View commit details -
Configuration menu - View commit details
-
Copy full SHA for d834de2 - Browse repository at this point
Copy the full SHA d834de2View commit details -
Configuration menu - View commit details
-
Copy full SHA for bb25dad - Browse repository at this point
Copy the full SHA bb25dadView commit details -
Configuration menu - View commit details
-
Copy full SHA for fd331ef - Browse repository at this point
Copy the full SHA fd331efView commit details -
onchaind: add recovery scans for option-will-fund
option_will_fund changes the to_remote/to_local commitment tx outputs by altering the CSV lock for leased channels. We need to grind/scan for these outputs now, provided the defaults don't work.
Configuration menu - View commit details
-
Copy full SHA for de7d3a0 - Browse repository at this point
Copy the full SHA de7d3a0View commit details -
Configuration menu - View commit details
-
Copy full SHA for f707bdb - Browse repository at this point
Copy the full SHA f707bdbView commit details -
liquidity-ads: persist channel blockheight states to disk
Adds new tables to database, backfills, basically copies the fee_rates state machine for channeld.
Configuration menu - View commit details
-
Copy full SHA for 817e5ce - Browse repository at this point
Copy the full SHA 817e5ceView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1e6950b - Browse repository at this point
Copy the full SHA 1e6950bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 2493bcc - Browse repository at this point
Copy the full SHA 2493bccView commit details -
chaintopology: new command 'parsefeerate'
Useful for parsing a passed in feerate before calling lightningd with it, e.g. when you need to know what the feerate is for a fundpsbt before calling fundpsbt Changelog-Added: JSON-RPC: new command `parsefeerate` which takes a feerate string and returns the calculated perkw/perkb
Configuration menu - View commit details
-
Copy full SHA for 3ab59fb - Browse repository at this point
Copy the full SHA 3ab59fbView commit details -
channel lease: set csv_lock for commitment transactions
If the channel is under lease, the lessor's (accepter, really) funds have a CSV lock that reflects the length of the remainder of the lease.
Configuration menu - View commit details
-
Copy full SHA for 484bcbe - Browse repository at this point
Copy the full SHA 484bcbeView commit details -
channel utxo: persist the 'csv' lock value to database
Channel leases modify the CSV height that an output is eligible for being spent at, persist this to the database
Configuration menu - View commit details
-
Copy full SHA for 7d756e0 - Browse repository at this point
Copy the full SHA 7d756e0View commit details -
utxo: don't add outputs that aren't currently eligible to be spent
If an output's CSV lock hasn't been surpassed yet, don't try to include it in a transaction
Configuration menu - View commit details
-
Copy full SHA for 4ff926a - Browse repository at this point
Copy the full SHA 4ff926aView commit details -
channeld: don't forget channels that we've put funds into
Typically we forget a channel if 2016 blocks have passed and the funding transaction hasn't been mined yet, however we SHOULD NOT forget these channels if we've got funds in them!
Configuration menu - View commit details
-
Copy full SHA for 27657cf - Browse repository at this point
Copy the full SHA 27657cfView commit details -
channel lease: fail leased channel if peer offline + blockheight behind
If the channel is leased and our peer is too far behind, fail the channel.
Configuration menu - View commit details
-
Copy full SHA for 9c39e6a - Browse repository at this point
Copy the full SHA 9c39e6aView commit details -
close: param to force-close a leased channel
By default, we won't close a channel that we leased to a peer. You can override this with the `force_lease_closed` flag. Changelog-Added: JSON-RPC: close now has parameter to force close a leased channel (option_will_fund)
Configuration menu - View commit details
-
Copy full SHA for 8097937 - Browse repository at this point
Copy the full SHA 8097937View commit details -
channel lease: update the blockheight on reconnect, also
We need to update the peer wrt our blockheight on reconnect
Configuration menu - View commit details
-
Copy full SHA for 74ccf75 - Browse repository at this point
Copy the full SHA 74ccf75View commit details -
lease rates: helpers for parsing, serializing + equating lease_rates
We're gonna need them
Configuration menu - View commit details
-
Copy full SHA for 8666cbb - Browse repository at this point
Copy the full SHA 8666cbbView commit details -
channel leases: pass expected lease rates around in compat form
We need to know what the lease we're expecting is. To do this we pass around the hex encoded portion of the wire format. We can use this passed in expected lease rates to confirm that the peer is, in fact, using the same rates as what we have currently. Changelog-Added: JSON-RPC: fundchannel, multifundchannel, and openchannel_init now accept a 'compact_lease' for any requested funds
Configuration menu - View commit details
-
Copy full SHA for 85fbd28 - Browse repository at this point
Copy the full SHA 85fbd28View commit details -
channel leases: add expected lease fee to opening PSBT
We need to parse the feerate string, so we can figure out what our weight fee will be for a leased channel, so we go get the feerate and use that to calculate what our expected lease fee will be for the requested amount.
Configuration menu - View commit details
-
Copy full SHA for 93854d5 - Browse repository at this point
Copy the full SHA 93854d5View commit details -
channel-lease: reject if we're not currently advertising liquidity
If there's no plugin currently in place, we simply won't return any funding at all, in which case we'd expect them to handle however they want. (our implementation would fail the open, as we only accept opens that have at least as much as we've requested provided)
Configuration menu - View commit details
-
Copy full SHA for 6e7b36b - Browse repository at this point
Copy the full SHA 6e7b36bView commit details -
nit: better error messages on dualopend's check_balances failures
Make it easier to figure out what the inputs were to check_balances on two failure cases
Configuration menu - View commit details
-
Copy full SHA for 02644be - Browse repository at this point
Copy the full SHA 02644beView commit details -
channel-leases: add lease fee to accepter's funding earlier up
We need the 'actual' accepter's funding for the reserve calculations, which includes the lease fee that the opener is paying them, so we calculate it before doing all that jazz. However, we MUST send the actual "on paper" (e.g. without lease fee) amount to the peer in accept_channel2, so we stash the original amount and send it.
Configuration menu - View commit details
-
Copy full SHA for 1d6f313 - Browse repository at this point
Copy the full SHA 1d6f313View commit details -
dualopend: hold onto open_tlv for longer than the tmpctx persists
with channel leases, we use the open_tlv data after a round of talking to the peer (which clears out the tmpctx). It'll get cleaned up when this peer opens/fails.
Configuration menu - View commit details
-
Copy full SHA for 64123f1 - Browse repository at this point
Copy the full SHA 64123f1View commit details -
lease-channels: tests for the test gods
Check that channel leases work as expected for unilateral closes and cheats!
Configuration menu - View commit details
-
Copy full SHA for 86dacd9 - Browse repository at this point
Copy the full SHA 86dacd9View commit details -
Since we now use 'compact_lease' to gate an open (if the rates have changed, we fail), we no longer need to rely on query rates for figuring things out, so we make it dev-only. Changelog-Changed: JSON-API: queryrates is now developer only
Configuration menu - View commit details
-
Copy full SHA for 8729d6b - Browse repository at this point
Copy the full SHA 8729d6bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7049c30 - Browse repository at this point
Copy the full SHA 7049c30View commit details -
overflows: helpers for integer assignment overflows.
Signed-off-by: Rusty Russell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 48a46a3 - Browse repository at this point
Copy the full SHA 48a46a3View commit details -
lease_rates, funder: use overflow helpers
Signed-off-by: Rusty Russell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 26474c7 - Browse repository at this point
Copy the full SHA 26474c7View commit details -
Signed-off-by: Rusty Russell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 4a967ba - Browse repository at this point
Copy the full SHA 4a967baView commit details -
We don't actually use the NULL-is-equal in the one caller, so ignore that. Signed-off-by: Rusty Russell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f8f4e43 - Browse repository at this point
Copy the full SHA f8f4e43View commit details -
common/lease_rates: more things const.
And fix up lease_rates_fromhex to be the obvious calling convention. Signed-off-by: Rusty Russell <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 103d3f1 - Browse repository at this point
Copy the full SHA 103d3f1View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7be8e71 - Browse repository at this point
Copy the full SHA 7be8e71View commit details