-
Notifications
You must be signed in to change notification settings - Fork 29
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_state_sync): boxing SyncBlock in requests and responses #3263
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.
Reviewable status: 0 of 3 files reviewed, 1 unresolved discussion (waiting on @lev-starkware)
crates/starknet_state_sync_types/src/communication.rs
line 119 at r1 (raw file):
#[allow(clippy::large_enum_variant)] pub enum StateSyncResponse { GetBlock(StateSyncResult<Box<Option<SyncBlock>>>),
@ShahakShama Box<Option<...>>
or Option<Box<...>>
?
Code quote:
Box<Option<SyncBlock>>>
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 3 of 3 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @lev-starkware)
crates/starknet_state_sync_types/src/communication.rs
line 119 at r1 (raw file):
Previously, Itay-Tsabary-Starkware wrote…
@ShahakShama
Box<Option<...>>
orOption<Box<...>>
?
IMO Option<Box<...>
crates/starknet_state_sync/src/test.rs
line 63 at r1 (raw file):
panic!("Expected StateSyncResponse::GetBlock::Ok(Box(Some(_))), but got {:?}", response); }; let Some(block) = *boxed_sync_block else {
Unite this with the let
above
crates/starknet_state_sync/src/lib.rs
line 50 at r1 (raw file):
StateSyncRequest::GetBlock(block_number) => { let result: StateSyncResult<Box<Option<SyncBlock>>> = match self.get_block(block_number) {
Use map instead
a70e365
to
42d4dce
Compare
269ca56
to
026e3c3
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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @lev-starkware)
crates/starknet_state_sync_types/src/communication.rs
line 119 at r1 (raw file):
Previously, ShahakShama wrote…
IMO Option<Box<...>
After talking with lev that is impossible so we should stay with Box<Option<
026e3c3
to
fa1313b
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: 1 of 3 files reviewed, 2 unresolved discussions (waiting on @Itay-Tsabary-Starkware and @ShahakShama)
crates/starknet_state_sync/src/lib.rs
line 50 at r1 (raw file):
Previously, ShahakShama wrote…
Use map instead
Done.
crates/starknet_state_sync_types/src/communication.rs
line 119 at r1 (raw file):
Previously, ShahakShama wrote…
After talking with lev that is impossible so we should stay with Box<Option<
Macro, currently, can deal with Result<Box<Response>, Err>
but not with Result<Option<Box<PartialResponse>>, Err>
.
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 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Itay-Tsabary-Starkware)
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 3 files at r1, 1 of 2 files at r2, 1 of 1 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @lev-starkware)
commit-id:fba480c4
fa1313b
to
ec56e31
Compare
No description provided.