Skip to content

Commit

Permalink
Fix: Hive engine api FCU regression (#4947)
Browse files Browse the repository at this point in the history
* Swap lines order to ensure we commit FCU even if payload timestamp is before head timestamp

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

* spotless

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>

Signed-off-by: Gabriel Fukushima <gabrielfukushima@gmail.com>
  • Loading branch information
gfukushima authored Jan 18, 2023
1 parent 48a1249 commit b36f84e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,10 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
ws ->
ws.stream().map(WithdrawalParameter::toWithdrawal).collect(toList())));

ForkchoiceResult result =
mergeCoordinator.updateForkChoice(
newHead, forkChoice.getFinalizedBlockHash(), forkChoice.getSafeBlockHash());

if (maybePayloadAttributes.isPresent()
&& !isPayloadAttributesValid(maybePayloadAttributes.get(), withdrawals, newHead)) {
warnLambda(
Expand All @@ -153,10 +157,6 @@ public JsonRpcResponse syncResponse(final JsonRpcRequestContext requestContext)
return new JsonRpcErrorResponse(requestId, JsonRpcError.INVALID_PAYLOAD_ATTRIBUTES);
}

ForkchoiceResult result =
mergeCoordinator.updateForkChoice(
newHead, forkChoice.getFinalizedBlockHash(), forkChoice.getSafeBlockHash());

if (!result.isValid()) {
logForkchoiceUpdatedCall(INVALID, forkChoice);
return handleNonValidForkchoiceUpdate(requestId, result);
Expand Down

0 comments on commit b36f84e

Please sign in to comment.