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(starknet_gateway): create sync state reader infra with todos #2754

Merged
merged 1 commit into from
Dec 22, 2024

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/sync_state_reader_infra branch from 007c21e to 0f4bcbd Compare December 18, 2024 12:16
@noamsp-starkware noamsp-starkware changed the title chore(gateway): create sync state reader infra with todos chore(starknet_gateway): create sync state reader infra with todos Dec 18, 2024
@starkware-libs starkware-libs deleted a comment from github-actions bot Dec 18, 2024
@noamsp-starkware noamsp-starkware marked this pull request as ready for review December 18, 2024 12:40
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 5 of 5 files at r1, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @noamsp-starkware)


a discussion (no related file):
@alonh5 should review this as well. Please send it to him in slack


crates/starknet_state_sync_types/src/communication.rs line 37 at r1 (raw file):

    ) -> StateSyncClientResult<()>;

    // TODO: add get_storage_at for BlockifierStateReader trait

This sounds like you want to add this method to the BlockifierStateReader trait. Rephrase it "for SyncStateReader"


crates/starknet_gateway/src/sync_state_reader.rs line 14 at r1 (raw file):

struct SyncStateReader {
    block_number: BlockNumber,
    shared_state_sync_client: SharedStateSyncClient,

You can name this state_sync_client


crates/starknet_gateway/src/sync_state_reader.rs line 19 at r1 (raw file):

impl SyncStateReader {
    pub fn from_number(
        shared_state_sync_client: &SharedStateSyncClient,

In rust we usually don't take by reference what we then clone, we consume it. This allows the caller to maybe pass to us an object that they don't need anymore and save the clone

@alonh5 FYI since it is copied from the RpcStateReader

@noamsp-starkware noamsp-starkware force-pushed the noam.s/sync_state_reader_infra branch from 0f4bcbd to e00bff3 Compare December 19, 2024 08:45
@noamsp-starkware noamsp-starkware changed the base branch from noam.s/remove_empty_state_sync_client to main December 19, 2024 08:45
Copy link

Artifacts upload workflows:

Copy link

Benchmark movements:
tree_computation_flow performance improved 😺
tree_computation_flow time: [34.345 ms 34.505 ms 34.704 ms]
change: [-5.6152% -4.1015% -2.7146%] (p = 0.00 < 0.05)
Performance has improved.
Found 13 outliers among 100 measurements (13.00%)
13 (13.00%) high severe

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 5 files reviewed, 4 unresolved discussions (waiting on @alonh5 and @ShahakShama)


crates/starknet_gateway/src/sync_state_reader.rs line 14 at r1 (raw file):

Previously, ShahakShama wrote…

You can name this state_sync_client

Done.


crates/starknet_gateway/src/sync_state_reader.rs line 19 at r1 (raw file):

Previously, ShahakShama wrote…

In rust we usually don't take by reference what we then clone, we consume it. This allows the caller to maybe pass to us an object that they don't need anymore and save the clone

@alonh5 FYI since it is copied from the RpcStateReader

Done.


crates/starknet_state_sync_types/src/communication.rs line 37 at r1 (raw file):

Previously, ShahakShama wrote…

This sounds like you want to add this method to the BlockifierStateReader trait. Rephrase it "for SyncStateReader"

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 3 of 3 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @noamsp-starkware)

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: all files reviewed, 1 unresolved discussion (waiting on @alonh5)


a discussion (no related file):

Previously, ShahakShama wrote…

@alonh5 should review this as well. Please send it to him in slack

I spoke with @alonh5; his team's review will be required for the PRs that actually integrate the sync state reader into gateway. resolving this.

Copy link
Contributor Author

noamsp-starkware commented Dec 22, 2024

Merge activity

  • Dec 22, 3:18 AM EST: A user started a stack merge that includes this pull request via Graphite.
  • Dec 22, 3:19 AM EST: A user merged this pull request with Graphite.

@noamsp-starkware noamsp-starkware merged commit cf354ca into main Dec 22, 2024
21 of 39 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Dec 23, 2024
@noamsp-starkware noamsp-starkware deleted the noam.s/sync_state_reader_infra branch December 31, 2024 09:10
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.

3 participants