-
Notifications
You must be signed in to change notification settings - Fork 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
EIP-7549: Add aggregate attestation interfaces #14029
Conversation
2526056
to
ed7a52b
Compare
ed7a52b
to
fb1f9c3
Compare
@@ -1,7 +1,6 @@ | |||
syntax = "proto3"; | |||
package ethereum.validator.accounts.v2; | |||
|
|||
import "google/protobuf/wrappers.proto"; |
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.
this is unused and the warning annoyed me
"attestationSlot1": slashing.FirstAttestation().GetData().Slot, | ||
"beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.FirstAttestation().GetData().BeaconBlockRoot)), | ||
"sourceEpoch1": slashing.FirstAttestation().GetData().Source.Epoch, | ||
"targetEpoch1": slashing.FirstAttestation().GetData().Target.Epoch, | ||
"attestationSlot2": slashing.SecondAttestation().GetData().Slot, | ||
"beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(slashing.SecondAttestation().GetData().BeaconBlockRoot)), | ||
"sourceEpoch2": slashing.SecondAttestation().GetData().Source.Epoch, | ||
"targetEpoch2": slashing.SecondAttestation().GetData().Target.Epoch, |
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.
This is definitely more a nit but may improve readability here.
firstAttestation := slashing.FirstAttestation().GetData()
secondAttestation := slashing.SecondAttestation().GetData()
log.WithFields(logrus.Fields{
"attesterIndex": idx,
"blockInclusionSlot": blk.Slot(),
"attestationSlot1": firstAttestation.Slot,
"beaconBlockRoot1": fmt.Sprintf("%#x", bytesutil.Trunc(firstAttestation.BeaconBlockRoot)),
"sourceEpoch1": firstAttestation.Source.Epoch,
"targetEpoch1": firstAttestation.Target.Epoch,
"attestationSlot2": secondAttestation.Slot,
"beaconBlockRoot2": fmt.Sprintf("%#x", bytesutil.Trunc(secondAttestation.BeaconBlockRoot)),
"sourceEpoch2": secondAttestation.Source.Epoch,
"targetEpoch2": secondAttestation.Target.Epoch,
}).Info("Attester slashing was included")
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.
+1, except I prefer data1
and data2
@@ -247,7 +248,7 @@ func (b *BeaconBlockBody) SetProposerSlashings([]*eth.ProposerSlashing) { | |||
panic("implement me") | |||
} | |||
|
|||
func (b *BeaconBlockBody) SetAttesterSlashings([]interfaces.AttesterSlashing) { | |||
func (b *BeaconBlockBody) SetAttesterSlashings([]ethpb.AttesterSlashing) { |
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.
Some of these receivers have pointers and others don't. If not in this PR will be worth fixing at some point
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.
LGTM!
What type of PR is this?
Other
What does this PR do? Why is it needed?
Adds the following interfaces:
SignedAggregateAttAndProof
AggregateAttAndProof
Because of circular dependencies, these two interfaces and the
Attestation
interface have to be defined underproto
directory. Since it's preferable to keep all attestation-related interfaces in one place, I moved the last interface,AttesterSlashing
, to theproto
directory as well. Because of name clashes, interfaces' names useAtt
instead ofAttestation
.