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

fix: node gets banned on reorg #4949

Conversation

brianp
Copy link
Contributor

@brianp brianp commented Nov 23, 2022

Description

Remove the FetchBlocksByHash handler. It was only called from a single place and although designed to handle multiple blocks it was only ever sending a single hash at once making the multi-block functionality useless.
Instead, opt to use the existing GetBlockByHash handler and expand that handler to accept a new orphans flag. Passing this flag means we'll accept found blocks from the orphan pool,

Motivation and Context

Previously if a node had re-orged after a sync had started it may result in not providing the complete block for a block it claimed it had. This results in a brief ban.

Make it also return blocks from the orphan pool and let the peer figure out what to do with it.

How Has This Been Tested?

Tests, and running nodes.

Fixes: #4799

Copy link
Collaborator

@stringhandler stringhandler left a comment

Choose a reason for hiding this comment

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

looking good so far

@brianp brianp force-pushed the fix-4799-node-gets-banned-on-reorg branch from 58e3cde to 3c55b18 Compare November 25, 2022 20:54
@brianp brianp marked this pull request as ready for review November 25, 2022 21:14
@brianp brianp requested a review from stringhandler November 25, 2022 21:14
@brianp
Copy link
Contributor Author

brianp commented Nov 25, 2022

Got the failing test all worked out but now it's segfault'ing during syncs. I've already got an idea why that might be happening. New fix is incoming.

@brianp
Copy link
Contributor Author

brianp commented Nov 25, 2022

segfault fix pushed. I had gotten a little too overzealous with the code removal. Removing the grpc response formats for HistoricalBlocks results in segfault when syncing. I've re-added the hastily removed code and the segfault no longer occurs.

Good for review now.

@stringhandler stringhandler merged commit 5bcf6e5 into tari-project:development Nov 28, 2022
@brianp brianp deleted the fix-4799-node-gets-banned-on-reorg branch February 13, 2023 20:51
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.

Node gets banned during reorgs if mining
2 participants