app/eth2wrap: fix mutation of pointer#4486
Conversation
|
I have tested this patch with {"level":"error","ts":"2026-04-21T08:30:00.031081603Z","caller":"validatorapi/router.go:1759","msg":"Validator api 5xx response: pubshare not found","stacktrace":"\tcore/validatorapi/validatorapi.go:1195 .AttesterDuties\n\tcore/validatorapi/router.go:739 .func1\n\tcore/validatorapi/router.go:411 .func31\n\tapp/app.go:1073 .func1","status_code":500,"message":"Internal server error","duration":"26.396401ms","pubkey":"0xa85e33ca0737c84dc947006226462a6eba8a96c41962248031980326ee1d119b5e64bb868c9c279ca9424799dda52698","vapi_endpoint":"attester_duties","topic":"vapi"}
{"level":"error","ts":"2026-04-21T08:30:01.268150598Z","caller":"validatorapi/router.go:1759","msg":"Validator api 5xx response: pubshare not found","stacktrace":"\tcore/validatorapi/validatorapi.go:1195 .AttesterDuties\n\tcore/validatorapi/router.go:739 .func1\n\tcore/validatorapi/router.go:411 .func31\n\tapp/app.go:1073 .func1","status_code":500,"message":"Internal server error","duration":"7.595396ms","pubkey":"0xa85e33ca0737c84dc947006226462a6eba8a96c41962248031980326ee1d119b5e64bb868c9c279ca9424799dda52698","vapi_endpoint":"attester_duties","topic":"vapi"}Thanks for the fix. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4486 +/- ##
==========================================
- Coverage 56.56% 56.09% -0.48%
==========================================
Files 245 245
Lines 32817 41956 +9139
==========================================
+ Hits 18564 23536 +4972
- Misses 11895 16057 +4162
- Partials 2358 2363 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Fixes DutiesCache request handling to avoid mutating caller-provided validator index slices and to more accurately determine cache hits using the set of previously-requested indices (including “no duty” cases).
Changes:
- Clone
vidxsin proposer/attester/sync duties cache methods to avoid mutating the caller’s slice. - Rework cache-hit/miss detection to use
requestedIdxs(indices already queried from the beacon node) and compute a “missing indices” list. - Add shared scenario-based tests that validate beacon-node call patterns for proposer/attester/sync committee duties caching.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.
| File | Description |
|---|---|
app/eth2wrap/cache.go |
Prevents caller slice mutation and refines cache completeness logic using requestedIdxs. |
app/eth2wrap/cache_test.go |
Adds reusable test harness + scenarios across duty types to validate caching behavior and beacon call minimization. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
* app/eth2wrap: fix mutation of pointer (#4486) * Fix mutation of pointer * Compare contents, not only lengths in the fast path; add more tests * Address PR review comments * Fix linter * Version to rc


WIP
category: bug
ticket: none