-
Notifications
You must be signed in to change notification settings - Fork 25
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
fix(execution): forbid calling cairo0 contract with cairo1 only builtins #128
fix(execution): forbid calling cairo0 contract with cairo1 only builtins #128
Conversation
801e36d
to
d13501f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 3 of 3 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @avi-starkware and @meship-starkware)
crates/blockifier/src/execution/deprecated_entry_point_execution.rs
line 85 at r1 (raw file):
context: &'a mut EntryPointExecutionContext, ) -> Result<VmExecutionContext<'a>, PreExecutionError> { // Resolve initial PC from EP indicator.
Please move it to the relevant line of code.
Code quote:
// Resolve initial PC from EP indicator.
crates/blockifier/src/execution/deprecated_entry_point_execution.rs
line 94 at r1 (raw file):
unsupported_builtins_set.iter().map(|&item| *item).collect(), )); }
Suggestion:
// Verify use of cairo0 builtins only.
let program_builtins: HashSet<&BuiltinName> =
HashSet::from_iter(contract_class.program.iter_builtins());
let unsupported_builtins =
&program_builtins - &HashSet::from_iter(CAIRO0_BUILTINS_NAMES.iter());
if !unsupported_builtins_set.is_empty() {
return Err(PreExecutionError::UnsupportedCairo0Builtin(
unsupported_builtins_set.iter().map(|&item| *item).collect(),
));
}
d13501f
to
58af0ae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 2 of 3 files reviewed, 2 unresolved discussions (waiting on @avi-starkware and @noaov1)
crates/blockifier/src/execution/deprecated_entry_point_execution.rs
line 85 at r1 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Please move it to the relevant line of code.
Done.
crates/blockifier/src/execution/deprecated_entry_point_execution.rs
line 94 at r1 (raw file):
unsupported_builtins_set.iter().map(|&item| *item).collect(), )); }
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @avi-starkware)
58af0ae
to
bbc9f2a
Compare
This change is