-
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(batcher): add validate flow to proposal manager #1951
feat(batcher): add validate flow to proposal manager #1951
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1951 +/- ##
==========================================
- Coverage 40.10% 5.02% -35.09%
==========================================
Files 26 140 +114
Lines 1895 16808 +14913
Branches 1895 16808 +14913
==========================================
+ Hits 760 844 +84
- Misses 1100 15896 +14796
- Partials 35 68 +33 ☔ View full report in Codecov by Sentry. |
3dacb2e
to
f9fdf7c
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 3 files at r1, all commit messages.
Reviewable status: 1 of 3 files reviewed, 3 unresolved discussions (waiting on @Yael-Starkware and @yair-starkware)
crates/batcher/src/proposal_manager.rs
line 88 at r2 (raw file):
) -> Result<(), BuildProposalError>; // TODO delete allow dead code once the batcher uses this code.
Suggestion:
// TODO: delete allow dead code once the batcher uses this code.
crates/batcher/src/proposal_manager.rs
line 96 at r2 (raw file):
deadline: tokio::time::Instant, tx_receiver: tokio::sync::mpsc::Receiver<Transaction>, ) -> Result<(), BuildProposalError>;
If we want to use the same error we should change it's name.
Suggestion:
ProposalError
crates/batcher/src/proposal_manager.rs
line 200 at r2 (raw file):
)?; self.spawn_build_block_task(proposal_id, block_builder).await?;
Extracting into a function would be a great preliminary PR :)
f9fdf7c
to
687d0d4
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 3 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @yair-starkware)
crates/batcher/src/proposal_manager.rs
line 96 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
If we want to use the same error we should change it's name.
I think ProposalError is too general since we have GetProposalResultError and StartHeightError.
changed to GenerateProposalError, which is not perfect because it is similar to Build.
I think the the problem with the terminology comes from the api, we have build or validate proposal, while it should have been propose and validate. And then we could have used the word build as describing both.
wdyt?
btw , opened a separate PR for this name change.
crates/batcher/src/proposal_manager.rs
line 200 at r2 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Extracting into a function would be a great preliminary PR :)
Done.
crates/batcher/src/proposal_manager.rs
line 88 at r2 (raw file):
) -> Result<(), BuildProposalError>; // TODO delete allow dead code once the batcher uses this code.
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 3 of 3 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yael-Starkware and @yair-starkware)
crates/batcher/src/proposal_manager_test.rs
line 233 at r3 (raw file):
// Build and validate multiple proposal consecutively (awaiting on them to // make sure they finished successfully). build_proposal_and_await_completion(&mut proposal_manager, ProposalId(0)).await;
Maybe interleave them?
dd63481
to
1ff2b0f
Compare
687d0d4
to
00b5e9b
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 3 files reviewed, all discussions resolved (waiting on @alonh5 and @yair-starkware)
crates/batcher/src/proposal_manager_test.rs
line 233 at r3 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Maybe interleave them?
done, unfortunately lines are too long now to see it aligned nicely together.
Do you think it's worth shortening names for this?
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 r3, 3 of 3 files at r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Yael-Starkware)
crates/batcher/src/proposal_manager_test.rs
line 202 at r4 (raw file):
#[rstest] #[tokio::test] async fn validate_proposal_fails_without_start_height(
Consider using a test case in a single test
crates/batcher/src/proposal_manager_test.rs
line 230 at r4 (raw file):
#[rstest] #[tokio::test] async fn validate_proposal_success(
same
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 r4, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Yael-Starkware)
crates/batcher/src/proposal_manager_test.rs
line 233 at r3 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
done, unfortunately lines are too long now to see it aligned nicely together.
Do you think it's worth shortening names for this?
Maybe remove the _and_await_completion
suffix to the function names. I don't think it's important to the test reader in this case.
2733f1b
to
b065f32
Compare
00b5e9b
to
233986f
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 6 of 6 files at r5, all commit messages.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @Yael-Starkware)
crates/starknet_batcher/src/proposal_manager_test.rs
line 119 at r5 (raw file):
} async fn build_proposal_and_await_completion(
Remove these?
Code quote:
_and_await_completion
crates/starknet_batcher/src/proposal_manager_test.rs
line 39 at r5 (raw file):
tokio::sync::mpsc::unbounded_channel() }
Restore blank line.
39c2415
to
4d57d5f
Compare
233986f
to
d50b9fe
Compare
4d57d5f
to
8637ec6
Compare
d50b9fe
to
d5644b1
Compare
d5644b1
to
f59caff
Compare
8637ec6
to
4e8f690
Compare
48fbbdf
to
1707470
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: 3 of 6 files reviewed, all discussions resolved (waiting on @alonh5 and @yair-starkware)
crates/starknet_batcher/src/proposal_manager_test.rs
line 39 at r5 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Restore blank line.
done.
crates/starknet_batcher/src/proposal_manager_test.rs
line 119 at r5 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Remove these?
done.
crates/batcher/src/proposal_manager_test.rs
line 233 at r3 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Maybe remove the
_and_await_completion
suffix to the function names. I don't think it's important to the test reader in this case.
done.
crates/batcher/src/proposal_manager_test.rs
line 202 at r4 (raw file):
Previously, yair-starkware (Yair) wrote…
Consider using a test case in a single test
couldn't find a simple solution
crates/batcher/src/proposal_manager_test.rs
line 230 at r4 (raw file):
Previously, yair-starkware (Yair) wrote…
same
same
1707470
to
53eeb10
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 2 of 3 files at r8, 1 of 1 files at r9, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)
No description provided.