-
Notifications
You must be signed in to change notification settings - Fork 23
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
base: arni/batcher/block_builder_factory/set_gas_prices
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## arni/batcher/block_builder_factory/set_gas_prices #2342 +/- ##
=====================================================================================
+ Coverage 17.79% 17.84% +0.04%
=====================================================================================
Files 119 119
Lines 13878 13886 +8
Branches 13878 13886 +8
=====================================================================================
+ Hits 2470 2478 +8
Misses 11137 11137
Partials 271 271 ☔ 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.
No description provided.