-
Notifications
You must be signed in to change notification settings - Fork 12
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
Gracefully reject mining of already existing blocks #174
Comments
Good point! |
I think conceptually it is as if the new block can come from any of the validator client, the current validator client just being one of them. But I see what you mean, in principle the new pending block should be assured to be parented to the block that was the current block at the time the Honey Badger epoch has started, and that is not guaranteed right now, since the creation of the pending block is deferred until the transaction batch is available, at which point another validator client may have sent it to us already. |
So what we really have to do is to create the pending block at the start of the epoch already, and simply update it when we have the actual transactions to be included in it. |
What I need to investigate is what will happen if a block from another validator gets imported while there is a pending block - will the imported block be ignored in that case? |
I'm not sure about the empty pending block… but I think the Parity code has something like this already, does it? So if it fits better into the codebase, that makes sense, of course.
I'm pretty sure it won't be ignored: In Ethereum if we're currently mining block n, and we receive another, valid block n, we'll stop our mining work and start mining n + 1 instead. Regarding the block author: |
Let me check, but I think the author is simply set to 0 in the hbbft branch. |
Yes, the author is 0 currently. I can send transactions and produce blocks in a multi-node setup without problems - and it runs stable except for those occasional "TimestampOverflow" errors when a block is imported from another node before it is mined. |
That is an interesting point - so maybe the best way would be to just cancel the current hbbft epoch and/or the current pending block if a new block has been imported. |
You're right, we should probably just cancel the epoch. The hbbft crate will need an API for that first, though: poanetwork/hbbft#413 |
Note to self: |
With Honey Badger BFT all nodes mine the same block simultaneously, while syncing each other's chain.
Since some nodes will be faster than others it can happen that the block to be mined has already been synced from another validator, causing an attempt to mine a block that is already imported.
This causes a verification error on the block to be mined since the block is in fact identical to the parent, causing a "TimestampOverflow" error.
Parity needs to be adjusted to expect this case and gracefully reject adding a block to be mined if it is identical to the parent block - this is a common and expected case with the Honey Badger BFT protocol.
The text was updated successfully, but these errors were encountered: