-
Notifications
You must be signed in to change notification settings - Fork 20k
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
eth/catalyst: add validation error in new paylaod hash mismatch #28226
Merged
Merged
Changes from 1 commit
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
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.
Why not
return api.invalid(err, nil), nil
?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 would set
LatestValidHash
non-nil. Currently the engine API specifies that if the block hash verification fails, the EL must returnnil
. See point 5 here: https://github.com/ethereum/execution-apis/blob/main/src/engine/paris.md#specification.--
With that said, I don't really understand the purpose of returning
nil
when we actually know the latest valid hash.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.
@karalabe I tried refactoring
api.invalid(..)
a bit so that it behaves as you requested. It doesn't seem like we are using the functionality where you pass innil
toinvalid(..)
and it actually grabs the head of the chain. Let me know if you prefer this or the original way.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.
What's teh purpose of returning nil for latest valid? Shouldn't it be... you know... the "latest valid"?
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 was also wondering this. But I'm not sure what the thinking there that caused it to be written into the engine api like it is.
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.
Could we perhaps have a clarification and maybe fix the spec if it's wrong?
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 looked a bit more into this and it seems to have come from the SYNCING response.
latestValidHash
is supposed to return the latest valid hash from the ancestors of the provided payload. If the payload references an unknown parent, of course we must returnnil
since we don't know the ancestor chain.The block hash check was added (I think) to protect the CL while the EL is syncing. So it would make sense to simply return
nil
for latest valid hash. I guess the case of a new payload request while not syncing wasn't as closely considered and so it also returnsnil
even when we can return the latest valid block hash.