Fleet-mode safe behavior for fcU in SynchronizationService (#7517)

* fleet-mode safe behavior for fcU in SynchronizationService

Signed-off-by: garyschulte <garyschulte@gmail.com>

* spotless

Signed-off-by: garyschulte <garyschulte@gmail.com>

---------

Signed-off-by: garyschulte <garyschulte@gmail.com>
pull/7519/head
garyschulte 3 months ago committed by GitHub
parent 58bb931efe
commit d87650b944
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 16
      besu/src/main/java/org/hyperledger/besu/services/SynchronizationServiceImpl.java

@ -74,17 +74,11 @@ public class SynchronizationServiceImpl implements SynchronizationService {
@Override @Override
public void fireNewUnverifiedForkchoiceEvent( public void fireNewUnverifiedForkchoiceEvent(
final Hash head, final Hash safeBlock, final Hash finalizedBlock) { final Hash head, final Hash safeBlock, final Hash finalizedBlock) {
final MergeContext mergeContext = protocolContext.getConsensusContext(MergeContext.class); protocolContext
if (mergeContext != null) { .safeConsensusContext(MergeContext.class)
mergeContext.fireNewUnverifiedForkchoiceEvent(head, safeBlock, finalizedBlock); .ifPresent(mc -> mc.fireNewUnverifiedForkchoiceEvent(head, safeBlock, finalizedBlock));
protocolContext.getBlockchain().setFinalized(finalizedBlock); protocolContext.getBlockchain().setFinalized(finalizedBlock);
protocolContext.getBlockchain().setSafeBlock(safeBlock); protocolContext.getBlockchain().setSafeBlock(safeBlock);
} else {
LOG.atWarn()
.setMessage(
"The merge context is unavailable, hence the fork choice event cannot be triggered")
.log();
}
} }
@Override @Override

Loading…
Cancel
Save