-
Notifications
You must be signed in to change notification settings - Fork 377
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
Clarify the place of payloadAttributes check against Cancun timeframes #476
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should apply also to point 1. if the
Invalid params
comes from payload validationThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the add line might be clearer if it is point 1? Something like: "Apply the forkchoice state before verifying the payload attributes, do not roll back state if attributes are invalid"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By receiving
Unsupported fork
orInvalid payload attributes
errors CL can conclude that the forkchoice state has been applied successfully, while ifInvalid params
is received it wouldn't be clear which part of the request this error relates to. The order of checks looks pretty messy in this particular method call but I think that that the consistency of data passed onto the request should be validated before any state updatesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I quite understand your point here. Are you saying you think that if 1) here fails, the forkchoice should not be updated?
Generally it feels like we should say very explicitly, if the forkchoice update state is valid, clients MUST update the forkchoice before we even look at the params. But it seems like you might be saying first check that the params is well formed and then after forkchoice update, you need verify the semantic checks on the params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If 1) fails it can also mean that e.g.
headBlockHash
wasn't provided thus the forkchoice update can't happen.So, the pipeline can be as follows:
Invalid params
if notVALID
andpayloadAttributes
are provided goto 3, break otherwisepayloadAttributes
are well formed (all fields are provided) and if not return eitherInvalid params
ORInvalid payload attributes
payloadAttributes.timestamp
againstheadBlock.timestamp
, returnInvalid payload attributes
if failedpayloadAttributes.timestamp
against Cancun timeframes, returnUnsupported fork
if failedIn 3) if
Invalid params
is returned, there will be no possibility for CL to understand that the forkchoice state has been updated if it was. I am not standing strong on that we should preserve such behavior but it is a slight change in the semantics and I see three options here:a) check that the request is well formed before doing any downstream processing and return
Invalid params
if fails even in the case when the forkchoice state part is valid, i.e. do not apply the forkchoice state ifpayloadAttributes
aren't well formedb) return
Invalid params
error separately forpayloadAttributes
, notify CL client devs about this changec) return
Invalid payload attributes
ifpayloadAttributes
aren't well formed and leaveInvalid params
error for the forkchoice state onlyI am slightly in favour of c) because it is simple and seems to fit well for the optional parameter which
payloadAttributes
isThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this, I understand now. I agree with you that it is probably important for CL to know for certain if the forkchoice was applied or not, so it is good to not allow
Invalid params
to be returned both before fcu update and after.After thinking about this, I am also in favour of c). I think it will allow the specification to read a bit more clearly (e.g. first check fcu state and apply, then check payload attributes).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took a stab at c), pls take a look: #479