Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impossible to produce blocks with forkchoiceUpdated #2588

Closed
tersec opened this issue Sep 3, 2024 · 1 comment · Fixed by #2651
Closed

Impossible to produce blocks with forkchoiceUpdated #2588

tersec opened this issue Sep 3, 2024 · 1 comment · Fixed by #2651
Labels

Comments

@tersec
Copy link
Contributor

tersec commented Sep 3, 2024

master and #2423 have the same issue

If it already knows about the block:

# If the head block is already in our canonical chain, the beacon client is
# probably resyncing. Ignore the update.
# See point 2 of fCUV1 specification
# https://github.com/ethereum/execution-apis/blob/v1.0.0-beta.4/src/engine/paris.md#specification-1
var canonHash: common.Hash256
if db.getBlockHash(header.number, canonHash) and canonHash == blockHash:
notice "Ignoring beacon update to old head",
blockHash=blockHash.short,
blockNumber=header.number
return validFCU(Opt.none(PayloadID), blockHash)

then it returns and never processes the payload attributes to trigger payload generation later on in that function:

# If payload generation was requested, create a new block to be potentially
# sealed by the beacon client. The payload will be requested later, and we
# might replace it arbitrarilly many times in between.
if attrsOpt.isSome:
let attrs = attrsOpt.get()
validateVersion(attrs, com, apiVersion)
let bundle = ben.generatePayload(attrs).valueOr:
error "Failed to create sealing payload", err = error
raise invalidAttr(error)
let id = computePayloadId(blockHash, attrs)
ben.put(id, bundle.blockValue, bundle.executionPayload, bundle.blobsBundle)
info "Created payload for sealing",
id = id.toHex,
hash = bundle.executionPayload.blockHash.short,
number = bundle.executionPayload.blockNumber
return validFCU(Opt.some(id), blockHash)
return validFCU(Opt.none(PayloadID), blockHash)

@jangko
Copy link
Contributor

jangko commented Sep 3, 2024

Client software MAY skip an update of the forkchoice state and MUST NOT begin a payload build process if forkchoiceState.headBlockHash references a VALID ancestor of the head of canonical chain, i.e. the ancestor passed payload validation process and deemed VALID. In the case of such an event, client software MUST return {payloadStatus: {status: VALID, latestValidHash: forkchoiceState.headBlockHash, validationError: null}, payloadId: null}.

This is what the spec says.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants