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

[4844] [Hive] Fix fcuV3 parameter return #5940

Merged

Conversation

Gabriel-Trintinalia
Copy link
Contributor

PR description

Fix some hive tests

  • Return JsonRpcErrorResponse instead of JsonRpcSuccessResponse when fork not supported or parameters invalid.
  • Validate parameter before fork validation
  • Validate getParentBeaconBlockRoot on EngineForkchoiceUpdatedV3

Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Gabriel-Trintinalia <[email protected]>
@github-actions
Copy link

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I thought about the changelog and included a changelog update if required.
  • If my PR includes database changes (e.g. KeyValueSegmentIdentifier) I have thought about compatibility and performed forwards and backwards compatibility tests

@Gabriel-Trintinalia Gabriel-Trintinalia changed the title Devnet9 hive [4844] [Hive] Fix fcuV3 parameter return Sep 26, 2023
Copy link
Contributor

@macfarla macfarla left a comment

Choose a reason for hiding this comment

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

LGTM

if (fcuParameter.getHeadBlockHash() == null) {
return ValidationResult.invalid(RpcErrorType.INVALID_PARAMS, "Missing head block hash");
} else if (fcuParameter.getSafeBlockHash() == null) {
return ValidationResult.invalid(RpcErrorType.INVALID_PARAMS, "Missing safe block hash");
} else if (fcuParameter.getFinalizedBlockHash() == null) {
return ValidationResult.invalid(RpcErrorType.INVALID_PARAMS, "Missing finalized block hash");
}
if (maybePayloadAttributes.isPresent()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this is the parameter checking you mean that will potentially conflict with the larger refactor?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think fine to fix it like this in the short-term to clear the noise for the hive tests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We would not necessarily have to validate this if the plans are to use strict JSON validation

@Gabriel-Trintinalia Gabriel-Trintinalia marked this pull request as ready for review September 26, 2023 02:57
@Gabriel-Trintinalia Gabriel-Trintinalia merged commit 387d3f2 into hyperledger:main Sep 26, 2023
jflo pushed a commit to jflo/besu that referenced this pull request Nov 10, 2023
Signed-off-by: Gabriel-Trintinalia <[email protected]>
Signed-off-by: Justin Florentine <[email protected]>
NickSneo pushed a commit to NickSneo/besu that referenced this pull request Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants