-
Notifications
You must be signed in to change notification settings - Fork 246
feat(sequencers/based): add based batch time #2911
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
Conversation
|
The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).
|
|
Claude finished @julienrbrt's task in 2m 36s —— View job Comprehensive Code ReviewI've completed a thorough review of the based batch time implementation. Here are my findings: SummaryThis PR successfully integrates DA layer block timestamps into the based sequencer's batching process, replacing placeholder timestamps with actual DA block times. The implementation is well-designed with strong test coverage (91.66%). The timestamp calculation strategy using millisecond offsets ensures deterministic, strictly increasing block times when DA epochs span multiple blocks. Code Quality & Architecture ⭐⭐⭐⭐½Strengths:
Observations:
Minor Suggestion:
Error Handling & Resilience ⭐⭐⭐⭐⭐Strengths:
Specific observations:
Security ⭐⭐⭐⭐⭐Strengths:
Observations:
No security concerns identified. Performance & Resource Efficiency ⭐⭐⭐⭐Strengths:
Observations:
Minor optimization opportunity:
Testing & Reliability ⭐⭐⭐⭐⭐Strengths:
Specific praise:
Coverage gap: Documentation & Developer Experience ⭐⭐⭐⭐Strengths:
Areas for enhancement:
Specific Code Review Comments
|
Summary of ChangesHello @julienrbrt, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
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.
Code Review
The pull request introduces changes to incorporate the Data Availability (DA) block timestamp into the batching process for the BasedSequencer. This addresses a previous TODO to use the DA block timestamp for determinism. The ForcedInclusionEvent struct now includes a Timestamp field, which is populated during the retrieval of forced inclusion blobs. The BasedSequencer's fetchNextDAEpoch method has been updated to return this timestamp, which is then used in the GetNextBatchResponse. New test cases have been added to client_test.go to cover batch retrieval scenarios, and existing tests in forced_inclusion_retriever_test.go have been updated to assert on the new timestamp field. The changes are well-implemented and improve the determinism of the sequencer.
sequencers/based/sequencer.go
Outdated
| return &coresequencer.GetNextBatchResponse{ | ||
| Batch: batch, | ||
| Timestamp: time.Time{}, // TODO(@julienrbrt): we need to use DA block timestamp for determinism | ||
| Timestamp: t, |
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.
We currently want strictly increasing time and not the same time. So maybe we can have a jitter based on the tx index (so if it doesn't fit all in the same block the time is the same for everyone)
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.
What do you think @alpe?
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.
The block time should be incremental and deterministic, indeed. Either some logic based on the tx index or a new block counter per epoch comes to my mind. Not sure if it makes sense to use block time here as well. In any case, the time of the block must not overlap with the the next epoch. I hope this helps
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.
Yep, did that already. Have you seen the last commit?
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2911 +/- ##
==========================================
+ Coverage 65.73% 65.88% +0.14%
==========================================
Files 87 87
Lines 7985 7990 +5
==========================================
+ Hits 5249 5264 +15
+ Misses 2162 2153 -9
+ Partials 574 573 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5f2b4af to
e7cd0af
Compare
sequencers/based/sequencer.go
Outdated
| // If we have no cached transactions or we've consumed all from the current DA block, | ||
| // fetch the next DA epoch | ||
| daHeight := s.GetDAHeight() | ||
| t := time.Time{} |
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.
personal preference: prefer var t time.Time for an empty time to make it more readable
sequencers/based/sequencer.go
Outdated
| return &coresequencer.GetNextBatchResponse{ | ||
| Batch: batch, | ||
| Timestamp: time.Time{}, // TODO(@julienrbrt): we need to use DA block timestamp for determinism | ||
| Timestamp: t, |
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.
The block time should be incremental and deterministic, indeed. Either some logic based on the tx index or a new block counter per epoch comes to my mind. Not sure if it makes sense to use block time here as well. In any case, the time of the block must not overlap with the the next epoch. I hope this helps
* main: chore: execute goimports to format the code (#2924) refactor(block)!: remove GetLastState from components (#2923) feat(syncing): add grace period for missing force txs inclusion (#2915) chore: minor improvement for docs (#2918) feat: DA Client remove interface part 2, add client for celestia blob api (#2909) chore: update rust deps (#2917) feat(sequencers/based): add based batch time (#2911) build(deps): Bump golangci/golangci-lint-action from 9.1.0 to 9.2.0 (#2914) refactor(sequencers): implement batch position persistance (#2908)
Overview
ref: #2906
Add based block time based on epoch da time.
DO NOT MERGE YET, based on #2908 to avoid conflicts later.