-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Add SealingState; don't prepare block when not ready. #10529
Add SealingState; don't prepare block when not ready. #10529
Conversation
It looks like @afck hasn't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement at the following URL: https://cla.parity.io Once you've signed, please reply to this thread with Many thanks, Parity Technologies CLA Bot |
I tried hard to not miss anything, but I'm not very confident about the change, so let's only merge it if someone who is more familiar with the code is certain that it makes sense. An enum better conveys the meaning of the value, but of course I'm happy to revert to the |
[clabot:check] |
It looks like @afck signed our Contributor License Agreement. 👍 Many thanks, Parity Technologies CLA Bot |
@afck Can you please rebase this branch because a |
58a90df
to
8c1fd06
Compare
Sorry for the delay! I rebased it. |
@niklasad1 Could you (or someone else from Parity team) please review these changes? We made the same for our fork (poanetwork#103) but not sure the changes are correct. It would be awesome if someone from Parity could have a look at these changes. It would help AuRa nodes not to waste CPU time when they are not validators. Thank you. |
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.
LGTM (Need again rebase on master)
8c1fd06
to
7a457bc
Compare
Sorry, I don't understand why one of the builds failed: Is that something about the build cache, or is it an actual test failure? |
@afck it is build cache error, I don't know why it failed but I restarted and it succeed! |
This replaces
Engine::seals_internally
withEngine::sealing_state
, and returns an enum indicating whether the engine seals internally and whether it is currently ready to do so.For engines that don't seal internally,
Miner::prepare_block
is only called when they are ready. This prevents preparing (and subsequently failling to seal) blocks all the time withAuthorityRound
.