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

feat(blockifier): add replace_class cairo native syscall #1551

Open
wants to merge 1 commit into
base: rdr/add-syscall-counting
Choose a base branch
from

Conversation

PearsonWhite
Copy link
Contributor

Implements thereplace_class syscall for native cairo syscall handler.

@PearsonWhite PearsonWhite added the native integration Related with the integration of Cairo Native into the Blockifier label Oct 24, 2024
@reviewable-StarkWare
Copy link

This change is Reviewable

@PearsonWhite PearsonWhite changed the base branch from main to rdr/update-testing-suite October 24, 2024 15:20
Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

@PearsonWhite PearsonWhite marked this pull request as ready for review October 25, 2024 20:20
Copy link
Contributor

@varex83 varex83 left a comment

Choose a reason for hiding this comment

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

Please, rebase / change target branch to #1305

Reviewable status: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @PearsonWhite)


crates/blockifier/src/execution/native/syscall_handler.rs line 180 at r3 (raw file):

            .state
            .get_compiled_contract_class(class_hash)
            .expect("Failed to get ContractClass from class hash: {class_hash}.");

Please, be consistent with VM implementation, return the runtime error here, not panic


crates/blockifier/src/execution/native/syscall_handler.rs line 186 at r3 (raw file):

                let err =
                    &SyscallExecutionError::ForbiddenClassReplacement { class_hash }.to_string();
                panic!("{err:?}");

Don't use panic here


crates/blockifier/src/execution/native/syscall_handler.rs line 191 at r3 (raw file):

                self.state
                    .set_class_hash_at(self.contract_address, class_hash)
                    .expect("Failed to set class hash for class hash: {class_hash}.");

And here

@rodrigo-pino rodrigo-pino force-pushed the rdr/update-testing-suite branch 2 times, most recently from a00994e to e2c9fe8 Compare October 28, 2024 15:36
@PearsonWhite PearsonWhite force-pushed the pwhite/replace_class branch 2 times, most recently from 12eb020 to 4a2d661 Compare October 28, 2024 18:44
@PearsonWhite PearsonWhite changed the base branch from rdr/update-testing-suite to rdr/add-syscall-counting October 28, 2024 18:45
Copy link

Artifacts upload triggered. View details here

Copy link

codecov bot commented Oct 28, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.55%. Comparing base (861b3c2) to head (e337479).

Additional details and impacted files
@@                     Coverage Diff                      @@
##           rdr/add-syscall-counting    #1551      +/-   ##
============================================================
+ Coverage                     68.48%   68.55%   +0.06%     
============================================================
  Files                           102      103       +1     
  Lines                         13662    13687      +25     
  Branches                      13662    13687      +25     
============================================================
+ Hits                           9357     9383      +26     
+ Misses                         3904     3903       -1     
  Partials                        401      401              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Contributor Author

@PearsonWhite PearsonWhite left a comment

Choose a reason for hiding this comment

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

I rebased it onto rdr/add-syscall-counting because it doesn't depend on rdr/native-storage-read.

Reviewable status: 0 of 5 files reviewed, 3 unresolved discussions (waiting on @varex83)


crates/blockifier/src/execution/native/syscall_handler.rs line 180 at r3 (raw file):

Previously, varex83 (Bohdan Ohorodnii) wrote…

Please, be consistent with VM implementation, return the runtime error here, not panic

Done.


crates/blockifier/src/execution/native/syscall_handler.rs line 186 at r3 (raw file):

Previously, varex83 (Bohdan Ohorodnii) wrote…

Don't use panic here

Done.


crates/blockifier/src/execution/native/syscall_handler.rs line 191 at r3 (raw file):

Previously, varex83 (Bohdan Ohorodnii) wrote…

And here

Done.

@rodrigo-pino rodrigo-pino force-pushed the rdr/add-syscall-counting branch 2 times, most recently from 147c1d3 to ded98cf Compare October 29, 2024 14:23
Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link

Artifacts upload triggered. View details here

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 5 files at r4, 5 of 6 files at r5, all commit messages.
Reviewable status: 6 of 7 files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 6 files at r5.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)

@rodrigo-pino rodrigo-pino force-pushed the rdr/add-syscall-counting branch 4 times, most recently from 6e88aa9 to 55834b2 Compare October 31, 2024 14:45
Copy link

Artifacts upload triggered. View details here

Copy link

github-actions bot commented Nov 1, 2024

Artifacts upload triggered. View details here

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 3 files at r6, all commit messages.
Reviewable status: 6 of 7 files reviewed, 3 unresolved discussions (waiting on @noaov1 and @varex83)

Copy link
Contributor

@meship-starkware meship-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 3 files at r6.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

Copy link
Contributor

@varex83 varex83 left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

Copy link
Contributor

@avi-starkware avi-starkware left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 6 files at r5, 2 of 3 files at r6, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noaov1)

Copy link

github-actions bot commented Nov 7, 2024

Artifacts upload triggered. View details here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
native integration Related with the integration of Cairo Native into the Blockifier
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants