-
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(starknet_batcher): setup gas prices for testing #2445
test(starknet_batcher): setup gas prices for testing #2445
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
862c770
to
11f3e05
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 4 files reviewed, 1 unresolved discussion (waiting on @alonh5)
crates/starknet_api/src/block.rs
line 456 at r1 (raw file):
// TODO(Arni): Remove derive of Default. Gas prices should always be set. #[derive(Clone, Debug, Default, Deserialize, Eq, PartialEq, Serialize)]
I used this to compare the results. There is no need for this struct to implement these properties.
Suggestion:
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
11f3e05
to
57d8ea0
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 4 files reviewed, all discussions resolved (waiting on @alonh5)
crates/starknet_api/src/block.rs
line 456 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
I used this to compare the results. There is no need for this struct to implement these properties.
Done.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## arni/gas_prices/fix_default_strk_l1_gas_price #2445 +/- ##
================================================================================
Coverage ? 80.02%
================================================================================
Files ? 98
Lines ? 13596
Branches ? 13596
================================================================================
Hits ? 10880
Misses ? 2232
Partials ? 484 ☔ View full report in Codecov by Sentry. |
0dcf39a
to
71ef06d
Compare
57d8ea0
to
f32d098
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 r1, 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArniStarkware)
crates/starknet_api/src/test_utils.rs
line 138 at r3 (raw file):
NonzeroGasPrice::new_unchecked(GasPrice(25 * u128::pow(10, 5))); pub const DEFAULT_STRK_L2_GAS_PRICE: NonzeroGasPrice = NonzeroGasPrice::new_unchecked(GasPrice(25 * u128::pow(10, 5)));
This is a good place to use static lazy if you want them to match the default l1 price.
Code quote:
pub const DEFAULT_ETH_L2_GAS_PRICE: NonzeroGasPrice =
NonzeroGasPrice::new_unchecked(GasPrice(25 * u128::pow(10, 5)));
pub const DEFAULT_STRK_L2_GAS_PRICE: NonzeroGasPrice =
NonzeroGasPrice::new_unchecked(GasPrice(25 * u128::pow(10, 5)));
f32d098
to
af99903
Compare
105bf9a
to
3e497cf
Compare
af99903
to
ff3cbab
Compare
Benchmark movements: |
3e497cf
to
dfca6ec
Compare
ff3cbab
to
7df0d42
Compare
Benchmark movements: |
7df0d42
to
fabc719
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: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @alonh5)
crates/starknet_api/src/test_utils.rs
line 138 at r3 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
This is a good place to use static lazy if you want them to match the default l1 price.
- There is no need to match them to the l1 gas price.
- The mechanism that does the conversion is dependent on versioned constants, which are in the blockifier repo.
- If we put
DEFAULT_ETH_L2_GAS_PRICE
andDEFAULT_STRK_L2_GAS_PRICE
inside a lazy evaluation block of any type, we would have to do the same forDEFAULT_GAS_PRICES
. As I said in item 1 of this list - there is no benefit to that.
dfca6ec
to
5506889
Compare
fabc719
to
ee7467d
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 2 of 2 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
5506889
to
3c92529
Compare
ee7467d
to
2db8500
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 1 files at r5, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
2db8500
to
423ec5d
Compare
423ec5d
to
00179e3
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 all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
No description provided.