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

Implement RPC errors proposal #156 #815

Merged
merged 61 commits into from
Mar 18, 2024

Conversation

Jim8y
Copy link
Contributor

@Jim8y Jim8y commented Aug 29, 2023

@Jim8y
Copy link
Contributor Author

Jim8y commented Aug 29, 2023

@AnnaShaleva Please review

src/RpcServer/RpcServer.SmartContract.cs Outdated Show resolved Hide resolved
src/RpcServer/RpcServer.Wallet.cs Outdated Show resolved Hide resolved
src/RpcServer/RpcServer.Wallet.cs Outdated Show resolved Hide resolved
src/RpcServer/RpcServer.Wallet.cs Outdated Show resolved Hide resolved
src/RpcServer/RpcError.cs Outdated Show resolved Hide resolved
@shargon
Copy link
Member

shargon commented Nov 12, 2023

@Liaojinghui if you unify the namespace and fix the unit test we can merge it.

@Jim8y
Copy link
Contributor Author

Jim8y commented Nov 12, 2023

@Liaojinghui if you unify the namespace and fix the unit test we can merge it.

I need to talk with you about this pr since it changes the error code, do you think it is ok to merge it? This is inconsistent change.

@shargon
Copy link
Member

shargon commented Nov 12, 2023

@Liaojinghui if you unify the namespace and fix the unit test we can merge it.

I need to talk with you about this pr since it changes the error code, do you think it is ok to merge it? This is inconsistent change.

It will unify the error codes, I can't see the problem.

@Jim8y
Copy link
Contributor Author

Jim8y commented Nov 12, 2023

@Liaojinghui if you unify the namespace and fix the unit test we can merge it.

I need to talk with you about this pr since it changes the error code, do you think it is ok to merge it? This is inconsistent change.

It will unify the error codes, I can't see the problem.

Fair enough, I will work on it

@Jim8y
Copy link
Contributor Author

Jim8y commented Nov 13, 2023

@roman-khimov will need you to define some new error code for the canceltx command. The existing error code are like randomly assigned. As to the format, i run dotnet format everytime i commit.

@AnnaShaleva
Copy link
Member

AnnaShaleva commented Nov 13, 2023

@roman-khimov will need you to define some new error code for the canceltx command.

I don't think we need a separate error code. canceltx creates a simple transaction with Conflicts attribute, it uses a standard transaction relay mechanism, and the error codes should be the same as for the sendrawtransaction. When it comes to NeoGo implementation, we have a bit different CLI scheme and we'll use the standard sendrawtransaction RPC call and send the conflicting transaction from NeoGo CLI to the provided RPC node endpoint (it will be done within the scope of nspcc-dev/neo-go#3151). So I'd say that the error codes will be the same as described at https://github.com/neo-project/proposals/pull/156/files#diff-2b5f7c12a23f7dbe4cb46bbf4be6936882f8e0f0b3a4db9d8c58eb294b02e6edR288-R289.

@Liaojinghui, does this comment answer your question?

@Jim8y
Copy link
Contributor Author

Jim8y commented Jan 11, 2024

@superboyiii good to go for testing.

Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

We will need this PR in the mono repo, we don't have nuget, so, you can't update neo (for AlreadyInPool).

@Jim8y
Copy link
Contributor Author

Jim8y commented Jan 11, 2024

We will need this PR in the mono repo, we don't have nuget, so, you can't update neo (for AlreadyInPool).

Can use local reference to test. Postpone the monorepo merge can make things unnecessarily complex. Waiting for a release is nonsense.

@Jim8y Jim8y closed this Feb 11, 2024
@roman-khimov
Copy link
Contributor

We need this.

@roman-khimov roman-khimov reopened this Feb 11, 2024
@Jim8y Jim8y closed this Feb 12, 2024
@Jim8y Jim8y reopened this Feb 15, 2024
@Jim8y Jim8y added blocked Need Update This pr needs to be updated. and removed blocked labels Feb 15, 2024
@Jim8y Jim8y added waiting for review and removed Need Update This pr needs to be updated. labels Feb 16, 2024
Copy link
Member

@shargon shargon left a comment

Choose a reason for hiding this comment

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

Looks good to me if neo-go team are good with it

Copy link
Contributor

@roman-khimov roman-khimov left a comment

Choose a reason for hiding this comment

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

We actually have spotted some minor problems in the set of errors passed from core to module (we can have a bit more details there), but I don't think these should hold the PR. We can also improve the proposal now with Conflicts handling that was missing from the protocol when it was initially submitted, but that's also a different topic. The PR here is a pretty big and good set of changes, it definitely improves the situation and it's compliant to the current state of proposal, so let's merge it as is and then improve upon it if and when needed.

@vncoelho vncoelho merged commit 253a77e into neo-project:master Mar 18, 2024
4 checks passed
@shargon shargon deleted the Add-error-codes-and-response-errors branch March 18, 2024 16:48
shargon added a commit to neo-project/proposals that referenced this pull request Apr 4, 2024
* add RPC error proposal

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

* nep-Y: correct group description

Co-authored-by: Erik van den Brink <[email protected]>

* nep-Y: typo fix

Co-authored-by: Erik van den Brink <[email protected]>

* nep-Y: unify -104 wording

Co-authored-by: Erik van den Brink <[email protected]>

* nep-Y: UTF-8 for code/message

* nep-Y: clarify "other codes"

* nep-Y: the most specific

* NEP-Y: extend list of `getblock` and `getblockheader` return error codes

These can autoresolve height to hash, so height-related error code
is applicable as well.

Signed-off-by: Anna Shaleva <[email protected]>

* NEP-Y: extend list of `submitoracleresponse` return error codes

Oracle response can have invalid signature.

Signed-off-by: Anna Shaleva <[email protected]>

* NEP-Y: extend list of `submitblock` return error codes

Blocks contain transactions, therefore any transaction-related
error codes can be applicable too.

Signed-off-by: Anna Shaleva <[email protected]>

* NEP-Y: extend list of `verifyproof` return error codes

Proof verification is relevant only for the nodes that store not only
the latest chain state.

Signed-off-by: Anna Shaleva <[email protected]>

* nep-Y: add -600 for "access denied"

See neo-project/neo-modules#815 (comment)

Signed-off-by: Roman Khimov <[email protected]>

* nep-Y: spelling fix

Signed-off-by: Roman Khimov <[email protected]>

* Update nep-Y.mediawiki

Co-authored-by: Jimmy <[email protected]>

* Rename nep-Y.mediawiki to nep-23.mediawiki

* Update README.mediawiki

* Update nep-23.mediawiki

* Update README.mediawiki

* README: fix link to the document

Signed-off-by: Roman Khimov <[email protected]>

* nep-23: add implementation links

Signed-off-by: Roman Khimov <[email protected]>

* nep-23: extend -510 to cover NVB

Signed-off-by: Roman Khimov <[email protected]>

* nep-23: add -513 for Conflicts

Signed-off-by: Roman Khimov <[email protected]>

---------

Signed-off-by: Anna Shaleva <[email protected]>
Signed-off-by: Roman Khimov <[email protected]>
Co-authored-by: Erik van den Brink <[email protected]>
Co-authored-by: Anna Shaleva <[email protected]>
Co-authored-by: Shargon <[email protected]>
Co-authored-by: Jimmy <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants