stop checking beacon parent root for fcU caching (#5635)

This commit is contained in:
tersec 2023-12-01 12:24:23 +00:00 committed by GitHub
parent 7ba6f13312
commit 91b5204e52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 9 deletions

View File

@ -17,7 +17,6 @@ import
eth/async_utils, stew/[assign2, byteutils, objects, results, shims/hashes, endians2], eth/async_utils, stew/[assign2, byteutils, objects, results, shims/hashes, endians2],
# Local modules: # Local modules:
../spec/[deposit_snapshots, eth2_merkleization, forks, helpers], ../spec/[deposit_snapshots, eth2_merkleization, forks, helpers],
../spec/datatypes/[base, phase0, bellatrix, deneb],
../networking/network_metadata, ../networking/network_metadata,
../consensus_object_pools/block_pools_types, ../consensus_object_pools/block_pools_types,
".."/[beacon_chain_db, beacon_node_status, beacon_clock, future_combinators], ".."/[beacon_chain_db, beacon_node_status, beacon_clock, future_combinators],
@ -758,8 +757,7 @@ func areSameAs(expectedParams: Option[NextExpectedPayloadParams],
timestamp: uint64, timestamp: uint64,
randomData: Eth2Digest, randomData: Eth2Digest,
feeRecipient: Eth1Address, feeRecipient: Eth1Address,
withdrawals: seq[WithdrawalV1], withdrawals: seq[WithdrawalV1]): bool =
parentBeaconBlockRoot: FixedBytes[32]): bool =
expectedParams.isSome and expectedParams.isSome and
expectedParams.get.headBlockHash == latestHead and expectedParams.get.headBlockHash == latestHead and
expectedParams.get.safeBlockHash == latestSafe and expectedParams.get.safeBlockHash == latestSafe and
@ -767,9 +765,7 @@ func areSameAs(expectedParams: Option[NextExpectedPayloadParams],
expectedParams.get.payloadAttributes.timestamp.uint64 == timestamp and expectedParams.get.payloadAttributes.timestamp.uint64 == timestamp and
expectedParams.get.payloadAttributes.prevRandao.bytes == randomData.data and expectedParams.get.payloadAttributes.prevRandao.bytes == randomData.data and
expectedParams.get.payloadAttributes.suggestedFeeRecipient == feeRecipient and expectedParams.get.payloadAttributes.suggestedFeeRecipient == feeRecipient and
expectedParams.get.payloadAttributes.withdrawals == withdrawals and expectedParams.get.payloadAttributes.withdrawals == withdrawals
expectedParams.get.payloadAttributes.parentBeaconBlockRoot ==
parentBeaconBlockRoot
proc forkchoiceUpdated(rpcClient: RpcClient, proc forkchoiceUpdated(rpcClient: RpcClient,
state: ForkchoiceStateV1, state: ForkchoiceStateV1,
@ -906,8 +902,7 @@ proc getPayload*(m: ELManager,
engineApiWithdrawals = toEngineWithdrawals withdrawals engineApiWithdrawals = toEngineWithdrawals withdrawals
isFcUpToDate = m.nextExpectedPayloadParams.areSameAs( isFcUpToDate = m.nextExpectedPayloadParams.areSameAs(
headBlock, safeBlock, finalizedBlock, timestamp, headBlock, safeBlock, finalizedBlock, timestamp,
randomData, suggestedFeeRecipient, engineApiWithdrawals, randomData, suggestedFeeRecipient, engineApiWithdrawals)
consensusHead.asBlockHash)
# `getPayloadFromSingleEL` may introduce additional latency # `getPayloadFromSingleEL` may introduce additional latency
const extraProcessingOverhead = 500.milliseconds const extraProcessingOverhead = 500.milliseconds

View File

@ -342,7 +342,7 @@ proc requestManagerBlobLoop(rman: RequestManager) {.async.} =
failed = (len(workers) - succeed), failed = (len(workers) - succeed),
sync_speed = speed(start, finish) sync_speed = speed(start, finish)
except CancelledError as exc: except CancelledError:
break break
except CatchableError as exc: except CatchableError as exc:
warn "Unexpected error in request manager blob loop", exc = exc.msg warn "Unexpected error in request manager blob loop", exc = exc.msg