core: version and broadcast payload attestation message - #4668
Conversation
There was a problem hiding this comment.
Pull request overview
This PR refactors payload attestation messages on the “signed/parsig” side to be fork-versioned, aligning them with the existing “versioned data” patterns (and mirroring the earlier VersionedPayloadAttestationData work). It updates wire formats (SSZ/JSON) and the validator API submit path to use validating constructors rather than hardcoded Gloas checks, enabling fork-version-aware handling end-to-end.
Changes:
- Introduces
core.VersionedPayloadAttestationMessagewrappingeth2spec.VersionedPayloadAttestationMessage, including SSZ + JSON envelope encoding with the fork version. - Updates
validatorapipayload attestation message submission to use the validating constructor and versioned accessors (Data(),ValidatorIndex()). - Updates fuzz/random generators, proto decoding, and golden/SSZ tests to cover the new versioned message format.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
testutil/random.go |
Adds a random generator for eth2spec.VersionedPayloadAttestationMessage to support tests/helpers. |
testutil/fuzz.go |
Adds fuzzing support for core.VersionedPayloadAttestationMessage (fixed version set to Gloas). |
core/validatorapi/validatorapi.go |
Replaces hardcoded Gloas checks with NewPartialVersionedPayloadAttestationMessage + versioned accessors. |
core/validatorapi/validatorapi_test.go |
Updates expected parsig objects to use the new versioned constructor. |
core/ssz.go |
Implements SSZ marshal/unmarshal for VersionedPayloadAttestationMessage using the versioned envelope. |
core/ssz_test.go |
Updates SSZ tests to validate the new versioned envelope bytes and round-trip behavior. |
core/signeddata.go |
Adds VersionedPayloadAttestationMessage type, constructor/partial constructor, MessageRoot/signature plumbing, and JSON wrapper format. |
core/serialise_test.go |
Switches JSON golden serialization coverage to the new versioned type. |
core/proto.go |
Updates parsig proto decoding for DutyPayloadAttestation to unmarshal VersionedPayloadAttestationMessage. |
core/eth2signeddata.go |
Updates Eth2SignedData implementation to use VersionedPayloadAttestationMessage for domain/epoch. |
core/eth2signeddata_test.go |
Updates Eth2SignedData verification test to build a valid versioned payload attestation message. |
core/testdata/TestSSZSerialisation_SignedPayloadAttestationMessage.ssz.golden |
Removes obsolete golden for the removed signed-only payload attestation message format. |
core/testdata/TestJSONSerialisation_SignedPayloadAttestationMessage.json.golden |
Removes obsolete golden for the removed signed-only JSON payload attestation message format. |
core/testdata/TestJSONSerialisation_VersionedPayloadAttestationMessage.json.golden |
Adds new JSON golden for the versioned message wrapper format. |
💡 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 #4668 +/- ##
========================================
Coverage ? 58.78%
========================================
Files ? 246
Lines ? 34746
Branches ? 0
========================================
Hits ? 20427
Misses ? 11778
Partials ? 2541 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|



Refactor
core.SignedPayloadAttestationMessageintocore.VersionedPayloadAttestationMessagewrappingeth2spec.VersionedPayloadAttestationMessage, mirroring #4663 on the signed side and following theVersionedAttestationpattern. The parsig wire format (SSZ/JSON) now carries the fork version, and the validatorapi submit handler uses the validating constructor instead of a hardcoded gloas check.On top of that, add
DutyPayloadAttestationto the broadcaster: unwrap the signed set and submit viaSubmitPayloadAttestationMessages, with no version fabrication anywhere.category: feature
ticket: #4324