Skip to content
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

[WIP] Random scid #1195

Closed
wants to merge 34 commits into from
Closed

[WIP] Random scid #1195

wants to merge 34 commits into from

Conversation

akumaigorodski
Copy link
Contributor

It's an attempt to implement lightning/bolts#681, it is sufficient for my needs as is but not complete and overall has different goals mixed in, maybe parts of it will be of help.

What is does:

  1. Implements random scid basics: feature bits, messages, assigning logic
  • max random block height is set to 500000
  • the same scid is used for both sides of channel which is probably not compliant (option_scid_assign: privacy protection for private channels. lightning/bolts#681 (comment)) but makes implementation easy (Router first receives LocalChannelUpdate and then remote PeerRoutingMessage with a same random scid)
  • peers exchange ChannelUpdates after assigning random scid to make sure Router has a refreshed PrivateChannelwith both updates present.
  1. Changes UsableBalances logic in Relayer, see https://gitter.im/ACINQ/developers?at=5db6cec8e886fb5aa20d6776 and https://gitter.im/ACINQ/developers?at=5db9756c14d55a3785a12f2b
  2. Adds a new createinvoicewithextrahops API call which was a goal for all of this. This call creates an invoice with routing hints for local private channels which can receive a requested amount right now (have remote ChannelUpdate, have sufficient availableBalanceForReceive).

anton added 30 commits May 30, 2019 12:27
to remove old scid from Router and Register mappings
without this cleanup those maps may become clogged if new scid
is requested often
by BITCOIN_FUNDING_DEEPLYBURIED for private channels
When making an invoice with route hints for private channels:
1. Obtain `List[List[ExtraHop]]` from Router
2. Obtain `Map[ShortChannelId, UsableBalances]` from Relayer
3. Select currently online private channels which can receive an amount
with route hints from private channels
because:
- offline channel may still be seen as `enabled=true` by Relayer
due to flappy channel protection (channel may go offline without
 `enabled` updated to `false`).
- online channel may still be seen as `enabled=false` by Relayer
because incoming channels are initially below reserve so can't send
but can receive.

Using new approach an API user may apply additional logic to output:
- for sending: throw away all channels with `enabled=false`,
offline and `enabled=true` may happen but that's not a serious issue
(sender will retry with different route).
- for receiving: keep all `enabled=false` because they may be online
but below reserve (perfectly good for receiving) or offline (but may
become online by the time a payment arrives).
and check if local balance has changed in Auditor,
this lets Relayer always know an actual sendable/receivable
for every channel
anton added 4 commits October 30, 2019 16:06
They're 114/115 currently (did not figure out how to make those work),
but will be 14/15 once PR is merged: lightning/bolts#681 (comment)
`-- excludeIsolatedPeers = true`: do not use route hints for private
channels with remote peers who are themselves not announced
on network (to exclude mobile LN nodes which do not announce themselves
and only use private channels, routing hints from those are useless).

`-- vertexThreshold=3`: do not use route hints for private channels
with remote peers who did announce themselves but have less than 3
public channels because chances of routing success from those are low.
@akumaigorodski akumaigorodski deleted the random-scid branch November 10, 2019 16:35
@akumaigorodski akumaigorodski restored the random-scid branch November 16, 2019 10:05
@t-bast
Copy link
Member

t-bast commented Mar 26, 2020

I think we can close this PR as rusty decided to retract the corresponding spec PR.
We will instead use blinded paths to achieve that result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants