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

Clean cairo_rs_py_patch.py #375

Merged
merged 4 commits into from
Jan 20, 2023

Conversation

fmoletta
Copy link
Contributor

@fmoletta fmoletta commented Jan 3, 2023

Remove some overrides and changes made to starknet code via monkey patch

Main changes:

  • Remove overriden methods: _allocate_segment, _read_and_validate_syscall_requests, validate_read_only_segments & get_os_segment_ptr_range
  • Remove commented asserts across overrides
  • Import RelocatableValue class from cairo_rs_py to allow isisnstance assertions
  • Remove run_resources skip in execute_entry_point
  • Override get_runtime_type to use cairo_rs_py’s RelocatableValue type (function code is left untouched)
  • Add __str__ implementation for HandlerException

Notes:

This patch changes work with the newly pubished version of cairo-rs-py (0.1.1)

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

@fmoletta fmoletta marked this pull request as ready for review January 3, 2023 18:24
@mikiw
Copy link
Contributor

mikiw commented Jan 4, 2023

Hi @fmoletta, we will need to wait for @FabijanC to review it. My knowledge about cairo_rs is really limited. He will be back on the 9th of January.

@mikiw mikiw requested a review from FabijanC January 4, 2023 00:40
@FabijanC
Copy link
Collaborator

@fmoletta A couple of observations.

I see that you wrote:

For the new patch to work, cairo-rs-py installation needs to be updated to the latest commit

We are installing cairo-rs-py with pip install cairo-rs-py as you agreed to maintain it on PyPI. Ideally we would keep on doing that, and not installing from source. If your plans regarding the package maintenance have changed, let us know.

Also, is this PR (and the new cairo-rs-py version) supposed to introduce any performance improvements?

@fmoletta
Copy link
Contributor Author

@fmoletta A couple of observations.

I see that you wrote:

For the new patch to work, cairo-rs-py installation needs to be updated to the latest commit

We are installing cairo-rs-py with pip install cairo-rs-py as you agreed to maintain it on PyPI. Ideally we would keep on doing that, and not installing from source. If your plans regarding the package maintenance have changed, let us know.

Also, is this PR (and the new cairo-rs-py version) supposed to introduce any performance improvements?

We will soon be updating our cairo-rs-py version on PyPI (should be ready in a couple of days).
As for the performance improvements, there have been some performance improvements merged in cairo-rs, so updating the cairo-rs-py version will improve the performance of the vm. But the purpose of this PR is to remove the amount of patching and to make our integration more transparent rather than improving performance

Copy link
Collaborator

@FabijanC FabijanC left a comment

Choose a reason for hiding this comment

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

Approving this after cairo-rs-py 0.1.1 has been released, but I'll merge it with [skip ci] because pyproject.toml needs to be updated.

@FabijanC FabijanC merged commit 4344644 into 0xSpaceShard:master Jan 20, 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.

None yet

3 participants