-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Update Beacon API events to Electra #14855
base: develop
Are you sure you want to change the base?
Conversation
@@ -170,24 +167,23 @@ func (vs *Server) proposeAtt( | |||
return nil, status.Errorf(codes.Internal, "Could not get attestation root: %v", err) | |||
} | |||
|
|||
var singleAtt *ethpb.SingleAttestation |
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.
There is no need for this variable anymore. It was used so that we can broadcast a single attestation but send an Electra attestation through the feed. But we can safely send a single attestation because the only consumers are the monitor tool and API which know how to handle single attestations.
@@ -320,6 +320,13 @@ func (s *Server) handleAttestationsElectra( | |||
} | |||
|
|||
for i, singleAtt := range validAttestations { | |||
s.OperationNotifier.OperationFeed().Send(&feed.Event{ |
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.
why did we need to move this?
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.
So that we send a single attestation and not an Electra one. Previously we were sending att
where att := singleAtt.ToAttestationElectra(committee)
@@ -139,8 +139,9 @@ func (s *Service) validateCommitteeIndexBeaconAttestation(ctx context.Context, p | |||
return validationRes, err | |||
} | |||
|
|||
var singleAtt *eth.SingleAttestation |
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.
In contrast to the code in beacon-chain/rpc/prysm/v1alpha1/validator/attester.go
, here we need the variable because att
becomes the Electra attestation (see line 148). It is necessary to convert before calling validateUnaggregatedAttWithState
case operation.SingleAttReceived: | ||
data, ok := e.Data.(*operation.SingleAttReceivedData) | ||
if !ok { | ||
log.Error("Event feed data is not of type *operation.SingleAttReceivedData") |
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.
i wonder why we don't print the Type of the data here for old ones, maybe that would be useful
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.
is it because we already do that once in the marshal reader?
att := structs.AttFromConsensus(att) | ||
return jsonMarshalReader(eventName, att) | ||
}, nil | ||
case *eth.AttestationElectra: |
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.
shoot this must have been missed...
s.OperationNotifier.OperationFeed().Send(&feed.Event{ | ||
Type: operation.SingleAttReceived, | ||
Data: &operation.SingleAttReceivedData{ | ||
Attestation: singleAtt, |
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.
Sending in a loop might not be OK, need to look at this
}) | ||
} | ||
} | ||
s.cfg.attestationNotifier.OperationFeed().Send(&feed.Event{ |
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.
What about pending att queue?
s.cfg.attestationNotifier.OperationFeed().Send(&feed.Event{ | ||
Type: operation.SingleAttReceived, | ||
Data: &operation.SingleAttReceivedData{ | ||
Attestation: attToBroadcast, |
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.
oops, this should be singleAtt
s.cfg.attestationNotifier.OperationFeed().Send(&feed.Event{ | ||
Type: operation.UnaggregatedAttReceived, | ||
Data: &operation.UnAggregatedAttReceivedData{ | ||
Attestation: attToBroadcast, |
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.
oops, this should be att
What type of PR is this?
Feature
What does this PR do? Why is it needed?
Beacon API event support for
SingleAttestation
andSignedAggregateAttestationAndProofElectra
Acknowledgements