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_gateway): use sync state reader instead of rpc #2990

Merged
merged 5 commits into from
Jan 2, 2025

Conversation

noamsp-starkware
Copy link
Contributor

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

feat(starknet_gateway): use sync state reader instead of rpc

feat(starknet_sequencer_node): remove rpc state reader

Due to this change we also fix the integration tests accordingly

fix(starknet_mempool_p2p): fix directory erasing after setup

Tests were running without the temporary directory handles, causing
these directory to be erased when setup would finish running.

This commit Adds temp dir handles to the setup output for the test to
hold to prevent the erasure.

fix(starknet_gateway): sync state reader fails end to end flow

End to End flow currently provides a zero value to gas_prices.
This commit adds a default assignment to gas price if a zero value was
provided, and add a TODO to remove the default once the test is fixed

@reviewable-StarkWare
Copy link

This change is Reviewable

@noamsp-starkware noamsp-starkware marked this pull request as ready for review December 26, 2024 18:58
@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
@noamsp-starkware noamsp-starkware force-pushed the noam.s/gateway_use_sync_state_reader branch 2 times, most recently from 72ab028 to 212401d Compare December 30, 2024 10:33
@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/gateway_use_sync_state_reader branch from 212401d to 484053e Compare December 30, 2024 12:06
@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
@noamsp-starkware noamsp-starkware force-pushed the noam.s/gateway_use_sync_state_reader branch from 484053e to 0625380 Compare December 30, 2024 12:50
@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 force-pushed the noam.s/gateway_use_sync_state_reader branch from 0625380 to 5005e2e Compare December 31, 2024 12:05
@noamsp-starkware noamsp-starkware changed the base branch from noam.s/get_latest_block_sync_state to main December 31, 2024 12:05
@noamsp-starkware noamsp-starkware force-pushed the noam.s/gateway_use_sync_state_reader branch from 5005e2e to 90bd740 Compare December 31, 2024 13:46
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 1 of 3 files at r1, 2 of 9 files at r4, 5 of 7 files at r5, 1 of 1 files at r6, 1 of 1 files at r7, 1 of 8 files at r8, 6 of 7 files at r9, 1 of 1 files at r10, 1 of 1 files at r11, 1 of 1 files at r12, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @alonh5 and @noamsp-starkware)


crates/starknet_gateway/src/sync_state_reader.rs line 45 at r12 (raw file):

            block_timestamp: block_header.timestamp,
            sequencer_address: block_header.sequencer.0,
            // TODO(noamsp): Remove unwrap_or_default after consensus gas price fix is merged.

Fix this in consensus instead. Change the default gas price to be one instead of zero and add a TODO on @asmaastarkware to fix this properly

@noamsp-starkware noamsp-starkware force-pushed the noam.s/gateway_use_sync_state_reader branch from 90bd740 to a4fcc21 Compare December 31, 2024 14:35
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: 10 of 12 files reviewed, 1 unresolved discussion (waiting on @alonh5, @asmaastarkware, and @ShahakShama)


crates/starknet_gateway/src/sync_state_reader.rs line 45 at r12 (raw file):

Previously, ShahakShama wrote…

Fix this in consensus instead. Change the default gas price to be one instead of zero and add a TODO on @asmaastarkware to fix this properly

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

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.

:lgtm:

Reviewed 1 of 3 files at r1, 1 of 9 files at r4, 1 of 8 files at r8.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @noamsp-starkware)

Due to this change we also fix the integration tests accordingly
Tests were running without the temporary directory handles, causing
these directory to be erased when setup would finish running.

This commit Adds temp dir handles to the setup output for the test to
hold to prevent the eraseure.
@noamsp-starkware noamsp-starkware force-pushed the noam.s/gateway_use_sync_state_reader branch from a4fcc21 to 36a3cd2 Compare January 1, 2025 15:53
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 7 of 10 files at r14, 6 of 7 files at r15, 1 of 1 files at r16, 1 of 1 files at r17, 1 of 1 files at r18, 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 Jan 2, 2025
Merged via the queue into main with commit 4ce974e Jan 2, 2025
14 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jan 3, 2025
@noamsp-starkware noamsp-starkware deleted the noam.s/gateway_use_sync_state_reader branch January 27, 2025 11:20
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