Skip to content

Commit

Permalink
Fleet-mode safe behavior for fcU in SynchronizationService (hyperledg…
Browse files Browse the repository at this point in the history
…er#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>
  • Loading branch information
garyschulte committed Aug 23, 2024
1 parent 58bb931 commit d87650b
Showing 1 changed file with 5 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,11 @@ public SynchronizationServiceImpl(
@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
Expand Down

0 comments on commit d87650b

Please sign in to comment.