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

[Katana] Expose panic reason to client side and not only to log #904

Closed
yoga-braavos opened this issue Sep 18, 2023 · 4 comments
Closed
Labels
blocked This issue is blocked due to some other issues katana This issue is related to Katana question Further information is requested

Comments

@yoga-braavos
Copy link

Is your feature request related to a problem? Please describe.
Contract errors cannot be consumed programmatically from client side. A generic error is returned for failed contract invocations without the panic reason:
E Input: 'Client failed with code 40: Contract error.'

Describe the solution you'd like
Output the panic reason (felt) not only to the log but also as part of the API output. For example, this is printed out to the log but not returned to the client:

2023-09-18T13:09:31.874215Z  WARN executor: Transaction validation error: ContractConstructorExecutionFailed(ExecutionFailed { error_data: [StarkFelt("0x00000000000000000000494e56414c49445f4445504c4f594d454e545f534947")] })
@kariy kariy added the katana This issue is related to Katana label Sep 18, 2023
@kariy
Copy link
Member

kariy commented Sep 18, 2023

I'm not sure if it is part of the JSON-RPC spec to include the errors reason in the API response? or does it break the spec if it is included? ideally, we don't want to introduce anything that's not gonna be spec compatible.

@yoga-braavos
Copy link
Author

You are correct, I opened an issue in the specs repo and also communicated Starkware regarding this

starkware-libs/starknet-specs#137

@kariy kariy added question Further information is requested blocked This issue is blocked due to some other issues labels Sep 20, 2023
@kariy
Copy link
Member

kariy commented Sep 22, 2023

seems like will be added in v0.5.0

@kariy
Copy link
Member

kariy commented Sep 22, 2023

closing this as it will be included in upcoming json-rpc ver. and implementing this now will break current rpc spec that katana is based on.

@kariy kariy closed this as not planned Won't fix, can't repro, duplicate, stale Sep 22, 2023
@github-project-automation github-project-automation bot moved this to ✅ Done in Dojo Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue is blocked due to some other issues katana This issue is related to Katana question Further information is requested
Projects
No open projects
Status: Done
Development

No branches or pull requests

2 participants