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

p2p/discover: fix crash when revalidated node is removed #29864

Merged
merged 6 commits into from
May 28, 2024

Conversation

fjl
Copy link
Contributor

@fjl fjl commented May 28, 2024

Fixes #29860

@fjl fjl requested a review from zsfelfoldi as a code owner May 28, 2024 10:53
@fjl fjl added this to the 1.14.4 milestone May 28, 2024
@fjl fjl removed the status:triage label May 28, 2024
@fjl
Copy link
Contributor Author

fjl commented May 28, 2024

After looking into this a bit more, I now think the whole idea of tracking the origin list for revalidation requests is wrong. The list a node is contained in can change while a request is in progress. We should just store the current revalidation list in *node instead.

@fjl fjl merged commit af0a327 into ethereum:master May 28, 2024
2 of 3 checks passed
@HemirAli
Copy link

hi

jorgemmsilva pushed a commit to iotaledger/go-ethereum that referenced this pull request Jun 17, 2024
)

In ethereum#29572, I assumed the revalidation list that the node is contained in could only ever
be changed by the outcome of a revalidation request. But turns out that's not true: if the
node gets removed due to FINDNODE failure, it will also be removed from the list it is in.
This causes a crash.

The invariant is: while node is in table, it is always in exactly one of the two lists. So
it seems best to store a pointer to the current list within the node itself.
maoueh pushed a commit to streamingfast/go-ethereum that referenced this pull request Aug 1, 2024
)

In ethereum#29572, I assumed the revalidation list that the node is contained in could only ever
be changed by the outcome of a revalidation request. But turns out that's not true: if the
node gets removed due to FINDNODE failure, it will also be removed from the list it is in.
This causes a crash.

The invariant is: while node is in table, it is always in exactly one of the two lists. So
it seems best to store a pointer to the current list within the node itself.
stwiname pushed a commit to subquery/data-node-go-ethereum that referenced this pull request Sep 9, 2024
)

In ethereum#29572, I assumed the revalidation list that the node is contained in could only ever
be changed by the outcome of a revalidation request. But turns out that's not true: if the
node gets removed due to FINDNODE failure, it will also be removed from the list it is in.
This causes a crash.

The invariant is: while node is in table, it is always in exactly one of the two lists. So
it seems best to store a pointer to the current list within the node itself.
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.

ethereum node panic.
3 participants