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

Use the new ContractExecutor API from cairo native #19

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

PearsonWhite
Copy link

@PearsonWhite PearsonWhite commented Sep 16, 2024

From #14 but updated dependencies

Corresponding Juno PR: NethermindEth/juno#2156

PearsonWhite added a commit to NethermindEth/juno that referenced this pull request Sep 16, 2024
@PearsonWhite PearsonWhite marked this pull request as ready for review September 16, 2024 20:31
Copy link

@xrvdg xrvdg left a comment

Choose a reason for hiding this comment

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

Do formatting changes comply with the cargo fmt rules of the sequencer?

Comment on lines 253 to 254
) -> Result<ContractExecutor, cairo_native::error::Error> {
ContractExecutor::new(sierra_program, cairo_native::OptLevel::Default)
Copy link

Choose a reason for hiding this comment

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

Inline compile_and_load

Copy link
Author

Choose a reason for hiding this comment

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

Removed compile_and_load and just used ContractExecutor::new.

@PearsonWhite
Copy link
Author

Do formatting changes comply with the cargo fmt rules of the sequencer?

Was this meant for the Juno PR? I fixed the formatting there with this commit.
I checked the formatting on these files and it looks fine (now at least). I'm using the rustfmt.toml at the root of the sequencer repo.

@xrvdg
Copy link

xrvdg commented Sep 19, 2024

I checked the formatting on these files and it looks fine (now at least). I'm using the rustfmt.toml at the root of the sequencer repo.

cargo +nightly fmt -p blockifier is giving me different results than displayed here and it also makes use of the rustfmt.toml.

Program as DeprecatedProgram,
};
use starknet_api::hash::StarkHash as Hash;
Copy link

Choose a reason for hiding this comment

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

Better to use Felt directly instead of introducing an alias for a type alias of Felt.

Copy link
Author

Choose a reason for hiding this comment

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

No longer in the diff after rebase.

crates/blockifier/src/execution/contract_class.rs Outdated Show resolved Hide resolved
crates/blockifier/src/execution/contract_class.rs Outdated Show resolved Hide resolved
@PearsonWhite
Copy link
Author

cargo +nightly fmt -p blockifier is giving me different results than displayed here and it also makes use of the rustfmt.toml.

Fixed. The rustfmt.toml uses nightly only options but there is no rust-toolchain.toml, so the formatting depends on your default toolchain selection. After setting to nightly it works.

@PearsonWhite PearsonWhite merged commit 68cd327 into native2.8.x Sep 20, 2024
4 of 9 checks passed
PearsonWhite added a commit to NethermindEth/juno that referenced this pull request Sep 23, 2024
PearsonWhite added a commit to NethermindEth/juno that referenced this pull request Sep 23, 2024
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