-
Notifications
You must be signed in to change notification settings - Fork 28
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(blockifier): get alias from last state diff #2946
base: main-v0.13.4
Are you sure you want to change the base?
Conversation
Artifacts upload workflows: |
This stack of pull requests is managed by Graphite. Learn more about stacking. |
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: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware and @yoavGrs)
crates/blockifier/src/state/stateful_compression.rs
line 183 at r1 (raw file):
struct AliasCompressor<'a, S: StateReader> { state: &'a S, alias_contract_address: ContractAddress,
Why is this needed? use the constant
Code quote:
alias_contract_address: ContractAddress,
crates/blockifier/src/state/stateful_compression.rs
line 194 at r1 (raw file):
new_aliases: state_diff .storage .iter()
Since you need to iterate the entire diff again, how about a more straightforward suggestion (that would be compatible with the execution):
In state_diff_with_alias_allocation
:
- Compute
state_diff_without_aliases
- Let the
AliasUpdater
insert the new aliases directly to thestate
. - Compute the state diff again.
Now the AliasCompressor
has all the info in state
.
Code quote:
.storage
.iter()
5937694
to
8f1025d
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 3 files at r2.
Reviewable status: 1 of 3 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware and @yoavGrs)
crates/blockifier/src/state/stateful_compression.rs
line 84 at r2 (raw file):
/// Updates the alias contract with the new keys. struct AliasUpdater<'a, S: StateReader> { state: &'a mut CachedState<S>,
Try this
Suggestion:
struct AliasUpdater<'a, S: State> {
state: &'a mut S,
crates/blockifier/src/blockifier/transaction_executor.rs
line 171 at r2 (raw file):
log::debug!("Final block weights: {:?}.", self.bouncer.get_accumulated_weights()); let mut block_state = self.block_state.take().expect(BLOCK_STATE_ACCESS_ERR);
Why not?
Suggestion:
self.block_state.as_mut().expect(BLOCK_STATE_ACCESS_ERR);
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 3 files at r2.
Reviewable status: 2 of 3 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware and @yoavGrs)
8f1025d
to
5956f90
Compare
5956f90
to
3b6e5a0
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: 1 of 3 files reviewed, 4 unresolved discussions (waiting on @dorimedini-starkware and @Yoni-Starkware)
crates/blockifier/src/blockifier/transaction_executor.rs
line 171 at r2 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Why not?
Done.
crates/blockifier/src/state/stateful_compression.rs
line 183 at r1 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Why is this needed? use the constant
I removed the constant when I saw it in the versioned_constants
crates/blockifier/src/state/stateful_compression.rs
line 194 at r1 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Since you need to iterate the entire diff again, how about a more straightforward suggestion (that would be compatible with the execution):
In
state_diff_with_alias_allocation
:
- Compute
state_diff_without_aliases
- Let the
AliasUpdater
insert the new aliases directly to thestate
.- Compute the state diff again.
Now the
AliasCompressor
has all the info instate
.
Done.
crates/blockifier/src/state/stateful_compression.rs
line 84 at r2 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Try this
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 3 of 3 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)
Merge activity
|
No description provided.