-
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
fix(batcher): treat deadline as error in validate flow #2148
fix(batcher): treat deadline as error in validate flow #2148
Conversation
834e59b
to
ede1319
Compare
39d387a
to
13bf505
Compare
ede1319
to
cbb54e6
Compare
13bf505
to
ba48389
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2148 +/- ##
==========================================
- Coverage 40.10% 5.26% -34.85%
==========================================
Files 26 145 +119
Lines 1895 17068 +15173
Branches 1895 17068 +15173
==========================================
+ Hits 760 898 +138
- Misses 1100 16094 +14994
- Partials 35 76 +41 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
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 @alonh5 and @yair-starkware)
crates/starknet_batcher/src/block_builder.rs
line 52 at r1 (raw file):
StreamTransactionsError(#[from] tokio::sync::mpsc::error::SendError<Transaction>), #[error("Build block with fail_on_err mode, failed on error {}.", _0)] FailOnError(String),
do you think an enum would be better than a string here?
#[derive(Debug)]
pub enum FailCause {
DeadlineReached,
BlockFull,
TransactionError(err),
}
Code quote:
FailOnError(String)
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, 1 unresolved discussion (waiting on @Yael-Starkware and @yair-starkware)
crates/starknet_batcher/src/block_builder.rs
line 52 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
do you think an enum would be better than a string here?
#[derive(Debug)]
pub enum FailCause {
DeadlineReached,
BlockFull,
TransactionError(err),
}
Both are fine, but I think an enum would be better.
ba48389
to
0ef64e6
Compare
cbb54e6
to
b4a9025
Compare
afc5b93
to
e3e8aac
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, 1 unresolved discussion (waiting on @alonh5 and @yair-starkware)
crates/starknet_batcher/src/block_builder.rs
line 52 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Both are fine, but I think an enum would be better.
Done.
e3e8aac
to
d3224ef
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 r2, 1 of 1 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @Yael-Starkware and @yair-starkware)
crates/starknet_batcher/src/block_builder.rs
line 71 at r3 (raw file):
match self { FailOnErrorCause::BlockFull => write!(f, "Block is full"), FailOnErrorCause::DeadlineReached => write!(f, "Deadline was reached"),
Suggestion:
has been reached
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 r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Yael-Starkware)
a discussion (no related file):
Can we use test cases in the tests that check fail_on_error
crates/starknet_batcher/src/block_builder_test.rs
line 154 at r3 (raw file):
fn mock_transaction_executor_with_delay( input_txs: Vec<Transaction>,
Not blocking, but IIUC this change is not necessary (and it is advised to use slices in arguments)
Code quote:
Vec<T
crates/starknet_batcher/src/block_builder.rs
line 52 at r3 (raw file):
#[error(transparent)] StreamTransactionsError(#[from] tokio::sync::mpsc::error::SendError<Transaction>), #[error("Build block with fail_on_err mode, failed on error {0}.")]
activated
Code quote:
mode
crates/starknet_batcher/src/block_builder.rs
line 61 at r3 (raw file):
#[derive(Debug)] pub enum FailOnErrorCause {
You can derive Error
and use error(transaparent)
in BlockBuilderError
Code quote:
pub enum FailOnErrorCause {
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 r2, 1 of 1 files at r3.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @Yael-Starkware)
d3224ef
to
fa0b49a
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, 1 unresolved discussion (waiting on @alonh5 and @yair-starkware)
a discussion (no related file):
Previously, yair-starkware (Yair) wrote…
Can we use test cases in the tests that check
fail_on_error
done.
crates/starknet_batcher/src/block_builder.rs
line 52 at r3 (raw file):
Previously, yair-starkware (Yair) wrote…
activated
done
crates/starknet_batcher/src/block_builder.rs
line 61 at r3 (raw file):
Previously, yair-starkware (Yair) wrote…
You can derive
Error
and useerror(transaparent)
inBlockBuilderError
Done.
crates/starknet_batcher/src/block_builder_test.rs
line 154 at r3 (raw file):
Previously, yair-starkware (Yair) wrote…
Not blocking, but IIUC this change is not necessary (and it is advised to use slices in arguments)
done.
crates/starknet_batcher/src/block_builder.rs
line 71 at r3 (raw file):
match self { FailOnErrorCause::BlockFull => write!(f, "Block is full"), FailOnErrorCause::DeadlineReached => write!(f, "Deadline was reached"),
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 2 of 2 files at r4, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @yair-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 2 files at r4, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @Yael-Starkware)
No description provided.