-
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
feat(starknet_gateway): implement sync state reader get block info #2942
feat(starknet_gateway): implement sync state reader get block info #2942
Conversation
b575e4b
to
368475b
Compare
dbe2a1a
to
fd1726a
Compare
fd1726a
to
7287611
Compare
This stack of pull requests is managed by Graphite. Learn more about stacking. |
c2267ac
to
367bc61
Compare
7287611
to
04f0dbf
Compare
04f0dbf
to
8c370b3
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: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @eitanm-starkware and @noamsp-starkware)
crates/starknet_gateway/src/sync_state_reader.rs
line 53 at r4 (raw file):
}, }, use_kzg_da: matches!(block_header.l1_da_mode, L1DataAvailabilityMode::Blob),
This will compile if someone adds a variant to L1DataAvailabilityMode, and I want it to not compile in that case so that the person who added a variant will TAL at this code and decide what's right
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 7 files reviewed, 1 unresolved discussion (waiting on @eitanm-starkware and @noamsp-starkware)
crates/starknet_gateway/src/sync_state_reader.rs
line 53 at r4 (raw file):
Previously, ShahakShama wrote…
This will compile if someone adds a variant to L1DataAvailabilityMode, and I want it to not compile in that case so that the person who added a variant will TAL at this code and decide what's right
Leaving unblocking so that if you fix it and Eitan approves you can merge
8c370b3
to
505f90d
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: 0 of 7 files reviewed, 1 unresolved discussion (waiting on @eitanm-starkware and @ShahakShama)
crates/starknet_gateway/src/sync_state_reader.rs
line 53 at r4 (raw file):
Previously, ShahakShama wrote…
Leaving unblocking so that if you fix it and Eitan approves you can merge
Fixed
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 r4, 4 of 4 files at r5, all commit messages.
Reviewable status: 5 of 7 files reviewed, 1 unresolved discussion (waiting on @ShahakShama)
crates/starknet_gateway/src/sync_state_reader.rs
line 34 at r5 (raw file):
let block = block_on(self.state_sync_client.get_block(self.block_number)) .map_err(|e| StateError::StateReadError(e.to_string()))? .ok_or(StateError::StateReadError("Block not found".to_string()))?;
ok_or_else isnt eager - better practice to use it when there is a fn calculated in the brackets. leaving unblocking
Suggestion:
ok_or_else(||
505f90d
to
dc6c133
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 7 files reviewed, all discussions resolved (waiting on @eitanm-starkware and @ShahakShama)
crates/starknet_gateway/src/sync_state_reader.rs
line 34 at r5 (raw file):
Previously, eitanm-starkware wrote…
ok_or_else isnt eager - better practice to use it when there is a fn calculated in the brackets. leaving unblocking
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 1 of 1 files at r6, all commit messages.
Reviewable status: 5 of 7 files reviewed, all discussions resolved (waiting on @eitanm-starkware)
crates/starknet_gateway/src/sync_state_reader.rs
line 34 at r5 (raw file):
Previously, noamsp-starkware wrote…
Done
No. It's actually better to do ok_or in this case. ok_or_else should only be used if the calculation is either heavy or it produces panic
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: 5 of 7 files reviewed, all discussions resolved (waiting on @eitanm-starkware)
crates/starknet_gateway/src/sync_state_reader.rs
line 34 at r5 (raw file):
Previously, ShahakShama wrote…
No. It's actually better to do ok_or in this case. ok_or_else should only be used if the calculation is either heavy or it produces panic
Please revert
dc6c133
to
74ae549
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 1 of 1 files at r7, all commit messages.
Reviewable status: 5 of 7 files reviewed, all discussions resolved (waiting on @eitanm-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 2 of 6 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @noamsp-starkware)
No description provided.