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

Skip most chain sync on startup #2698

Open
TheBlueMatt opened this issue Oct 31, 2023 · 4 comments
Open

Skip most chain sync on startup #2698

TheBlueMatt opened this issue Oct 31, 2023 · 4 comments
Milestone

Comments

@TheBlueMatt
Copy link
Collaborator

TheBlueMatt commented Oct 31, 2023

The naive issues with running before we have finished chain sync are not an issue - if we step the channel after the peer has broadcasted the peer has revoked their latest state and we get their money, if we have broadcasted our ChannelMonitor should refuse to let us step the channel state machine.

There is the issue of if we're way behind and our peer has broadcasted their state, waited the timeout period, then got their funds back. At this point if we step the channel state we potentially lose funds. Still, we could just sync until we reach being behind by the CSV delay on our channels and then sync from there after startup.

May be a bit complicated to do in our sync utils, but we should look into it.

@TheBlueMatt TheBlueMatt added this to the 0.0.119 milestone Oct 31, 2023
@TheBlueMatt TheBlueMatt changed the title Can we run before sync Skip most chain sync on startup Oct 31, 2023
@TheBlueMatt
Copy link
Collaborator Author

For electrum/esplora clients, to implement this, we probably need to think about switching the order from best_block_updated -> transaction confirmation to transaction confirmation -> best_block_updated.

@benthecarman
Copy link
Contributor

Kinda related to lightning/bolts#934

@TheBlueMatt
Copy link
Collaborator Author

That's pretty unrelated - that's just about when our counterparty is stale/has reverted to a previous state. We actually already do that. This is more about us having the latest state, but not the latest blockchain data.

@TheBlueMatt
Copy link
Collaborator Author

Sadly I don't think we have the bandwidth in 0.0.119 to dig into this, but hopefully its mostly a documentation thing in a release soon.

@TheBlueMatt TheBlueMatt modified the milestones: 0.0.119, 0.0.120 Nov 28, 2023
@TheBlueMatt TheBlueMatt modified the milestones: 0.0.120 , 0.0.121 Jan 9, 2024
@TheBlueMatt TheBlueMatt modified the milestones: 0.0.122, 0.0.123 Mar 18, 2024
@TheBlueMatt TheBlueMatt modified the milestones: 0.0.124, 0.2 May 6, 2024
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

No branches or pull requests

2 participants