Skip to content
This repository has been archived by the owner on Dec 15, 2023. It is now read-only.

Fix failing isinstance checks in syscalls with Rust VM #466

Merged
merged 4 commits into from
May 11, 2023

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented May 10, 2023

Fixes a bug causing certain syscalls to fail when running with cairo_rs_py. This bug was first discovered by running a contract that emits an event. It is caused by an isinstance check in the method SyscallHandlerBase._get_felt_range that failed due to cairo_rs_py and cairo-lang using a similar but different RelocatableValue class.

In order to fix this, the method SyscallHandlerBase._get_felt_range was overriden in the patch so that it uses cairo_rs_py.RelocatableValue for its isinstance checks.

Checklist:

  • Applied formatting - ./scripts/format.sh
  • No linter errors - ./scripts/lint.sh
  • Performed code self-review
  • Rebased to the last commit of the target branch (or merged it into my branch)
  • Documented the changes
  • Linked the issues which this PR resolves
  • Updated the tests
  • All tests are passing - ./scripts/test.sh

@fmoletta fmoletta changed the title Fix failed isinstace checks during syscalls when running with STARKNET_DEVNET_CAIRO_VM=rust Fix failing isinstace checks during syscalls when running with STARKNET_DEVNET_CAIRO_VM=rust May 10, 2023
@FabijanC FabijanC self-requested a review May 11, 2023 07:40
@FabijanC FabijanC changed the title Fix failing isinstace checks during syscalls when running with STARKNET_DEVNET_CAIRO_VM=rust Fix failing isinstance checks in syscalls with Rust VM May 11, 2023
@fmoletta fmoletta requested a review from FabijanC May 11, 2023 13:06
@FabijanC FabijanC merged commit 7a245e3 into 0xSpaceShard:master May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants