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>
This commit is contained in:
garyschulte
2024-08-23 16:35:18 -07:00
committed by GitHub
parent 58bb931efe
commit d87650b944

View File

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