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

RPC - default to internal error not invalid params #5506

Merged
merged 10 commits into from
Jun 21, 2023

Conversation

macfarla
Copy link
Contributor

@macfarla macfarla commented May 29, 2023

Fallback RPC error should not be "Invalid params" - see #4212

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

github-actions bot commented May 29, 2023

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.
  • I have considered running ./gradlew acceptanceTestNonMainnet locally if my PR affects non-mainnet modules.
  • 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

@macfarla macfarla marked this pull request as draft May 29, 2023 05:41
@macfarla macfarla marked this pull request as ready for review June 14, 2023 11:03
Copy link
Contributor

@pinges pinges left a comment

Choose a reason for hiding this comment

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

I agree with using internal error as the default. Left a few comments.

@@ -148,7 +148,7 @@ public void shouldReturnErrorWithGasPriceLessThanCurrentBaseFee() {
null);
final JsonRpcRequestContext request = requestWithParams(callParameter, "latest");
final JsonRpcResponse expectedResponse =
new JsonRpcErrorResponse(null, JsonRpcError.INVALID_PARAMS);
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 still not giving our users good information about why it failed ...
Almost feels like invalid params in that case was better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

exposed GAS_PRICE_BELOW_CURRENT_BASE_FEE

Copy link
Contributor

@pinges pinges left a comment

Choose a reason for hiding this comment

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

LGTM

@macfarla macfarla merged commit 251fded into hyperledger:main Jun 21, 2023
@macfarla macfarla deleted the rpc-internal-error-default branch June 22, 2023 01:50
davidkngo pushed a commit to liquichain/besu that referenced this pull request Jun 28, 2023
* added new error code

* fixed remaining privacy unit tests; added new error code

* internal error not invalid params

Signed-off-by: Sally MacFarlane <[email protected]>

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
davidkngo pushed a commit to liquichain/besu that referenced this pull request Jul 21, 2023
* added new error code

* fixed remaining privacy unit tests; added new error code

* internal error not invalid params

Signed-off-by: Sally MacFarlane <[email protected]>

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
davidkngo added a commit to liquichain/besu that referenced this pull request Jul 21, 2023
elenduuche pushed a commit to elenduuche/besu that referenced this pull request Aug 16, 2023
* added new error code

* fixed remaining privacy unit tests; added new error code

* internal error not invalid params

Signed-off-by: Sally MacFarlane <[email protected]>

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
eum602 pushed a commit to lacchain/besu that referenced this pull request Nov 3, 2023
* added new error code

* fixed remaining privacy unit tests; added new error code

* internal error not invalid params

Signed-off-by: Sally MacFarlane <[email protected]>

---------

Signed-off-by: Sally MacFarlane <[email protected]>
Co-authored-by: Stefan Pingel <[email protected]>
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.

2 participants