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,starknet_api): migrate GasVector from blockifier … #1165

Conversation

dorimedini-starkware
Copy link
Collaborator

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

…to starknet_api


This change is Reviewable

@dorimedini-starkware dorimedini-starkware self-assigned this Oct 4, 2024
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: 0 of 20 files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware)


crates/blockifier/src/fee/resources.rs line 378 at r1 (raw file):

    /// If this function is called with kzg_flag==false, then l1_data_gas==0, and this dicount
    /// function does nothing.
    pub fn to_discounted_l1_gas(&self, tx_context: &TransactionContext) -> GasAmount {

self-blocking:
this should be a method of starknet-api's GasVector (not TransactionContext).
need to do this first though:

  1. replace the GasPrices struct to be a struct with two fields of type GasPricesForFeeType
  2. rename GasPrices -> BothGasPrices, and GasPricesForFeeType -> GasPrices
  3. move GasPrices to starknet-api

Code quote:

pub fn to_discounted_l1_gas(&self, tx_context: &TransactionContext) -> GasAmount {

Copy link

codecov bot commented Oct 4, 2024

Codecov Report

Attention: Patch coverage is 54.90196% with 23 lines in your changes missing coverage. Please review.

Project coverage is 67.85%. Comparing base (a41a12a) to head (e40c65f).

Files with missing lines Patch % Lines
crates/starknet_api/src/execution_resources.rs 54.90% 15 Missing and 8 partials ⚠️
Additional details and impacted files
@@                            Coverage Diff                            @@
##           dori/refactor-discounted-gas-function    #1165      +/-   ##
=========================================================================
- Coverage                                  70.55%   67.85%   -2.71%     
=========================================================================
  Files                                         88      146      +58     
  Lines                                      11452    18107    +6655     
  Branches                                   11452    18107    +6655     
=========================================================================
+ Hits                                        8080    12286    +4206     
- Misses                                      2992     4927    +1935     
- Partials                                     380      894     +514     

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

@dorimedini-starkware dorimedini-starkware changed the base branch from dori/starknet-api-gas-vector-typing to dori/refactor-discounted-gas-function October 5, 2024 11:03
@dorimedini-starkware dorimedini-starkware force-pushed the dori/refactor-discounted-gas-function branch from e16d88b to f1342c2 Compare October 5, 2024 11:06
@dorimedini-starkware dorimedini-starkware force-pushed the dori/refactor-discounted-gas-function branch from f1342c2 to adae6ca Compare October 5, 2024 11:10
@dorimedini-starkware dorimedini-starkware force-pushed the dori/refactor-discounted-gas-function branch from adae6ca to a41a12a Compare October 5, 2024 11:13
…to starknet_api

Signed-off-by: Dori Medini <dori@starkware.co>
@github-actions github-actions bot locked and limited conversation to collaborators Oct 7, 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.

1 participant