Ensure block height manager is restarted when BFT coordinator is#8308
Ensure block height manager is restarted when BFT coordinator is#8308matthew1001 merged 13 commits intohyperledger:mainfrom
Conversation
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
…ithout calling reset Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
| LOG.debug("Interrupted while waiting for BftProcessor to stop.", e); | ||
| Thread.currentThread().interrupt(); | ||
| } | ||
| eventHandler.reset(); |
There was a problem hiding this comment.
Reset seems odd here in that we trying to stop all processing of BFT here. A stop method to prevent any more processing in the controller would make sense. With everything stopped, we won't be processing BFT events anyway so maybe it's not worth it?
And by a stop method on the controller I'm thinking it would change the started state to false as it does right now in the reset method and also replace the block height manager with the noop version so it wouldn't do any processing of events.
There was a problem hiding this comment.
Yeah I originally called it stop(), but as it wasn't doing anything other than reset the state var I wasn't sure it was quite right. But I'm fine with using that term, and I'll add in replacing the block height manager at the same time as you've suggested.
Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io>
…pped Signed-off-by: Matthew Whitehead <matthew1001@gmail.com>
Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
df1e619 to
881d371
Compare
881d371 to
03b17a6
Compare
|
@jframe I think it's ready for another look now, thanks |
Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
…erledger#8308) * Ensure block height manager is restarted when BFT coordinator is Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Refactor and add runtime exception if an attempt is made to restart without calling reset Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Update BFT adaptor Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Uupdate changelog Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Add QBFT implementation and tests Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Update IBFT tests Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Rename reset() -> stop() Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io> * Replace the height manager with a no-op height manager while it's stopped Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Javadoc Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> --------- Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io> Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io> Signed-off-by: Marcos Serradilla Diez <marcos@io.builders>
…erledger#8308) * Ensure block height manager is restarted when BFT coordinator is Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Refactor and add runtime exception if an attempt is made to restart without calling reset Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Update BFT adaptor Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Uupdate changelog Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Add QBFT implementation and tests Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Update IBFT tests Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Rename reset() -> stop() Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io> * Replace the height manager with a no-op height manager while it's stopped Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> * Javadoc Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> --------- Signed-off-by: Matthew Whitehead <matthew1001@gmail.com> Signed-off-by: Matthew Whitehead <matthew.whitehead@kaleido.io> Signed-off-by: Matt Whitehead <matthew.whitehead@kaleido.io>
PR description
Some changes were made to the BFT mining coordinator to ensure it could be stopped and started (see #5861). A bug in those changes meant that when it was restarted, a new block height manager wasn't created.
This PR ensures that when BFT mining is restarted, so is the block height manager.
Fixed Issue(s)
Fixes #8307