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_state_sync): implement state sync get latest block number #2944

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

noamsp-starkware
Copy link
Contributor

@noamsp-starkware noamsp-starkware commented Dec 25, 2024

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from e25ec06 to f6a1c07 Compare December 25, 2024 13:31
@noamsp-starkware noamsp-starkware force-pushed the noam.s/sync_state_reader_get_block_info branch from dbe2a1a to fd1726a Compare December 25, 2024 15:08
@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from f6a1c07 to cd47438 Compare December 25, 2024 15:08
@noamsp-starkware noamsp-starkware force-pushed the noam.s/sync_state_reader_get_block_info branch from fd1726a to 7287611 Compare December 26, 2024 10:16
@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from cd47438 to b4be593 Compare December 26, 2024 10:16
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.

Reviewable status: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware)


crates/starknet_gateway/src/stateful_transaction_validator.rs line 138 at r1 (raw file):

    let state_reader = state_reader_factory.get_state_reader_from_latest_block().map_err(|e| {
        error!("Failed to get state reader from latest block: {}", e);
        GatewaySpecError::UnexpectedError { data: "Internal server error.".to_owned() }

Check this with @alonh5

@noamsp-starkware noamsp-starkware force-pushed the noam.s/sync_state_reader_get_block_info branch from 8c370b3 to 505f90d Compare December 30, 2024 09:21
@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from 5000672 to b5f9e76 Compare December 30, 2024 09:21
Copy link
Collaborator

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


crates/starknet_gateway/src/stateful_transaction_validator.rs line 138 at r1 (raw file):

Previously, ShahakShama wrote…

Check this with @alonh5

This is fine. Didn't review the rest.

@noamsp-starkware noamsp-starkware force-pushed the noam.s/sync_state_reader_get_block_info branch from 505f90d to dc6c133 Compare December 30, 2024 12:00
@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from b5f9e76 to a203295 Compare December 30, 2024 12:05
@noamsp-starkware noamsp-starkware force-pushed the noam.s/sync_state_reader_get_block_info branch from dc6c133 to 74ae549 Compare December 30, 2024 12:50
@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from a203295 to a8a8da2 Compare December 30, 2024 12:50
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 7 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware)


crates/starknet_gateway/src/sync_state_reader.rs line 121 at r3 (raw file):

impl StateReaderFactory for SyncStateReaderFactory {
    fn get_state_reader_from_latest_block(&self) -> StateResult<Box<dyn MempoolStateReader>> {

No reason to use StateResult. You can use StateSyncResult instead

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 @ShahakShama)


crates/starknet_gateway/src/sync_state_reader.rs line 121 at r3 (raw file):

Previously, ShahakShama wrote…

No reason to use StateResult. You can use StateSyncResult instead

StateReaderFactory defines this return value.

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.

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @noamsp-starkware)


crates/starknet_gateway/src/sync_state_reader.rs line 121 at r3 (raw file):

Previously, noamsp-starkware wrote…

StateReaderFactory defines this return value.

This just means that I put the comment on the wrong file. Fix it where you define StateReaderFactory

@noamsp-starkware noamsp-starkware force-pushed the noam.s/get_latest_block_sync_state branch from a8a8da2 to d3e4bca Compare December 31, 2024 08:08
@noamsp-starkware noamsp-starkware changed the base branch from noam.s/sync_state_reader_get_block_info to main December 31, 2024 08:08
Copy link

Artifacts upload workflows:

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


crates/starknet_gateway/src/sync_state_reader.rs line 121 at r3 (raw file):

Previously, ShahakShama wrote…

This just means that I put the comment on the wrong file. Fix it where you define StateReaderFactory

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

@noamsp-starkware noamsp-starkware added this pull request to the merge queue Dec 31, 2024
Merged via the queue into main with commit 19176d0 Dec 31, 2024
21 of 27 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 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