-
Notifications
You must be signed in to change notification settings - Fork 132
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
base: main
Are you sure you want to change the base?
feat: added error codes for supervisor RPC errors #661
Conversation
hey @emhane, can you provide a review....will fix it according to the suggestions. ty! |
There was a problem hiding this 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
There was a problem hiding this 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:
- we add an extra digit, so we are guaranteed not to conflict with l1 error codes https://ethereum-json-rpc.com/errors, we get 6 digits
- we use gRPC status codes to group errors https://grpc.io/docs/guides/status-codes/. this helps users guess the error type of unknown errors and gives nice system to follow.
the 6 digit error code is made up as follows
- first 2 digits reserved for
32
XXXX meaning server error - following digit pair reserved for gRPC error category (1-16)
e.g.320600
refers to the first server error of categoryALREADY_EXISTS
= 6.
we use 06 so we can make the distinction between status codeCANCELLED
= 1,3201
XX, andABORTED
= 10,3210
XX. - last digit pair is reserved for indexing errors of same gRPC code on the same server. so,
320601
is the second error of categoryALREADY_EXISTS
on the server.
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! |
There was a problem hiding this 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
There was a problem hiding this 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 !
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 |
flagging @alfonso-op on this. we will want to make sure that the error codes make sense for |
Closes - #660
Changes