Skip to content

Verify channel-monitor processes blocks with skipped best_block #2566

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

Merged
merged 1 commit into from
Sep 11, 2023

Conversation

G8XSU
Copy link
Contributor

@G8XSU G8XSU commented Sep 8, 2023

This can happen due to races b/w client's call to block_connect
and adding newly created channel-monitor to chain-monitor using
watch_channel in funding_created.

Detailed description in tests.

Closes #2538

Copy link
Collaborator

@TheBlueMatt TheBlueMatt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks

@G8XSU G8XSU force-pushed the check-best-block-2538 branch from eb0847e to a349b53 Compare September 9, 2023 01:48
@G8XSU G8XSU marked this pull request as ready for review September 9, 2023 01:50
This can happen due to races b/w client's call to block_connect
and adding newly created channel-monitor to chain-monitor using
watch_channel in funding_created.
@G8XSU G8XSU force-pushed the check-best-block-2538 branch from a349b53 to d926be2 Compare September 9, 2023 01:51
Copy link
Contributor

@wpaulino wpaulino left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but this doesn't seem to be addressing what #2538 outlined? We will eventually get to the same state, but we have to wait for a new block connection after the new monitor is registered.

@G8XSU
Copy link
Contributor Author

G8XSU commented Sep 11, 2023

We will eventually get to the same state, but we have to wait for a new block connection after the new monitor is registered.

That was one of the solutions proposed but we discussed it, we shouldn't be needing that for now. Concern was for race-condition and we would have done that if there was a problem in correctness.
We don't need to wait, since skipped block cannot contain anything relevant for this newly added monitor.

@G8XSU G8XSU requested a review from TheBlueMatt September 11, 2023 19:22
@TheBlueMatt TheBlueMatt merged commit 1c9df02 into lightningdevkit:main Sep 11, 2023
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.

Check best block before connecting a new one in ChainMonitor
3 participants