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

Support RapidGossipSync #2

Closed
tnull opened this issue Aug 26, 2022 · 2 comments · Fixed by #70
Closed

Support RapidGossipSync #2

tnull opened this issue Aug 26, 2022 · 2 comments · Fixed by #70
Milestone

Comments

@tnull
Copy link
Collaborator

tnull commented Aug 26, 2022

Currently we only sync the gossip state via the P2P network.
We should however allow to configure a RGS server and use it for the initial sync.

We may also consider using RGS when we haven't synced in a long time and it may be faster to forget our old state and use RGS to start from scratch.

@moneyball
Copy link

moneyball commented Aug 26, 2022

Random ideas (that aren't necessarily candidates for an MVP of this in LDKLite but at least wanted to toss out for consideration and discussion).

  1. Do both p2p network and RGS in parallel. If p2p finishes before the app needs to do a payment, great! If not, then use RGS so the user experiences no latency. The only drawback to this approach is wasted bandwidth, and for certain mobile users, this might be meaningful.
  2. Occasionally / randomly do p2p network gossip sync instead of RGS in order to spot check the RGS server to ensure it isn't misleading/cheating the user. If it is, then the wallet could automatically switch to another RGS. Would need to think about how to alert the user / wallet dev / community that a particular RGS server has reputation issues. Maybe just communicate a message / logs back to the wallet developers so they know to avoid that RGS server? (although the wallet developers might be the ones hosting it / doing the cheating?)

@arik-so @TheBlueMatt

@TheBlueMatt
Copy link

I don't think we should for a few reasons - (a) P2P sync currently doesn't have a decent way to just sync what you're missing, so we have to waste a ton of bandwidth on each start, (b) this assumes the peer is trusted because LDKLite probably shouldnt/wont bother doing on-chain validation of gossip, and (c) there's no good way to determine if P2P sync is "done". Not to mention the bandwidth waste you mention :).

If our concern is trust in the RGS server, we should just sync from two RGS servers. Note that I don't really think its all that trivial for an RGS server to lie and hijack all payments - yes, they can in theory, but in order to actually do so, IIUC, they'll still need to open a ton of channels to actually route the payment in question. It may very well be that they have to open a sufficient number of channels that they dont have to exploit the RGS, they can just intercept payments by opening a ton of channels and setting fees to zero.

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 a pull request may close this issue.

3 participants