From fe9341a5047b97cee84057178a9e1c14952ef434 Mon Sep 17 00:00:00 2001 From: Jason Frame Date: Wed, 18 Dec 2024 13:20:35 +1000 Subject: [PATCH] Move the core of QBFT into a qbft core module so it can be reused outside Besu Signed-off-by: Jason Frame --- besu/build.gradle | 1 + .../controller/QbftBesuControllerBuilder.java | 14 +-- consensus/qbft-core/build.gradle | 88 +++++++++++++++++++ .../core}/support/IntegrationTestHelpers.java | 8 +- .../core}/support/RoundSpecificPeers.java | 20 ++--- .../qbft/core}/support/TestContext.java | 4 +- .../core}/support/TestContextBuilder.java | 16 ++-- .../qbft/core}/support/ValidatorPeer.java | 28 +++--- .../qbft/core}/test/FutureHeightTest.java | 16 ++-- .../qbft/core}/test/FutureRoundTest.java | 18 ++-- .../consensus/qbft/core}/test/GossipTest.java | 22 ++--- .../core}/test/LocalNodeIsProposerTest.java | 18 ++-- .../core}/test/LocalNodeNotProposerTest.java | 16 ++-- .../test/ReceivedFutureProposalTest.java | 26 +++--- .../qbft/core}/test/RoundChangeTest.java | 24 ++--- .../core}/test/SpuriousBehaviourTest.java | 20 ++--- .../qbft/core}/test/TransitionsTest.java | 6 +- .../core}/test/ValidatorContractTest.java | 10 +-- .../test/round/QbftRoundIntegrationTest.java | 12 +-- .../genesis_migrating_validator_contract.json | 0 .../resources/genesis_validator_contract.json | 0 .../genesis_validator_contract_london.json | 0 .../genesis_validator_contract_shanghai.json | 0 .../src/integration-test/resources/log4j2.xml | 0 .../resources/validator_contract.sol | 0 .../core}/messagedata/CommitMessageData.java | 4 +- .../core}/messagedata/PrepareMessageData.java | 4 +- .../messagedata/ProposalMessageData.java | 4 +- .../qbft/core}/messagedata/QbftV1.java | 2 +- .../messagedata/RoundChangeMessageData.java | 4 +- .../qbft/core}/messagewrappers/Commit.java | 4 +- .../qbft/core}/messagewrappers/Prepare.java | 4 +- .../qbft/core}/messagewrappers/Proposal.java | 8 +- .../core}/messagewrappers/RoundChange.java | 8 +- .../qbft/core/network}/QbftGossip.java | 12 +-- .../core}/network/QbftMessageTransmitter.java | 26 +++--- .../qbft/core}/payload/CommitPayload.java | 4 +- .../qbft/core}/payload/MessageFactory.java | 12 +-- .../qbft/core}/payload/PreparePayload.java | 4 +- .../core}/payload/PreparedRoundMetadata.java | 2 +- .../qbft/core}/payload/ProposalPayload.java | 4 +- .../qbft/core}/payload/QbftPayload.java | 2 +- .../core}/payload/RoundChangePayload.java | 4 +- .../BaseQbftBlockHeightManager.java | 10 +-- .../statemachine/NoOpBlockHeightManager.java | 10 +-- .../statemachine/PreparedCertificate.java | 4 +- .../statemachine/QbftBlockHeightManager.java | 18 ++-- .../QbftBlockHeightManagerFactory.java | 8 +- .../core}/statemachine/QbftController.java | 12 +-- .../qbft/core}/statemachine/QbftRound.java | 16 ++-- .../core}/statemachine/QbftRoundFactory.java | 8 +- .../statemachine/RoundChangeArtifacts.java | 6 +- .../statemachine/RoundChangeManager.java | 6 +- .../qbft/core}/statemachine/RoundState.java | 10 +-- .../core}/validation/CommitValidator.java | 6 +- .../FutureRoundProposalMessageValidator.java | 4 +- .../core}/validation/MessageValidator.java | 8 +- .../validation/MessageValidatorFactory.java | 4 +- .../core}/validation/PrepareValidator.java | 6 +- .../validation/ProposalPayloadValidator.java | 4 +- .../core}/validation/ProposalValidator.java | 10 +-- .../RoundChangeMessageValidator.java | 8 +- .../RoundChangePayloadValidator.java | 6 +- .../ValidatorModeTransitionLogger.java | 2 +- .../core}/messagewrappers/CommitTest.java | 6 +- .../core}/messagewrappers/PrepareTest.java | 6 +- .../core}/messagewrappers/ProposalTest.java | 12 +-- .../messagewrappers/RoundChangeTest.java | 10 +-- .../qbft/core}/payload/QbftPayloadTest.java | 2 +- .../QbftBlockHeightManagerTest.java | 22 ++--- .../statemachine/QbftControllerTest.java | 22 ++--- .../core}/statemachine/QbftRoundTest.java | 12 +-- .../core}/statemachine/RoundStateTest.java | 14 +-- .../core}/validation/CommitValidatorTest.java | 4 +- .../validation/PrepareValidatorTest.java | 4 +- .../ProposalPayloadValidatorTest.java | 6 +- .../validation/ProposalValidatorTest.java | 18 ++-- .../qbft/core}/validation/QbftNode.java | 4 +- .../qbft/core}/validation/QbftNodeList.java | 4 +- .../RoundChangeMessageValidatorTest.java | 14 +-- .../RoundChangePayloadValidatorTest.java | 6 +- .../validation/ValidationTestHelpers.java | 8 +- consensus/qbft/build.gradle | 17 +--- .../qbft/protocol/Istanbul100SubProtocol.java | 2 +- .../ValidatorModeTransitionLoggerTest.java | 1 + settings.gradle | 1 + 86 files changed, 458 insertions(+), 382 deletions(-) create mode 100644 consensus/qbft-core/build.gradle rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/support/IntegrationTestHelpers.java (90%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/support/RoundSpecificPeers.java (91%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/support/TestContext.java (97%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/support/TestContextBuilder.java (97%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/support/ValidatorPeer.java (76%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/FutureHeightTest.java (94%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/FutureRoundTest.java (89%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/GossipTest.java (88%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/LocalNodeIsProposerTest.java (90%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/LocalNodeNotProposerTest.java (89%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/ReceivedFutureProposalTest.java (90%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/RoundChangeTest.java (93%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/SpuriousBehaviourTest.java (88%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/TransitionsTest.java (93%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/ValidatorContractTest.java (98%) rename consensus/{qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core}/test/round/QbftRoundIntegrationTest.java (95%) rename consensus/{qbft => qbft-core}/src/integration-test/resources/genesis_migrating_validator_contract.json (100%) rename consensus/{qbft => qbft-core}/src/integration-test/resources/genesis_validator_contract.json (100%) rename consensus/{qbft => qbft-core}/src/integration-test/resources/genesis_validator_contract_london.json (100%) rename consensus/{qbft => qbft-core}/src/integration-test/resources/genesis_validator_contract_shanghai.json (100%) rename consensus/{qbft => qbft-core}/src/integration-test/resources/log4j2.xml (100%) rename consensus/{qbft => qbft-core}/src/integration-test/resources/validator_contract.sol (100%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagedata/CommitMessageData.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagedata/PrepareMessageData.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagedata/ProposalMessageData.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagedata/QbftV1.java (94%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagedata/RoundChangeMessageData.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/Commit.java (92%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/Prepare.java (92%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/Proposal.java (92%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/RoundChange.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network}/QbftGossip.java (87%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/network/QbftMessageTransmitter.java (82%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/CommitPayload.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/MessageFactory.java (90%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/PreparePayload.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/PreparedRoundMetadata.java (98%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/ProposalPayload.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/QbftPayload.java (97%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/payload/RoundChangePayload.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/BaseQbftBlockHeightManager.java (79%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/NoOpBlockHeightManager.java (83%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/PreparedCertificate.java (92%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftBlockHeightManager.java (95%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftBlockHeightManagerFactory.java (92%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftController.java (90%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftRound.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftRoundFactory.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/RoundChangeArtifacts.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/RoundChangeManager.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/RoundState.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/CommitValidator.java (94%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/FutureRoundProposalMessageValidator.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/MessageValidator.java (94%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/MessageValidatorFactory.java (97%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/PrepareValidator.java (92%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/ProposalPayloadValidator.java (96%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/ProposalValidator.java (97%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/RoundChangeMessageValidator.java (94%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validation/RoundChangePayloadValidator.java (93%) rename consensus/{qbft/src/main/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core}/validator/ValidatorModeTransitionLogger.java (98%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/CommitTest.java (91%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/PrepareTest.java (90%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/ProposalTest.java (90%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/messagewrappers/RoundChangeTest.java (93%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/payload/QbftPayloadTest.java (97%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftBlockHeightManagerTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftControllerTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/QbftRoundTest.java (97%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/statemachine/RoundStateTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/CommitValidatorTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/PrepareValidatorTest.java (95%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/ProposalPayloadValidatorTest.java (97%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/ProposalValidatorTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/QbftNode.java (91%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/QbftNodeList.java (92%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/RoundChangeMessageValidatorTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/RoundChangePayloadValidatorTest.java (96%) rename consensus/{qbft/src/test/java/org/hyperledger/besu/consensus/qbft => qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core}/validation/ValidationTestHelpers.java (88%) diff --git a/besu/build.gradle b/besu/build.gradle index 01b0b4bead7..d1230b6974b 100644 --- a/besu/build.gradle +++ b/besu/build.gradle @@ -39,6 +39,7 @@ dependencies { implementation project(':consensus:ibft') implementation project(':consensus:merge') implementation project(':consensus:qbft') + implementation project(':consensus:qbft-core') implementation project(':crypto:services') implementation project(':datatypes') implementation project(':enclave') diff --git a/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java b/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java index e8c08d8a473..4143d034058 100644 --- a/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java +++ b/besu/src/main/java/org/hyperledger/besu/controller/QbftBesuControllerBuilder.java @@ -47,20 +47,20 @@ import org.hyperledger.besu.consensus.common.validator.blockbased.BlockValidatorProvider; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; import org.hyperledger.besu.consensus.qbft.QbftForksSchedulesFactory; -import org.hyperledger.besu.consensus.qbft.QbftGossip; import org.hyperledger.besu.consensus.qbft.QbftProtocolScheduleBuilder; import org.hyperledger.besu.consensus.qbft.blockcreation.QbftBlockCreatorFactory; +import org.hyperledger.besu.consensus.qbft.core.network.QbftGossip; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftBlockHeightManagerFactory; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftController; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftRoundFactory; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.validator.ValidatorModeTransitionLogger; import org.hyperledger.besu.consensus.qbft.jsonrpc.QbftJsonRpcMethods; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; import org.hyperledger.besu.consensus.qbft.protocol.Istanbul100SubProtocol; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftBlockHeightManagerFactory; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftController; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftRoundFactory; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; import org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider; import org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider; import org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController; -import org.hyperledger.besu.consensus.qbft.validator.ValidatorModeTransitionLogger; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.api.jsonrpc.methods.JsonRpcMethods; diff --git a/consensus/qbft-core/build.gradle b/consensus/qbft-core/build.gradle new file mode 100644 index 00000000000..aab093f53ef --- /dev/null +++ b/consensus/qbft-core/build.gradle @@ -0,0 +1,88 @@ +/* + * 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 + */ + +apply plugin: 'java-library' + +jar { + archiveBaseName = 'besu-qbft-core' + manifest { + attributes( + 'Specification-Title': archiveBaseName, + 'Specification-Version': project.version, + 'Implementation-Title': archiveBaseName, + 'Implementation-Version': calculateVersion(), + 'Commit-Hash': getGitCommitDetails(40).hash + ) + } +} + +dependencies { + implementation project(':config') + implementation project(':consensus:common') + implementation project(':crypto:services') + implementation project(':datatypes') + implementation project(':ethereum:api') + implementation project(':ethereum:blockcreation') + implementation project(':ethereum:core') + implementation project(':ethereum:eth') + implementation project(':ethereum:p2p') + implementation project(':ethereum:rlp') + implementation project(':evm') + + implementation 'com.google.guava:guava' + implementation 'io.vertx:vertx-core' + implementation 'com.fasterxml.jackson.core:jackson-databind' + implementation 'io.tmio:tuweni-bytes' + implementation 'io.tmio:tuweni-units' + implementation 'org.web3j:abi' + + integrationTestImplementation project(path: ':config', configuration: 'testSupportArtifacts') + integrationTestImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') + + testImplementation project(path: ':crypto:services', configuration: 'testSupportArtifacts') + testImplementation project(path: ':config', configuration: 'testSupportArtifacts') + testImplementation project(path: ':consensus:common', configuration: 'testArtifacts') + testImplementation project(path: ':consensus:common', configuration: 'testSupportArtifacts') + testImplementation project(':consensus:qbft') + testImplementation project(':ethereum:core') + testImplementation project(path: ':ethereum:core', configuration: 'testSupportArtifacts') + testImplementation project(':crypto:algorithms') + testImplementation project(':evm') + testImplementation project(':metrics:core') + testImplementation project(':testutil') + + testImplementation 'org.assertj:assertj-core' + testImplementation 'org.awaitility:awaitility' + testImplementation 'org.junit.jupiter:junit-jupiter' + testImplementation 'org.mockito:mockito-core' + testImplementation 'org.mockito:mockito-junit-jupiter' + + integrationTestImplementation project(':crypto:algorithms') + integrationTestImplementation project(path: ':crypto:services', configuration: 'testSupportArtifacts') + integrationTestImplementation project(path: ':consensus:common', configuration: 'testSupportArtifacts') + integrationTestImplementation project(':consensus:qbft') + integrationTestImplementation project(':evm') + integrationTestImplementation project(':metrics:core') + integrationTestImplementation project(':testutil') + + integrationTestImplementation 'org.assertj:assertj-core' + integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api' + integrationTestImplementation 'org.mockito:mockito-core' + integrationTestImplementation 'org.mockito:mockito-junit-jupiter' + + integrationTestRuntimeOnly 'org.junit.jupiter:junit-jupiter' + + testSupportImplementation 'org.mockito:mockito-core' +} diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/IntegrationTestHelpers.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/IntegrationTestHelpers.java similarity index 90% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/IntegrationTestHelpers.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/IntegrationTestHelpers.java index 4a9f8e7057a..390302eb880 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/IntegrationTestHelpers.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/IntegrationTestHelpers.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.support; +package org.hyperledger.besu.consensus.qbft.core.support; import org.hyperledger.besu.consensus.common.bft.BftBlockHashing; import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; @@ -20,9 +20,9 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.payload.CommitPayload; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.payload.CommitPayload; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/RoundSpecificPeers.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/RoundSpecificPeers.java similarity index 91% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/RoundSpecificPeers.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/RoundSpecificPeers.java index dc35796d0dc..afa07b31a4d 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/RoundSpecificPeers.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/RoundSpecificPeers.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.support; +package org.hyperledger.besu.consensus.qbft.core.support; import static java.util.Optional.empty; import static org.assertj.core.api.Assertions.assertThat; @@ -23,15 +23,15 @@ import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.Payload; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagedata.CommitMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.PrepareMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.messagedata.CommitMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.PrepareMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContext.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/TestContext.java similarity index 97% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContext.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/TestContext.java index 54dab34bdf5..0a65d03bcd3 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContext.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/TestContext.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.support; +package org.hyperledger.besu.consensus.qbft.core.support; import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; import org.hyperledger.besu.consensus.common.bft.BftExecutors; @@ -23,7 +23,7 @@ import org.hyperledger.besu.consensus.common.bft.statemachine.BftEventHandler; import org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState; import org.hyperledger.besu.consensus.common.validator.ValidatorProvider; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.chain.MutableBlockchain; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/TestContextBuilder.java similarity index 97% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/TestContextBuilder.java index a9de97ae18a..4d4f6832241 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/TestContextBuilder.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/TestContextBuilder.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.support; +package org.hyperledger.besu.consensus.qbft.core.support; import static java.nio.charset.StandardCharsets.UTF_8; import static org.hyperledger.besu.ethereum.core.InMemoryKeyValueStorageProvider.createInMemoryBlockchain; @@ -64,18 +64,18 @@ import org.hyperledger.besu.consensus.qbft.MutableQbftConfigOptions; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; import org.hyperledger.besu.consensus.qbft.QbftForksSchedulesFactory; -import org.hyperledger.besu.consensus.qbft.QbftGossip; import org.hyperledger.besu.consensus.qbft.QbftProtocolScheduleBuilder; import org.hyperledger.besu.consensus.qbft.blockcreation.QbftBlockCreatorFactory; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftBlockHeightManagerFactory; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftController; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftRoundFactory; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.network.QbftGossip; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftBlockHeightManagerFactory; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftController; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftRoundFactory; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.validator.ValidatorModeTransitionLogger; import org.hyperledger.besu.consensus.qbft.validator.ForkingValidatorProvider; import org.hyperledger.besu.consensus.qbft.validator.TransactionValidatorProvider; import org.hyperledger.besu.consensus.qbft.validator.ValidatorContractController; -import org.hyperledger.besu.consensus.qbft.validator.ValidatorModeTransitionLogger; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/ValidatorPeer.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/ValidatorPeer.java similarity index 76% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/ValidatorPeer.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/ValidatorPeer.java index af764bfed72..a4e482c7a1b 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/support/ValidatorPeer.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/support/ValidatorPeer.java @@ -12,27 +12,27 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.support; +package org.hyperledger.besu.consensus.qbft.core.support; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createCommitBlockFromProposalBlock; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createCommitBlockFromProposalBlock; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.EventMultiplexer; import org.hyperledger.besu.consensus.common.bft.inttest.DefaultValidatorPeer; import org.hyperledger.besu.consensus.common.bft.inttest.NodeParams; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagedata.CommitMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.PrepareMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.messagedata.CommitMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.PrepareMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/FutureHeightTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/FutureHeightTest.java similarity index 94% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/FutureHeightTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/FutureHeightTest.java index 811899bc7f5..a8438d3c01e 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/FutureHeightTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/FutureHeightTest.java @@ -12,23 +12,23 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.util.Lists.emptyList; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createSignedCommitPayload; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createSignedCommitPayload; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.BftHelpers; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; import org.hyperledger.besu.ethereum.core.Block; import java.time.Clock; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/FutureRoundTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/FutureRoundTest.java similarity index 89% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/FutureRoundTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/FutureRoundTest.java index 9681ca4f7d6..c2920619e46 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/FutureRoundTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/FutureRoundTest.java @@ -12,22 +12,22 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createCommitBlockFromProposalBlock; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createCommitBlockFromProposalBlock; import org.hyperledger.besu.consensus.common.bft.BftHelpers; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/GossipTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/GossipTest.java similarity index 88% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/GossipTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/GossipTest.java index fbe98de6b79..acafe66a055 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/GossipTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/GossipTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static java.util.Collections.emptyList; @@ -20,16 +20,16 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; -import org.hyperledger.besu.consensus.qbft.support.ValidatorPeer; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.support.ValidatorPeer; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/LocalNodeIsProposerTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/LocalNodeIsProposerTest.java similarity index 90% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/LocalNodeIsProposerTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/LocalNodeIsProposerTest.java index e5885d96a4f..85896bda3e4 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/LocalNodeIsProposerTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/LocalNodeIsProposerTest.java @@ -12,22 +12,22 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createSignedCommitPayload; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createSignedCommitPayload; 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.NewChainHead; import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; import org.hyperledger.besu.ethereum.core.Block; import java.time.Clock; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/LocalNodeNotProposerTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/LocalNodeNotProposerTest.java similarity index 89% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/LocalNodeNotProposerTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/LocalNodeNotProposerTest.java index 9d386178686..16cc4f87807 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/LocalNodeNotProposerTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/LocalNodeNotProposerTest.java @@ -12,18 +12,18 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createSignedCommitPayload; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createSignedCommitPayload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; import org.hyperledger.besu.ethereum.core.Block; import org.junit.jupiter.api.BeforeEach; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/ReceivedFutureProposalTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/ReceivedFutureProposalTest.java similarity index 90% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/ReceivedFutureProposalTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/ReceivedFutureProposalTest.java index 77b33ad2adc..260e996c223 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/ReceivedFutureProposalTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/ReceivedFutureProposalTest.java @@ -12,23 +12,23 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createValidPreparedCertificate; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createValidPreparedCertificate; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; -import org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; -import org.hyperledger.besu.consensus.qbft.support.ValidatorPeer; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.support.ValidatorPeer; import org.hyperledger.besu.ethereum.core.Block; import java.util.Collections; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/RoundChangeTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/RoundChangeTest.java similarity index 93% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/RoundChangeTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/RoundChangeTest.java index b1464efd53b..79761b10064 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/RoundChangeTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/RoundChangeTest.java @@ -12,27 +12,27 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static java.util.Collections.emptyList; import static java.util.Optional.empty; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createValidPreparedCertificate; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createValidPreparedCertificate; import org.hyperledger.besu.consensus.common.bft.BftHelpers; 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.RoundExpiry; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; -import org.hyperledger.besu.consensus.qbft.support.ValidatorPeer; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.support.ValidatorPeer; import org.hyperledger.besu.ethereum.core.Block; import java.time.Clock; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/SpuriousBehaviourTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/SpuriousBehaviourTest.java similarity index 88% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/SpuriousBehaviourTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/SpuriousBehaviourTest.java index 8f1bfb9a7fd..a18a885bafd 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/SpuriousBehaviourTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/SpuriousBehaviourTest.java @@ -12,21 +12,21 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static org.assertj.core.api.Assertions.assertThat; -import static org.hyperledger.besu.consensus.qbft.support.IntegrationTestHelpers.createSignedCommitPayload; +import static org.hyperledger.besu.consensus.qbft.core.support.IntegrationTestHelpers.createSignedCommitPayload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.inttest.NodeParams; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; -import org.hyperledger.besu.consensus.qbft.support.ValidatorPeer; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.support.ValidatorPeer; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/TransitionsTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/TransitionsTest.java similarity index 93% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/TransitionsTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/TransitionsTest.java index 93268ab1b81..1c57e532b33 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/TransitionsTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/TransitionsTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static org.assertj.core.api.Assertions.assertThat; @@ -21,8 +21,8 @@ import org.hyperledger.besu.config.QbftFork; import org.hyperledger.besu.consensus.common.bft.BftEventQueue; import org.hyperledger.besu.consensus.common.bft.events.NewChainHead; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.testutil.TestClock; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/ValidatorContractTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/ValidatorContractTest.java similarity index 98% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/ValidatorContractTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/ValidatorContractTest.java index c5978560065..4ab147989e3 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/ValidatorContractTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/ValidatorContractTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test; +package org.hyperledger.besu.consensus.qbft.core.test; import static java.time.temporal.ChronoUnit.SECONDS; import static org.assertj.core.api.Assertions.assertThat; @@ -27,10 +27,10 @@ import org.hyperledger.besu.consensus.common.bft.inttest.NodeParams; import org.hyperledger.besu.consensus.common.validator.ValidatorProvider; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.support.RoundSpecificPeers; -import org.hyperledger.besu.consensus.qbft.support.TestContext; -import org.hyperledger.besu.consensus.qbft.support.TestContextBuilder; -import org.hyperledger.besu.consensus.qbft.support.ValidatorPeer; +import org.hyperledger.besu.consensus.qbft.core.support.RoundSpecificPeers; +import org.hyperledger.besu.consensus.qbft.core.support.TestContext; +import org.hyperledger.besu.consensus.qbft.core.support.TestContextBuilder; +import org.hyperledger.besu.consensus.qbft.core.support.ValidatorPeer; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/round/QbftRoundIntegrationTest.java b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/round/QbftRoundIntegrationTest.java similarity index 95% rename from consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/round/QbftRoundIntegrationTest.java rename to consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/round/QbftRoundIntegrationTest.java index 7dcca442a7f..e93b2e7f40e 100644 --- a/consensus/qbft/src/integration-test/java/org/hyperledger/besu/consensus/qbft/test/round/QbftRoundIntegrationTest.java +++ b/consensus/qbft-core/src/integration-test/java/org/hyperledger/besu/consensus/qbft/core/test/round/QbftRoundIntegrationTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.test.round; +package org.hyperledger.besu.consensus.qbft.core.test.round; import static java.util.Collections.emptyList; import static java.util.Optional.empty; @@ -32,11 +32,11 @@ import org.hyperledger.besu.consensus.common.bft.blockcreation.BftBlockCreator; import org.hyperledger.besu.consensus.common.bft.inttest.StubValidatorMulticaster; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.network.QbftMessageTransmitter; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.statemachine.QbftRound; -import org.hyperledger.besu.consensus.qbft.statemachine.RoundState; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidator; +import org.hyperledger.besu.consensus.qbft.core.network.QbftMessageTransmitter; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.statemachine.QbftRound; +import org.hyperledger.besu.consensus.qbft.core.statemachine.RoundState; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidator; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.cryptoservices.NodeKey; diff --git a/consensus/qbft/src/integration-test/resources/genesis_migrating_validator_contract.json b/consensus/qbft-core/src/integration-test/resources/genesis_migrating_validator_contract.json similarity index 100% rename from consensus/qbft/src/integration-test/resources/genesis_migrating_validator_contract.json rename to consensus/qbft-core/src/integration-test/resources/genesis_migrating_validator_contract.json diff --git a/consensus/qbft/src/integration-test/resources/genesis_validator_contract.json b/consensus/qbft-core/src/integration-test/resources/genesis_validator_contract.json similarity index 100% rename from consensus/qbft/src/integration-test/resources/genesis_validator_contract.json rename to consensus/qbft-core/src/integration-test/resources/genesis_validator_contract.json diff --git a/consensus/qbft/src/integration-test/resources/genesis_validator_contract_london.json b/consensus/qbft-core/src/integration-test/resources/genesis_validator_contract_london.json similarity index 100% rename from consensus/qbft/src/integration-test/resources/genesis_validator_contract_london.json rename to consensus/qbft-core/src/integration-test/resources/genesis_validator_contract_london.json diff --git a/consensus/qbft/src/integration-test/resources/genesis_validator_contract_shanghai.json b/consensus/qbft-core/src/integration-test/resources/genesis_validator_contract_shanghai.json similarity index 100% rename from consensus/qbft/src/integration-test/resources/genesis_validator_contract_shanghai.json rename to consensus/qbft-core/src/integration-test/resources/genesis_validator_contract_shanghai.json diff --git a/consensus/qbft/src/integration-test/resources/log4j2.xml b/consensus/qbft-core/src/integration-test/resources/log4j2.xml similarity index 100% rename from consensus/qbft/src/integration-test/resources/log4j2.xml rename to consensus/qbft-core/src/integration-test/resources/log4j2.xml diff --git a/consensus/qbft/src/integration-test/resources/validator_contract.sol b/consensus/qbft-core/src/integration-test/resources/validator_contract.sol similarity index 100% rename from consensus/qbft/src/integration-test/resources/validator_contract.sol rename to consensus/qbft-core/src/integration-test/resources/validator_contract.sol diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/CommitMessageData.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/CommitMessageData.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/CommitMessageData.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/CommitMessageData.java index c0e8c537cd6..f39c3e66e19 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/CommitMessageData.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/CommitMessageData.java @@ -12,10 +12,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagedata; +package org.hyperledger.besu.consensus.qbft.core.messagedata; import org.hyperledger.besu.consensus.common.bft.messagedata.AbstractBftMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData; import org.apache.tuweni.bytes.Bytes; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/PrepareMessageData.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/PrepareMessageData.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/PrepareMessageData.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/PrepareMessageData.java index 30ed2e33dac..564468cfe6e 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/PrepareMessageData.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/PrepareMessageData.java @@ -12,10 +12,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagedata; +package org.hyperledger.besu.consensus.qbft.core.messagedata; import org.hyperledger.besu.consensus.common.bft.messagedata.AbstractBftMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData; import org.apache.tuweni.bytes.Bytes; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/ProposalMessageData.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/ProposalMessageData.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/ProposalMessageData.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/ProposalMessageData.java index 28d8c8d82e9..e474c5cfd86 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/ProposalMessageData.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/ProposalMessageData.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagedata; +package org.hyperledger.besu.consensus.qbft.core.messagedata; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.messagedata.AbstractBftMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData; import org.apache.tuweni.bytes.Bytes; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/QbftV1.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/QbftV1.java similarity index 94% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/QbftV1.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/QbftV1.java index ef42312b37a..a598308b39c 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/QbftV1.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/QbftV1.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagedata; +package org.hyperledger.besu.consensus.qbft.core.messagedata; /** Message codes for QBFT v1 messages */ public interface QbftV1 { diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/RoundChangeMessageData.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/RoundChangeMessageData.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/RoundChangeMessageData.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/RoundChangeMessageData.java index 6b017b0a1a2..37ebe4c0a2a 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagedata/RoundChangeMessageData.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagedata/RoundChangeMessageData.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagedata; +package org.hyperledger.besu.consensus.qbft.core.messagedata; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.messagedata.AbstractBftMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData; import org.apache.tuweni.bytes.Bytes; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Commit.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Commit.java similarity index 92% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Commit.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Commit.java index 5745f7af9de..142069ec708 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Commit.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Commit.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.CommitPayload; +import org.hyperledger.besu.consensus.qbft.core.payload.CommitPayload; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.rlp.RLP; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Prepare.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Prepare.java similarity index 92% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Prepare.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Prepare.java index 2ffd0bf180f..28bcae7bf80 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Prepare.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Prepare.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.rlp.RLP; import org.hyperledger.besu.ethereum.rlp.RLPInput; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Proposal.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Proposal.java similarity index 92% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Proposal.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Proposal.java index 8650a9c6b66..20847236f14 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/Proposal.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/Proposal.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.ProposalPayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.ProposalPayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; import org.hyperledger.besu.ethereum.rlp.RLP; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/RoundChange.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/RoundChange.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/RoundChange.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/RoundChange.java index cbebdf7debd..945a4bafb63 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/messagewrappers/RoundChange.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/RoundChange.java @@ -12,15 +12,15 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.rlp.BytesValueRLPOutput; import org.hyperledger.besu.ethereum.rlp.RLP; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/QbftGossip.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network/QbftGossip.java similarity index 87% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/QbftGossip.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network/QbftGossip.java index d0965e11620..c2ebf480a79 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/QbftGossip.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network/QbftGossip.java @@ -12,17 +12,17 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft; +package org.hyperledger.besu.consensus.qbft.core.network; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.Gossiper; import org.hyperledger.besu.consensus.common.bft.network.ValidatorMulticaster; import org.hyperledger.besu.consensus.common.bft.payload.Authored; -import org.hyperledger.besu.consensus.qbft.messagedata.CommitMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.PrepareMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.CommitMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.PrepareMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.Message; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.MessageData; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/network/QbftMessageTransmitter.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network/QbftMessageTransmitter.java similarity index 82% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/network/QbftMessageTransmitter.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network/QbftMessageTransmitter.java index 7c5b93c24a7..5aaa4887fe0 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/network/QbftMessageTransmitter.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/network/QbftMessageTransmitter.java @@ -12,23 +12,23 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.network; +package org.hyperledger.besu.consensus.qbft.core.network; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.network.ValidatorMulticaster; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagedata.CommitMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.PrepareMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.messagedata.CommitMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.PrepareMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/CommitPayload.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/CommitPayload.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/CommitPayload.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/CommitPayload.java index 716417922c4..824bd063bd6 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/CommitPayload.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/CommitPayload.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.Payload; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.datatypes.Hash; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/MessageFactory.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/MessageFactory.java similarity index 90% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/MessageFactory.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/MessageFactory.java index 860a4c9c418..c359c7ef597 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/MessageFactory.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/MessageFactory.java @@ -12,16 +12,16 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.Payload; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.datatypes.Hash; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/PreparePayload.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/PreparePayload.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/PreparePayload.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/PreparePayload.java index b0198058e45..58470b2a4d6 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/PreparePayload.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/PreparePayload.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.Payload; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.rlp.RLPInput; import org.hyperledger.besu.ethereum.rlp.RLPOutput; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/PreparedRoundMetadata.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/PreparedRoundMetadata.java similarity index 98% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/PreparedRoundMetadata.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/PreparedRoundMetadata.java index 5e534a7178c..4b732d1551b 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/PreparedRoundMetadata.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/PreparedRoundMetadata.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.rlp.RLPInput; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/ProposalPayload.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/ProposalPayload.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/ProposalPayload.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/ProposalPayload.java index 3bbe48dec0f..81a5caa2d94 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/ProposalPayload.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/ProposalPayload.java @@ -12,12 +12,12 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.rlp.RLPInput; import org.hyperledger.besu.ethereum.rlp.RLPOutput; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/QbftPayload.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/QbftPayload.java similarity index 97% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/QbftPayload.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/QbftPayload.java index 4cc64e9d0d0..57faa3225fb 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/QbftPayload.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/QbftPayload.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.Payload; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/RoundChangePayload.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/RoundChangePayload.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/RoundChangePayload.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/RoundChangePayload.java index f40e0464c32..9f4d9abedbd 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/payload/RoundChangePayload.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/payload/RoundChangePayload.java @@ -12,10 +12,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; import org.hyperledger.besu.ethereum.rlp.RLPInput; import org.hyperledger.besu.ethereum.rlp.RLPOutput; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/BaseQbftBlockHeightManager.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/BaseQbftBlockHeightManager.java similarity index 79% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/BaseQbftBlockHeightManager.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/BaseQbftBlockHeightManager.java index 6f1cca0d350..b426263c25b 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/BaseQbftBlockHeightManager.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/BaseQbftBlockHeightManager.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.statemachine.BaseBlockHeightManager; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; /** The interface Base qbft block height manager. */ public interface BaseQbftBlockHeightManager extends BaseBlockHeightManager { diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/NoOpBlockHeightManager.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/NoOpBlockHeightManager.java similarity index 83% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/NoOpBlockHeightManager.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/NoOpBlockHeightManager.java index ae5bde0e9a2..4ad83333d6c 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/NoOpBlockHeightManager.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/NoOpBlockHeightManager.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.events.RoundExpiry; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; import org.hyperledger.besu.ethereum.core.BlockHeader; /** The type NoOp block height manager. */ diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/PreparedCertificate.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/PreparedCertificate.java similarity index 92% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/PreparedCertificate.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/PreparedCertificate.java index 3b5a8df848a..aa72d62fef0 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/PreparedCertificate.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/PreparedCertificate.java @@ -12,10 +12,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; import org.hyperledger.besu.ethereum.core.Block; import java.util.List; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManager.java similarity index 95% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManager.java index 757998b5ca6..2c7e55cbf66 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManager.java @@ -12,21 +12,21 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; 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.common.bft.statemachine.BftFinalState; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.network.QbftMessageTransmitter; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.validation.FutureRoundProposalMessageValidator; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.network.QbftMessageTransmitter; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.validation.FutureRoundProposalMessageValidator; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidatorFactory; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.core.Block; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerFactory.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManagerFactory.java similarity index 92% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerFactory.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManagerFactory.java index 889f83f98a7..679ef222eb6 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerFactory.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManagerFactory.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.BftHelpers; import org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; -import org.hyperledger.besu.consensus.qbft.validator.ValidatorModeTransitionLogger; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.validator.ValidatorModeTransitionLogger; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.slf4j.Logger; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftController.java similarity index 90% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftController.java index 57737542eaf..4944aba53bc 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftController.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftController.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.Gossiper; @@ -22,11 +22,11 @@ import org.hyperledger.besu.consensus.common.bft.statemachine.BaseBlockHeightManager; import org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState; import org.hyperledger.besu.consensus.common.bft.statemachine.FutureMessageBuffer; -import org.hyperledger.besu.consensus.qbft.messagedata.CommitMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.PrepareMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.CommitMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.PrepareMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; import org.hyperledger.besu.ethereum.chain.Blockchain; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.Message; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRound.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRound.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRound.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRound.java index 64f23cef279..6a7ce1042a7 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRound.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRound.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import static java.util.Collections.emptyList; @@ -26,13 +26,13 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.RoundTimer; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.network.QbftMessageTransmitter; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.network.QbftMessageTransmitter; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.datatypes.Hash; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRoundFactory.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRoundFactory.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRoundFactory.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRoundFactory.java index 6383945bcdf..ca57b50baa5 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRoundFactory.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRoundFactory.java @@ -12,16 +12,16 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.blockcreation.BftBlockCreatorFactory; import org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState; -import org.hyperledger.besu.consensus.qbft.network.QbftMessageTransmitter; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.network.QbftMessageTransmitter; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidatorFactory; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.blockcreation.BlockCreator; import org.hyperledger.besu.ethereum.chain.MinedBlockObserver; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundChangeArtifacts.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundChangeArtifacts.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundChangeArtifacts.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundChangeArtifacts.java index 322d6990ac4..773ff06ef25 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundChangeArtifacts.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundChangeArtifacts.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import java.util.Collection; import java.util.Comparator; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundChangeManager.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundChangeManager.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundChangeManager.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundChangeManager.java index 89e2888395c..aa4f605c7c5 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundChangeManager.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundChangeManager.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.validation.RoundChangeMessageValidator; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.validation.RoundChangeMessageValidator; import org.hyperledger.besu.datatypes.Address; import java.util.Collection; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundState.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundState.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundState.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundState.java index 6acbae56558..d9a9221e4a3 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundState.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundState.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidator; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidator; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/CommitValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/CommitValidator.java similarity index 94% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/CommitValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/CommitValidator.java index 35e49dbb171..e211c6a8ede 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/CommitValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/CommitValidator.java @@ -12,12 +12,12 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.payload.CommitPayload; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.payload.CommitPayload; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.core.Util; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/FutureRoundProposalMessageValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/FutureRoundProposalMessageValidator.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/FutureRoundProposalMessageValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/FutureRoundProposalMessageValidator.java index 3c401bb203c..dd585c26fda 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/FutureRoundProposalMessageValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/FutureRoundProposalMessageValidator.java @@ -12,10 +12,10 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; import org.hyperledger.besu.ethereum.core.BlockHeader; /** The Future round proposal message validator. */ diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/MessageValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/MessageValidator.java similarity index 94% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/MessageValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/MessageValidator.java index ac112baa051..f526f2b7a3a 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/MessageValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/MessageValidator.java @@ -12,15 +12,15 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.BftBlockHeaderFunctions; import org.hyperledger.besu.consensus.common.bft.BftBlockInterface; import org.hyperledger.besu.consensus.common.bft.BftExtraDataCodec; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/MessageValidatorFactory.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/MessageValidatorFactory.java similarity index 97% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/MessageValidatorFactory.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/MessageValidatorFactory.java index b5164746bf6..17795acfb21 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/MessageValidatorFactory.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/MessageValidatorFactory.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.BftBlockInterface; import org.hyperledger.besu.consensus.common.bft.BftContext; @@ -21,7 +21,7 @@ import org.hyperledger.besu.consensus.common.bft.BftProtocolSchedule; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.blockcreation.ProposerSelector; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidator.SubsequentMessageValidator; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidator.SubsequentMessageValidator; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.ProtocolContext; import org.hyperledger.besu.ethereum.core.BlockHeader; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/PrepareValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/PrepareValidator.java similarity index 92% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/PrepareValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/PrepareValidator.java index 54fbaef855f..61bde6a802d 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/PrepareValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/PrepareValidator.java @@ -12,12 +12,12 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalPayloadValidator.java similarity index 96% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalPayloadValidator.java index 3d04f699c04..a50f2c79345 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalPayloadValidator.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static com.google.common.base.Preconditions.checkState; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.ProposalPayload; +import org.hyperledger.besu.consensus.qbft.core.payload.ProposalPayload; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.BlockValidator; import org.hyperledger.besu.ethereum.ProtocolContext; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalValidator.java similarity index 97% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalValidator.java index bc3f1bb205c..094521133cd 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalValidator.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static org.hyperledger.besu.consensus.common.bft.validation.ValidationHelpers.hasDuplicateAuthors; import static org.hyperledger.besu.consensus.common.bft.validation.ValidationHelpers.hasSufficientEntries; @@ -24,10 +24,10 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.Payload; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.BlockValidator; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangeMessageValidator.java similarity index 94% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangeMessageValidator.java index 0f0761d4621..1420c32c418 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangeMessageValidator.java @@ -12,16 +12,16 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static org.hyperledger.besu.consensus.common.bft.validation.ValidationHelpers.hasDuplicateAuthors; import static org.hyperledger.besu.consensus.common.bft.validation.ValidationHelpers.hasSufficientEntries; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.ethereum.BlockValidator; import org.hyperledger.besu.ethereum.ProtocolContext; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangePayloadValidator.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangePayloadValidator.java similarity index 93% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangePayloadValidator.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangePayloadValidator.java index 18977bf2902..549acdd9c55 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangePayloadValidator.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangePayloadValidator.java @@ -12,11 +12,11 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.datatypes.Address; import java.util.Collection; diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLogger.java b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validator/ValidatorModeTransitionLogger.java similarity index 98% rename from consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLogger.java rename to consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validator/ValidatorModeTransitionLogger.java index 83c18262c66..8265959ef63 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLogger.java +++ b/consensus/qbft-core/src/main/java/org/hyperledger/besu/consensus/qbft/core/validator/ValidatorModeTransitionLogger.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validator; +package org.hyperledger.besu.consensus.qbft.core.validator; import org.hyperledger.besu.config.QbftConfigOptions; import org.hyperledger.besu.consensus.common.ForkSpec; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/CommitTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/CommitTest.java similarity index 91% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/CommitTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/CommitTest.java index 87d3a46abe5..11cc9cbeb41 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/CommitTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/CommitTest.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import static org.assertj.core.api.Assertions.assertThat; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.payload.CommitPayload; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.payload.CommitPayload; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/PrepareTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/PrepareTest.java similarity index 90% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/PrepareTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/PrepareTest.java index 0aed7ed554e..adff617af1c 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/PrepareTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/PrepareTest.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import static org.assertj.core.api.Assertions.assertThat; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/ProposalTest.java similarity index 90% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/ProposalTest.java index 5b7314f94a2..885bd03c2d9 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/ProposalTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/ProposalTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import static org.assertj.core.api.Assertions.assertThat; @@ -21,11 +21,11 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.ProposalPayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.ProposalPayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/RoundChangeTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/RoundChangeTest.java similarity index 93% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/RoundChangeTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/RoundChangeTest.java index 23de31417c6..cf415b3bef1 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/messagewrappers/RoundChangeTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/messagewrappers/RoundChangeTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.messagewrappers; +package org.hyperledger.besu.consensus.qbft.core.messagewrappers; import static org.assertj.core.api.Assertions.assertThat; @@ -21,10 +21,10 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/payload/QbftPayloadTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/payload/QbftPayloadTest.java similarity index 97% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/payload/QbftPayloadTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/payload/QbftPayloadTest.java index 820b0f976f9..38db37cca76 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/payload/QbftPayloadTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/payload/QbftPayloadTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.payload; +package org.hyperledger.besu.consensus.qbft.core.payload; import static org.assertj.core.api.Assertions.assertThat; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManagerTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManagerTest.java index b6adcb73e62..2788dfc0505 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManagerTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftBlockHeightManagerTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; @@ -44,16 +44,16 @@ import org.hyperledger.besu.consensus.common.bft.network.ValidatorMulticaster; import org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.network.QbftMessageTransmitter; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.validation.FutureRoundProposalMessageValidator; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidator; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidatorFactory; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.network.QbftMessageTransmitter; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.validation.FutureRoundProposalMessageValidator; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidator; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidatorFactory; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftControllerTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftControllerTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftControllerTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftControllerTest.java index 3e3a38af824..6a1b18fa709 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftControllerTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftControllerTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import static org.assertj.core.util.Lists.newArrayList; import static org.mockito.ArgumentMatchers.any; @@ -36,16 +36,16 @@ import org.hyperledger.besu.consensus.common.bft.statemachine.BftFinalState; import org.hyperledger.besu.consensus.common.bft.statemachine.FutureMessageBuffer; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.QbftGossip; -import org.hyperledger.besu.consensus.qbft.messagedata.CommitMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.PrepareMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.ProposalMessageData; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; -import org.hyperledger.besu.consensus.qbft.messagedata.RoundChangeMessageData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.messagedata.CommitMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.PrepareMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.ProposalMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.RoundChangeMessageData; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.network.QbftGossip; import org.hyperledger.besu.datatypes.Address; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.chain.Blockchain; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRoundTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRoundTest.java similarity index 97% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRoundTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRoundTest.java index fb84c1c38fa..9e61d582a3c 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftRoundTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/QbftRoundTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import static java.util.Collections.emptyList; import static java.util.Collections.singletonList; @@ -38,11 +38,11 @@ import org.hyperledger.besu.consensus.common.bft.blockcreation.BftBlockCreator; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.network.QbftMessageTransmitter; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidator; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.network.QbftMessageTransmitter; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidator; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.cryptoservices.NodeKey; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundStateTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundStateTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundStateTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundStateTest.java index ff76a19b8ad..8cdd29c4009 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/statemachine/RoundStateTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/statemachine/RoundStateTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.statemachine; +package org.hyperledger.besu.consensus.qbft.core.statemachine; import static org.assertj.core.api.Assertions.assertThat; import static org.mockito.ArgumentMatchers.any; @@ -23,12 +23,12 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.messagewrappers.BftMessage; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.validation.MessageValidator; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.validation.MessageValidator; import org.hyperledger.besu.crypto.SignatureAlgorithm; import org.hyperledger.besu.crypto.SignatureAlgorithmFactory; import org.hyperledger.besu.cryptoservices.NodeKey; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/CommitValidatorTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/CommitValidatorTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/CommitValidatorTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/CommitValidatorTest.java index 02ca653f2a3..3960cf64f9b 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/CommitValidatorTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/CommitValidatorTest.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static org.assertj.core.api.Assertions.assertThat; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundHelpers; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Commit; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Commit; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.datatypes.Hash; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/PrepareValidatorTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/PrepareValidatorTest.java similarity index 95% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/PrepareValidatorTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/PrepareValidatorTest.java index b6c63b5598b..91a36ee61a0 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/PrepareValidatorTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/PrepareValidatorTest.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static org.assertj.core.api.Assertions.assertThat; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundHelpers; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; import org.hyperledger.besu.datatypes.Hash; import org.junit.jupiter.api.Test; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidatorTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalPayloadValidatorTest.java similarity index 97% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidatorTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalPayloadValidatorTest.java index 09e9455d89e..4984a950c21 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ProposalPayloadValidatorTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalPayloadValidatorTest.java @@ -12,7 +12,7 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; @@ -26,8 +26,8 @@ import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.ProposedBlockHelpers; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidatorTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalValidatorTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidatorTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalValidatorTest.java index 43afff35018..ea680866546 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ProposalValidatorTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ProposalValidatorTest.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.consensus.common.bft.BftContextBuilder.setupContextWithBftExtraDataEncoder; -import static org.hyperledger.besu.consensus.qbft.validation.ValidationTestHelpers.createEmptyRoundChangePayloads; -import static org.hyperledger.besu.consensus.qbft.validation.ValidationTestHelpers.createPreparePayloads; +import static org.hyperledger.besu.consensus.qbft.core.validation.ValidationTestHelpers.createEmptyRoundChangePayloads; +import static org.hyperledger.besu.consensus.qbft.core.validation.ValidationTestHelpers.createPreparePayloads; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; import static org.mockito.Mockito.reset; @@ -32,12 +32,12 @@ import org.hyperledger.besu.consensus.common.bft.ProposedBlockHelpers; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Prepare; -import org.hyperledger.besu.consensus.qbft.messagewrappers.Proposal; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Prepare; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.Proposal; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.BlockProcessingResult; import org.hyperledger.besu.ethereum.BlockValidator; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/QbftNode.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/QbftNode.java similarity index 91% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/QbftNode.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/QbftNode.java index d66952b6960..0d8f6cb00bf 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/QbftNode.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/QbftNode.java @@ -12,9 +12,9 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; import org.hyperledger.besu.datatypes.Address; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/QbftNodeList.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/QbftNodeList.java similarity index 92% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/QbftNodeList.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/QbftNodeList.java index 2f1ac09af12..c787cbc5acb 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/QbftNodeList.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/QbftNodeList.java @@ -12,9 +12,9 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; -import org.hyperledger.besu.consensus.qbft.payload.MessageFactory; +import org.hyperledger.besu.consensus.qbft.core.payload.MessageFactory; import org.hyperledger.besu.datatypes.Address; import java.util.Collection; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidatorTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangeMessageValidatorTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidatorTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangeMessageValidatorTest.java index 82e8fb5c7a8..67fce5fbfb0 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangeMessageValidatorTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangeMessageValidatorTest.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static com.google.common.collect.Iterables.toArray; import static java.util.Collections.emptyList; import static org.assertj.core.api.Assertions.assertThat; import static org.hyperledger.besu.consensus.common.bft.BftContextBuilder.setupContextWithBftExtraDataEncoder; -import static org.hyperledger.besu.consensus.qbft.validation.ValidationTestHelpers.createPreparePayloads; -import static org.hyperledger.besu.consensus.qbft.validation.ValidationTestHelpers.createPreparedCertificate; +import static org.hyperledger.besu.consensus.qbft.core.validation.ValidationTestHelpers.createPreparePayloads; +import static org.hyperledger.besu.consensus.qbft.core.validation.ValidationTestHelpers.createPreparedCertificate; import static org.mockito.Mockito.any; import static org.mockito.Mockito.lenient; import static org.mockito.Mockito.when; @@ -32,10 +32,10 @@ import org.hyperledger.besu.consensus.common.bft.ProposedBlockHelpers; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; import org.hyperledger.besu.consensus.qbft.QbftExtraDataCodec; -import org.hyperledger.besu.consensus.qbft.messagewrappers.RoundChange; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.messagewrappers.RoundChange; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.BlockProcessingResult; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangePayloadValidatorTest.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangePayloadValidatorTest.java similarity index 96% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangePayloadValidatorTest.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangePayloadValidatorTest.java index f4a91024b4a..e1f1df801ad 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/RoundChangePayloadValidatorTest.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/RoundChangePayloadValidatorTest.java @@ -12,14 +12,14 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import static org.assertj.core.api.Assertions.assertThat; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparedRoundMetadata; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparedRoundMetadata; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; import org.hyperledger.besu.crypto.SECPSignature; import org.hyperledger.besu.cryptoservices.NodeKey; import org.hyperledger.besu.cryptoservices.NodeKeyUtils; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ValidationTestHelpers.java b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ValidationTestHelpers.java similarity index 88% rename from consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ValidationTestHelpers.java rename to consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ValidationTestHelpers.java index 63a6e4e8e2d..e8b6538e81a 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validation/ValidationTestHelpers.java +++ b/consensus/qbft-core/src/test/java/org/hyperledger/besu/consensus/qbft/core/validation/ValidationTestHelpers.java @@ -12,13 +12,13 @@ * * SPDX-License-Identifier: Apache-2.0 */ -package org.hyperledger.besu.consensus.qbft.validation; +package org.hyperledger.besu.consensus.qbft.core.validation; import org.hyperledger.besu.consensus.common.bft.ConsensusRoundIdentifier; import org.hyperledger.besu.consensus.common.bft.payload.SignedData; -import org.hyperledger.besu.consensus.qbft.payload.PreparePayload; -import org.hyperledger.besu.consensus.qbft.payload.RoundChangePayload; -import org.hyperledger.besu.consensus.qbft.statemachine.PreparedCertificate; +import org.hyperledger.besu.consensus.qbft.core.payload.PreparePayload; +import org.hyperledger.besu.consensus.qbft.core.payload.RoundChangePayload; +import org.hyperledger.besu.consensus.qbft.core.statemachine.PreparedCertificate; import org.hyperledger.besu.datatypes.Hash; import org.hyperledger.besu.ethereum.core.Block; diff --git a/consensus/qbft/build.gradle b/consensus/qbft/build.gradle index 23e5576ebac..5481d9776e8 100644 --- a/consensus/qbft/build.gradle +++ b/consensus/qbft/build.gradle @@ -31,6 +31,7 @@ jar { dependencies { implementation project(':config') implementation project(':consensus:common') + implementation project(':consensus:qbft-core') implementation project(':crypto:services') implementation project(':datatypes') implementation project(':ethereum:api') @@ -67,20 +68,4 @@ dependencies { testImplementation 'org.junit.jupiter:junit-jupiter' testImplementation 'org.mockito:mockito-core' testImplementation 'org.mockito:mockito-junit-jupiter' - - integrationTestImplementation project(':crypto:algorithms') - integrationTestImplementation project(path: ':crypto:services', configuration: 'testSupportArtifacts') - integrationTestImplementation project(path: ':consensus:common', configuration: 'testSupportArtifacts') - integrationTestImplementation project(':evm') - integrationTestImplementation project(':metrics:core') - integrationTestImplementation project(':testutil') - - integrationTestImplementation 'org.assertj:assertj-core' - integrationTestImplementation 'org.junit.jupiter:junit-jupiter-api' - integrationTestImplementation 'org.mockito:mockito-core' - integrationTestImplementation 'org.mockito:mockito-junit-jupiter' - - integrationTestRuntimeOnly 'org.junit.jupiter:junit-jupiter' - - testSupportImplementation 'org.mockito:mockito-core' } diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/protocol/Istanbul100SubProtocol.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/protocol/Istanbul100SubProtocol.java index 37f04391cbd..70e4a8e5445 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/protocol/Istanbul100SubProtocol.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/protocol/Istanbul100SubProtocol.java @@ -14,7 +14,7 @@ */ package org.hyperledger.besu.consensus.qbft.protocol; -import org.hyperledger.besu.consensus.qbft.messagedata.QbftV1; +import org.hyperledger.besu.consensus.qbft.core.messagedata.QbftV1; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.Capability; import org.hyperledger.besu.ethereum.p2p.rlpx.wire.SubProtocol; diff --git a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLoggerTest.java b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLoggerTest.java index dabf26749a5..1a531cb344f 100644 --- a/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLoggerTest.java +++ b/consensus/qbft/src/test/java/org/hyperledger/besu/consensus/qbft/validator/ValidatorModeTransitionLoggerTest.java @@ -25,6 +25,7 @@ import org.hyperledger.besu.consensus.common.ForkSpec; import org.hyperledger.besu.consensus.common.ForksSchedule; import org.hyperledger.besu.consensus.qbft.MutableQbftConfigOptions; +import org.hyperledger.besu.consensus.qbft.core.validator.ValidatorModeTransitionLogger; import org.hyperledger.besu.ethereum.core.BlockHeader; import org.hyperledger.besu.ethereum.core.BlockHeaderTestFixture; diff --git a/settings.gradle b/settings.gradle index 761449b6ca1..2473b7c0502 100644 --- a/settings.gradle +++ b/settings.gradle @@ -36,6 +36,7 @@ include 'consensus:common' include 'consensus:ibft' include 'consensus:merge' include 'consensus:qbft' +include 'consensus:qbft-core' include 'datatypes' include 'crypto:algorithms' include 'crypto:services'