Skip to content

chore(starknet_l1_provider): add lazy sync height test #5188

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

Conversation

giladchase
Copy link
Contributor

Also add util for flushing the fake l1 client: its currently just
buffering the calls it gets, and needs a manual flush.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

giladchase commented Mar 23, 2025

@giladchase giladchase marked this pull request as ready for review March 23, 2025 14:42
Copy link
Contributor

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

Reviewed 1 of 2 files at r1, all commit messages.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @alonh5)

@giladchase giladchase force-pushed the gilad/03-23-fix_starknet_l1_provider_flow_test_consistency branch from d8b1c0e to 7bb36d5 Compare March 25, 2025 06:38
@giladchase giladchase force-pushed the gilad/03-23-chore_starknet_l1_provider_add_lazy_sync_height_test branch 2 times, most recently from 4d7b272 to b5afc16 Compare March 25, 2025 06:46
@giladchase giladchase force-pushed the gilad/03-23-fix_starknet_l1_provider_flow_test_consistency branch from 7bb36d5 to 254769e Compare March 25, 2025 06:47
@giladchase giladchase force-pushed the gilad/03-23-chore_starknet_l1_provider_add_lazy_sync_height_test branch from b5afc16 to 94a87e9 Compare March 25, 2025 06:47
@giladchase giladchase requested a review from elintul March 26, 2025 10:09
Copy link
Collaborator

@elintul elintul 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 2 files at r1, 1 of 2 files at r2, all commit messages.
Reviewable status: 2 of 3 files reviewed, 3 unresolved discussions (waiting on @alonh5)


crates/starknet_l1_provider/tests/startup_flows.rs line 209 at r2 (raw file):

#[tokio::test]
async fn bootstrap_delayed_sync_state_with_catch_up() {

Not sure I understand the scenario from this name, consider a docstring.

Code quote:

bootstrap_delayed_sync_state_with_catch_up

crates/starknet_l1_provider/tests/startup_flows.rs line 212 at r2 (raw file):

    if !in_ci() {
        return;
    }

Remind me, why?

Code quote:

    if !in_ci() {
        return;
    }

crates/starknet_l1_provider/tests/startup_flows.rs line 213 at r2 (raw file):

        return;
    }
    configure_tracing().await;

Why manually? :(

Code quote:

configure_tracing().await;

@giladchase giladchase force-pushed the gilad/03-23-fix_starknet_l1_provider_flow_test_consistency branch from 254769e to fb390a7 Compare March 26, 2025 10:28
@giladchase giladchase force-pushed the gilad/03-23-chore_starknet_l1_provider_add_lazy_sync_height_test branch 2 times, most recently from 78ef1bb to 6b16cca Compare March 26, 2025 10:35
@giladchase giladchase force-pushed the gilad/03-23-fix_starknet_l1_provider_flow_test_consistency branch from fb390a7 to 2117d5b Compare March 26, 2025 10:35
Copy link
Contributor Author

@giladchase giladchase 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, 3 unresolved discussions (waiting on @alonh5 and @elintul)


crates/starknet_l1_provider/tests/startup_flows.rs line 209 at r2 (raw file):

Previously, elintul (Elin) wrote…

Not sure I understand the scenario from this name, consider a docstring.

Srry, is this better?


crates/starknet_l1_provider/tests/startup_flows.rs line 212 at r2 (raw file):

Previously, elintul (Elin) wrote…

Remind me, why?

Local users might not have anvil installed.


crates/starknet_l1_provider/tests/startup_flows.rs line 213 at r2 (raw file):

Previously, elintul (Elin) wrote…

Why manually? :(

Looks like without this i don't get tracing in the test :(

Copy link
Collaborator

@elintul elintul 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 r3, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @alonh5)


crates/starknet_l1_provider/tests/startup_flows.rs line 249 at r3 (raw file):

    // **Commit** a few blocks. These should get backlogged since they are post-sync-height.
    // Sleeps are sprinkled in to give the async task a couple shots at attempting to get the sync

✨❤️

Code quote:

sprinkled

crates/starknet_l1_provider/tests/startup_flows.rs line 283 at r3 (raw file):

    assert_eq!(
        l1_provider.current_height,
        sync_height.unchecked_next().unchecked_next().unchecked_next()

A better alternative? :(

Code quote:

sync_height.unchecked_next().unchecked_next().unchecked_next()

Copy link
Contributor Author

@giladchase giladchase 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)


crates/starknet_l1_provider/tests/startup_flows.rs line 283 at r3 (raw file):

Previously, elintul (Elin) wrote…

A better alternative? :(

How about this?

@giladchase giladchase force-pushed the gilad/03-23-chore_starknet_l1_provider_add_lazy_sync_height_test branch 2 times, most recently from 7d2b1be to 06864d2 Compare March 26, 2025 10:53
Copy link
Collaborator

@elintul elintul 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 2 of 2 files at r4, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)


crates/starknet_l1_provider/tests/startup_flows.rs line 283 at r3 (raw file):

Previously, giladchase wrote…

How about this?

Looks good, thanks!

@giladchase giladchase force-pushed the gilad/03-23-chore_starknet_l1_provider_add_lazy_sync_height_test branch from 06864d2 to ffce343 Compare March 26, 2025 11:05
Copy link
Contributor

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

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

Also add util for flushing the fake l1 client: its currently just
buffering the calls it gets, and needs a manual flush.
@giladchase giladchase changed the base branch from gilad/03-23-fix_starknet_l1_provider_flow_test_consistency to graphite-base/5188 March 26, 2025 11:31
@giladchase giladchase force-pushed the gilad/03-23-chore_starknet_l1_provider_add_lazy_sync_height_test branch from ffce343 to 1bef7fe Compare March 26, 2025 11:31
@giladchase giladchase changed the base branch from graphite-base/5188 to main March 26, 2025 11:31
Copy link
Collaborator

@elintul elintul 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 r5, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @alonh5)

@giladchase giladchase added this pull request to the merge queue Mar 26, 2025
Merged via the queue into main with commit 6eec4c7 Mar 26, 2025
9 of 13 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 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