|
# If the head hash is unknown (was not given to us in a newPayload request), |
|
# we cannot resolve the header, so not much to do. This could be extended in |
|
# the future to resolve from the `eth` network, but it's an unexpected case |
|
# that should be fixed, not papered over. |
|
let header = chain.quarantine.getHeader(headHash).valueOr: |
|
warn "Forkchoice requested unknown head", |
|
hash = headHash.short |
|
return simpleFCU(PayloadExecutionStatus.syncing) |
In this code path, we can see that fCU call to blocks whose header is not with us, are ignored.
But the syncer already have interface which allows us to sync from just a blockHash
|
# Optional for pre-setting the sync target (e.g. for debugging) |
|
if config.beaconSyncTarget.isSome(): |
|
syncerShouldRun = true |
|
let |
|
hex = config.beaconSyncTarget.unsafeGet |
|
isFinal = config.beaconSyncTargetIsFinal |
|
if not nimbus.beaconSyncRef.configTarget(hex, isFinal): |
|
fatal "Error parsing hash32 argument for --debug-beacon-sync-target", |
|
hash32=hex |
|
quit QuitFailure |
What needs to be done is unify the interface, such that only need the hash, and let the syncer handle the rest. Use that same interface inside the forkChoice api call, instead of handling this case separately
nimbus-eth1/execution_chain/beacon/api_handler/api_forkchoice.nim
Lines 110 to 117 in 24f0760
In this code path, we can see that fCU call to blocks whose header is not with us, are ignored.
But the syncer already have interface which allows us to sync from just a blockHash
nimbus-eth1/execution_chain/nimbus_execution_client.nim
Lines 178 to 187 in 24f0760
What needs to be done is unify the interface, such that only need the hash, and let the syncer handle the rest. Use that same interface inside the forkChoice api call, instead of handling this case separately