From aa7e38f861353c7ef85458d9d0f6219d4da07478 Mon Sep 17 00:00:00 2001 From: amsmota Date: Tue, 16 Apr 2024 16:24:15 +0100 Subject: [PATCH] Corrections from review comments Signed-off-by: amsmota --- .../org/hyperledger/besu/cli/CommandTestAbstract.java | 3 +-- .../org/hyperledger/besu/config/JsonBftConfigOptions.java | 2 +- .../qbft/statemachine/QbftBlockHeightManager.java | 8 ++++---- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java b/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java index 11c883d7cd7..f8e39c80831 100644 --- a/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java +++ b/besu/src/test/java/org/hyperledger/besu/cli/CommandTestAbstract.java @@ -139,8 +139,7 @@ public abstract class CommandTestAbstract { private static final Logger TEST_LOGGER = LoggerFactory.getLogger(CommandTestAbstract.class); protected static final int POA_BLOCK_PERIOD_SECONDS = 5; - protected static final int POA_EMPTY_BLOCK_PERIOD_SECONDS = - 50; // TODO: IS THIS APPLICABLE FOR POA? + protected static final int POA_EMPTY_BLOCK_PERIOD_SECONDS = 50; protected static final JsonObject VALID_GENESIS_QBFT_POST_LONDON = (new JsonObject()) .put( diff --git a/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java b/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java index 5187eeae42f..5e688bd5b00 100644 --- a/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java +++ b/config/src/main/java/org/hyperledger/besu/config/JsonBftConfigOptions.java @@ -142,7 +142,7 @@ public Map asMap() { builder.put("blockPeriodSeconds", getBlockPeriodSeconds()); } if (bftConfigRoot.has("emptyblockperiodseconds")) { - builder.put("emptyblockperiodseconds", getBlockPeriodSeconds()); + builder.put("emptyblockperiodseconds", getEmptyBlockPeriodSeconds()); } if (bftConfigRoot.has("requesttimeoutseconds")) { builder.put("requestTimeoutSeconds", getRequestTimeoutSeconds()); diff --git a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java index d41e8e18a47..d8ecff79a74 100644 --- a/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java +++ b/consensus/qbft/src/main/java/org/hyperledger/besu/consensus/qbft/statemachine/QbftBlockHeightManager.java @@ -153,10 +153,10 @@ private void buildBlockAndMaybePropose( final boolean blockHasTransactions = !block.getBody().getTransactions().isEmpty(); if (blockHasTransactions) { if (isProposer) { - LOG.debug("Block Has Transactions and I AM proposer so send proposal"); + LOG.debug("Block has transactions and this node is a proposer so it will send a proposal"); qbftRound.sendProposalMessage(block); }else{ - LOG.debug("Block Has Transactions and I am NOT proposer"); + LOG.debug("Block has transactions but this node is not a proposer so it will not send a proposal"); } } else { final long emptyBlockPeriodSeconds = finalState.getBlockTimer().getEmptyBlockPeriodSeconds(); @@ -164,10 +164,10 @@ private void buildBlockAndMaybePropose( final long nowInSeconds = finalState.getClock().millis() / 1000; if (nowInSeconds >= emptyBlockPeriodExpiryTime) { if (isProposer) { - LOG.debug("Block Do Not Have Transactions and I AM proposer so send proposal"); + LOG.debug("Block has no transactions and this node is a proposer so it will send a proposal"); qbftRound.sendProposalMessage(block); } else { - LOG.debug("Block Do Not Have Transactions and I am NOT proposer"); + LOG.debug("Block has no transactions but this node is not a proposer so it will not send a proposal"); } } else { finalState.getRoundTimer().cancelTimer();