-
Notifications
You must be signed in to change notification settings - Fork 52
feat(blockifier): exclude l1_data_gas from accounts in VC #5185
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(blockifier): exclude l1_data_gas from accounts in VC #5185
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
762f180
to
be513b8
Compare
2417026
to
15b9b32
Compare
be513b8
to
d8b6bb5
Compare
15b9b32
to
d6174bc
Compare
d8b6bb5
to
565bf41
Compare
d6174bc
to
09886b9
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: 0 of 4 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware)
crates/blockifier/src/execution/syscalls/hint_processor.rs
line 473 at r1 (raw file):
if returned_version != original_version { return self.allocate_execution_info_segment(vm, returned_version, exclude_l1_data_gas); }
You have to do something like this. The ptr in this syscall is cached, and you must override it if the syscall us called from one of the whitelisted contracts
Code quote:
if returned_version != original_version {
return self.allocate_execution_info_segment(vm, returned_version, exclude_l1_data_gas);
}
565bf41
to
b9e6c91
Compare
09886b9
to
ecd0878
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: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @nimrod-starkware)
crates/blockifier/src/execution/syscalls/syscall_base.rs
line 216 at r1 (raw file):
} /// Return wether the class is in the data gas accounts set.
Suggestion:
/// Return whether the L1 data gas should be excluded for the `get_execution_info` syscall.
crates/blockifier/src/execution/syscalls/syscall_base.rs
line 217 at r1 (raw file):
/// Return wether the class is in the data gas accounts set. pub fn exclude_l1_data_gas(&self) -> bool {
Suggestion:
pub fn should_exclude_l1_data_gas(&self) -> bool
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 4 files reviewed, 3 unresolved discussions (waiting on @nimrod-starkware and @Yoni-Starkware)
crates/blockifier/src/execution/syscalls/hint_processor.rs
line 473 at r1 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
You have to do something like this. The ptr in this syscall is cached, and you must override it if the syscall us called from one of the whitelisted contracts
What do you think of something like this pseudo-code
If class hash in data gas accounts or in v1 bounds accounts:
recalculate the execution info ptr
else:
use the cached one if exists (otherwise calculate and cache)
crates/blockifier/src/execution/syscalls/syscall_base.rs
line 216 at r1 (raw file):
} /// Return wether the class is in the data gas accounts set.
Done.
crates/blockifier/src/execution/syscalls/syscall_base.rs
line 217 at r1 (raw file):
/// Return wether the class is in the data gas accounts set. pub fn exclude_l1_data_gas(&self) -> bool {
Done.
78366fc
to
62506ee
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: 0 of 4 files reviewed, 3 unresolved discussions (waiting on @nimrod-starkware and @Yoni-Starkware)
crates/blockifier/src/execution/syscalls/hint_processor.rs
line 473 at r1 (raw file):
Previously, nimrod-starkware wrote…
What do you think of something like this pseudo-code
If class hash in data gas accounts or in v1 bounds accounts: recalculate the execution info ptr else: use the cached one if exists (otherwise calculate and cache)
Done, i think
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.
What about Native? different PR?
Reviewed 1 of 3 files at r1, 1 of 2 files at r3.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware)
crates/blockifier/src/execution/syscalls/hint_processor.rs
line 471 at r1 (raw file):
// If the transaction version was overridden, `self.execution_info_ptr` cannot be used. if returned_version != original_version {
Hmmm, this code is not necessary. I'll clean it in a different 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.
I'll do native in a future PR (on top of this)
Reviewable status: 2 of 4 files reviewed, all discussions resolved (waiting on @nimrod-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.
Done:
https://reviewable.io/reviews/starkware-libs/sequencer/5273
Reviewable status: 2 of 4 files reviewed, all discussions resolved (waiting on @nimrod-starkware)
b9e6c91
to
6396d4c
Compare
62506ee
to
1067145
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 2 files at r4.
Reviewable status: 2 of 4 files reviewed, 2 unresolved discussions (waiting on @nimrod-starkware)
crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs
line 378 at r4 (raw file):
], (_, _) => { vec![felt!(if exclude_l1_data_gas { 2_u8 } else { 3 })] // Length of resource bounds array.
Be consistent
Code quote:
2_u8 } else { 3
crates/blockifier/src/execution/syscalls/hint_processor.rs
line 668 at r4 (raw file):
vm, context, self.base.should_exclude_l1_data_gas(),
Extract into a var and add a comment above: See the comment about the returned version.
Code quote:
self.base.should_exclude_l1_data_gas(),
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: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @Yoni-Starkware)
crates/blockifier/src/execution/syscalls/syscall_tests/get_execution_info.rs
line 378 at r4 (raw file):
Previously, Yoni-Starkware (Yoni) wrote…
Be consistent
Done.
1067145
to
6a5227d
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 r5, all commit messages.
Reviewable status:complete! all files reviewed, all discussions resolved (waiting on @nimrod-starkware)
6a5227d
to
0a32d4e
Compare
No description provided.