-
Notifications
You must be signed in to change notification settings - Fork 219
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
fix: node gets banned on reorg #4949
Conversation
There was a problem hiding this 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
This commit attempts to simplify the if/else nested branches. The result is three much simpler branches but the overall formatting is much more daunting. So i could take it or leave it.
58e3cde
to
3c55b18
Compare
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. |
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. |
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 neworphans
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