-
Notifications
You must be signed in to change notification settings - Fork 84
feat(l2): enhance monitor performance #3757
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
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.
Pull Request Overview
This PR enhances monitor performance by optimizing how batches are processed and refreshed. The changes focus on reducing redundant database queries and improving startup time when restarting a sequencer with monitor enabled after it has been running for an extended period.
- Optimizes batch refresh logic to only fetch incomplete batches instead of all batches
- Limits the number of batches fetched by introducing a 50-batch window from the latest batch
- Refactors batch processing into smaller, more focused functions for better maintainability
Comments suppressed due to low confidence (1)
crates/l2/monitor/widget/batches.rs:146
- This is another instance where a type alias for the batch tuple would improve maintainability and reduce code duplication of clippy suppressions.
#[expect(clippy::type_complexity)]
Lines of code reportTotal lines added: Detailed view
|
Motivation
If a sequencer runs for a long time, it stops, and we run it again activating the monitor, it takes a long time to start and is slow.
Description
Makes the monitor load and work faster by simplifying the batches processing.
How to Test
make restart
incrates/l2
).make init-prover
incrates/l2
.--monitor
to theinit-l2-no-metrics
target incrates/l2/Makefile
.make init-l2-no-metrics