-
Notifications
You must be signed in to change notification settings - Fork 26
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): update test_insufficient_max_fee_reverts to include new resource bounds #1313
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1313 +/- ##
===========================================
+ Coverage 40.10% 77.46% +37.36%
===========================================
Files 26 100 +74
Lines 1895 13447 +11552
Branches 1895 13447 +11552
===========================================
+ Hits 760 10417 +9657
- Misses 1100 2574 +1474
- Partials 35 456 +421 ☔ View full report in Codecov by Sentry. |
b04682d
to
eb8ef23
Compare
a400602
to
e569b59
Compare
eb8ef23
to
0173dfa
Compare
e569b59
to
26404f4
Compare
0173dfa
to
43ad094
Compare
1e42bb3
to
b0bcf2b
Compare
43ad094
to
1e7005b
Compare
b0bcf2b
to
241f6da
Compare
1e7005b
to
eacda12
Compare
241f6da
to
1b6e002
Compare
eacda12
to
fd85e54
Compare
1b6e002
to
7dc156d
Compare
Benchmark movements: |
e941695
to
a09dcf2
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 2 files reviewed, 6 unresolved discussions (waiting on @dorimedini-starkware)
crates/blockifier/src/transaction/account_transactions_test.rs
line 1167 at r2 (raw file):
) { let gas_mode = resource_bounds.get_gas_vector_computation_mode(); let overdraft_resource = match gas_mode {
Move it next to its use.
It's the overdraft resource only for the second tx.
Code quote:
let overdraft_resource
crates/blockifier/src/transaction/account_transactions_test.rs
line 1206 at r2 (raw file):
} GasVectorComputationMode::All => { // We do not expect the exact same fee in the All case.
Despite the expectation, in practice, we do get equality. Why?
Code quote:
We do not expect the exact same fee in the All case.
crates/blockifier/src/transaction/account_transactions_test.rs
line 1227 at r2 (raw file):
// This call should fail due to insufficient max fee (steps bound based on max_fee is not so // tight as to stop execution between iterations 1 and 2). let resource_bounds_depth1 = match gas_mode {
It's not the bounds in tx_execution_info1
Suggestion:
resource_used_depth1
crates/blockifier/src/transaction/account_transactions_test.rs
line 1248 at r2 (raw file):
) .unwrap(); // In the deprecated bounds case, due to resource limit being estimated by steps, the execution
Is that the case?
Suggestion:
In the l1 gas bounds case
crates/blockifier/src/transaction/account_transactions_test.rs
line 1267 at r2 (raw file):
resource_bounds: resource_bounds_depth1, nonce: nonce_manager.next(account_address), calldata: recursive_function_calldata(&contract_address, 824, false),
Is it tight?
Is it going to change frequently?
Code quote:
824
crates/blockifier/src/transaction/account_transactions_test.rs
line 1273 at r2 (raw file):
.unwrap(); // In the deprecated bounds case, the entire step limit is derived from 100% of all the // bounds (only L1 gas), so expected revert fee is identical to the original fee.
This comment should appear above the NoL2Gas
case in the macro.
Code quote:
// In the deprecated bounds case, the entire step limit is derived from 100% of all the
// bounds (only L1 gas), so expected revert fee is identical to the original fee.
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, 6 unresolved discussions (waiting on @yoavGrs)
crates/blockifier/src/transaction/account_transactions_test.rs
line 1167 at r2 (raw file):
Previously, yoavGrs wrote…
Move it next to its use.
It's the overdraft resource only for the second tx.
Done.
crates/blockifier/src/transaction/account_transactions_test.rs
line 1206 at r2 (raw file):
Previously, yoavGrs wrote…
Despite the expectation, in practice, we do get equality. Why?
WDYM in practice we get the same? equality isn't asserted here
crates/blockifier/src/transaction/account_transactions_test.rs
line 1227 at r2 (raw file):
Previously, yoavGrs wrote…
It's not the bounds in
tx_execution_info1
Done.
crates/blockifier/src/transaction/account_transactions_test.rs
line 1248 at r2 (raw file):
Previously, yoavGrs wrote…
Is that the case?
Done.
crates/blockifier/src/transaction/account_transactions_test.rs
line 1267 at r2 (raw file):
Previously, yoavGrs wrote…
Is it tight?
Is it going to change frequently?
this test is old, and it didn't change now, so I guess it's not very sensitive
crates/blockifier/src/transaction/account_transactions_test.rs
line 1273 at r2 (raw file):
Previously, yoavGrs wrote…
This comment should appear above the
NoL2Gas
case in the macro.
Done.
f056a9d
to
fbbc727
Compare
a09dcf2
to
c9ce605
Compare
Artifacts upload triggered. View details here |
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 r2, all commit messages.
Reviewable status: 1 of 2 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)
crates/blockifier/src/transaction/account_transactions_test.rs
line 1206 at r2 (raw file):
Previously, dorimedini-starkware wrote…
WDYM in practice we get the same? equality isn't asserted here
In the code, you don't assert inequality.
But the explanations point out that execution_info.receipt.gas.l2_gas < tx_execution_info1.receipt.gas.l2_gas
, but it's not the case: when I ran the test I got equality.
Artifacts upload triggered. View details here |
c9ce605
to
52ba961
Compare
fbbc727
to
27784b2
Compare
Artifacts upload triggered. View details here |
52ba961
to
0b8953a
Compare
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
Artifacts upload triggered. View details here |
Benchmark movements: |
0b8953a
to
6de4946
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 2 files reviewed, 1 unresolved discussion (waiting on @yoavGrs)
crates/blockifier/src/transaction/account_transactions_test.rs
line 1206 at r2 (raw file):
Previously, yoavGrs wrote…
In the code, you don't assert inequality.
But the explanations point out thatexecution_info.receipt.gas.l2_gas < tx_execution_info1.receipt.gas.l2_gas
, but it's not the case: when I ran the test I got equality.
Done. You're right, the final fee should be the same (snap to bounds). The final gas vector however need not be the same on revert, so I simplified this a bit (no need for the macro anymore)
Artifacts upload triggered. View details here |
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.
Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)
… new resource bounds
6de4946
to
f0f7db2
Compare
Artifacts upload triggered. View details here |
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 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)
This change is