Skip to content

Conversation

@nimrod-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

nimrod-starkware commented Jul 6, 2025

@nimrod-starkware nimrod-starkware marked this pull request as ready for review July 6, 2025 09:03
Copy link
Contributor Author

@nimrod-starkware nimrod-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 2 files reviewed, 1 unresolved discussion (waiting on @amosStarkware and @dorimedini-starkware)


crates/starknet_os/src/test_utils/utils.rs line 163 at r1 (raw file):

pub(crate) type DictEntry = [Felt; DICT_ACCESS_SIZE];

@dorimedini-starkware this code should be also useful for the aggregator, right?
Maybe worth moving it somewhere else and use errors instead?

Copy link
Collaborator

@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.

Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @amosStarkware and @TzahiTaub)


crates/starknet_os/src/test_utils/utils.rs line 163 at r1 (raw file):

Previously, nimrod-starkware wrote…

@dorimedini-starkware this code should be also useful for the aggregator, right?
Maybe worth moving it somewhere else and use errors instead?

WDYM by "use errors instead"?
can you ask @TzahiTaub if this code is useful in the aggregator area?


crates/starknet_os/src/test_utils/utils.rs line 0 at r1 (raw file):
please sync with @TzahiTaub , by a brief overview I see there may be code sharing potential with the aggregator code


crates/starknet_os/src/test_utils/utils.rs line 220 at r1 (raw file):

        let contracts = (0..n_contracts)
            .map(|_| FullOutputContractChanges::new_from_iter(os_output_iter))
            .collect();

since the order is crucial here, consider converting this to a for loop.
iterators can be easily parallelized, but doing so in this case would be incorrect.
(unless you can quote the rust docs for a guaranteed execution order :) )

Code quote:

        let contracts = (0..n_contracts)
            .map(|_| FullOutputContractChanges::new_from_iter(os_output_iter))
            .collect();

crates/starknet_os/src/tests/aliases.rs line 454 at r1 (raw file):

    #[case] initial_alias_storage: HashMap<u128, u128>,
    #[case] expected_alias_storage: HashMap<u128, u128>,
    #[case] contract_state_diff_len: usize,

can't this parameter be computed by the test input?

Code quote:

#[case] contract_state_diff_len: usize,

@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 7f8ba6b to 833b5f9 Compare July 6, 2025 11:22
Copy link
Collaborator

@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.

Reviewed 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @amosStarkware, @nimrod-starkware, and @TzahiTaub)

@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 833b5f9 to 87fe43e Compare July 6, 2025 12:33
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/allocate_and_replace branch from 1a8e992 to 6aec9d9 Compare July 6, 2025 12:33
Copy link
Contributor Author

@nimrod-starkware nimrod-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: all files reviewed, 3 unresolved discussions (waiting on @amosStarkware, @dorimedini-starkware, and @TzahiTaub)


crates/starknet_os/src/test_utils/utils.rs line 220 at r1 (raw file):

Previously, dorimedini-starkware wrote…

since the order is crucial here, consider converting this to a for loop.
iterators can be easily parallelized, but doing so in this case would be incorrect.
(unless you can quote the rust docs for a guaranteed execution order :) )

Maybe this comment is relevant to Tzahi's implementation?


crates/starknet_os/src/test_utils/utils.rs line at r1 (raw file):

Previously, dorimedini-starkware wrote…

please sync with @TzahiTaub , by a brief overview I see there may be code sharing potential with the aggregator code

Talked to him and used his implementation.


crates/starknet_os/src/tests/aliases.rs line 454 at r1 (raw file):

Previously, dorimedini-starkware wrote…

can't this parameter be computed by the test input?

ATM, the cairo runner has a limitation that it needs to know in advance the length of an array. These numbers were calculated from python...
Maybe worth adding a TODO to extend the cairo runner to be able to load an entire segment without knowing in advance the length.

Copy link
Collaborator

@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.

Reviewed 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @amosStarkware and @nimrod-starkware)


crates/starknet_os/src/tests/aliases.rs line 454 at r1 (raw file):

Previously, nimrod-starkware wrote…

ATM, the cairo runner has a limitation that it needs to know in advance the length of an array. These numbers were calculated from python...
Maybe worth adding a TODO to extend the cairo runner to be able to load an entire segment without knowing in advance the length.

please do, and if you don't intend to do it please ask amos/rotem?


crates/starknet_os/src/tests/aliases.rs line 455 at r3 (raw file):

    #[case] contract_state_diff_len: usize,
) {
    use crate::io::os_output::OsStateDiff;

move to top

Code quote:

use crate::io::os_output::OsStateDiff;

@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 87fe43e to d9b20fb Compare July 6, 2025 14:19
Copy link
Contributor Author

@nimrod-starkware nimrod-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: all files reviewed, 2 unresolved discussions (waiting on @amosStarkware and @dorimedini-starkware)


crates/starknet_os/src/tests/aliases.rs line 454 at r1 (raw file):

Previously, dorimedini-starkware wrote…

please do, and if you don't intend to do it please ask amos/rotem?

Done.


crates/starknet_os/src/tests/aliases.rs line 455 at r3 (raw file):

Previously, dorimedini-starkware wrote…

move to top

Done.

Copy link
Collaborator

@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.

Reviewed 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)

@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from d9b20fb to 6ff8932 Compare July 7, 2025 07:00
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/allocate_and_replace branch from 6aec9d9 to 4f1831f Compare July 7, 2025 07:00
Copy link
Collaborator

@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.

Reviewed 2 of 2 files at r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @amosStarkware)

@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 6ff8932 to 7924cef Compare July 7, 2025 15:24
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/allocate_and_replace branch from 4f1831f to 124855c Compare July 7, 2025 15:24
Copy link
Collaborator

@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.

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

@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/allocate_and_replace branch from 124855c to b482214 Compare July 7, 2025 15:59
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 7924cef to 09012d3 Compare July 7, 2025 16:00
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/allocate_and_replace branch from b482214 to 23e65b6 Compare July 8, 2025 06:11
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 09012d3 to 1940aa1 Compare July 8, 2025 06:11
@nimrod-starkware nimrod-starkware changed the base branch from nimrod/aliases_test/allocate_and_replace to graphite-base/7792 July 8, 2025 06:58
@nimrod-starkware nimrod-starkware force-pushed the nimrod/aliases_test/parse_os_state_diff branch from 1940aa1 to 61cf5e6 Compare July 8, 2025 06:58
@nimrod-starkware nimrod-starkware changed the base branch from graphite-base/7792 to main-v0.14.0 July 8, 2025 06:58
@nimrod-starkware nimrod-starkware added this pull request to the merge queue Jul 8, 2025
Merged via the queue into main-v0.14.0 with commit 5953e20 Jul 8, 2025
16 of 17 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 9, 2025
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.

4 participants