core/validatorapi: adopt payload attestation interfaces - #4658
Conversation
There was a problem hiding this comment.
Pull request overview
Refactors the validator API’s payload attestation endpoints to use the upstream go-eth2-client payload attestation provider/submitter interfaces after bumping Charon’s forked go-eth2-client dependency for Gloas support, while keeping the VC-facing JSON wire format unchanged.
Changes:
- Bumps the
attestantio/go-eth2-clientreplacement togithub.com/ObolNetwork/go-eth2-client v0.29.0-obol.2-gloas. - Updates
core/validatorapicomponent methods to implementeth2client.PayloadAttestationDataProviderandeth2client.PayloadAttestationMessagesSubmitterusing versioned opts/response/message types. - Adapts router/tests/mocks to the new interfaces and propagates the validated
Eth-Consensus-Versioninto submitted message versions.
Reviewed changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| go.sum | Updates module checksums for the bumped forked go-eth2-client version. |
| go.mod | Updates the replace directive to the new go-eth2-client fork version. |
| core/validatorapi/validatorapi.go | Implements upstream payload attestation provider/submitter interfaces and wraps data/messages in versioned containers. |
| core/validatorapi/validatorapi_test.go | Updates component tests to use opts structs and assert versioned response/message behavior. |
| core/validatorapi/router.go | Switches payload attestation routes to call the new interfaces and build versioned submit opts. |
| core/validatorapi/router_internal_test.go | Updates router tests for the new handler signatures and versioned message passing. |
| core/validatorapi/mocks/handler.go | Regenerates/updates mocks for the new payload attestation method signatures and types. |
Files not reviewed (1)
- core/validatorapi/mocks/handler.go: Generated file
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## gloas #4658 +/- ##
========================================
Coverage ? 58.84%
========================================
Files ? 245
Lines ? 34316
Branches ? 0
========================================
Hits ? 20193
Misses ? 11617
Partials ? 2506 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 7 changed files in this pull request and generated no new comments.
Files not reviewed (1)
- core/validatorapi/mocks/handler.go: Generated file
Suppressed comments (1)
core/validatorapi/router.go:1621
payloadAttestationDatadereferenceseth2Resp.Dataand then readsdata.Versionwithout guarding against a nil response or nilData. If the provider ever returns(nil, nil)or a response withData == nil, this handler will panic instead of returning an HTTP error.
data := eth2Resp.Data
if data.Version != eth2spec.DataVersionGloas || data.Gloas == nil {
return nil, nil, errors.New("unsupported payload attestation data version")
}



Bump
go-eth2-clienttov0.29.0-obol.2-gloas(obol stack rebased onto upstream gloas with the merged ePBS transport and PTC endpoints from attestantio/go-eth2-client#310 and #311). Replace the temporary plainHandlermethods with the upstreameth2client.PayloadAttestationDataProviderandeth2client.PayloadAttestationMessagesSubmitterinterfaces, adapting the component and router to the versioned opts/response types. The VC-facing wire format is unchanged; the validatedEth-Consensus-Versionheader now selects the message version passed to the submitter.category: refactor
ticket: #4324