-
Notifications
You must be signed in to change notification settings - Fork 58
blockifier: get compiled class hash v2 dict state reader #8435
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
base: aviv/add_compiled_class_hash_to_feature_contract_data
Are you sure you want to change the base?
blockifier: get compiled class hash v2 dict state reader #8435
Conversation
Warning This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
This stack of pull requests is managed by Graphite. Learn more about stacking. |
Artifacts upload workflows: |
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 r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1)
a discussion (no related file):
Can you add a simple test that adds a class and tries to read the compiled class and compiled class v2?
Can be in a separate PR
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 r1.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @AvivYossef-starkware)
crates/blockifier/src/test_utils/dict_state_reader.rs
line 88 at r1 (raw file):
fn get_compiled_class_hash(&self, class_hash: ClassHash) -> StateResult<CompiledClassHash> { // Try to get the v2 compiled class hash first.
Why is it needed? What will happen if we want to declare an "old" class (to test the migration)?
Note that the use of add_class
is for the preprocess (so it can be an old declare)
Code quote:
// Try to get the v2 compiled class hash first.
crates/blockifier/src/test_utils/dict_state_reader.rs
line 98 at r1 (raw file):
// Fallback. let compiled_class_hash = self.class_hash_to_compiled_class_hash.get(&class_hash).copied().unwrap_or_default();
Note that this is updated only in case of declare transaction (and not in add_class
)
Code quote:
self.class_hash_to_compiled_class_hash.get(&class_hash).copied().unwrap_or_default();
fca62d4
to
e7bcd31
Compare
41c4067
to
009f424
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 5 of 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @AvivYossef-starkware)
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, 3 unresolved discussions (waiting on @meship-starkware and @noaov1)
a discussion (no related file):
Previously, meship-starkware (Meshi Peled) wrote…
Can you add a simple test that adds a class and tries to read the compiled class and compiled class v2?
Can be in a separate PR
Still relevant?
crates/blockifier/src/test_utils/dict_state_reader.rs
line 88 at r1 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Why is it needed? What will happen if we want to declare an "old" class (to test the migration)?
Note that the use ofadd_class
is for the preprocess (so it can be an old declare)
Discussed
crates/blockifier/src/test_utils/dict_state_reader.rs
line 98 at r1 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Note that this is updated only in case of declare transaction (and not in
add_class
)
Discussed
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, 2 unresolved discussions (waiting on @noaov1)
a discussion (no related file):
Previously, AvivYossef-starkware wrote…
Still relevant?
No, we will test it as part of the migration
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 5 files at r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @AvivYossef-starkware)
crates/blockifier/src/test_utils/dict_state_reader.rs
line 30 at r2 (raw file):
impl DictStateReader { /// Adds a contract class to the state reader.
Suggestion:
/// Pre-process: declares a class.
crates/blockifier/src/test_utils/dict_state_reader.rs
line 57 at r2 (raw file):
/// Adds the compiled class hashes of the contract to the state reader. /// The `hash_version` parameter is used to determine if we should add the class before the // migration.
Suggestion:
/// migration.
No description provided.