diff --git a/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java index e45f99f96b..44c1c486fb 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/IbftBesuControllerBuilder.java @@ -24,9 +24,10 @@ import org.hyperledger.besu.consensus.common.IbftValidatorOverrides; import org.hyperledger.besu.consensus.common.VoteProposer; import org.hyperledger.besu.consensus.common.VoteTallyCache; import org.hyperledger.besu.consensus.common.VoteTallyUpdater; +import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.ibft.BlockTimer; import org.hyperledger.besu.consensus.ibft.EthSynchronizerUpdater; -import org.hyperledger.besu.consensus.ibft.EventMultiplexer; import org.hyperledger.besu.consensus.ibft.IbftBlockInterface; import org.hyperledger.besu.consensus.ibft.IbftContext; import org.hyperledger.besu.consensus.ibft.IbftEventQueue; @@ -172,7 +173,7 @@ public class IbftBesuControllerBuilder extends BesuControllerBuilder { final MessageTracker duplicateMessageTracker = new MessageTracker(ibftConfig.getDuplicateMessageLimit()); - final IbftController ibftController = + final BftEventHandler ibftController = new IbftController( blockchain, finalState, diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/EventMultiplexer.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/EventMultiplexer.java similarity index 65% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/EventMultiplexer.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/EventMultiplexer.java index 8b3f735a65..7ce1f07d95 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/EventMultiplexer.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/EventMultiplexer.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft; +package org.hyperledger.besu.consensus.common.bft; -import org.hyperledger.besu.consensus.ibft.ibftevent.BlockTimerExpiry; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvent; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftReceivedMessageEvent; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; -import org.hyperledger.besu.consensus.ibft.statemachine.IbftController; +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvent; +import org.hyperledger.besu.consensus.common.bft.events.IbftReceivedMessageEvent; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -28,10 +28,10 @@ public class EventMultiplexer { private static final Logger LOG = LogManager.getLogger(); - private final IbftController ibftController; + private final BftEventHandler eventHandler; - public EventMultiplexer(final IbftController ibftController) { - this.ibftController = ibftController; + public EventMultiplexer(final BftEventHandler eventHandler) { + this.eventHandler = eventHandler; } public void handleIbftEvent(final IbftEvent ibftEvent) { @@ -39,19 +39,19 @@ public class EventMultiplexer { switch (ibftEvent.getType()) { case MESSAGE: final IbftReceivedMessageEvent rxEvent = (IbftReceivedMessageEvent) ibftEvent; - ibftController.handleMessageEvent(rxEvent); + eventHandler.handleMessageEvent(rxEvent); break; case ROUND_EXPIRY: final RoundExpiry roundExpiryEvent = (RoundExpiry) ibftEvent; - ibftController.handleRoundExpiry(roundExpiryEvent); + eventHandler.handleRoundExpiry(roundExpiryEvent); break; case NEW_CHAIN_HEAD: final NewChainHead newChainHead = (NewChainHead) ibftEvent; - ibftController.handleNewBlockEvent(newChainHead); + eventHandler.handleNewBlockEvent(newChainHead); break; case BLOCK_TIMER_EXPIRY: final BlockTimerExpiry blockTimerExpiry = (BlockTimerExpiry) ibftEvent; - ibftController.handleBlockTimerExpiry(blockTimerExpiry); + eventHandler.handleBlockTimerExpiry(blockTimerExpiry); break; default: throw new RuntimeException("Illegal event in queue."); diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/BlockTimerExpiry.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/BlockTimerExpiry.java similarity index 97% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/BlockTimerExpiry.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/BlockTimerExpiry.java index 29c3e1228d..89250da701 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/BlockTimerExpiry.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/BlockTimerExpiry.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft.ibftevent; +package org.hyperledger.besu.consensus.common.bft.events; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftEvent.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftEvent.java similarity index 93% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftEvent.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftEvent.java index d93277b5e1..aab16d71db 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftEvent.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftEvent.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft.ibftevent; +package org.hyperledger.besu.consensus.common.bft.events; /** Category of events that will effect and are interpretable by the Ibft processing mechanism */ public interface IbftEvent { diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftEvents.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftEvents.java similarity index 94% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftEvents.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftEvents.java index 45ec68600c..c8c8971b81 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftEvents.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftEvents.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft.ibftevent; +package org.hyperledger.besu.consensus.common.bft.events; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.Message; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftReceivedMessageEvent.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftReceivedMessageEvent.java similarity index 94% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftReceivedMessageEvent.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftReceivedMessageEvent.java index 1cdd33fa8a..c11f0b4c24 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/IbftReceivedMessageEvent.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/IbftReceivedMessageEvent.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft.ibftevent; +package org.hyperledger.besu.consensus.common.bft.events; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.Message; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/NewChainHead.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/NewChainHead.java similarity index 97% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/NewChainHead.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/NewChainHead.java index 306b4bfafe..fb81d29b02 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/NewChainHead.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/NewChainHead.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft.ibftevent; +package org.hyperledger.besu.consensus.common.bft.events; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/RoundExpiry.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/RoundExpiry.java similarity index 96% rename from consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/RoundExpiry.java rename to consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/RoundExpiry.java index 8742523e88..d26fe7c6b4 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/ibftevent/RoundExpiry.java +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/events/RoundExpiry.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.ibft.ibftevent; +package org.hyperledger.besu.consensus.common.bft.events; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; diff --git a/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/statemachine/BftEventHandler.java b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/statemachine/BftEventHandler.java new file mode 100644 index 0000000000..8a967fe086 --- /dev/null +++ b/consensus/common/src/main/java/org/hyperledger/besu/consensus/common/bft/statemachine/BftEventHandler.java @@ -0,0 +1,33 @@ +/* + * Copyright ConsenSys AG. + * + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on + * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + * SPDX-License-Identifier: Apache-2.0 + */ +package org.hyperledger.besu.consensus.common.bft.statemachine; + +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.IbftReceivedMessageEvent; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; + +public interface BftEventHandler { + + void start(); + + void handleMessageEvent(IbftReceivedMessageEvent msg); + + void handleNewBlockEvent(NewChainHead newChainHead); + + void handleBlockTimerExpiry(BlockTimerExpiry blockTimerExpiry); + + void handleRoundExpiry(RoundExpiry roundExpiry); +} diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContext.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContext.java index 62978c9740..b213d5a1dd 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContext.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContext.java @@ -15,10 +15,10 @@ package org.hyperledger.besu.consensus.ibft.support; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.ibft.IbftExecutors; import org.hyperledger.besu.consensus.ibft.payload.MessageFactory; -import org.hyperledger.besu.consensus.ibft.statemachine.IbftController; import org.hyperledger.besu.consensus.ibft.statemachine.IbftFinalState; import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.core.Address; @@ -42,7 +42,7 @@ public class TestContext { private final Map remotePeers; private final MutableBlockchain blockchain; private final IbftExecutors ibftExecutors; - private final IbftController controller; + private final BftEventHandler controller; private final IbftFinalState finalState; private final EventMultiplexer eventMultiplexer; @@ -50,7 +50,7 @@ public class TestContext { final Map remotePeers, final MutableBlockchain blockchain, final IbftExecutors ibftExecutors, - final IbftController controller, + final BftEventHandler controller, final IbftFinalState finalState, final EventMultiplexer eventMultiplexer) { this.remotePeers = remotePeers; @@ -70,7 +70,7 @@ public class TestContext { return blockchain; } - public IbftController getController() { + public BftEventHandler getController() { return controller; } diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java index 86dc8f3021..f29e9cc84a 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/TestContextBuilder.java @@ -25,8 +25,9 @@ import org.hyperledger.besu.consensus.common.EpochManager; import org.hyperledger.besu.consensus.common.VoteProposer; import org.hyperledger.besu.consensus.common.VoteTallyCache; import org.hyperledger.besu.consensus.common.VoteTallyUpdater; +import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.ibft.BlockTimer; -import org.hyperledger.besu.consensus.ibft.EventMultiplexer; import org.hyperledger.besu.consensus.ibft.Gossiper; import org.hyperledger.besu.consensus.ibft.IbftBlockHeaderFunctions; import org.hyperledger.besu.consensus.ibft.IbftBlockInterface; @@ -94,17 +95,17 @@ public class TestContextBuilder { private static class ControllerAndState { private final IbftExecutors ibftExecutors; - private final IbftController controller; + private final BftEventHandler eventHandler; private final IbftFinalState finalState; private final EventMultiplexer eventMultiplexer; public ControllerAndState( final IbftExecutors ibftExecutors, - final IbftController controller, + final BftEventHandler eventHandler, final IbftFinalState finalState, final EventMultiplexer eventMultiplexer) { this.ibftExecutors = ibftExecutors; - this.controller = controller; + this.eventHandler = eventHandler; this.finalState = finalState; this.eventMultiplexer = eventMultiplexer; } @@ -113,8 +114,8 @@ public class TestContextBuilder { return ibftExecutors; } - public IbftController getController() { - return controller; + public BftEventHandler getEventHandler() { + return eventHandler; } public IbftFinalState getFinalState() { @@ -219,7 +220,7 @@ public class TestContextBuilder { remotePeers, blockChain, controllerAndState.getIbftExecutors(), - controllerAndState.getController(), + controllerAndState.getEventHandler(), controllerAndState.getFinalState(), controllerAndState.getEventMultiplexer()); } @@ -347,7 +348,7 @@ public class TestContextBuilder { FUTURE_MESSAGES_LIMIT, blockChain.getChainHeadBlockNumber()); - final IbftController ibftController = + final BftEventHandler ibftController = new IbftController( blockChain, finalState, diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/ValidatorPeer.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/ValidatorPeer.java index db98b225bb..11564aa4e3 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/ValidatorPeer.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/support/ValidatorPeer.java @@ -17,8 +17,8 @@ package org.hyperledger.besu.consensus.ibft.support; import static org.assertj.core.api.Assertions.assertThat; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.EventMultiplexer; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvents; +import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvents; import org.hyperledger.besu.consensus.ibft.messagedata.CommitMessageData; import org.hyperledger.besu.consensus.ibft.messagedata.PrepareMessageData; import org.hyperledger.besu.consensus.ibft.messagedata.ProposalMessageData; diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/FutureHeightTest.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/FutureHeightTest.java index d586177188..57277c99dd 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/FutureHeightTest.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/FutureHeightTest.java @@ -19,8 +19,8 @@ import static org.assertj.core.util.Lists.emptyList; import static org.hyperledger.besu.consensus.ibft.support.IntegrationTestHelpers.createSignedCommitPayload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; import org.hyperledger.besu.consensus.ibft.IbftHelpers; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; import org.hyperledger.besu.consensus.ibft.payload.MessageFactory; diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/GossipTest.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/GossipTest.java index eab0d53bde..65c5309b8d 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/GossipTest.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/GossipTest.java @@ -18,8 +18,8 @@ import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; import org.hyperledger.besu.consensus.ibft.IbftHelpers; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; import org.hyperledger.besu.consensus.ibft.messagedata.ProposalMessageData; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/LocalNodeIsProposerTest.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/LocalNodeIsProposerTest.java index ae303d129b..f172d1b1ba 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/LocalNodeIsProposerTest.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/LocalNodeIsProposerTest.java @@ -18,9 +18,9 @@ import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.consensus.ibft.support.IntegrationTestHelpers.createSignedCommitPayload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.BlockTimerExpiry; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Proposal; import org.hyperledger.besu.consensus.ibft.payload.MessageFactory; diff --git a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/RoundChangeTest.java b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/RoundChangeTest.java index 29bd49b2bc..0217e10b20 100644 --- a/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/RoundChangeTest.java +++ b/consensus/ibft/src/integration-test/java/org/hyperledger/besu/consensus/ibft/tests/RoundChangeTest.java @@ -19,9 +19,9 @@ import static java.util.Optional.empty; import static org.hyperledger.besu.consensus.ibft.support.IntegrationTestHelpers.createValidPreparedRoundArtifacts; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.ibft.IbftHelpers; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; import org.hyperledger.besu.consensus.ibft.messagewrappers.Proposal; import org.hyperledger.besu.consensus.ibft.messagewrappers.RoundChange; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/BlockTimer.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/BlockTimer.java index 48e169d630..1027f3c8a9 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/BlockTimer.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/BlockTimer.java @@ -15,7 +15,7 @@ package org.hyperledger.besu.consensus.ibft; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; import org.hyperledger.besu.ethereum.core.BlockHeader; import java.time.Clock; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftEventQueue.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftEventQueue.java index ae5129749d..5595e0de8d 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftEventQueue.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftEventQueue.java @@ -14,7 +14,7 @@ */ package org.hyperledger.besu.consensus.ibft; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvent; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvent; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftProcessor.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftProcessor.java index 86ad206bd3..1cd15c9ca7 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftProcessor.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/IbftProcessor.java @@ -14,7 +14,8 @@ */ package org.hyperledger.besu.consensus.ibft; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvent; +import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvent; import java.util.Optional; import java.util.concurrent.CountDownLatch; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/RoundTimer.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/RoundTimer.java index ba4c86c556..a6bbf77397 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/RoundTimer.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/RoundTimer.java @@ -15,7 +15,7 @@ package org.hyperledger.besu.consensus.ibft; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import java.util.Optional; import java.util.concurrent.ScheduledFuture; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinator.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinator.java index 2c03aa9e21..36720370ac 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinator.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinator.java @@ -16,11 +16,11 @@ package org.hyperledger.besu.consensus.ibft.blockcreation; import static org.apache.logging.log4j.LogManager.getLogger; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.ibft.IbftEventQueue; import org.hyperledger.besu.consensus.ibft.IbftExecutors; import org.hyperledger.besu.consensus.ibft.IbftProcessor; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; -import org.hyperledger.besu.consensus.ibft.statemachine.IbftController; import org.hyperledger.besu.ethereum.blockcreation.MiningCoordinator; import org.hyperledger.besu.ethereum.chain.BlockAddedEvent; import org.hyperledger.besu.ethereum.chain.BlockAddedObserver; @@ -48,7 +48,7 @@ public class IbftMiningCoordinator implements MiningCoordinator, BlockAddedObser private static final Logger LOG = getLogger(); - private final IbftController controller; + private final BftEventHandler eventHandler; private final IbftProcessor ibftProcessor; private final IbftBlockCreatorFactory blockCreatorFactory; protected final Blockchain blockchain; @@ -60,13 +60,13 @@ public class IbftMiningCoordinator implements MiningCoordinator, BlockAddedObser public IbftMiningCoordinator( final IbftExecutors ibftExecutors, - final IbftController controller, + final BftEventHandler eventHandler, final IbftProcessor ibftProcessor, final IbftBlockCreatorFactory blockCreatorFactory, final Blockchain blockchain, final IbftEventQueue eventQueue) { this.ibftExecutors = ibftExecutors; - this.controller = controller; + this.eventHandler = eventHandler; this.ibftProcessor = ibftProcessor; this.blockCreatorFactory = blockCreatorFactory; this.eventQueue = eventQueue; @@ -79,7 +79,7 @@ public class IbftMiningCoordinator implements MiningCoordinator, BlockAddedObser if (state.compareAndSet(State.IDLE, State.RUNNING)) { ibftExecutors.start(); blockAddedObserverId = blockchain.observeBlockAdded(this); - controller.start(); + eventHandler.start(); ibftExecutors.executeIbftProcessor(ibftProcessor); } } diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/protocol/IbftProtocolManager.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/protocol/IbftProtocolManager.java index 4c7b613b70..ee8945c952 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/protocol/IbftProtocolManager.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/protocol/IbftProtocolManager.java @@ -14,9 +14,9 @@ */ package org.hyperledger.besu.consensus.ibft.protocol; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvent; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvents; import org.hyperledger.besu.consensus.ibft.IbftEventQueue; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvent; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvents; import org.hyperledger.besu.consensus.ibft.network.PeerConnectionTracker; import org.hyperledger.besu.ethereum.p2p.network.ProtocolManager; import org.hyperledger.besu.ethereum.p2p.rlpx.connections.PeerConnection; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/BlockHeightManager.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/BlockHeightManager.java index d16faa1889..5facdda17e 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/BlockHeightManager.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/BlockHeightManager.java @@ -15,7 +15,7 @@ package org.hyperledger.besu.consensus.ibft.statemachine; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; import org.hyperledger.besu.consensus.ibft.messagewrappers.Proposal; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManager.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManager.java index f51c96d50e..44c9fdf4c7 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManager.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManager.java @@ -19,10 +19,10 @@ import static org.hyperledger.besu.consensus.ibft.statemachine.IbftBlockHeightMa import static org.hyperledger.besu.consensus.ibft.statemachine.IbftBlockHeightManager.MessageAge.PRIOR_ROUND; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.Payload; import org.hyperledger.besu.consensus.ibft.BlockTimer; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; import org.hyperledger.besu.consensus.ibft.messagewrappers.Proposal; diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java index 96cbb659f1..fb701d056d 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftController.java @@ -15,15 +15,16 @@ package org.hyperledger.besu.consensus.ibft.statemachine; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.IbftReceivedMessageEvent; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.Authored; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.ibft.Gossiper; import org.hyperledger.besu.consensus.ibft.MessageTracker; import org.hyperledger.besu.consensus.ibft.SynchronizerUpdater; -import org.hyperledger.besu.consensus.ibft.ibftevent.BlockTimerExpiry; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftReceivedMessageEvent; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagedata.CommitMessageData; import org.hyperledger.besu.consensus.ibft.messagedata.IbftV2; import org.hyperledger.besu.consensus.ibft.messagedata.PrepareMessageData; @@ -40,7 +41,7 @@ import java.util.function.Consumer; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; -public class IbftController { +public class IbftController implements BftEventHandler { private static final Logger LOG = LogManager.getLogger(); private final Blockchain blockchain; @@ -71,12 +72,14 @@ public class IbftController { this.sychronizerUpdater = sychronizerUpdater; } + @Override public void start() { if (started.compareAndSet(false, true)) { startNewHeightManager(blockchain.getChainHeadHeader()); } } + @Override public void handleMessageEvent(final IbftReceivedMessageEvent msg) { final MessageData data = msg.getMessage().getData(); if (!duplicateMessageTracker.hasSeenMessage(data)) { @@ -145,6 +148,7 @@ public class IbftController { } } + @Override public void handleNewBlockEvent(final NewChainHead newChainHead) { final BlockHeader newBlockHeader = newChainHead.getNewChainHeadHeader(); final BlockHeader currentMiningParent = currentHeightManager.getParentBlockHeader(); @@ -177,6 +181,7 @@ public class IbftController { startNewHeightManager(newBlockHeader); } + @Override public void handleBlockTimerExpiry(final BlockTimerExpiry blockTimerExpiry) { final ConsensusRoundIdentifier roundIndentifier = blockTimerExpiry.getRoundIndentifier(); if (isMsgForCurrentHeight(roundIndentifier)) { @@ -189,6 +194,7 @@ public class IbftController { } } + @Override public void handleRoundExpiry(final RoundExpiry roundExpiry) { // Discard all messages which target the BLOCKCHAIN height (which SHOULD be 1 less than // the currentHeightManager, but CAN be the same directly following import). diff --git a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/NoOpBlockHeightManager.java b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/NoOpBlockHeightManager.java index 3407993d02..c2acb4f689 100644 --- a/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/NoOpBlockHeightManager.java +++ b/consensus/ibft/src/main/java/org/hyperledger/besu/consensus/ibft/statemachine/NoOpBlockHeightManager.java @@ -15,7 +15,7 @@ package org.hyperledger.besu.consensus.ibft.statemachine; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; import org.hyperledger.besu.consensus.ibft.messagewrappers.Proposal; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/BlockTimerTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/BlockTimerTest.java index db27c1b11a..69314165c8 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/BlockTimerTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/BlockTimerTest.java @@ -25,8 +25,8 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.BlockTimerExpiry; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvent; +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvent; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftEventQueueTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftEventQueueTest.java index 3f1fc53328..12a665bd3c 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftEventQueueTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftEventQueueTest.java @@ -17,8 +17,8 @@ package org.hyperledger.besu.consensus.ibft; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThatCode; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvent; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftEvents; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvent; +import org.hyperledger.besu.consensus.common.bft.events.IbftEvents; import java.util.ArrayList; import java.util.List; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftProcessorTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftProcessorTest.java index ac2f0b3ac2..bafcb21523 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftProcessorTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/IbftProcessorTest.java @@ -25,7 +25,8 @@ import static org.mockito.Mockito.times; import static org.mockito.Mockito.verify; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/RoundTimerTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/RoundTimerTest.java index 15674b692a..10f45f8f5a 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/RoundTimerTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/RoundTimerTest.java @@ -24,7 +24,7 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import java.util.concurrent.ScheduledFuture; import java.util.concurrent.TimeUnit; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinatorTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinatorTest.java index 3556ef3bf4..b92690f60a 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinatorTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/blockcreation/IbftMiningCoordinatorTest.java @@ -19,11 +19,11 @@ import static org.mockito.Mockito.never; import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.ibft.IbftEventQueue; import org.hyperledger.besu.consensus.ibft.IbftExecutors; import org.hyperledger.besu.consensus.ibft.IbftProcessor; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; -import org.hyperledger.besu.consensus.ibft.statemachine.IbftController; import org.hyperledger.besu.ethereum.chain.BlockAddedEvent; import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.Block; @@ -44,7 +44,7 @@ import org.mockito.junit.MockitoJUnitRunner; @RunWith(MockitoJUnitRunner.class) public class IbftMiningCoordinatorTest { - @Mock private IbftController controller; + @Mock private BftEventHandler controller; @Mock private IbftExecutors ibftExecutors; @Mock private IbftProcessor ibftProcessor; @Mock private IbftBlockCreatorFactory ibftBlockCreatorFactory; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManagerTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManagerTest.java index 3e8af28121..41ee6a5316 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManagerTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftBlockHeightManagerTest.java @@ -31,11 +31,11 @@ import static org.mockito.Mockito.verify; import static org.mockito.Mockito.when; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.ibft.BlockTimer; import org.hyperledger.besu.consensus.ibft.IbftExtraData; import org.hyperledger.besu.consensus.ibft.RoundTimer; import org.hyperledger.besu.consensus.ibft.blockcreation.IbftBlockCreator; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagewrappers.Commit; import org.hyperledger.besu.consensus.ibft.messagewrappers.Prepare; import org.hyperledger.besu.consensus.ibft.messagewrappers.Proposal; diff --git a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftControllerTest.java b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftControllerTest.java index 81699cb5bd..9a12f0bb5a 100644 --- a/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftControllerTest.java +++ b/consensus/ibft/src/test/java/org/hyperledger/besu/consensus/ibft/statemachine/IbftControllerTest.java @@ -27,13 +27,13 @@ import static org.mockito.Mockito.verifyNoMoreInteractions; import static org.mockito.Mockito.when; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; +import org.hyperledger.besu.consensus.common.bft.events.BlockTimerExpiry; +import org.hyperledger.besu.consensus.common.bft.events.IbftReceivedMessageEvent; +import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; +import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; import org.hyperledger.besu.consensus.ibft.EthSynchronizerUpdater; import org.hyperledger.besu.consensus.ibft.IbftGossip; import org.hyperledger.besu.consensus.ibft.MessageTracker; -import org.hyperledger.besu.consensus.ibft.ibftevent.BlockTimerExpiry; -import org.hyperledger.besu.consensus.ibft.ibftevent.IbftReceivedMessageEvent; -import org.hyperledger.besu.consensus.ibft.ibftevent.NewChainHead; -import org.hyperledger.besu.consensus.ibft.ibftevent.RoundExpiry; import org.hyperledger.besu.consensus.ibft.messagedata.CommitMessageData; import org.hyperledger.besu.consensus.ibft.messagedata.IbftV2; import org.hyperledger.besu.consensus.ibft.messagedata.PrepareMessageData;