Skip to content
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

refactor(blockifier): refactor default testing resource bounds #1306

Conversation

dorimedini-starkware
Copy link
Collaborator

@dorimedini-starkware dorimedini-starkware commented Oct 10, 2024

This change is Reviewable

Copy link

codecov bot commented Oct 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.94%. Comparing base (b0cfe82) to head (068214d).
Report is 382 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1306      +/-   ##
==========================================
- Coverage   74.18%   71.94%   -2.25%     
==========================================
  Files         359      357       -2     
  Lines       36240    37960    +1720     
  Branches    36240    37960    +1720     
==========================================
+ Hits        26886    27310     +424     
- Misses       7220     8534    +1314     
+ Partials     2134     2116      -18     
Flag Coverage Δ
?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.035 ms 34.153 ms 34.351 ms]
change: [-6.3293% -4.7101% -3.1494%] (p = 0.00 < 0.05)
Performance has improved.
Found 8 outliers among 100 measurements (8.00%)
4 (4.00%) high mild
4 (4.00%) high severe

Copy link
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed 13 of 13 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @dorimedini-starkware)


crates/blockifier/src/test_utils.rs line 100 at r1 (raw file):

// The max_fee / resource bounds used for txs in this test.
// V3 transactions:
pub const DEFAULT_L1_GAS_AMOUNT: GasAmount = GasAmount(1000000);

Suggestion:

u64::pow(10, 6)

crates/blockifier/src/test_utils.rs line 120 at r1 (raw file):

// The amount of test-token allocated to the account in this test, set to a multiple of the max
// amount deprecated / non-deprecated transactions commit to paying.
pub const BALANCE: Fee = Fee(10

Move this definition after DEFAULT_ALL_BOUNDS_COMMITTED_FEE

Code quote:

BALANCE

crates/blockifier/src/test_utils.rs line 122 at r1 (raw file):

pub const BALANCE: Fee = Fee(10
    * const_max(
        const_max(DEFAULT_ALL_BOUNDS_COMMITTED_FEE.0, DEFAULT_L1_BOUNDS_COMMITTED_FEE.0),

Is there a case whereDEFAULT_ALL_BOUNDS_COMMITTED_FEE.0 < DEFAULT_L1_BOUNDS_COMMITTED_FEE.0?

Code quote:

const_max(DEFAULT_ALL_BOUNDS_COMMITTED_FEE.0, DEFAULT_L1_BOUNDS_COMMITTED_FEE.0),

@dorimedini-starkware dorimedini-starkware force-pushed the 10-10-refactor_blockifier_refactor_default_testing_resource_bounds branch from 42b94c9 to 068214d Compare October 15, 2024 07:52
Copy link
Collaborator Author

@dorimedini-starkware dorimedini-starkware left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: 9 of 13 files reviewed, 3 unresolved discussions (waiting on @yoavGrs)


crates/blockifier/src/test_utils.rs line 100 at r1 (raw file):

// The max_fee / resource bounds used for txs in this test.
// V3 transactions:
pub const DEFAULT_L1_GAS_AMOUNT: GasAmount = GasAmount(1000000);

Done.


crates/blockifier/src/test_utils.rs line 120 at r1 (raw file):

Previously, yoavGrs wrote…

Move this definition after DEFAULT_ALL_BOUNDS_COMMITTED_FEE

Done.


crates/blockifier/src/test_utils.rs line 122 at r1 (raw file):

Previously, yoavGrs wrote…

Is there a case whereDEFAULT_ALL_BOUNDS_COMMITTED_FEE.0 < DEFAULT_L1_BOUNDS_COMMITTED_FEE.0?

in AllResourceBounds mode, it makes sense if the L1 gas bound is very low - even zero.
so, yes

Copy link
Contributor

@yoavGrs yoavGrs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @dorimedini-starkware)

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.671 ms 34.737 ms 34.803 ms]
change: [-5.7970% -4.2970% -2.9066%] (p = 0.00 < 0.05)
Performance has improved.

@dorimedini-starkware dorimedini-starkware merged commit 678bfc6 into main Oct 15, 2024
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Oct 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants