Skip to content

Commit

Permalink
7582: Remove estimated chain height check from PivotBlockConfirmer wh…
Browse files Browse the repository at this point in the history
…en waiting for peers

Signed-off-by: Matilda Clerke <[email protected]>
  • Loading branch information
Matilda-Clerke committed Dec 13, 2024
1 parent 215813d commit 8c0df49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,7 @@ private CompletableFuture<FastSyncState> internalDownloadPivotBlockHeader(

return ethContext
.getEthPeers()
.waitForPeer(
(peer) -> true)
.waitForPeer((peer) -> true)
.thenCompose(
unused ->
currentState
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,10 @@ private CompletableFuture<BlockHeader> executePivotQuery(final long blockNumber)
pivotHeaderFuture =
ethContext
.getEthPeers()
.waitForPeer(
(peer) ->
peer.chainState().getEstimatedHeight() >= blockNumber
&& !pivotBlockQueriesByPeerId.containsKey(peer.nodeId()))
.waitForPeer((peer) -> !pivotBlockQueriesByPeerId.containsKey(peer.nodeId()))
.orTimeout(5, TimeUnit.SECONDS)
.handle((r, e) -> null) // Ignore result, ensure even a timeout will result in calling
// executePivotQuery
// Ignore result, ensure even a timeout will result in calling executePivotQuery
.handle((r, e) -> null)
.thenCompose(res -> executePivotQuery(blockNumber));
}

Expand Down

0 comments on commit 8c0df49

Please sign in to comment.