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

Fcu verify payload attributes #3837

Merged

Conversation

daniellehrner
Copy link
Contributor

PR description

Adds payload attributes checks to EngineForkchoiceUpdated and returns INVALID_PAYLOAD_ATTRIBUTES error if any of them should be invalid.

Fixed Issue(s)

"fixes #3836 "

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if
    updates are required.

Changelog

@daniellehrner daniellehrner self-assigned this May 15, 2022
…e one of the head block

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
@daniellehrner daniellehrner force-pushed the fcu_verify_payload_attributes branch from 44455b6 to 8cacabf Compare June 7, 2022 11:08
@daniellehrner daniellehrner marked this pull request as ready for review June 7, 2022 11:10
Comment on lines 118 to 122
if (optionalPayloadAttributes.isPresent()
&& !isPayloadAttributesValid(optionalPayloadAttributes.get(), newHead.get())) {
return new JsonRpcErrorResponse(requestId, JsonRpcError.INVALID_PAYLOAD_ATTRIBUTES);
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a doubt, since #3836 says:

Invalid payload attributes and MUST NOT begin a payload build process. In such an event, the forkchoiceState update MUST NOT be rolled back.

my understanding is that, even if there are payload attribute errors, the FcU should be applied, but the error is returned before the mergeCoordinator.updateForkChoice call, so the FcU update is never applied, or am I missnig something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, after further investigation that is how it should work. I've changed the code accordingly

@fab-10
Copy link
Contributor

fab-10 commented Jun 7, 2022

Please add a CHANGELOG entry

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
@daniellehrner daniellehrner requested a review from fab-10 June 10, 2022 09:41
Copy link

@callree callree left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CHANGELOG.md

@daniellehrner daniellehrner merged commit 81f25e1 into hyperledger:main Jun 13, 2022
@daniellehrner daniellehrner deleted the fcu_verify_payload_attributes branch June 13, 2022 08:40
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* check that the timestamp in fcu payload attributes is greater than the one of the head block

Signed-off-by: Daniel Lehrner <daniel.lehrner@consensys.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

EngineForkchoiceUpdated: Verify if payload attributes are valid
3 participants