-
Notifications
You must be signed in to change notification settings - Fork 21
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
feat(execution): add l2_gas_price to FeeEstimation #644
feat(execution): add l2_gas_price to FeeEstimation #644
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @TzahiTaub and the rest of your teammates on Graphite |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
===========================================
- Coverage 74.18% 50.90% -23.29%
===========================================
Files 359 131 -228
Lines 36240 18906 -17334
Branches 36240 18906 -17334
===========================================
- Hits 26886 9624 -17262
- Misses 7220 8219 +999
+ Partials 2134 1063 -1071
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
f79df55
to
a8186d0
Compare
31fd634
to
9a4cab6
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ShahakShama and @TzahiTaub)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
pub struct FeeEstimation { pub gas_consumed: Felt, pub gas_price: GasPrice,
can this be renamed to l1_gas_price...? confusing as it is now
or is this some object that needs to be BC?
Code quote:
pub gas_price: GasPrice,
crates/papyrus_rpc/src/v0_7/execution_test.rs
line 163 at r1 (raw file):
price_in_wei: GasPrice(1), price_in_fri: GasPrice(0), };
the first two prices are "sane" (pretty close to actual prices), should L2_GAS_PRICE be the same? @ShahakShama
Code quote:
pub static ref GAS_PRICE: GasPricePerToken = GasPricePerToken{
price_in_wei: GasPrice(100 * u128::pow(10, 9)),
price_in_fri: GasPrice(0),
};
pub static ref DATA_GAS_PRICE: GasPricePerToken = GasPricePerToken{
price_in_wei: GasPrice(1),
price_in_fri: GasPrice(0),
};
pub static ref L2_GAS_PRICE: GasPricePerToken = GasPricePerToken{
price_in_wei: GasPrice(1),
price_in_fri: GasPrice(0),
};
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: all files reviewed, 4 unresolved discussions (waiting on @ArielElp, @dorimedini-starkware, and @TzahiTaub)
crates/papyrus_execution/src/objects.rs
line 100 at r1 (raw file):
/// The gas price for DA blob. pub data_gas_price: GasPrice, // TODO(Tzahi): Add l2_gas_consumed + verify estimation is close enough to l1 gas fee if user
This TODO is very unclear. Try to rephrase it. The + is the confusing part IMO
crates/papyrus_execution/src/objects.rs
line 160 at r1 (raw file):
) -> ExecutionResult<FeeEstimation> { let gas_prices = &block_context.block_info().gas_prices; let (gas_price, data_gas_price, l2_gas_price) = (
As Dori said, change gas_price to l1_gas_price (and if it's nahoog to write l1_data_gas instead of data_gas write l1_data_gas_price as well)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, dorimedini-starkware wrote…
can this be renamed to l1_gas_price...? confusing as it is now
or is this some object that needs to be BC?
Dan recently said that in the RPC we support only the latest version, so no need for BC
We should verify with @ArielElp what are the names of fields of FeeEstimation in rpc v0.8
crates/papyrus_rpc/src/v0_7/execution_test.rs
line 163 at r1 (raw file):
Previously, dorimedini-starkware wrote…
the first two prices are "sane" (pretty close to actual prices), should L2_GAS_PRICE be the same? @ShahakShama
the DATA_GAS_PRICE isn't tested yet, that's why we put 1. For now, you can keep the l2 gas price as you did. Just add a TODO to add tests for data gas and l2 gas
a8186d0
to
67da519
Compare
9a4cab6
to
704c48a
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 3 files reviewed, 4 unresolved discussions (waiting on @ArielElp, @dorimedini-starkware, and @ShahakShama)
crates/papyrus_execution/src/objects.rs
line 100 at r1 (raw file):
Previously, ShahakShama wrote…
This TODO is very unclear. Try to rephrase it. The + is the confusing part IMO
I think I meant (:) ) - we have an automatic translation of l1_gas_price to l2_gas_price in the version constants (l1\_to\_l2\_gas\_price\_conversion
). I think we would like to verify that running txs with l1_gas_price only, and running them using l1_gas_price and the l2_gas_price as computed automatically, will give close overall_fee
results (otherwise, we have some inconsistency). "close" and not exact equality as we use rounding.
Makes sense?
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 3 files reviewed, 4 unresolved discussions (waiting on @ArielElp, @dorimedini-starkware, and @ShahakShama)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, ShahakShama wrote…
Dan recently said that in the RPC we support only the latest version, so no need for BC
We should verify with @ArielElp what are the names of fields of FeeEstimation in rpc v0.8
Is rpc
considered the only user interface with theoretically BC issues, and in any other crate we can do whatever we want?
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 3 files reviewed, 4 unresolved discussions (waiting on @ArielElp, @dorimedini-starkware, and @ShahakShama)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
Is
rpc
considered the only user interface with theoretically BC issues, and in any other crate we can do whatever we want?
And I see this truct (FeeEstimation) is returned in rpc calls - we would like to keep the same names for v7 and v6 if possible AFAIU, I think we don't want to runover those names for existing API. (I mean, making v7 return l1_gas_price
is not exactly BC issue, its making the V7 route in our rpc server diverge from the V7 spec).
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 r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ArielElp, @dorimedini-starkware, and @TzahiTaub)
crates/papyrus_execution/src/objects.rs
line 100 at r1 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
I think I meant (:) ) - we have an automatic translation of l1_gas_price to l2_gas_price in the version constants (
l1\_to\_l2\_gas\_price\_conversion
). I think we would like to verify that running txs with l1_gas_price only, and running them using l1_gas_price and the l2_gas_price as computed automatically, will give closeoverall_fee
results (otherwise, we have some inconsistency). "close" and not exact equality as we use rounding.
Makes sense?
Yes. Now write it inside the comment
crates/papyrus_execution/src/objects.rs
line 160 at r1 (raw file):
Previously, ShahakShama wrote…
As Dori said, change gas_price to l1_gas_price (and if it's nahoog to write l1_data_gas instead of data_gas write l1_data_gas_price as well)
Checking with @ArielElp on slack if it's l1_data_gas or data_gas
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, TzahiTaub (Tzahi) wrote…
And I see this truct (FeeEstimation) is returned in rpc calls - we would like to keep the same names for v7 and v6 if possible AFAIU, I think we don't want to runover those names for existing API. (I mean, making v7 return
l1_gas_price
is not exactly BC issue, its making the V7 route in our rpc server diverge from the V7 spec).
We only need to support the latest version. Change the jsonschema file to have l1_gas_price instead of gas_price and I'm checking with Ariel whether data_gas needs renaming or not
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: all files reviewed, 4 unresolved discussions (waiting on @ArielElp and @TzahiTaub)
67da519
to
8941522
Compare
4106211
to
90a2c4a
Compare
8941522
to
5d2cb0c
Compare
90a2c4a
to
cd41b84
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 18 files at r3, 1 of 1 files at r5, all commit messages.
Reviewable status: 4 of 19 files reviewed, 4 unresolved discussions (waiting on @ArielElp, @ShahakShama, and @TzahiTaub)
bin/protoc
line 0 at r5 (raw file):
should this file be tracked by git...?
where does it come from?
@ShahakShama maybe related to AlonL's changes?
5d2cb0c
to
e26b0ea
Compare
cd41b84
to
2b2b2d6
Compare
2b2b2d6
to
3d7c1a0
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 18 files at r3, 14 of 14 files at r4.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @ArielElp, @TzahiTaub, and @yoavGrs)
3d7c1a0
to
da4fbcf
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: 18 of 19 files reviewed, 4 unresolved discussions (waiting on @ArielElp, @dorimedini-starkware, @ShahakShama, and @TzahiTaub)
bin/protoc
line at r5 (raw file):
Previously, dorimedini-starkware wrote…
should this file be tracked by git...?
where does it come from?
@ShahakShama maybe related to AlonL's changes?
Reverted
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 r6, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArielElp 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: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, ShahakShama wrote…
We only need to support the latest version. Change the jsonschema file to have l1_gas_price instead of gas_price and I'm checking with Ariel whether data_gas needs renaming or not
Change gas_price to l1_gas_price and data_gas_price to l1_data_gas_price
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: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
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: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, ShahakShama wrote…
Change gas_price to l1_gas_price and data_gas_price to l1_data_gas_price
I'm opening a new PR for this
da4fbcf
to
0c0182f
Compare
0c0182f
to
2e11701
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 r8, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
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: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
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: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, yoavGrs wrote…
I'm opening a new PR for this
@yoavGrs can you link to it when it's open?
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: all files reviewed, 1 unresolved discussion (waiting on @ArielElp)
crates/papyrus_execution/src/testing_instances.rs
line 69 at r1 (raw file):
Previously, dorimedini-starkware wrote…
@yoavGrs can you link to it when it's open?
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: complete! all files reviewed, all discussions resolved (waiting on @TzahiTaub)
This change is