-
Notifications
You must be signed in to change notification settings - Fork 15
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
chore(blockifier): check max price of l1_data_gas and l2_gas #710
base: aner/pre_validation_enforce_fee
Are you sure you want to change the base?
chore(blockifier): check max price of l1_data_gas and l2_gas #710
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## aner/pre_validation_enforce_fee #710 +/- ##
===================================================================
- Coverage 75.49% 75.24% -0.26%
===================================================================
Files 87 87
Lines 11109 11146 +37
Branches 11109 11146 +37
===================================================================
Hits 8387 8387
- Misses 2311 2348 +37
Partials 411 411
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
958996d
to
b9ee9bc
Compare
Benchmark movements: |
b9ee9bc
to
b864fc2
Compare
Benchmark movements: |
b864fc2
to
bab93cc
Compare
bab93cc
to
e571b60
Compare
Benchmark movements: |
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 6 files reviewed, 6 unresolved discussions (waiting on @aner-starkware, @dorimedini-starkware, and @TzahiTaub)
crates/blockifier/src/transaction/account_transaction.rs
line 234 at r1 (raw file):
tx_context: &TransactionContext, ) -> TransactionPreValidationResult<()> { // TODO(Aner): seprate to cases based on context.resource_bounds type
Looks like you can remove the todo, right?
Code quote:
// TODO(Aner): seprate to cases based on context.resource_bounds type
crates/blockifier/src/transaction/account_transaction.rs
line 260 at r1 (raw file):
// TODO(Ori, 1/2/2024): Write an indicative expect message // explaining why the convertion // works.
why did this change?
Code quote:
// TODO(Ori, 1/2/2024): Write an indicative expect message
// explaining why the convertion
// works.
crates/blockifier/src/transaction/account_transaction.rs
line 292 at r1 (raw file):
})?; } // TODO(Aner): add checks for minimal_l1_data_gas and minimal_l2_gas
Suggestion:
// TODO(Aner): Add checks for minimal l1_data_gas and minimal l2_gas.
crates/blockifier/src/transaction/account_transaction.rs
line 296 at r1 (raw file):
let GasPricesForFeeType { l1_gas_price, l1_data_gas_price, l2_gas_price } = block_info.gas_prices.get_gas_prices_by_fee_type(fee_type); // TODO!(Aner): add tests for l1_data_gas_price and l2_gas_price
Suggestion:
// TODO(Aner): Add tests for l1_data_gas_price and l2_gas_price.
crates/blockifier/src/transaction/account_transaction.rs
line 300 at r1 (raw file):
(L1Gas, l1_gas.max_price_per_unit, l1_gas_price.into()), (L1DataGas, l1_data_gas.max_price_per_unit, l1_data_gas_price.into()), (L2Gas, l2_gas.max_price_per_unit, l2_gas_price.into()),
The order of the iteration matters if there is more than one resource that is too expensive, @dorimedini-starkware WDYT?
Code quote:
for (gas_type, max_gas_price, actual_gas_price) in [
(L1Gas, l1_gas.max_price_per_unit, l1_gas_price.into()),
(L1DataGas, l1_data_gas.max_price_per_unit, l1_data_gas_price.into()),
(L2Gas, l2_gas.max_price_per_unit, l2_gas_price.into()),
crates/blockifier/src/transaction/transactions_test.rs
line 986 at r1 (raw file):
); // TODO(Aner): add test for low Max L1 data gas price and L2 gas price
Suggestion:
// TODO(Aner): Add test for low max L1 data gas price and L2 gas price.
d89a9a0
to
2274e3a
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 6 files reviewed, 6 unresolved discussions (waiting on @dorimedini-starkware, @nimrod-starkware, and @TzahiTaub)
crates/blockifier/src/transaction/account_transaction.rs
line 234 at r1 (raw file):
Previously, nimrod-starkware wrote…
Looks like you can remove the todo, right?
Done.
crates/blockifier/src/transaction/account_transaction.rs
line 260 at r1 (raw file):
Previously, nimrod-starkware wrote…
why did this change?
The quoted comment didn't change (though it had a typo, so I fixed it now), but the error type changed to accommodate the different resources.
crates/blockifier/src/transaction/account_transaction.rs
line 292 at r1 (raw file):
})?; } // TODO(Aner): add checks for minimal_l1_data_gas and minimal_l2_gas
Done.
crates/blockifier/src/transaction/account_transaction.rs
line 296 at r1 (raw file):
let GasPricesForFeeType { l1_gas_price, l1_data_gas_price, l2_gas_price } = block_info.gas_prices.get_gas_prices_by_fee_type(fee_type); // TODO!(Aner): add tests for l1_data_gas_price and l2_gas_price
Done. The !
symbolizes that it needs to be done in the following PR.
crates/blockifier/src/transaction/transactions_test.rs
line 986 at r1 (raw file):
); // TODO(Aner): add test for low Max L1 data gas price and L2 gas price
Done.
2274e3a
to
1e25962
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 5 files at r2, 1 of 4 files at r3, all commit messages.
Reviewable status: 2 of 6 files reviewed, 1 unresolved discussion (waiting on @aner-starkware, @dorimedini-starkware, and @TzahiTaub)
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 6 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @TzahiTaub)
crates/blockifier/src/transaction/account_transaction.rs
line 300 at r1 (raw file):
Previously, nimrod-starkware wrote…
The order of the iteration matters if there is more than one resource that is too expensive, @dorimedini-starkware WDYT?
I think we should do better: the error we return should indicate exactly which gas price(s) are too low.
You should be collecting all problematic (gas_type, max_price, actual_price) tuples and outputting all of them in the error.
The MaxGasPriceTooLow
error should be updated to include a collection of such triples.
That way, the order won't matter, and the users will get the most information
Previously, dorimedini-starkware wrote…
@AvivYossef-starkware I'm guessing this will affect your PRs as well. |
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 6 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @TzahiTaub)
crates/blockifier/src/transaction/account_transaction.rs
line 300 at r1 (raw file):
Previously, aner-starkware wrote…
@AvivYossef-starkware I'm guessing this will affect your PRs as well.
I changed the error in my PR to include it
eff81e9
to
4c57e9e
Compare
e3ad3a6
to
78f2b58
Compare
4c57e9e
to
78e7053
Compare
78f2b58
to
a71ffd9
Compare
78e7053
to
90b89c5
Compare
a71ffd9
to
37c5646
Compare
90b89c5
to
0082793
Compare
0082793
to
e6feb76
Compare
37c5646
to
1968b80
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 62 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware and @TzahiTaub)
crates/blockifier/src/transaction/account_transaction.rs
line 300 at r1 (raw file):
Previously, AvivYossef-starkware wrote…
I changed the error in my PR to include it
Added a TODO
e6feb76
to
f745dd0
Compare
This change is