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

feat: Better errors for JsonRPC calls #1002

Merged
merged 19 commits into from
Feb 14, 2024
Merged

feat: Better errors for JsonRPC calls #1002

merged 19 commits into from
Feb 14, 2024

Conversation

tomg10
Copy link
Contributor

@tomg10 tomg10 commented Feb 2, 2024

What ❔

Provides additional context for JSON-RPC client calls used by the EN with the help of an extension trait.

Why ❔

Some of client errors are currently quite obscure and thus difficult to debug.

Checklist

  • PR title corresponds to the body of PR (we generate changelog entries from PRs).
  • Tests for the changes have been added / updated.
  • Documentation comments have been added / updated.
  • Code has been formatted via zk fmt and zk lint.
  • Spellcheck has been run via zk spellcheck.
  • Linkcheck has been run via zk linkcheck.

@tomg10 tomg10 requested a review from slowli February 2, 2024 16:31
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
@tomg10 tomg10 requested a review from slowli February 5, 2024 16:14
slowli
slowli previously approved these changes Feb 8, 2024
Copy link
Contributor

@slowli slowli left a comment

Choose a reason for hiding this comment

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

Good enough 👍 There are some nits and potential improvements that I'll address in a follow-up PR if you don't mind. Just fix compilation failures, please (AFAIU, some test code wasn't updated).

Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
Signed-off-by: tomg10 <lemures64@gmail.com>
popzxc
popzxc previously approved these changes Feb 14, 2024
Copy link
Member

@popzxc popzxc left a comment

Choose a reason for hiding this comment

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

I like this addition.

core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
core/lib/web3_decl/src/error.rs Outdated Show resolved Hide resolved
Copy link
Member

@popzxc popzxc left a comment

Choose a reason for hiding this comment

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

👍

@slowli slowli added this pull request to the merge queue Feb 14, 2024
Merged via the queue into main with commit 079f999 Feb 14, 2024
30 checks passed
@slowli slowli deleted the en-rpc-context branch February 14, 2024 12:04
formatter.write_str(", ")?;
}
}
formatter.write_str(")")
Copy link
Collaborator

Choose a reason for hiding this comment

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

just curious - could we do something like .join(", ") here? Did you want to avoid allocating a vector for this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, it's an additional allocation that can be easily avoided.

Copy link
Collaborator

@RomanBrodetski RomanBrodetski left a comment

Choose a reason for hiding this comment

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

nice

github-merge-queue bot pushed a commit that referenced this pull request Feb 16, 2024
🤖 I have created a release *beep* *boop*
---


##
[20.7.0](core-v20.6.0...core-v20.7.0)
(2024-02-16)


### Features

* Add input field to CallRequest
([#1069](#1069))
([5087121](5087121))
* **api:** Remove unused and obsolete token info
([#1071](#1071))
([e920897](e920897))
* Better errors for JsonRPC calls
([#1002](#1002))
([079f999](079f999))
* **commitment:** Commitment component
([#1024](#1024))
([60305ba](60305ba))
* **en:** Make snapshots applier resilient and process storage log
chunks in parallel
([#1036](#1036))
([805218c](805218c))
* **node_framework:** Resources and layers for ETH clients
([#1074](#1074))
([776337a](776337a))
* **node_framework:** Support StateKeeper in the framework
([#1043](#1043))
([a80fff2](a80fff2))


### Bug Fixes

* **api:** Return on duplicate earlier
([#1059](#1059))
([cfa5701](cfa5701))
* **contract-verifier:** Use optimizer mode in solidity-single-file
verification
([#1079](#1079))
([fdab638](fdab638))
* Token distribution
([#1051](#1051))
([bd63b3a](bd63b3a))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).
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.

None yet

4 participants