Skip to content

feat: added error codes for supervisor RPC errors #661

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

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

07Vaishnavi-Singh
Copy link

Closes - #660

Changes

  • Added an "Errors" section to the Supervisor spec document with two subsections:
    • Standard JSON-RPC Error Codes (-32700 to -32006)
    • Protocol-Specific Error Codes (-32100 to -32119)
  • Mapped Go error types from the codebase to specific error codes
  • Used consistent error code grouping with shared prefixes
  • Followed standard JSON-RPC error formatting and descriptions

@07Vaishnavi-Singh 07Vaishnavi-Singh requested review from a team as code owners April 10, 2025 22:16
@07Vaishnavi-Singh
Copy link
Author

hey @emhane, can you provide a review....will fix it according to the suggestions. ty!

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

great start! first pass, will give this another pass in a bit. I like that you make the distinction between e.g. unknown chain and errors more specifically related to data availability by using the 3210 and 3211 prefixes respectively

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

thought again about how to do the codes, let's do this:

the 6 digit error code is made up as follows

  • first 2 digits reserved for 32XXXX meaning server error
  • following digit pair reserved for gRPC error category (1-16)
    e.g. 320600 refers to the first server error of category ALREADY_EXISTS = 6.
    we use 06 so we can make the distinction between status code CANCELLED = 1, 3201XX, and ABORTED = 10, 3210XX.
  • last digit pair is reserved for indexing errors of same gRPC code on the same server. so, 320601 is the second error of category ALREADY_EXISTS on the server.

@07Vaishnavi-Singh
Copy link
Author

Hey @emhane, I have adjusted the error codes according to the 6-digit standard, and also made the small refactoring nits asked. lmk if something still needs to be done. ty!

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

super nice! some nitpicks remaining

Copy link
Member

@emhane emhane left a comment

Choose a reason for hiding this comment

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

awesome. thanks a lot !

@07Vaishnavi-Singh
Copy link
Author

07Vaishnavi-Singh commented Apr 11, 2025

hey @emhane , can you provide some TG would be helpful while implementing these error codes in reth

@emhane
Copy link
Member

emhane commented Apr 14, 2025

hey @emhane , can you provide some TG would be helpful while implementing these error codes in reth

sure, when this pr is merged is a good time to start impl in reth

@tynes
Copy link
Contributor

tynes commented Apr 14, 2025

flagging @alfonso-op on this. we will want to make sure that the error codes make sense for proxyd and that the user story of a transaction being sent that includes an invalid access list is dropped returns an error code that is well defined and included in common libraries like viem

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.

3 participants