Skip to content

Commit

Permalink
Corrections from review comments
Browse files Browse the repository at this point in the history
Signed-off-by: amsmota <antonio.mota@citi.com>
  • Loading branch information
amsmota committed Apr 16, 2024
1 parent 03c0503 commit aa7e38f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public Map<String, Object> 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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,21 @@ 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();
final long emptyBlockPeriodExpiryTime = parentHeader.getTimestamp() + emptyBlockPeriodSeconds;
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();
Expand Down

0 comments on commit aa7e38f

Please sign in to comment.