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

fix: improve convertion errors and handle invalid ABI #387

Merged
merged 10 commits into from
Oct 14, 2024

Conversation

whichqua
Copy link
Collaborator

@whichqua whichqua commented Sep 27, 2024

Problem: During convertions between types from blockifier, starknet and cairolang classes, the errors returned are not consistent. This also led to finding an invalid api bug during convertion.

Solution:

  • Create better errors for ConvertionError and RpcClientError and handle them appropriately.
  • Default to None when abi is not valid JSON.

Issue Number: N/A

Type

  • feature
  • bugfix
  • dev (no functional changes, no API changes)
  • fmt (formatting, renaming)
  • build
  • docs
  • testing

Description

Breaking changes?

  • yes
  • no

Copy link
Collaborator

@HermanObst HermanObst left a comment

Choose a reason for hiding this comment

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

LGTM

@HermanObst
Copy link
Collaborator

@whichqua please address @shamsasari comments before merging

* fix: handle contract commitments for contract without data items

Problem: reexecution panics when a contract doesnt have data items

Solution: handle the edge case to prevent panics

* fix: only one commitment return
Copy link
Collaborator

@HermanObst HermanObst left a comment

Choose a reason for hiding this comment

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

This need further investigation in PAthfinder

Copy link
Collaborator

@HermanObst HermanObst left a comment

Choose a reason for hiding this comment

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

LGTM

@HermanObst HermanObst merged commit b60b2cb into main Oct 14, 2024
6 checks passed
@HermanObst HermanObst deleted the gm/no-possible-convertion branch October 14, 2024 18:48
matzayonc pushed a commit to matzayonc/snos that referenced this pull request Oct 15, 2024
…strange#387)

* fix: improve convertion errors to provide more context

* fix: better error handling and fix for invalid abi

* fix: add tests for blocks, and minor fixes based on review

* fix: handle contract commitments for contract without data items (keep-starknet-strange#388)

* fix: handle contract commitments for contract without data items

Problem: reexecution panics when a contract doesnt have data items

Solution: handle the edge case to prevent panics

* fix: only one commitment return

* Revert "fix: handle contract commitments for contract without data items (keep-starknet-strange#388)" (keep-starknet-strange#394)

This reverts commit 0c13f1c.

---------

Co-authored-by: Herman Obst Demaestri <[email protected]>
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.

4 participants