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

Bug: There are two bugs in the RPC error handling. #509

Closed
clint419 opened this issue Dec 2, 2023 · 4 comments · Fixed by #510
Closed

Bug: There are two bugs in the RPC error handling. #509

clint419 opened this issue Dec 2, 2023 · 4 comments · Fixed by #510

Comments

@clint419
Copy link
Contributor

clint419 commented Dec 2, 2023

[2023-12-02T06:05:37Z TRACE starknet_providers::jsonrpc::transports::http] Response from JSON-RPC: {"jsonrpc":"2.0","error":{"code":-32603,"message":"Internal error","data":{"error":"Internal error: Error in the called contract (0x05686c52b6f38639eb9cfb3dfff1b3260315099aa045fcc0b4a865068ba36aad):\nError at pc=0:558:\nCouldn't compute operand op1. Unknown value for memory cell 7:5"}},"id":1}

called `Result::unwrap()` on an `Err` value: Provider(Other(TransportError(Json(Error("data did not match any variant of untagged enum JsonRpcResponse", line: 0, column: 0)))))
@clint419
Copy link
Contributor Author

clint419 commented Dec 2, 2023

@xJonathanLEI

@clint419
Copy link
Contributor Author

clint419 commented Dec 2, 2023

Sequencer gateway error handling implementation bug:

[2023-12-02T07:39:04Z TRACE starknet_providers::sequencer] Response from sequencer API: {"code": "StarknetErrorCode.DEPRECATED_ENDPOINT", "message": "Endpoint is deprecated from version 0.12.3."}
thread 'main' panicked at examples/mint_tokens.rs:65:10:
called `Result::unwrap()` on an `Err` value: Provider(Other(Serde(Error("data did not match any variant of untagged enum RawFieldElementResponse", line: 0, column: 0))))

@clint419 clint419 changed the title Bug: there is a bug in the JSON-RPC error handling implementation Bug: There are two bugs in the RPC error handling. Dec 2, 2023
@xJonathanLEI
Copy link
Owner

For the original issue reported: you're using a JSON-RPC v0.4.x endpoint, which reports contract errors under the code -32603. Starknet-rs now works with JSON-RPC v0.5.1, which would instead report it under code 40.

For the 2nd issue, it's due to Starkware upgrading the Goerli testnet to v0.12.3 and deprecating most endpoints. At this point, using the sequencer gateway is almost pointless. The implementation of Provider for SequencerGatewayProvider will be removed in the next version.

@xJonathanLEI
Copy link
Owner

For the original issue, check out the support for error data introduced in #513.

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 a pull request may close this issue.

2 participants