Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of PR is this?
Bug fix
What does this PR do? Why is it needed?
This PR updates the event stream api to support electra
attestation
andattester_slashing
messages. The approach taken is to marshal these values as they would be represented elsewhere in the beacon api, without any special treatment around distinguishing the different schema of events that could be streamed in the same client session. This is unlikely to be the correct way to marshal these events when the beacon API spec discussion on this topic resolves, but in the meantime this approach should be backwards-compatible with the attestantio/go-eth2-client stream client used by tools like xatu and ethereum-metrics-exporter, assuming these tools are not using the newcommittee_bits
field.Other notes for review
This works because the electra attestation is almost the same as pre-electra, only adding
committee_bits
to the outer container (outside the signed container). So unmarshaling the electra json into a pre-electra struct should work, except it will drop the unknowncommittee_bits
field on the floor.Acknowledgements