feat: added error codes for supervisor RPC errors #661
feat: added error codes for supervisor RPC errors #661sebastianst merged 15 commits intoethereum-optimism:mainfrom
Conversation
|
hey @emhane, can you provide a review....will fix it according to the suggestions. ty! |
emhane
left a comment
There was a problem hiding this comment.
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
emhane
left a comment
There was a problem hiding this comment.
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
32XXXX meaning server error - following digit pair reserved for gRPC error category (1-16)
e.g.320600refers to the first server error of categoryALREADY_EXISTS= 6.
we use 06 so we can make the distinction between status codeCANCELLED= 1,3201XX, andABORTED= 10,3210XX. - last digit pair is reserved for indexing errors of same gRPC code on the same server. so,
320601is the second error of categoryALREADY_EXISTSon 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! |
emhane
left a comment
There was a problem hiding this comment.
super nice! some nitpicks remaining
|
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 |
|
apologies for the slow review @07Vaishnavi-Singh ! |
|
hey @tynes , if @alfonso-op is occupied at the moment I can handle the issue further. Can you please just tell me what needs to be done and would be great if you can share some resources for the same. Will wrap it up as soon as possible and and start working on paradigmxyz/reth#15671 |
|
Apologies for not replying to this directly last week. @jelias2 and @yashvardhan-kukreja are implementing the changes to proxyd to integrate with supervisor and will share any feedback. |
|
overall lgtm, needs a spec reviewer |
|
Thank you @07Vaishnavi-Singh, this looks neat and useful! Looking forwards to more such contributions :) |
Closes - #660
Changes