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

aliasmgr+channeldb: stop deleting zero-conf edges from graph if reorg occurs #7292

Merged
merged 4 commits into from
Jan 26, 2023

Conversation

Crypt-iQ
Copy link
Collaborator

@Crypt-iQ Crypt-iQ commented Jan 5, 2023

Fixes #7229

Description of issue:

When a block is disconnected due to a reorg, DisconnectBlockAtHeight is called for the block height. Prior to this patch, it would delete every SCID in the graph with a block height greater than the disconnected height. This meant that a reorg would delete every zero-conf channel edge from the graph. The fix simply iterates up until the StartingAlias and deletes every SCID between the disconnected height and the StartingAlias height.

An integration test is included that asserts that the fix works.

@Crypt-iQ Crypt-iQ changed the title Disconnectblock patch aliasmgr+channeldb: stop deleting zero-conf edges from graph if reorg occurs Jan 5, 2023
@Crypt-iQ Crypt-iQ force-pushed the disconnectblock_patch branch from 0b635f7 to 29166e3 Compare January 6, 2023 15:59
@Crypt-iQ Crypt-iQ added this to the v0.16.0 milestone Jan 6, 2023
@saubyk saubyk removed this from the v0.16.0 milestone Jan 6, 2023
Copy link
Collaborator

@GeorgeTsagk GeorgeTsagk left a comment

Choose a reason for hiding this comment

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

LGTM ⛓️

lntest/itest/lnd_zero_conf_test.go Outdated Show resolved Hide resolved
Copy link

@jerry47738 jerry47738 left a comment

Choose a reason for hiding this comment

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

7229

Copy link
Contributor

@positiveblue positiveblue left a comment

Choose a reason for hiding this comment

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

tACK 👍

The lint is complaining about a couple of things + the branch needs to be rebased and add release notes.

The itest have been migrated to the new format but this one can be updated in another PR (maybe we can create an issue with the good first issue tag)

aliasmgr/aliasmgr.go Show resolved Hide resolved
lntest/itest/lnd_zero_conf_test.go Outdated Show resolved Hide resolved
@Crypt-iQ Crypt-iQ force-pushed the disconnectblock_patch branch from 29166e3 to 11150fa Compare January 23, 2023 21:24
@lightninglabs-deploy
Copy link

@Crypt-iQ, remember to re-request review from reviewers when ready

@guggero
Copy link
Collaborator

guggero commented Jan 24, 2023

Needs a rebase and fix for the linter.

@Crypt-iQ Crypt-iQ force-pushed the disconnectblock_patch branch 4 times, most recently from f9d4bb7 to dcfff18 Compare January 24, 2023 22:20
lntest/itest/temp_lnd_test.go Outdated Show resolved Hide resolved
When a block is disconnected due to a reorg, DisconnectBlockAtHeight
is called for the block height. Prior to this patch, it would delete
every SCID in the graph with a block height greater than the
disconnected height. This meant that a reorg would delete every
zero-conf channel edge from the graph. The fix simply iterates up
until the StartingAlias and deletes every SCID between the
disconnected height and the StartingAlias height.
This itest asserts that zero-conf edges exist even after a reorg.
Without the prior commit, this test fails.
@Crypt-iQ Crypt-iQ force-pushed the disconnectblock_patch branch from dcfff18 to b002879 Compare January 25, 2023 17:03
@guggero guggero merged commit 33a0cbe into lightningnetwork:master Jan 26, 2023
@Crypt-iQ Crypt-iQ deleted the disconnectblock_patch branch January 26, 2023 17:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[bug]: GetChanInfo returns an error for zero-conf channels
9 participants