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

Make errors thrown during data transformation more descriptive #2554

Closed
integraledelebesgue opened this issue Oct 3, 2024 · 5 comments
Closed

Comments

@integraledelebesgue
Copy link
Member

integraledelebesgue commented Oct 3, 2024

Component the issue is related to

Cast - data transformer

Issue

Before introducing calldata transformation, commands used to throw quite verbose errors concerning e.g. absence of the requested class hash. They originated from blockifier.
Since transformer was introduced, such errors are thrown earlier in the execution process and are less descriptive

I added a workaround for preserving old error messages despite throwing them from completely different place. ContractErrors normally obtained after sending transaction to chain are created here and here to mimic the old behaviour.

This isn't a nice solution though. Maybe we should rethink our error propagation logic and perform a revamp.

@cptartur
Copy link
Member

cptartur commented Oct 7, 2024

@integraledelebesgue please update this

@cptartur
Copy link
Member

cptartur commented Oct 7, 2024

I think we could at least retain behavior similar to older errors we had.

E.g. (as of writing this) instead of an error like that error: An error occurred in the called contract[..]Class with hash[..]is not declared[..] we now throw "Error: Couldn't retrieve contract class with hash:.

However, the RPC endpoint used to get contract class (and so an ABI) is throwing a very descriptive error https://github.com/starkware-libs/starknet-specs/blob/6d88b7399f56260ece3821c71f9ce53ec55f830b/api/starknet_api_openrpc.json#L522 in a case where contract is missing: We could handle that and show an information to the user that the contract is not declared to the network at all.

@integraledelebesgue
Copy link
Member Author

See #2572

@cptartur cptartur added this to the Data Transformer milestone Oct 14, 2024
@cptartur cptartur removed the new label Oct 14, 2024
@cptartur cptartur moved this from Backlog to TODO in Starknet foundry Oct 14, 2024
@cptartur cptartur moved this from TODO to Backlog in Starknet foundry Oct 17, 2024
@cptartur
Copy link
Member

cptartur commented Nov 4, 2024

The workarounds introduced to solve this might no longer be required/good since we are distinguishing data transformation and old calldata flow.

@cptartur
Copy link
Member

Closing in favor of #2694

@cptartur cptartur closed this as not planned Won't fix, can't repro, duplicate, stale Nov 20, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Starknet foundry Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

2 participants