-
Notifications
You must be signed in to change notification settings - Fork 25
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_batcher): set block timestamp in build block input #2342
chore(starknet_batcher): set block timestamp in build block input #2342
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2342 +/- ##
===========================================
- Coverage 40.10% 17.98% -22.13%
===========================================
Files 26 119 +93
Lines 1895 13954 +12059
Branches 1895 13954 +12059
===========================================
+ Hits 760 2509 +1749
- Misses 1100 11174 +10074
- Partials 35 271 +236 ☔ View full report in Codecov by Sentry. |
6541e23
to
6158a58
Compare
a21cac0
to
3bb7ed9
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 2 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @ArniStarkware)
crates/starknet_batcher/src/block_builder.rs
line 321 at r1 (raw file):
.try_into() .map_err(BlockBuilderError::BadTimestamp)?, ),
why did you change it?
I think the previous version was easier to read.
This code will be deleted anyway, right?
Code quote:
block_timestamp: BlockTimestamp(
chrono::Utc::now()
.timestamp()
.try_into()
.map_err(BlockBuilderError::BadTimestamp)?,
),
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs
line 163 at r1 (raw file):
gas_prices: TEMPORARY_GAS_PRICES, block_timestamp: BlockTimestamp( now.timestamp().try_into().expect("Failed to convert timestamp"),
same for the next change.
Suggestion:
chrono::Utc::now().timestamp().try_into().expect("Failed to convert timestamp"),
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 r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @ArniStarkware)
crates/starknet_batcher/src/block_builder.rs
line 49 at r1 (raw file):
pub enum BlockBuilderError { #[error(transparent)] BadTimestamp(#[from] std::num::TryFromIntError),
Why this change?
6158a58
to
37ca509
Compare
Previously, Yael-Starkware (YaelD) wrote…
So, Should I have two invocations of In my opinion, it is bad - as these will be slightly different from each other - based on how long these lines take to execute. |
3bb7ed9
to
c65933e
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.
Dismissed @alonh5 from a discussion.
Reviewable status: 0 of 2 files reviewed, 2 unresolved discussions (waiting on @alonh5 and @Yael-Starkware)
crates/starknet_batcher/src/block_builder.rs
line 49 at r1 (raw file):
Previously, alonh5 (Alon Haramati) wrote…
Why this change?
As @Yael-Starkware pointed out - this will be deleted by the next PR anyway.
Reverted.
crates/starknet_batcher/src/block_builder.rs
line 321 at r1 (raw file):
Previously, Yael-Starkware (YaelD) wrote…
why did you change it?
I think the previous version was easier to read.This code will be deleted anyway, right?
- Yes - the code will be deleted anyway. Reverted.
- I think it is bad that a generic
TryFromIntError
is always converted to aBadTimestamp
. (Again - in theory), what happens if another conversion from integer happens in the scope of Block-build, but has nothing to do with timestamp?
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 r2, all commit messages.
Reviewable status: all files reviewed, 2 unresolved discussions (waiting on @Yael-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 all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @ArniStarkware)
crates/sequencing/papyrus_consensus_orchestrator/src/sequencer_consensus_context.rs
line 163 at r1 (raw file):
Previously, ArniStarkware (Arnon Hod) wrote…
So, Should I have two invocations of
chorono::Utc::now()
five lines apart? Once fordeadline
and once forblock_timestamp
.In my opinion, it is bad - as these will be slightly different from each other - based on how long these lines take to execute.
oh sorry I missed the deadline usage. retracting.
37ca509
to
3564bee
Compare
c65933e
to
5e58a58
Compare
3564bee
to
5b58ea9
Compare
5e58a58
to
83b3f3e
Compare
7b83d10
to
71bf431
Compare
83b3f3e
to
3d7428d
Compare
3d7428d
to
5e5126a
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 2 files at r3, all commit messages.
Reviewable status: 1 of 2 files reviewed, all discussions resolved (waiting on @alonh5)
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 r3.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @alonh5)
No description provided.