-
Notifications
You must be signed in to change notification settings - Fork 26
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): pass new internal blocks from state sync to p2p sync client #2631
base: main
Are you sure you want to change the base?
feat(starknet_state_sync): pass new internal blocks from state sync to p2p sync client #2631
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 1 of 6 files at r1, 3 of 3 files at r2, all commit messages.
Reviewable status: 4 of 8 files reviewed, all discussions resolved (waiting on @ShahakShama)
51929fb
to
6d8f02a
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2631 +/- ##
===========================================
+ Coverage 40.10% 77.08% +36.97%
===========================================
Files 26 393 +367
Lines 1895 42577 +40682
Branches 1895 42577 +40682
===========================================
+ Hits 760 32819 +32059
- Misses 1100 7463 +6363
- Partials 35 2295 +2260 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: 4 of 8 files reviewed, 4 unresolved discussions (waiting on @AlonLStarkWare and @eitanm-starkware)
crates/starknet_state_sync/src/runner/mod.rs
line 74 at r2 (raw file):
storage_writer, p2p_sync_client_channels, Box::pin(new_block_receiver),
use .boxed() instead
crates/starknet_state_sync_types/src/errors.rs
line 14 at r2 (raw file):
StorageError(String), #[error("Failed to send message to P2pSyncClient")] P2PSyncClientError,
Read the comment above on the StorageError. The reason we did not use #[error(transparent)]
and used the direct error in StorageError is because StorageError does not derive stuff
If your error type also doesn't derive these, copy the comment and change the type to string and implement the conversion manually
If it does, just contain the error and the #[error(transparent)]
will implement the From by itself
Please note that in a different comment in the PR I wrote about changing the error here
crates/starknet_state_sync/src/lib.rs
line 50 at r2 (raw file):
.send((block_number, sync_block)) .await .map_err(|_| StateSyncError::P2PSyncClientError),
This is a send error. not a sync client error
crates/starknet_state_sync/src/lib.rs
line 50 at r2 (raw file):
.send((block_number, sync_block)) .await .map_err(|_| StateSyncError::P2PSyncClientError),
If you implement error conversion like I said below, you can just use ? instead of map_err or use into()
There was a problem hiding this 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 9 files reviewed, 4 unresolved discussions (waiting on @eitanm-starkware and @ShahakShama)
crates/starknet_state_sync/src/lib.rs
line 50 at r2 (raw file):
Previously, ShahakShama wrote…
This is a send error. not a sync client error
Done.
crates/starknet_state_sync/src/lib.rs
line 50 at r2 (raw file):
Previously, ShahakShama wrote…
If you implement error conversion like I said below, you can just use ? instead of map_err or use into()
SendError does not implement Deserialize so I changed to from
crates/starknet_state_sync/src/runner/mod.rs
line 74 at r2 (raw file):
Previously, ShahakShama wrote…
use .boxed() instead
Done.
crates/starknet_state_sync_types/src/errors.rs
line 14 at r2 (raw file):
Previously, ShahakShama wrote…
Read the comment above on the StorageError. The reason we did not use
#[error(transparent)]
and used the direct error in StorageError is because StorageError does not derive stuffIf your error type also doesn't derive these, copy the comment and change the type to string and implement the conversion manually
If it does, just contain the error and the#[error(transparent)]
will implement the From by itselfPlease note that in a different comment in the PR I wrote about changing the error here
Done.
f87d8e8
to
365db40
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 6 files at r1, 5 of 5 files at r6, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @AlonLStarkWare)
crates/starknet_state_sync_types/src/errors.rs
line 14 at r2 (raw file):
Previously, AlonLStarkWare (Alon-Lukatch-Starkware) wrote…
Done.
Copy the comment
b30ae06
to
bccdf63
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 9 files reviewed, 1 unresolved discussion (waiting on @ShahakShama)
crates/starknet_state_sync_types/src/errors.rs
line 14 at r2 (raw file):
Previously, ShahakShama wrote…
Copy the comment
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 4 of 5 files at r7, 5 of 5 files at r9, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AlonLStarkWare)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @AlonLStarkWare)
bccdf63
to
0ed3534
Compare
0ed3534
to
92a266c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: 4 of 9 files reviewed, 3 unresolved discussions (waiting on @AlonLStarkWare and @ShahakShama)
crates/starknet_state_sync/src/runner/mod.rs
line 46 at r12 (raw file):
pub fn new( config: StateSyncConfig, new_block_receiver: Receiver<(BlockNumber, SyncBlock)>,
Suggestion:
internal
crates/starknet_state_sync/src/runner/mod.rs
line 75 at r12 (raw file):
storage_writer, p2p_sync_client_channels, new_block_receiver.boxed(),
Suggestion:
internal
crates/starknet_state_sync/src/lib.rs
line 34 at r12 (raw file):
pub struct StateSync { storage_reader: StorageReader, new_block_sender: Sender<(BlockNumber, SyncBlock)>,
Suggestion:
internal
No description provided.