-
Notifications
You must be signed in to change notification settings - Fork 16
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
test(blockifier): max fee exceeds balance errors on new resource bounds #764
base: aner/pre_validation_covers_sum_of_products_1
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## aner/pre_validation_covers_sum_of_products_1 #764 +/- ##
================================================================================
+ Coverage 70.33% 70.49% +0.16%
================================================================================
Files 87 87
Lines 11180 11180
Branches 11180 11180
================================================================================
+ Hits 7863 7881 +18
+ Misses 2929 2911 -18
Partials 388 388
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
cecac6d
to
70f25c7
Compare
552fd35
to
49bc1aa
Compare
70f25c7
to
0f89641
Compare
49bc1aa
to
c7f3e01
Compare
0f89641
to
808d19d
Compare
c7f3e01
to
e4d8c18
Compare
808d19d
to
ee3cae4
Compare
e4d8c18
to
28319f4
Compare
ee3cae4
to
b7f9fde
Compare
28319f4
to
22e9193
Compare
b7f9fde
to
e3bf0de
Compare
22e9193
to
2a11389
Compare
e3bf0de
to
44776d4
Compare
2a11389
to
3740a56
Compare
44776d4
to
f5e0e89
Compare
3740a56
to
52bee9c
Compare
f5e0e89
to
d31516e
Compare
52bee9c
to
c8533f6
Compare
d31516e
to
9095f45
Compare
c8533f6
to
343c018
Compare
d8fa853
to
54bc2bc
Compare
343c018
to
8d5d0b1
Compare
54bc2bc
to
df26a10
Compare
8d5d0b1
to
fbc05f3
Compare
df26a10
to
85446a2
Compare
fbc05f3
to
8dbaa4f
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 4 files at r2, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @aner-starkware, @dorimedini-starkware, and @nimrod-starkware)
crates/blockifier/src/transaction/transactions_test.rs
line 912 at r4 (raw file):
let invalid_max_fee = Fee(BALANCE + 1); // TODO(Ori, 1/2/2024): Write an indicative expect message explaining why the conversion works. let balance_over_l1_gas_price: u64 =
Clearer?
Suggestion:
maximal_l1_amount
crates/blockifier/src/transaction/transactions_test.rs
line 961 at r4 (raw file):
// TODO!(Aner): remove magic numbers, use function to calculate minimal amounts. let min_l1_amount = 1652; let min_l2_amount = 445500;
Do you know why these are needed here but weren't needed for the l1 cases above?
Code quote:
let min_l1_amount = 1652;
let min_l2_amount = 445500;
crates/blockifier/src/transaction/transactions_test.rs
line 968 at r4 (raw file):
// In the following cases, the balance is not enough to cover the gas price of the transaction. // Minimal amounts are used to avoid failing the test due to min gas usage not covered. for (l1_max_amount, l2_max_amount, l1_data_max_amount) in [
Why not modify the previous l1_gas txs tests for the all resources case as well? Loop between L1Resources once and AllResources and have less code (hopefully) and all scenarios for both types.
crates/blockifier/src/transaction/transactions_test.rs
line 969 at r4 (raw file):
// Minimal amounts are used to avoid failing the test due to min gas usage not covered. for (l1_max_amount, l2_max_amount, l1_data_max_amount) in [ (min_l1_amount + balance_over_l1_gas_price + 1, min_l2_amount, 0),
Isn't this the tight bound we need?
Suggestion:
max(min_l1_amount, balance_over_l1_gas_price + 1)
85446a2
to
1141f2a
Compare
8dbaa4f
to
374488b
Compare
1141f2a
to
a7c0b87
Compare
374488b
to
ec0748e
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 4 files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware, @nimrod-starkware, and @TzahiTaub)
crates/blockifier/src/transaction/transactions_test.rs
line 912 at r4 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Clearer?
Done.
crates/blockifier/src/transaction/transactions_test.rs
line 961 at r4 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Do you know why these are needed here but weren't needed for the l1 cases above?
Yes, because here I want to test each individual resource, so the other resources, if they are 0 for example, might fail a previous check and we won't get the correct error.
crates/blockifier/src/transaction/transactions_test.rs
line 968 at r4 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Why not modify the previous l1_gas txs tests for the all resources case as well? Loop between L1Resources once and AllResources and have less code (hopefully) and all scenarios for both types.
I didn't understand your suggestion.
crates/blockifier/src/transaction/transactions_test.rs
line 969 at r4 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Isn't this the tight bound we need?
Yes, but in any case, it was a temporary patch because of the bug. Now, it can be done without the max
(though max
is more correct, but is significantly longer and seems to not be needed).
ec0748e
to
a0bf6e5
Compare
This change is