-
Notifications
You must be signed in to change notification settings - Fork 245
chore: adding syncing tracing #2981
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 @chatton's task in 1m 41s —— View job Code Review: Adding Syncing TracingI've completed a comprehensive review of this PR. Overall, the implementation is excellent - it follows established patterns in the codebase, uses proper decorator design, and has thorough test coverage. Here are my findings: ✅ Strengths1. Architecture & Design
2. Context Propagation
3. Test Coverage
4. Observability
🔍 Issues & RecommendationsIssue 1: Inconsistent Span Naming (Medium Priority)Location: block/internal/syncing/tracing.go:33 The span name // Current:
ctx, span := t.tracer.Start(ctx, "BlockSyncer.SyncBlock",
// Recommended:
ctx, span := t.tracer.Start(ctx, "BlockSyncer.TrySyncNextBlock",Why it matters:
Alternative consideration: If "SyncBlock" is intentionally shorter for readability in trace UIs, document this decision in a comment. Issue 2: Missing Context Handling in Error Path (Low Priority)Location: block/internal/syncing/tracing.go:63 When state, err := t.inner.ApplyBlock(ctx, header, data, currentState)
if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
return types.State{}, err // ← Should return 'state', not empty State
}Why it matters:
However: Looking at the actual Issue 3: Nil Pointer Risk in Attribute Setting (Low Priority)Location: block/internal/syncing/tracing.go:67 After an error in if err != nil {
span.RecordError(err)
span.SetStatus(codes.Error, err.Error())
return types.State{}, err
}
span.SetAttributes(
attribute.String("state_root", hex.EncodeToString(state.AppHash)),
)If Issue 4: Method Signature Inconsistency (Observation)Location: block/internal/syncing/syncer.go:578, 667, 722, 825 The PR makes internal methods (
Not a bug, just an architectural observation. The underscore 📊 Code Quality AssessmentGo Best Practices: ✅ Excellent
Error Handling: ✅ Good
Security: ✅ No Issues
Performance: ✅ Excellent
Testing: ✅ Excellent
Documentation:
|
Summary of ChangesHello @chatton, 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 block synchronization mechanism by integrating OpenTelemetry tracing. It achieves this through a refactoring that introduces a Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. 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
This pull request introduces OpenTelemetry tracing to the block synchronization process using a decorator pattern. The changes are well-structured, defining a BlockSyncer interface, modifying the Syncer to use this interface, and implementing a tracedBlockSyncer decorator. This approach effectively adds tracing as a cross-cutting concern without altering the core synchronization logic. The accompanying tests for the tracing decorator are comprehensive and ensure proper span creation, attribute setting, and error handling.
| } | ||
|
|
||
| func (t *tracedBlockSyncer) TrySyncNextBlock(ctx context.Context, event *common.DAHeightEvent) error { | ||
| ctx, span := t.tracer.Start(ctx, "BlockSyncer.SyncBlock", |
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.
Consider making the span name more explicit to match the method name, for example, BlockSyncer.TrySyncNextBlock. While SyncBlock is concise, TrySyncNextBlock would provide a clearer indication of the specific operation being traced, especially when reviewing traces.
| ctx, span := t.tracer.Start(ctx, "BlockSyncer.SyncBlock", | |
| ctx, span := t.tracer.Start(ctx, "BlockSyncer.TrySyncNextBlock", |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2981 +/- ##
==========================================
+ Coverage 58.48% 58.72% +0.24%
==========================================
Files 100 101 +1
Lines 9619 9685 +66
==========================================
+ Hits 5626 5688 +62
- Misses 3382 3385 +3
- Partials 611 612 +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:
|
* main: chore: adding syncing tracing (#2981) feat(tracing): adding block production tracing (#2980) feat(tracing): Add Store, P2P and Config tracing (#2972) chore: fix upgrade test (#2979) build(deps): Bump github.com/ethereum/go-ethereum from 1.16.7 to 1.16.8 in /execution/evm/test in the go_modules group across 1 directory (#2974) feat(tracing): adding tracing to DA client (#2968) chore: create onboarding skill (#2971) test: add e2e tests for force inclusion (part 2) (#2970) feat(tracing): adding eth client tracing (#2960) test: add e2e tests for force inclusion (#2964) build(deps): Bump the all-go group across 4 directories with 10 updates (#2969)
Overview
Follow up which adds tracing to the block syncer