-
Notifications
You must be signed in to change notification settings - Fork 52
feat(starknet_os): implement assign bytecode segments hint #5004
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(starknet_os): implement assign bytecode segments hint #5004
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
0f0127c
to
3f1b5e9
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 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yoavGrs)
crates/starknet_os/src/hints/hint_implementation/compiled_class/implementation.rs
line 39 at r1 (raw file):
} else { unreachable!("assign_bytecode_segments should not be called on a leaf node."); }
I think technically this can happen, right?
I cannot - in a context-free way - see why the else
is unreachable...
how about this?
Suggestion:
match bytecode_segment_structure {
BytecodeSegmentNode::InnerNode(node) => {
exec_scopes.insert_value(Scope::BytecodeSegments.into(), node.segments.into_iter());
Ok(())
}
BytecodeSegmentNode::Leaf(_) => Err(OsHintError::AssignedLeafBytecode)
}
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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @yoavGrs)
crates/starknet_os/src/hints/hint_implementation/compiled_class/implementation.rs
line 39 at r1 (raw file):
Previously, dorimedini-starkware wrote…
I think technically this can happen, right?
I cannot - in a context-free way - see why theelse
is unreachable...
how about this?
yes, technically, it is possible, but within the flow of the OS code, it's not.
PTAL here , if the variant is a leaf then the function will return early and won't reach that hint.
(returning an error is also fine IMO, just want to clarify this should be unreachable)
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: all files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @yoavGrs)
crates/starknet_os/src/hints/hint_implementation/compiled_class/implementation.rs
line 39 at r1 (raw file):
Previously, nimrod-starkware wrote…
yes, technically, it is possible, but within the flow of the OS code, it's not.
PTAL here , if the variant is a leaf then the function will return early and won't reach that hint.
(returning an error is also fine IMO, just want to clarify this should be unreachable)
let's go with errors, we are writing a library here
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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @yoavGrs)
crates/starknet_os/src/hints/hint_implementation/compiled_class/implementation.rs
line 39 at r1 (raw file):
Previously, dorimedini-starkware wrote…
let's go with errors, we are writing a library here
Done.
3f1b5e9
to
1eec0db
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 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @yoavGrs)
crates/starknet_os/src/hints/hint_implementation/compiled_class/implementation.rs
line 39 at r1 (raw file):
Previously, nimrod-starkware wrote…
Done.
please use match
- it protects against addition of another variant without handling it correctly
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: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware and @yoavGrs)
crates/starknet_os/src/hints/hint_implementation/compiled_class/implementation.rs
line 39 at r1 (raw file):
Previously, dorimedini-starkware wrote…
please use
match
- it protects against addition of another variant without handling it correctly
Done.
1eec0db
to
eb8ed48
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 1 of 1 files at r3, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @yoavGrs)
No description provided.