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

feat(starknet_integration_tests): add snapshot tx generator fn #4075

Open
wants to merge 1 commit into
base: noam.s/feat_starknet_integration_tests_add_update_revert_config
Choose a base branch
from

Conversation

noamsp-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_update_revert_config branch from b6b9828 to 60be9d2 Compare February 11, 2025 09:51
@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_snapshot_tx_generator_fn branch from 2489e4f to 1788552 Compare February 11, 2025 09:51
@noamsp-starkware noamsp-starkware marked this pull request as ready for review February 11, 2025 09:52
Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.758 ms 34.911 ms 35.162 ms]
change: [-4.6011% -2.8101% -1.1544%] (p = 0.00 < 0.05)
Performance has improved.
Found 10 outliers among 100 measurements (10.00%)
1 (1.00%) low severe
2 (2.00%) low mild
3 (3.00%) high mild
4 (4.00%) high severe

Copy link
Contributor

@ShahakShama ShahakShama left a 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, 3 unresolved discussions (waiting on @noamsp-starkware)


crates/mempool_test_utils/src/starknet_api_test_utils.rs line 215 at r1 (raw file):

        let mut account_tx_generators = Vec::new();
        let nonce_manager = Rc::new(RefCell::new((*self.nonce_manager.borrow()).clone()));
        for tx_gen in self.account_tx_generators.iter() {

Change this to iterator functions

let  account_tx_generators = self.account_tx_generators.iter().map(...).collect();

crates/mempool_test_utils/src/starknet_api_test_utils.rs line 215 at r1 (raw file):

        let mut account_tx_generators = Vec::new();
        let nonce_manager = Rc::new(RefCell::new((*self.nonce_manager.borrow()).clone()));
        for tx_gen in self.account_tx_generators.iter() {

No need for iter in for loop. Just add & at the start of the container being iterated. If you accept my suggestion above this comment is irrelevant


crates/starknet_integration_tests/src/sequencer_manager.rs line 199 at r1 (raw file):

    }

    pub fn snapshot_tx_generator(&self) -> MultiAccountTransactionGenerator {

Change this to tx_generator which returns & and tx_generator_mut which returns &mut. In the test body call snapshot and assign the tx generator

@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_update_revert_config branch 2 times, most recently from c3b6ed9 to f70ccf1 Compare February 11, 2025 11:51
@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_snapshot_tx_generator_fn branch from 1788552 to d11d2af Compare February 11, 2025 11:56
Copy link
Contributor Author

@noamsp-starkware noamsp-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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @ShahakShama)


crates/mempool_test_utils/src/starknet_api_test_utils.rs line 215 at r1 (raw file):

Previously, ShahakShama wrote…

No need for iter in for loop. Just add & at the start of the container being iterated. If you accept my suggestion above this comment is irrelevant

Went with suggestion above.


crates/starknet_integration_tests/src/sequencer_manager.rs line 199 at r1 (raw file):

Previously, ShahakShama wrote…

Change this to tx_generator which returns & and tx_generator_mut which returns &mut. In the test body call snapshot and assign the tx generator

Why do we need tx_generator_mut?

Copy link
Contributor

@ShahakShama ShahakShama left a 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, 1 unresolved discussion (waiting on @noamsp-starkware)


crates/starknet_integration_tests/src/sequencer_manager.rs line 199 at r1 (raw file):

Previously, noamsp-starkware wrote…

Why do we need tx_generator_mut?

answered in slack

@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_update_revert_config branch from f70ccf1 to c082e20 Compare February 11, 2025 14:04
@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_snapshot_tx_generator_fn branch 2 times, most recently from 7098149 to c495fd7 Compare February 11, 2025 14:59
Copy link
Contributor Author

@noamsp-starkware noamsp-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: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @ShahakShama)


crates/starknet_integration_tests/src/sequencer_manager.rs line 199 at r1 (raw file):

Previously, ShahakShama wrote…

answered in slack

Done.

Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

:lgtm:

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

@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_update_revert_config branch from c082e20 to 4093bd4 Compare February 12, 2025 10:55
@noamsp-starkware noamsp-starkware force-pushed the noam.s/feat_starknet_integration_tests_add_snapshot_tx_generator_fn branch from c495fd7 to 8f46461 Compare February 12, 2025 10:55
Copy link
Contributor

@Itay-Tsabary-Starkware Itay-Tsabary-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: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @ShahakShama)


-- commits line 2 at r4:
Commit scope (starknet_integration_tests) is incorrect.

Code quote:

- 8f46461: feat(starknet_integration_tests): add snapshot tx generator fn

@ShahakShama ShahakShama force-pushed the noam.s/feat_starknet_integration_tests_add_snapshot_tx_generator_fn branch from 8f46461 to bec9bef Compare February 13, 2025 08:55
Copy link
Contributor

@ShahakShama ShahakShama left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants