-
Notifications
You must be signed in to change notification settings - Fork 65
blockifier: update patricia resource calc according to new OS impl #10073
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
blockifier: update patricia resource calc according to new OS impl #10073
Conversation
Yoni-Starkware
left a comment
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, 1 unresolved discussion (waiting on @dorimedini-starkware and @noaov1)
crates/blockifier/src/bouncer_test.rs line 457 at r1 (raw file):
527194, ), }
We have two acesses, one of the is write. So we saved one traversal:
In [2]: 702922 - (1 * 5722 + 100 * 16) * 24
Out[2]: 527194
In [3]: 542410 - (1 * 4050 + 100 * 16) * 24
Out[3]: 406810Code quote:
expect![
r#"
BouncerWeights {
l1_gas: 10,
message_segment_length: 10,
n_events: 10,
state_diff_size: 14,
sierra_gas: GasAmount(
406810,
),
n_txs: 20,
proving_gas: GasAmount(
527194,
),
}
dorimedini-starkware
left a comment
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.
@dorimedini-starkware reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @noaov1)
crates/blockifier/src/bouncer.rs line 852 at r1 (raw file):
n_visited_storage_entries, // TODO(Yoni) consider counting here the global contract tree and the aliases as well. state_changes_keys.storage_keys.len(),
this includes aliases? we can ignore the block hash update I guess but we can't ignore aliases
Code quote:
state_changes_keys.storage_keys.len(),
Yoni-Starkware
left a comment
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:
complete! all files reviewed, all discussions resolved (waiting on @noaov1)
crates/blockifier/src/bouncer.rs line 852 at r1 (raw file):
Previously, dorimedini-starkware wrote…
this includes aliases? we can ignore the block hash update I guess but we can't ignore aliases
No, it's not. I don't want to include it yet since it will double the estimation (alias access per every storage access).
We are already overshooting badly here. The alias is a special case, maybe I could estimate a multi-update there properly
6197f25 to
ef327fb
Compare
noaov1
left a comment
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.
@noaov1 reviewed 1 of 2 files at r1, 1 of 1 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)
crates/blockifier/src/bouncer.rs line 955 at r1 (raw file):
/// 1. n_visited_storage_entries includes both read and write accesses, and may overlap with /// n_modified_storage_entries (if the first access to a cell was write) and my not (if a /// cell was read by a previous transaction and is now modified).
What about a write overlap? If a previous transaction has already written to that cell?
Suggestion:
/// 1. n_visited_storage_entries includes both read and write accesses, and may overlap with
/// n_modified_storage_entries (if the first access to a cell was write) and may not (if a
/// cell was read by a previous transaction and is now modified).
noaov1
left a comment
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.
@noaov1 reviewed 1 of 2 files at r1.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yoni-Starkware)
ef327fb to
45e50a9
Compare
Yoni-Starkware
left a comment
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 2 files reviewed, 1 unresolved discussion (waiting on @noaov1)
crates/blockifier/src/bouncer.rs line 955 at r1 (raw file):
Previously, noaov1 (Noa Oved) wrote…
What about a write overlap? If a previous transaction has already written to that cell?
I wouldn't appear in state_changes_keys. Only the first change is counted. We do not remove cancelled writes from it.
Update names and docs; hopefully, we won't fall into this hole in the future
45e50a9 to
f029374
Compare
f029374 to
f412c97
Compare
dorimedini-starkware
left a comment
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.
@dorimedini-starkware reviewed 1 of 1 files at r5, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1)
noaov1
left a comment
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.
@noaov1 reviewed 1 of 1 files at r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @Yoni-Starkware)
No description provided.