init optional and logging fixes (#3965)

Signed-off-by: Justin Florentine <justin+github@florentine.us>
pull/3967/head
Justin Florentine 2 years ago committed by GitHub
parent 81f25e15f9
commit e1d0a3d601
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/manager/EthProtocolManager.java
  2. 2
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/PivotSelectorFromFinalizedBlock.java
  3. 2
      ethereum/eth/src/main/java/org/hyperledger/besu/ethereum/eth/sync/fastsync/TransitionPivotSelector.java

@ -78,7 +78,7 @@ public class EthProtocolManager
private final Blockchain blockchain;
private final BlockBroadcaster blockBroadcaster;
private final List<PeerValidator> peerValidators;
private Optional<Difficulty> powTerminalDifficulty;
private Optional<Difficulty> powTerminalDifficulty = Optional.empty();
private final StampedLock powTerminalDifficultyLock = new StampedLock();
private Hash lastFinalized = Hash.ZERO;
private final AtomicLong numFinalizedSeen = new AtomicLong(0);

@ -48,7 +48,7 @@ public class PivotSelectorFromFinalizedBlock implements PivotBlockSelector {
if (maybeHash.isPresent()) {
return Optional.of(selectLastFinalizedBlockAsPivot(maybeHash.get()));
}
LOG.info("No finalized block hash announced yet");
LOG.trace("No finalized block hash announced yet");
return Optional.empty();
}

@ -68,7 +68,7 @@ public class TransitionPivotSelector implements PivotBlockSelector {
}
if (bestPeerEstDifficulty.greaterOrEqualThan(totalTerminalDifficulty)) {
LOG.info(
LOG.debug(
"Chain has reached TTD, best peer has estimated difficulty {},"
+ " select pivot from finalized block",
bestPeerEstDifficulty);

Loading…
Cancel
Save