-
Notifications
You must be signed in to change notification settings - Fork 208
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
Restore cast script #2937
Restore cast script #2937
Conversation
note: Please remember that this PR fixes cast scripts, so tests and linting outside of sncast crate are still failing. |
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.
works!
…ub.com/foundry-rs/starknet-foundry into franciszekjob/2933-restore-cast-script
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.
Does test pass for this?
…ub.com/foundry-rs/starknet-foundry into franciszekjob/2933-restore-cast-script
Once I changed usage of |
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.
Please address the comments, otherwise we can merge
let param_types = builder.generic_id_and_size_from_concrete(&func.signature.param_types); | ||
let base_offset = 5; | ||
// * Segment arena is allocated conditionally, so segment index is automatically moved (+2 segments) | ||
// * Each used builtin moves the offset by +1 | ||
// * Line `let mut builtin_offset = 3;` in `create_entry_code_from_params` | ||
// * TODO Where is remaining +2 in base offset coming from? Maybe System builtin and Gas builtin which seem to be always included | ||
let segment_index = if param_types | ||
.iter() | ||
.any(|(ty, _)| ty == &SegmentArenaType::ID) | ||
{ | ||
// FIXME verify this | ||
base_offset + builtins.len() + 2 | ||
} else { | ||
// FIXME verify this | ||
base_offset + builtins.len() | ||
}; | ||
let syscall_handler = SyscallHintProcessor::new( | ||
&mut blockifier_state, | ||
&mut context, | ||
// This segment is created by SierraCasmRunner | ||
Relocatable { | ||
segment_index: segment_index | ||
.try_into() | ||
.expect("Failed to convert index to isize"), | ||
offset: 0, | ||
}, | ||
CallEntryPoint::default(), | ||
&string_to_hint, | ||
ReadOnlySegments::default(), | ||
); |
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.
Add a TODO here to extract the copied code to common function.
07cda7e
into
kkawula/2862-bump-cairo-and-blockifier
Closes #2933
Introduced changes
Restore cast script by adjusting
run
functionChecklist
CHANGELOG.md