-
Notifications
You must be signed in to change notification settings - Fork 626
perf(relayer): submission strategy fix logs, use blocktime for submission strategy and log metrics. #1663
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
perf(relayer): submission strategy fix logs, use blocktime for submission strategy and log metrics. #1663
Conversation
WalkthroughThis update modifies the L2 relayer's batch processing logic to use the timestamp of the first block in the batch's starting chunk instead of the batch creation time for age calculations, fee checks, and metrics. It also adds new Prometheus metrics for blob prices, commit latency, and backlog counts, adjusts SQL trace logging verbosity, and updates the version string. Changes
Sequence Diagram(s)sequenceDiagram
participant Relayer
participant Metrics
participant Batch
participant Chunk
Relayer->>Batch: Fetch oldest batch
Batch->>Chunk: Get first chunk's StartBlockTime
Relayer->>Relayer: Use StartBlockTime for age, fee, and timeout checks
Relayer->>Metrics: Update backlog count, blob prices, commit latency
Relayer->>Batch: Submit batch if conditions met
Possibly related PRs
Suggested reviewers
Poem
Note ⚡️ AI Code Reviews for VS Code, Cursor, WindsurfCodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback. Note ⚡️ Faster reviews with cachingCodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 30th. To opt out, configure 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
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.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
common/database/db.go
(1 hunks)common/version/version.go
(1 hunks)rollup/internal/controller/relayer/l2_relayer.go
(6 hunks)rollup/internal/controller/relayer/l2_relayer_metrics.go
(1 hunks)
🔇 Additional comments (9)
common/database/db.go (1)
44-44
: Improved log level categorizationChanged the SQL trace logs from Debug to Trace level, providing better categorization of log verbosity.
common/version/version.go (1)
8-8
: Version bump for the codebaseIncremented version tag from v4.5.15 to v4.5.16 to reflect the changes in this PR.
rollup/internal/controller/relayer/l2_relayer.go (7)
329-330
: Updated backlog count metricsAdded metric update to track backlog counts immediately after retrieving the value, improving monitoring capabilities.
338-343
: Use blocktime instead of batch creation timeChanged to use the timestamp of the first block in the batch's starting chunk instead of the batch creation time, which aligns with how bundle timeouts are handled.
346-346
: Updated timeout check to use block timestampModified the timeout check to use the block timestamp instead of batch creation time, providing consistency with the rest of the system.
357-357
: Updated fee check to use block timestamp and metricsModified the function call to pass the block timestamp and metrics object to the fee check function.
443-443
: Updated log message to use block timestampChanged the log message to reference the block timestamp instead of batch creation time for clarity and consistency.
508-508
: Added commit latency metricSet the commit latency metric based on the time elapsed since the oldest block timestamp, enhancing observability.
1091-1110
: Updated fee check function to update metricsModified the function signature to accept a metrics parameter and added code to update the current and target blob price metrics, enhancing monitoring capabilities.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #1663 +/- ##
===========================================
- Coverage 41.00% 40.92% -0.08%
===========================================
Files 225 225
Lines 18031 18061 +30
===========================================
- Hits 7393 7392 -1
- Misses 9913 9948 +35
+ Partials 725 721 -4
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:
|
Co-authored-by: Jonas Theis <4181434+jonastheis@users.noreply.github.com>
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.
Recommend adjusting the pr title to align with other prs.
Purpose or design rationale of this PR
PR title
Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:
Deployment tag versioning
Has
tag
incommon/version.go
been updated or have you addedbump-version
label to this PR?Breaking change label
Does this PR have the
breaking-change
label?Summary by CodeRabbit
New Features
Improvements
Other