| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
📝 Walkthrough
WalkthroughConstructors now seed rollup Prometheus gauges from persisted database or resumed watcher state. A committed-batch lookup supports relayer initialization, and the internal version tag advances to v4.7.16. ChangesStartup metric initialization
Version update
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested labels: bump-version Suggested reviewers: georgehao, johnsonjie 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
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. ❤️ ShareComment @coderabbitai help to get the list of available commands. |
Sorry, something went wrong.
There was a problem hiding this comment.
rollup/internal/controller/watcher/chunk_proposer.go (1)🤖 Prompt for all review comments with AI agents135-148: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value
Ignore gorm.ErrRecordNotFound to prevent startup warnings on a fresh database.
Like BatchProposer.initializeMetrics, consider explicitly ignoring gorm.ErrRecordNotFound. Without this check, starting the service with an empty database will trigger a warning log since GetLatestChunk returns ErrRecordNotFound when no chunks exist yet.
♻️ Proposed refactorfunc (p *ChunkProposer) initializeMetrics(ctx context.Context) { latestChunk, err := p.chunkOrm.GetLatestChunk(ctx) if err != nil { + if errors.Is(err, gorm.ErrRecordNotFound) { + return // no chunks proposed yet, nothing to seed + } log.Warn("failed to initialize chunk propose block height metric", "err", err) return }Ensure the "errors" and "gorm.io/gorm" packages are imported at the top of the file if you apply this fix.
🤖 Prompt for AI AgentsVerify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@rollup/internal/controller/watcher/chunk_proposer.go` around lines 135 - 148, Update ChunkProposer.initializeMetrics to treat gorm.ErrRecordNotFound from GetLatestChunk as an expected empty-database condition: detect it with errors.Is and return without logging, while preserving the warning for other errors and the metric update for an existing latestChunk. Add the required errors and gorm imports.
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. Nitpick comments: In `@rollup/internal/controller/watcher/chunk_proposer.go`: - Around line 135-148: Update ChunkProposer.initializeMetrics to treat gorm.ErrRecordNotFound from GetLatestChunk as an expected empty-database condition: detect it with errors.Is and return without logging, while preserving the warning for other errors and the metric update for an existing latestChunk. Add the required errors and gorm imports.
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 2cda3dd4-02e1-4b88-9350-e9276d4756f9
📥 CommitsReviewing files that changed from the base of the PR and between 79c1f8c and dee9965.
📒 Files selected for processing (7)
Sorry, something went wrong.
Codecov Report❌ Patch coverage is 44.00000% with 42 lines in your changes missing coverage. Please review. @@ Coverage Diff @@
## develop #1812 +/- ##
===========================================
+ Coverage 35.42% 35.44% +0.02%
===========================================
Files 262 262
Lines 22523 22596 +73
===========================================
+ Hits 7979 8010 +31
- Misses 13712 13748 +36
- Partials 832 838 +6
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Several Prometheus block-height gauges (batch/chunk propose height, L2 relayer commit height, L1/L2 watcher processed height) reset to 0 on restart, so lag alerts fired until the next event repopulated them. This seeds each gauge from the DB at startup so it reflects the real height immediately.
An orthogonal fix is to add a > 0 condition to the alert rules. But initializing the metrics here seems more correct.
Summary by CodeRabbit
New Features
Bug Fixes