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

chore(cairo_native): add native to stack trace test #2633

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

meship-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

@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.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @noaov1)


crates/blockifier/src/test_utils/contracts.rs line 404 at r1 (raw file):

                    panic!("Not implemented for cairo native contracts")
                }
            }

This is waiting for LC to add the entry_point_by_type to the AotContractExacutor.

Code quote:

            RunnableCompiledClass::V1Native(_) => {
                #[cfg(test)]
                {
                    EntryPointOffset(10000)
                }
                #[cfg(not(test))]
                {
                    panic!("Not implemented for cairo native contracts")
                }
            }

Copy link

codecov bot commented Dec 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.54%. Comparing base (e3165c4) to head (a305cca).
Report is 807 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2633       +/-   ##
===========================================
+ Coverage   40.10%   71.54%   +31.44%     
===========================================
  Files          26       98       +72     
  Lines        1895    13634    +11739     
  Branches     1895    13634    +11739     
===========================================
+ Hits          760     9755     +8995     
- Misses       1100     3450     +2350     
- Partials       35      429      +394     

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

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @meship-starkware)


crates/blockifier/src/test_utils/contracts.rs line 404 at r1 (raw file):

Previously, meship-starkware (Meshi Peled) wrote…

This is waiting for LC to add the entry_point_by_type to the AotContractExacutor.

Consider using the casm field

Copy link
Contributor Author

@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.

Reviewable status: 0 of 2 files reviewed, 1 unresolved discussion (waiting on @noaov1)


crates/blockifier/src/test_utils/contracts.rs line 404 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Consider using the casm field

Do we still need the entry_point_by_type for the V1Native class, or can we assume that the casm would be enough?

@meship-starkware meship-starkware force-pushed the meship/fix_stack_trace_in_native branch 4 times, most recently from 44179be to b703dee Compare December 16, 2024 13:25
Copy link
Contributor Author

@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.

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @noaov1)


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

            .map_err(|error| self.handle_error(remaining_gas, error.into()))?;

        let class_hash = self.base.get_class_hash_at(contract_address).unwrap_or_default();

This shouldn't be unwrap_or_default. Should this be expect if we can't get the class_hash error?
At the VM, we return the error in the function. I can add handle error flow here.

Code quote:

    let class_hash = self.base.get_class_hash_at(contract_address).unwrap_or_default();

@meship-starkware meship-starkware force-pushed the meship/fix_stack_trace_in_native branch from b703dee to f6869ad Compare December 16, 2024 16:54
Copy link
Contributor Author

@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.

Reviewable status: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @noaov1)


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

            .base
            .get_class_hash_at(contract_address)
            .map_err(|e| self.handle_error(remaining_gas, e))?;

It's the same as the VM, but I am not entirely sure why it should be like this.

Code quote:

        let class_hash = self
            .base
            .get_class_hash_at(contract_address)
            .map_err(|e| self.handle_error(remaining_gas, e))?;

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.

3 participants