Skip to content

refactor: display block source in sync log#3193

Merged
tac0turtle merged 3 commits intomainfrom
julien/display-source
Mar 24, 2026
Merged

refactor: display block source in sync log#3193
tac0turtle merged 3 commits intomainfrom
julien/display-source

Conversation

@julienrbrt
Copy link
Member

@julienrbrt julienrbrt commented Mar 24, 2026

Overview

Display log source in sync log. Not per se necessary but good to have.

Summary by CodeRabbit

  • Improvements

    • Enhanced block synchronization logging to display event source information alongside height metrics.
  • Documentation

    • Updated changelog with recent changes and improved documentation formatting.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 16b8ae24-c3d7-471f-bbc8-8b40bbe005c5

📥 Commits

Reviewing files that changed from the base of the PR and between ad76f1c and bd8d849.

📒 Files selected for processing (2)
  • CHANGELOG.md
  • block/internal/syncing/syncer.go

📝 Walkthrough

Walkthrough

Two files were updated to track block source information in sync operations. CHANGELOG.md added a new release entry documenting the feature and adjusted formatting for existing documentation. The syncer.go logging was enhanced to emit the DA/P2P event source alongside block height.

Changes

Cohort / File(s) Summary
Documentation
CHANGELOG.md
Added "Display block source in sync log" entry for PR #3193 and adjusted Markdown indentation for Node pruning support section to align with list structure.
Logging Enhancement
block/internal/syncing/syncer.go
Updated TrySyncNextBlock to log source=string(event.Source) alongside height in the "syncing block" log message.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A hop through the logs, a source now revealed,
The block's origin marked, no secrets concealed,
From DA to P2P, the journey is clear,
Sync information blooms—transparency's here! 📋✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description provides minimal context; it only states the change is 'not per se necessary but good to have' without explaining the rationale, benefits, or technical details. Expand the Overview section to explain the purpose and benefits of displaying block source in the sync log, and provide context for why this improvement is valuable.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and clearly describes the main change: adding source display to sync logging in the block synchronization code.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch julien/display-source

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@claude
Copy link
Contributor

claude bot commented Mar 24, 2026

Claude finished @julienrbrt's task in 41s —— View job


Code Review

  • Gather context
  • Review changed files
  • Post final feedback

This is a small, clean PR. Here's my review:

block/internal/syncing/syncer.go

The change on line 681 adds event.Source to the log message:

s.logger.Info().Uint64("height", nextHeight).Str("source", string(event.Source)).Msg("syncing block")

Assessment: LGTM. The EventSource type is already a well-defined string type with SourceDA = "DA" and SourceP2P = "P2P" constants, so the string(event.Source) cast is correct and safe. The log field key "source" is clear and consistent with typical observability conventions.

One minor observation: the Source field on DAHeightEvent is not always explicitly set — for example, in syncer_benchmark_test.go (line 147) the Source field is left as the zero value (empty string ""). This means in tests (and potentially in other code paths that construct DAHeightEvent without setting Source), the log would show source="". This isn't a bug introduced by this PR — the zero-value issue pre-exists — but it's worth being aware of for observability completeness. If this matters, a follow-up could add a validation/default in PipeEvent or the constructors.

CHANGELOG.md

The entry is correctly placed under the unreleased section. The whitespace/indentation fix on the pruning bullet points is a nice cleanup.


Summary: The change is minimal, correct, and improves observability with no downsides. No blocking issues.

@julienrbrt julienrbrt requested a review from tac0turtle March 24, 2026 10:50
@github-actions
Copy link
Contributor

github-actions bot commented Mar 24, 2026

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed✅ passedMar 24, 2026, 10:52 AM

@tac0turtle tac0turtle merged commit 1023109 into main Mar 24, 2026
16 of 20 checks passed
@tac0turtle tac0turtle deleted the julien/display-source branch March 24, 2026 10:56
@codecov
Copy link

codecov bot commented Mar 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 61.08%. Comparing base (ad76f1c) to head (bd8d849).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3193      +/-   ##
==========================================
- Coverage   61.14%   61.08%   -0.06%     
==========================================
  Files         117      117              
  Lines       12082    12082              
==========================================
- Hits         7387     7380       -7     
- Misses       3869     3874       +5     
- Partials      826      828       +2     
Flag Coverage Δ
combined 61.08% <100.00%> (-0.06%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

alpe added a commit that referenced this pull request Mar 25, 2026
* main:
  refactor(tools/da-debug): improve da debug (#3199)
  fix(pkg/da): fix json rpc types (#3200)
  chore: demote warn log as debug (#3198)
  build(deps): Bump the all-go group across 1 directory with 2 updates (#3191)
  refactor: display block source in sync log (#3193)
  chore: remove cache analyzer (#3192)
  feat: add TestStatePressure benchmark for state trie stress test (#3188)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants