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

Rpc 0.8.0 errors #627

Merged
merged 28 commits into from
Oct 21, 2024
Merged

Rpc 0.8.0 errors #627

merged 28 commits into from
Oct 21, 2024

Conversation

FabijanC
Copy link
Contributor

@FabijanC FabijanC commented Oct 11, 2024

Usage related changes

Development related changes

  • Copy stack_trace.rs from blockifier. Can be replaced with importing once included in an official blockifier release.
  • Introduce utility function for extracting RPC errors unmatched by starknet-rs (due to starknet-rs being adapted to an older RPC spec)
  • Vm frame not included in the returned errors as it doesn't have recursive properties (not suitable for error-composing). Only relying on EntryPointFrame and StringFrame.
  • Regarding the revert error in tx simulation and estimation still being a string, we could construct a stack trace based on that string, but it would be based on the structure of the stringified error.
  • Improve testing of json rpc error structure (introduce new utility method).

Checklist:

  • Checked out the contribution guidelines
  • Applied formatting - ./scripts/format.sh
  • No linter errors - ./scripts/clippy_check.sh
  • No unused dependencies - ./scripts/check_unused_deps.sh
  • No spelling errors - ./scripts/check_spelling.sh
  • Performed code self-review
  • Rebased to the latest commit of the target branch (or merged it into my branch)
    • Once you make the PR reviewable, please avoid force-pushing
  • Updated the docs if needed - ./website/README.md
  • Linked the issues resolvable by this PR - linking info
  • Updated the tests if needed; all passing - execution info

@FabijanC FabijanC mentioned this pull request Oct 11, 2024
7 tasks
@FabijanC FabijanC marked this pull request as ready for review October 17, 2024 15:16
Comment on lines +1210 to +1213
.map_err(|e| Error::ContractExecutionErrorInSimulation {
failure_index: tx_i as u64,
error_stack: gen_tx_execution_error_trace(&e),
})?;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

As per the specification of starknet_simulateTransactions, we shouldn't return the error right away, but include the error details in the trace of the result. Shall be taken care of in #628.

@FabijanC FabijanC merged commit 9e5bc95 into json-rpc-v0.8.0 Oct 21, 2024
1 check passed
@FabijanC FabijanC deleted the rpc-0.8.0-errors branch October 21, 2024 07:43
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 this pull request may close these issues.

Execution error on estimation and simulation should return TRANSACTION_EXECUTION_ERROR
2 participants