Skip to content
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

Merged
merged 6 commits into from
May 22, 2024
Merged

Conversation

rkapka
Copy link
Contributor

@rkapka rkapka commented May 21, 2024

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 under proto directory. Since it's preferable to keep all attestation-related interfaces in one place, I moved the last interface, AttesterSlashing, to the proto directory as well. Because of name clashes, interfaces' names use Att instead of Attestation.

@rkapka rkapka added Ready For Review A pull request ready for code review Electra electra hardfork labels May 21, 2024
@rkapka rkapka requested a review from a team as a code owner May 21, 2024 09:39
@rkapka rkapka requested review from kasey, nalepae and james-prysm May 21, 2024 09:39
@rkapka rkapka force-pushed the eip-7549-interfaces-move branch from 2526056 to ed7a52b Compare May 21, 2024 09:44
@rkapka rkapka enabled auto-merge May 21, 2024 09:44
@rkapka rkapka force-pushed the eip-7549-interfaces-move branch from ed7a52b to fb1f9c3 Compare May 21, 2024 09:57
@@ -1,7 +1,6 @@
syntax = "proto3";
package ethereum.validator.accounts.v2;

import "google/protobuf/wrappers.proto";
Copy link
Contributor Author

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

Comment on lines 127 to 134
"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,
Copy link
Contributor

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")

Copy link
Member

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) {
Copy link
Contributor

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

Copy link
Contributor

@saolyn saolyn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@rkapka rkapka added this pull request to the merge queue May 22, 2024
Merged via the queue into develop with commit 0fbb27d May 22, 2024
16 of 17 checks passed
@rkapka rkapka deleted the eip-7549-interfaces-move branch May 22, 2024 16:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Electra electra hardfork Ready For Review A pull request ready for code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants