-
Notifications
You must be signed in to change notification settings - Fork 220
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
Node gets banned during reorgs if mining #4799
Comments
Maybe a short ban? |
Good point, we ban for 100s only so that is ok. I'm still concerned about network splits during reorgs and that this is a fairly common case even though there are no malicious nodes. I was mining at a faster rate, and won a few blocks fairly quickly. This resulted in almost 50% of my connections being lost. Perhaps that is ok since it is unusual to produce many blocks (~4) that quickly (within 30-40s). There are a few options that I can think of (no particular order):
I guess we could try selfish mining attacks to see if we can force significant network splits. |
I would say:
|
IMPACT: This could cause a weird hard fork, so let's bump the priority |
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
WARN Could not provide requested block d54cd80ab95951fbc8cc605935ee11f9d8f9bdb2cd24ca319643a2bc16198241 to peer because not stored
This results in my node being banned (1 less connection each time) because we sent a block hash, but could not provide it later due to reorg (race condition). Full block requests happen a lot during reorgs because we check
if header.prev_hash != *current_meta.best_block() {
and then request the full block immediately if true.The reason for the ban is to prevent spamming of block hashes in the previous scheme.
I think we should:
The text was updated successfully, but these errors were encountered: