-
Notifications
You must be signed in to change notification settings - Fork 113
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 errors proposal #156
RPC errors proposal #156
Conversation
Based on neo-project/neo-modules#728, but differs a bit from it: * reduced set of groups * unified missing block/header error * improved compatibility for -301 and -302
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.
I really like supporting this. Many times the error responses are too general to figure out what is actually wrong and one has to debug it running their own node.
Co-authored-by: Erik van den Brink <[email protected]>
Co-authored-by: Erik van den Brink <[email protected]>
Co-authored-by: Erik van den Brink <[email protected]>
📯 📯 📯 @erikzhang, @shargon, @vncoelho, @devhawk, anyone else 🥁 🥁 🥁 I think we need to move on with this, it's important for dApp development. |
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.
Good proposal to improve the user experience
Agreed. When do we merge this? |
We need this. |
These can autoresolve height to hash, so height-related error code is applicable as well. Signed-off-by: Anna Shaleva <[email protected]>
Oracle response can have invalid signature. Signed-off-by: Anna Shaleva <[email protected]>
Blocks contain transactions, therefore any transaction-related error codes can be applicable too. Signed-off-by: Anna Shaleva <[email protected]>
Proof verification is relevant only for the nodes that store not only the latest chain state. Signed-off-by: Anna Shaleva <[email protected]>
Minor adjustments (no new codes) made based on implementation experience from nspcc-dev/neo-go#3063. |
According to proposal: neo-project/proposals#156 Close nspcc-dev#2248 Signed-off-by: Tatiana Nesterenko <[email protected]>
According to proposal: neo-project/proposals#156 Close nspcc-dev#2248 Signed-off-by: Tatiana Nesterenko <[email protected]>
According to proposal: neo-project/proposals#156 Close nspcc-dev#2248 Signed-off-by: Tatiana Nesterenko <[email protected]>
According to proposal: neo-project/proposals#156 Close nspcc-dev#2248 Signed-off-by: Tatiana Nesterenko <[email protected]>
According to proposal: neo-project/proposals#156 Close nspcc-dev#2248 Signed-off-by: Tatiana Nesterenko <[email protected]>
While our server no longer uses these codes (-100, -400) they still can come from C# servers and while we consider them deprecated we better at least have some definition of them until C# implements our proposal: neo-project/proposals#156 Also adding description of deprecated RPC error codes in ROADMAP.md. Signed-off-by: Tatiana Nesterenko <[email protected]>
This change makes code incompatible with C# node, because currently no error is returned on invalid proof. According to proposal: neo-project/proposals#156 Also adding `verifyProof` descpiption in docs/rpc.md. Signed-off-by: Tatiana Nesterenko <[email protected]>
Behaviour change. `terminatesession` returns ErrUnknownSession in case of impossibility of finding session, previously there was no-error response with `false` result. `traverseIterator`returns ErrUnknownSession in case of impossibility of finding session, previously there was no-error response with default result; `traverseIterator`returns ErrUnknownIterator, there were no such errors before. Accordingly to proposal: neo-project/proposals#156 Also adding description of `traverseIterator` in docs/rpc.md. Signed-off-by: Tatiana Nesterenko <[email protected]>
Just for the record: we've successfully adopted this standard to the NeoGo RPC server in nspcc-dev/neo-go#3063. It works fine in tests and we'll integrate these new error codes into NeoFS as soon as 0.102.0 is released. There's a couple of issues that will be fixed by the usage of new RPC errors standard. |
While this hasn't been merged yet, two suggestions related to new attributes:
|
mempool.ErrInsufficientFunds is used when sender doesn't have enough balance to pay the submitted transaction fees (-511 code according to neo-project/proposals#156). mempool.ErrConflict is used when sender is not able to pay the overall transactions fee sum in the pool (generic -500 error according to the proposal). This bugfix is kind of breaking change for those users who relied on the old -511 code previously returning "insufficient funds" error. Signed-off-by: Anna Shaleva <[email protected]>
This is not the way intended in neo-project/proposals#156. -511 covers _both_ cases because users hardly can distinguish one from another, it's just that our mempool implementation has error codes for both.. Signed-off-by: Roman Khimov <[email protected]>
I think it's good to go. Adding a implement link will be better. |
Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
Updated, added implementation links. |
LGTM |
Based on neo-project/neo-modules#728, but differs a bit from it: