-
Notifications
You must be signed in to change notification settings - Fork 107
Conversation
d939d32
to
e696426
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1754 +/- ##
==========================================
+ Coverage 78.37% 78.42% +0.04%
==========================================
Files 62 62
Lines 8856 8913 +57
Branches 8856 8913 +57
==========================================
+ Hits 6941 6990 +49
Misses 1476 1476
- Partials 439 447 +8 ☔ View full report in Codecov by Sentry. |
e696426
to
473b055
Compare
23ca409
to
7fc9922
Compare
@noaov1 do we need to add it here? Code quote: "sha256_process_block_gas_cost": { |
revert Code quote: .unwrap_or_else(|_| panic!("Versioned constants JSON file {file:#?} is malformed")); |
this should probably be done in a preliminary PR. Code quote: x4469766973696f6e2062792030 ('Division by 0') |
Suggestion: state_ptr |
this was already done here:
Code quote: let gas_cost = syscall_handler.context.gas_costs().sha256_process_block_gas_cost;
if gas_cost > *remaining_gas {
let out_of_gas_error =
StarkFelt::try_from(OUT_OF_GAS_ERROR).map_err(SyscallExecutionError::from)?;
return Err(SyscallExecutionError::SyscallError { error_data: vec![out_of_gas_error] });
}
*remaining_gas -= gas_cost; |
is there a ways to do it without building a vector? Code quote: .collect_vec() |
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 15 files at r1, 2 of 8 files at r2, all commit messages.
Reviewable status: 7 of 17 files reviewed, 6 unresolved discussions (waiting on @noaov1, @orizi, and @TomerStarkware)
7fc9922
to
fe31737
Compare
0b73de5
to
e3be6bf
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: 7 of 17 files reviewed, 7 unresolved discussions (waiting on @noaov1 and @TomerStarkware)
crates/blockifier/src/execution/syscalls/mod.rs
line 809 at r2 (raw file):
.collect_vec() .try_into() .unwrap();
.
Suggestion:
let mut state_as_words: [u32; SHA256_STATE_SIZE] =
core::array::from_fn(|i| prev_state[i].to_bigint().to_u32().unwrap());
7293bc4
to
66e91fa
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: 6 of 17 files reviewed, 7 unresolved discussions (waiting on @ilyalesokhin-starkware, @noaov1, and @orizi)
crates/blockifier/src/execution/entry_point_test.rs
line 720 at r2 (raw file):
Previously, ilyalesokhin-starkware wrote…
this should probably be done in a preliminary PR.
Done.
crates/blockifier/src/execution/syscalls/mod.rs
line 759 at r2 (raw file):
#[derive(Debug, Eq, PartialEq)] pub struct SHA256ProcessBlockResponse { pub state: Relocatable,
Done.
crates/blockifier/src/execution/syscalls/mod.rs
line 794 at r2 (raw file):
Previously, ilyalesokhin-starkware wrote…
this was already done here:
if gas_counter < required_gas {
Done.
crates/blockifier/src/execution/syscalls/mod.rs
line 807 at r2 (raw file):
Previously, ilyalesokhin-starkware wrote…
is there a ways to do it without building a vector?
used Ori's solution
crates/blockifier/src/execution/syscalls/mod.rs
line 809 at r2 (raw file):
Previously, orizi wrote…
.
Done.
crates/blockifier/src/versioned_constants_test.rs
line 201 at r2 (raw file):
Previously, ilyalesokhin-starkware wrote…
revert
Done.
e3be6bf
to
1c865f1
Compare
66e91fa
to
0522219
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: 5 of 17 files reviewed, 6 unresolved discussions (waiting on @ilyalesokhin-starkware and @orizi)
crates/blockifier/resources/versioned_constants_13_0.json
line 140 at r2 (raw file):
Previously, ilyalesokhin-starkware wrote…
@noaov1 do we need to add it here?
The syscall wasn't supported in that version.
Yes, for backward compatibility. Please set all the values to 0 in the files 13.0, 13.1 and 13.1.1
0522219
to
36378d9
Compare
3bbb911
to
2dcacf6
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 6 files at r17, 2 of 2 files at r18, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @TomerStarkware)
d352dcc
to
b2ae163
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 10 of 10 files at r19, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @TomerStarkware)
crates/blockifier/resources/versioned_constants.json
line 96 at r19 (raw file):
"step_gas_cost": 11822, "range_check_gas_cost": 448 },
What is it used for?
Code quote:
"sha256_batch_gas_cost": {
"step_gas_cost": 11822,
"range_check_gas_cost": 448
},
83094e6
to
eda3a2e
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: 18 of 20 files reviewed, 2 unresolved discussions (waiting on @ilyalesokhin-starkware and @noaov1)
crates/blockifier/resources/versioned_constants.json
line 89 at r17 (raw file):
Previously, ilyalesokhin-starkware wrote…
how come there is no
bitwise_builtin?
Done.
crates/blockifier/resources/versioned_constants.json
line 96 at r19 (raw file):
Previously, noaov1 (Noa Oved) wrote…
What is it used for?
we split the hint validation of the syscall into two parts, the first part copies the input of an array in the os,
the second which does the actual output validation is executed after all the transactions and validates all calls in batches of 7 calls at a time.
This is the price of validating all 7 syscalls,
the price of sha256_process_block_gas_cost
is the combined price of the parts
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 r18, 6 of 10 files at r19, 2 of 2 files at r20.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @noaov1)
2ad4108
to
64b4458
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 10 files at r19, 3 of 3 files at r21, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noaov1)
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 6 files at r17, 1 of 2 files at r18, 1 of 2 files at r20, 3 of 3 files at r21, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @TomerStarkware)
crates/blockifier/resources/versioned_constants_13_0.json
line 148 at r21 (raw file):
"step_gas_cost": 0, "range_check_gas_cost": 0 },
Remove?
Code quote:
"sha256_batch_gas_cost": {
"step_gas_cost": 0,
"range_check_gas_cost": 0
},
crates/blockifier/resources/versioned_constants_13_1_1.json
line 169 at r21 (raw file):
"step_gas_cost": 0, "range_check_gas_cost": 0 },
Remove?
Code quote:
"sha256_batch_gas_cost": {
"step_gas_cost": 0,
"range_check_gas_cost": 0
},
crates/blockifier/src/versioned_constants.rs
line 438 at r21 (raw file):
pub keccak_gas_cost: u64, pub keccak_round_cost_gas_cost: u64, pub sha256_process_block_gas_cost: u64,
Is it needed?
Code quote:
pub sha256_process_block_gas_cost: u64,
64b4458
to
edaa4de
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: 18 of 20 files reviewed, 3 unresolved discussions (waiting on @ilyalesokhin-starkware and @noaov1)
crates/blockifier/resources/versioned_constants_13_0.json
line 148 at r21 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Remove?
Done.
crates/blockifier/resources/versioned_constants_13_1_1.json
line 169 at r21 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Remove?
Done.
crates/blockifier/src/versioned_constants.rs
line 438 at r21 (raw file):
Previously, noaov1 (Noa Oved) wrote…
Is it needed?
this one is the full cost, which still exists in version_constants.json
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 r22, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)
edaa4de
to
e87c3e5
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 3 of 3 files at r23, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @TomerStarkware)
…-libs#1754) * refactor: use model hash as ids for grpc * fmt * remove println * refactor: get rid of wait for relay * relay runner * remove async
This change is