Skip to content

starknet_committer: add commit e2e tests#11331

Merged
ArielElp merged 1 commit intomain-v0.14.1-committerfrom
ariel/commit_e2e_tests
Feb 4, 2026
Merged

starknet_committer: add commit e2e tests#11331
ArielElp merged 1 commit intomain-v0.14.1-committerfrom
ariel/commit_e2e_tests

Conversation

@ArielElp
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

This was referenced Dec 31, 2025
@ArielElp ArielElp force-pushed the ariel/commit_e2e_tests branch from 53bc178 to d2cc76f Compare December 31, 2025 14:31
@ArielElp ArielElp force-pushed the ariel/abstract_original_forest_tests branch 2 times, most recently from 437648a to fe35926 Compare December 31, 2025 15:14
@ArielElp ArielElp force-pushed the ariel/abstract_original_forest_tests branch from 03dd814 to b03fdba Compare January 12, 2026 18:04
@ArielElp ArielElp force-pushed the ariel/commit_e2e_tests branch 2 times, most recently from 3165069 to c8151fc Compare January 13, 2026 06:43
@ArielElp ArielElp force-pushed the ariel/abstract_original_forest_tests branch from b03fdba to af38e6e Compare January 13, 2026 06:43
@ArielElp ArielElp force-pushed the ariel/commit_e2e_tests branch from c8151fc to ba45006 Compare January 13, 2026 07:03
@ArielElp ArielElp force-pushed the ariel/abstract_original_forest_tests branch from af38e6e to 00de040 Compare January 13, 2026 07:03
@ArielElp ArielElp force-pushed the ariel/commit_e2e_tests branch from ba45006 to ee507ba Compare January 13, 2026 07:10
@ArielElp ArielElp force-pushed the ariel/abstract_original_forest_tests branch from 30f425d to 193b115 Compare January 13, 2026 08:00
@ArielElp ArielElp force-pushed the ariel/commit_e2e_tests branch 2 times, most recently from 713449c to 701a89d Compare January 13, 2026 09:34
@ArielElp ArielElp force-pushed the ariel/abstract_original_forest_tests branch 2 times, most recently from 2b4d9f6 to 280b616 Compare January 13, 2026 15:21
Copy link
Contributor

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

@nimrod-starkware reviewed 2 files and all commit messages, and made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @ArielElp).


crates/starknet_committer/src/db/facts_db/types.rs line 71 at r1 (raw file):

        })
    }
}

should do the same thing :)

Suggestion:

#[derive(Clone, Debug, Default, PartialEq)]
pub struct FactsDbInitialRead(pub StateRoots);

Copy link
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

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

@ArielElp made 1 comment.
Reviewable status: 2 of 3 files reviewed, 1 unresolved discussion (waiting on @nimrod-starkware).


crates/starknet_committer/src/db/facts_db/types.rs line 71 at r1 (raw file):

Previously, nimrod-starkware wrote…

should do the same thing :)

Done.

Copy link
Contributor

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

:lgtm:

@nimrod-starkware reviewed 2 files and all commit messages, made 1 comment, and resolved 1 discussion.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).

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.

@dorimedini-starkware reviewed 3 files and all commit messages, and made 3 comments.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArielElp).


crates/starknet_committer/src/db/facts_db/types.rs line 62 at r3 (raw file):

/// Used for reading the roots in facts layout case.
#[derive(Clone, Debug, Default, PartialEq)]
pub struct FactsDbInitialRead(pub StateRoots);

non-blocking, because StateRoots does have a natural default; however, still consider this, if it's dangerous to accidentally use a default value in production

Suggestion:

#[cfg_attr(any(test, feature = "testing"), derive(Default))]
#[derive(Clone, Debug, PartialEq)]
pub struct FactsDbInitialRead(pub StateRoots);

crates/starknet_committer/src/block_committer/commit_test.rs line 60 at r3 (raw file):

#[rstest]
#[case([get_first_state_diff(), get_second_state_diff()], EXPECTED_ROOTS_SIMPLE_CASE)]
#[case(get_random_state_diffs(), EXPECTED_ROOTS_RANDOM_CASE)]

works, but seems odd; I would consider using expect! to generate the expected roots given the "random" state diffs.
if index layout and facts layout diverge, you will still fail at least one of the tests.
non-blocking

Code quote:

#[case(get_random_state_diffs(), EXPECTED_ROOTS_RANDOM_CASE)]

crates/starknet_committer/src/block_committer/commit_test.rs line 101 at r3 (raw file):

    expected_roots: StateRoots,
) {
    let [first_state_diff, second_state_diff] = state_diffs;

non-blocking

Suggestion:

    [first_state_diff, second_state_diff]: [StateDiff; 2],
    expected_roots: StateRoots,
) {
    

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.

@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArielElp).

Copy link
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

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

@ArielElp made 1 comment and resolved 2 discussions.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @dorimedini-starkware).


crates/starknet_committer/src/block_committer/commit_test.rs line 60 at r3 (raw file):

Previously, dorimedini-starkware wrote…

works, but seems odd; I would consider using expect! to generate the expected roots given the "random" state diffs.
if index layout and facts layout diverge, you will still fail at least one of the tests.
non-blocking

AFAIU it would require a different assertion line in each layout test, and DB layouts shouldn't affect the resulting roots, this would be a protocol change (OS changes + nodes changes etc.)

Copy link
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

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

@ArielElp resolved 1 discussion.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @dorimedini-starkware).

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.

@dorimedini-starkware made 1 comment.
Reviewable status: 2 of 3 files reviewed, all discussions resolved (waiting on @ArielElp).


crates/starknet_committer/src/block_committer/commit_test.rs line 60 at r3 (raw file):

Previously, ArielElp wrote…

AFAIU it would require a different assertion line in each layout test, and DB layouts shouldn't affect the resulting roots, this would be a protocol change (OS changes + nodes changes etc.)

layouts won't, but randomness will.
why different assert line? a single assert_debug_eq should do the trick

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.

@dorimedini-starkware reviewed 1 file and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).

@github-actions
Copy link

github-actions bot commented Feb 3, 2026

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.

@dorimedini-starkware reviewed 4 files and all commit messages, and made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @ArielElp).


crates/starknet_committer/src/block_committer/commit_test.rs line 79 at r6 (raw file):

        Self
    }
}

mmmm this isn't enough...?

Suggestion:

impl From<StateRoots> for FactsDbInitialRead {
    fn from(roots: StateRoots) -> Self {
        Self(roots)
    }
}

impl From<StateRoots> for IndexDbReadContext {
    fn from(_roots: StateRoots) -> Self {
        Self
    }
}

crates/starknet_committer/src/block_committer/commit_test.rs line 125 at r6 (raw file):

    expected_roots: &Expect,
) where
    Db::InitialReadContext: InitialReadContextFromRoots,

see above

Suggestion:

Db::InitialReadContext: From<StateRoots>,

Copy link
Contributor Author

@ArielElp ArielElp left a comment

Choose a reason for hiding this comment

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

@ArielElp made 2 comments.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @dorimedini-starkware).


crates/starknet_committer/src/block_committer/commit_test.rs line 79 at r6 (raw file):

Previously, dorimedini-starkware wrote…

mmmm this isn't enough...?

Done.


crates/starknet_committer/src/block_committer/commit_test.rs line 125 at r6 (raw file):

Previously, dorimedini-starkware wrote…

see above

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.

@dorimedini-starkware reviewed 1 file and all commit messages, and resolved 2 discussions.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @ArielElp).

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