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

chore: split transaction file part one fields dedicated file #1219

Closed

Conversation

ArniStarkware
Copy link
Contributor

@ArniStarkware ArniStarkware commented Oct 7, 2024

This change is Reviewable

@ArniStarkware ArniStarkware requested review from dorimedini-starkware and removed request for dorimedini-starkware October 7, 2024 07:48
@ArniStarkware ArniStarkware marked this pull request as ready for review October 7, 2024 07:48
Copy link

codecov bot commented Oct 7, 2024

Codecov Report

Attention: Patch coverage is 68.75000% with 65 lines in your changes missing coverage. Please review.

Project coverage is 63.78%. Comparing base (b0cfe82) to head (9df9c1b).
Report is 335 commits behind head on main.

Files with missing lines Patch % Lines
crates/starknet_api/src/transaction/fields.rs 69.15% 48 Missing and 14 partials ⚠️
crates/native_blockifier/src/py_transaction.rs 0.00% 2 Missing ⚠️
crates/papyrus_rpc/src/v0_8/transaction.rs 80.00% 1 Missing ⚠️

❗ There is a different number of reports uploaded between BASE (b0cfe82) and HEAD (9df9c1b). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (b0cfe82) HEAD (9df9c1b)
3 1
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #1219       +/-   ##
===========================================
- Coverage   74.18%   63.78%   -10.41%     
===========================================
  Files         359      345       -14     
  Lines       36240    37177      +937     
  Branches    36240    37177      +937     
===========================================
- Hits        26886    23713     -3173     
- Misses       7220    11507     +4287     
+ Partials     2134     1957      -177     
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
Contributor Author

@ArniStarkware ArniStarkware left a comment

Choose a reason for hiding this comment

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

The file transaction.rs is over 1000 lines long and holds more than transactions. As a first step, let us split the fields into a dedicated file.

Reviewable status: 0 of 4 files reviewed, 4 unresolved discussions


crates/blockifier/src/transaction/objects.rs line 11 at r1 (raw file):

    AccountDeploymentData,
    AllResourceBounds,
    Fee,

Remove this file from the PR.

Code quote:

use std::collections::HashMap;

use cairo_vm::types::builtin_name::BuiltinName;
use cairo_vm::vm::runners::cairo_runner::ExecutionResources;
use starknet_api::core::{ContractAddress, Nonce};
use starknet_api::data_availability::DataAvailabilityMode;
use starknet_api::transaction::fields::signed_tx_version;
use starknet_api::transaction::{
    AccountDeploymentData,
    AllResourceBounds,
    Fee,

crates/starknet_api/src/transaction.rs line 19 at r1 (raw file):

// TODO(Arni): Remove the use of pub use.
pub use crate::transaction::fields::{
    AccountDeploymentData,

add

Suggestion:

    signed_tx_version, signed_tx_version_from_tx, AccountDeploymentData,

crates/starknet_api/src/transaction.rs line 52 at r1 (raw file):

// TODO(Arni): Remove the use of pub use.
pub mod fields;
pub use crate::transaction::fields::{TransactionOptions, QUERY_VERSION_BASE_BIT};

Squash into the other pub use.

Code quote:

// TODO(Arni): Remove the use of pub use.
pub mod fields;
pub use crate::transaction::fields::{TransactionOptions, QUERY_VERSION_BASE_BIT};

crates/starknet_api/src/transaction_hash.rs line 13 at r1 (raw file):

    DeclareTransaction,
    DeclareTransactionV0V1,
    DeclareTransactionV2,

remove this file from the PR.

Code quote:

use std::sync::LazyLock;

use starknet_types_core::felt::Felt;

use crate::block::BlockNumber;
use crate::core::{ascii_as_felt, calculate_contract_address, ChainId, ContractAddress};
use crate::crypto::utils::HashChain;
use crate::data_availability::DataAvailabilityMode;
use crate::transaction::fields::signed_tx_version_from_tx;
use crate::transaction::{
    DeclareTransaction,
    DeclareTransactionV0V1,
    DeclareTransactionV2,

@ArniStarkware ArniStarkware force-pushed the arni/snapi/split_transaction_file branch 5 times, most recently from 9df9c1b to e7ed4ba Compare October 20, 2024 05:12
@ArniStarkware ArniStarkware changed the base branch from main to arni/self_contained_macros/patricia_key October 20, 2024 05:12
@ArniStarkware ArniStarkware force-pushed the arni/self_contained_macros/patricia_key branch from a4cd793 to 310adde Compare October 20, 2024 07:26
@ArniStarkware ArniStarkware force-pushed the arni/snapi/split_transaction_file branch from e7ed4ba to fbcdc88 Compare October 20, 2024 07:26
@ArniStarkware ArniStarkware force-pushed the arni/self_contained_macros/patricia_key branch 2 times, most recently from 02ca477 to 2c21ba4 Compare October 21, 2024 06:55
@ArniStarkware ArniStarkware force-pushed the arni/snapi/split_transaction_file branch from fbcdc88 to 303545a Compare October 21, 2024 06:55
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [35.354 ms 35.409 ms 35.467 ms]
change: [-6.0921% -4.0680% -2.2144%] (p = 0.00 < 0.05)
Performance has improved.
Found 4 outliers among 100 measurements (4.00%)
4 (4.00%) high mild

@ArniStarkware ArniStarkware force-pushed the arni/self_contained_macros/patricia_key branch from 2c21ba4 to b11a15b Compare October 21, 2024 08:02
@ArniStarkware ArniStarkware force-pushed the arni/self_contained_macros/patricia_key branch from b11a15b to 3ee6938 Compare October 21, 2024 16:30
@ArniStarkware ArniStarkware force-pushed the arni/self_contained_macros/patricia_key branch from 3ee6938 to 2582986 Compare October 22, 2024 06:55
@ArniStarkware ArniStarkware force-pushed the arni/snapi/split_transaction_file branch from 303545a to 94bfef7 Compare October 22, 2024 06:55
@ArniStarkware ArniStarkware force-pushed the arni/self_contained_macros/patricia_key branch 4 times, most recently from 0ccf6f3 to 023cf22 Compare October 25, 2024 08:04
@ArniStarkware ArniStarkware changed the base branch from arni/self_contained_macros/patricia_key to graphite-base/1219 October 27, 2024 10:34
@ArniStarkware ArniStarkware deleted the arni/snapi/split_transaction_file branch October 31, 2024 16:00
@github-actions github-actions bot locked and limited conversation to collaborators Nov 2, 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