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(blockifier): add resource bounds to faulty account transaction creator #365

Merged

Conversation

meship-starkware
Copy link
Contributor

@meship-starkware meship-starkware commented Aug 8, 2024

This change is Reviewable

@meship-starkware meship-starkware changed the base branch from meship/blockifier/remove_enforce_fee_from_max_fee to meship/blockifier/remove_enforce_fee_from_pre_validation August 8, 2024 10:29
@meship-starkware meship-starkware force-pushed the meship/blockifier/remove_enforce_fee_from_pre_validation branch 2 times, most recently from 9176d8e to 02b223e Compare August 8, 2024 11:25
@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from 68fa35c to c032388 Compare August 8, 2024 11:27
@meship-starkware meship-starkware force-pushed the meship/blockifier/remove_enforce_fee_from_pre_validation branch from 02b223e to 4c06451 Compare August 8, 2024 12:00
@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from c032388 to 6794b4c Compare August 8, 2024 12:01
@meship-starkware meship-starkware force-pushed the meship/blockifier/remove_enforce_fee_from_pre_validation branch from 4c06451 to ed871c4 Compare August 11, 2024 08:49
@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from 6794b4c to 6a12a10 Compare August 11, 2024 08:50
@meship-starkware meship-starkware force-pushed the meship/blockifier/remove_enforce_fee_from_pre_validation branch from ed871c4 to 747bdeb Compare August 13, 2024 10:44
@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from 6a12a10 to 932c145 Compare August 13, 2024 10:45
Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

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

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @meship-starkware)


crates/blockifier/src/blockifier/stateful_validator_test.rs line 50 at r1 (raw file):

    // TODO(Arni, 1/5/2024): Cover resource bounds in version 3 txs. Test the validator validate
    // enough "fee" in version 3 txs.

Can be removed, no?

Code quote:

    // TODO(Arni, 1/5/2024): Cover resource bounds in version 3 txs. Test the validator validate
    // enough "fee" in version 3 txs.

crates/blockifier/src/blockifier/stateful_validator_test.rs line 57 at r1 (raw file):

        class_hash,
        validate_constructor,
        // TODO(Arni, 1/5/2024): Add test for insufficient max fee.

Suggestion:

// TODO(Arni, 1/5/2024): Add test for insufficient maximal resources..

crates/blockifier/src/blockifier/stateful_validator_test.rs line 74 at r1 (raw file):

    let charge_fee = false;
    let skip_validation = false;
    let result = stateful_validator.perform_validations(tx, skip_validation, charge_fee);

Please restore

Code quote:

    let charge_fee = false;
    let skip_validation = false;
    let result = stateful_validator.perform_validations(tx, skip_validation, charge_fee);

crates/blockifier/src/blockifier/stateful_validator_test.rs line 92 at r1 (raw file):

        sender_address: faulty_account.get_instance_address(0),
        class_hash: faulty_account.get_class_hash(),
        max_fee: Fee(BALANCE),

Suggestion:

        tx_version: TransactionVersion::THREE,
        sender_address: faulty_account.get_instance_address(0),
        class_hash: faulty_account.get_class_hash(),

crates/blockifier/src/transaction/transactions_test.rs line 1557 at r1 (raw file):

        contract_address_salt: salt_manager.next_salt(),
        resource_bounds: default_testing_resource_bounds(),
        ..default_args

As it is defined in the default args :)
Same below

Suggestion:

        ..default_args

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

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

Nice catch!

Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @meship-starkware)

@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from 932c145 to b4733dc Compare August 26, 2024 06:04
@meship-starkware meship-starkware changed the base branch from meship/blockifier/remove_enforce_fee_from_pre_validation to main August 26, 2024 06:05
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [64.754 ms 65.470 ms 66.796 ms]
change: [-8.6072% -5.0535% -1.5491%] (p = 0.00 < 0.05)
Performance has improved.
Found 9 outliers among 100 measurements (9.00%)
6 (6.00%) high mild
3 (3.00%) high severe

@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from b4733dc to 1c4d377 Compare August 26, 2024 07:11
Copy link

codecov bot commented Aug 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 76.42%. Comparing base (cd9fcf5) to head (07cee6a).
Report is 11 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #365   +/-   ##
=======================================
  Coverage   76.42%   76.42%           
=======================================
  Files         349      349           
  Lines       36936    36939    +3     
  Branches    36936    36939    +3     
=======================================
+ Hits        28228    28231    +3     
- Misses       6383     6384    +1     
+ Partials     2325     2324    -1     

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

@meship-starkware meship-starkware force-pushed the meship/blockifier/add_resorce_bounds_to_faulty_account branch from 1c4d377 to 07cee6a Compare August 26, 2024 08:19
Copy link
Contributor Author

@meship-starkware meship-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 4 files reviewed, 2 unresolved discussions (waiting on @noaov1)


crates/blockifier/src/blockifier/stateful_validator_test.rs line 50 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

Can be removed, no?

Done.


crates/blockifier/src/transaction/transactions_test.rs line 1557 at r1 (raw file):

Previously, noaov1 (Noa Oved) wrote…

As it is defined in the default args :)
Same below

This does not work because reasource_boundes does not implement copy.
Will be solved soon after nimrod will finish with his PRs. Would you like me to add a TODO?

Copy link
Collaborator

@noaov1 noaov1 left a comment

Choose a reason for hiding this comment

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

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

@meship-starkware meship-starkware merged commit 2726f3d into main Aug 27, 2024
15 checks passed
@meship-starkware meship-starkware deleted the meship/blockifier/add_resorce_bounds_to_faulty_account branch August 27, 2024 09:16
@github-actions github-actions bot locked and limited conversation to collaborators Aug 30, 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