-
Notifications
You must be signed in to change notification settings - Fork 134
core/tracker: handle 404 errors gracefully #4041
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 improves the inclusion checker's error handling by treating 404 responses from the beacon node as valid "block not found" scenarios rather than errors. When a block proposal is missed (no block at a slot), the beacon node returns a 404, which previously caused unnecessary retries and spurious warnings.
Key Changes:
- Added 404 status code detection using
z.ContainsField()utility in bothcheckBlockandcheckBlockAndAttsfunctions - Modified error handling to return nil for 404 responses, stopping unnecessary retries
- Added comprehensive test coverage for both 404 and non-404 error scenarios
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| core/tracker/inclusion.go | Added 404 error handling in checkBlock and checkBlockAndAtts to treat missing blocks as valid scenarios |
| core/tracker/inclusion_internal_test.go | Added comprehensive test suite covering 404 handling for both block and attestation checks, plus validation that non-404 errors still propagate |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4041 +/- ##
=======================================
Coverage 53.79% 53.80%
=======================================
Files 242 242
Lines 39412 39425 +13
=======================================
+ Hits 21203 21213 +10
- Misses 15967 15970 +3
Partials 2242 2242 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Fix: Handle 404 errors gracefully in inclusion checker and improve error handling **Problem** The inclusion checker was treating 404 responses from the beacon node as errors, causing: - Unnecessary retries when blocks are missed, putting load on the beacon node - Spurious warnings for expected 404 responses (missed proposals are valid) **Solution** 1. Handle 404 errors gracefully Detect 404 status codes and treat them as "block not found" (expected behavior) Stop retrying and stop logging warnings for 404 responses Added comprehensive tests to verify correct behavior 2. Improve error handling approach Modified eth2wrap.wrapError() to use errors.Wrap() instead of errors.New() Preserves original eth2api.Error in the error chain Enables standard Go error checking with errors.As() instead of relying on logging fields Applied consistently across inclusion.go and synthproposer.go category: bug ticket: #4035



Fix: Handle 404 errors gracefully in inclusion checker and improve error handling
Problem
The inclusion checker was treating 404 responses from the beacon node as errors, causing:
Solution
Detect 404 status codes and treat them as "block not found" (expected behavior)
Stop retrying and stop logging warnings for 404 responses
Added comprehensive tests to verify correct behavior
Modified eth2wrap.wrapError() to use errors.Wrap() instead of errors.New()
Preserves original eth2api.Error in the error chain
Enables standard Go error checking with errors.As() instead of relying on logging fields
Applied consistently across inclusion.go and synthproposer.go
category: bug
ticket: #4035