Skip to content

Commit

Permalink
rebase fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
rkapka committed Jun 28, 2024
1 parent 10d426f commit 0d98c7f
Show file tree
Hide file tree
Showing 16 changed files with 294 additions and 21,241 deletions.
1 change: 0 additions & 1 deletion beacon-chain/operations/attestations/prepare_forkchoice.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ func (s *Service) seen(att ethpb.Att) (bool, error) {
if err != nil {
return false, errors.Wrap(err, "could not create attestation ID")
}
key := versionAndDataRoot{att.Version(), attRoot}
incomingBits := att.GetAggregationBits()
savedBits, ok := s.forkChoiceProcessedAtts.Get(id)
if ok {
Expand Down
4 changes: 3 additions & 1 deletion beacon-chain/rpc/prysm/v1alpha1/validator/aggregator.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,12 @@ func (vs *Server) SubmitAggregateSelectionProof(ctx context.Context, req *ethpb.
best = a
}
}
a := &ethpb.AggregateAttestationAndProof{
Aggregate: best,
SelectionProof: req.SlotSignature,
AggregatorIndex: validatorIndex,
}
return &ethpb.AggregateSelectionResponse{AggregateAndProof: attAndProof}, nil
return &ethpb.AggregateSelectionResponse{AggregateAndProof: a}, nil
}

// SubmitAggregateSelectionProofElectra is called by a validator when its assigned to be an aggregator.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,8 @@
package validator

import (
"math"
"slices"

"github.com/prysmaticlabs/go-bitfield"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/core/helpers"
"github.com/prysmaticlabs/prysm/v5/beacon-chain/operations/attestations/kv"
"github.com/prysmaticlabs/prysm/v5/config/params"
"github.com/prysmaticlabs/prysm/v5/consensus-types/primitives"
"github.com/prysmaticlabs/prysm/v5/crypto/bls"
ethpb "github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1"
"github.com/prysmaticlabs/prysm/v5/proto/prysm/v1alpha1/attestation"
)

// computeOnChainAggregate constructs an on chain final aggregate form a list of network aggregates with equal attestation data.
Expand Down Expand Up @@ -41,11 +33,11 @@ import (
// committee_bits=committee_bits,
// signature=signature,
// )
func computeOnChainAggregate(aggregates map[kv.AttestationId][]ethpb.Att) ([]ethpb.Att, error) {
func computeOnChainAggregate(aggregates map[attestation.Id][]ethpb.Att) ([]ethpb.Att, error) {
// Digest is the attestation data root. The incoming map has attestations for the same root
// but different committee indices under different keys. We create a new map where the digest is the key
// so that all attestations for the same root are under one key.
aggsByDigest := make(map[[32]byte][]ethpb.Att, 0)
/*aggsByDigest := make(map[[32]byte][]ethpb.Att, 0)
for id, aggs := range aggregates {
existing, ok := aggsByDigest[id.Digest]
if ok {
Expand Down Expand Up @@ -101,5 +93,6 @@ func computeOnChainAggregate(aggregates map[kv.AttestationId][]ethpb.Att) ([]eth
result = append(result, att)
}
return result, nil
return result, nil*/
return nil, nil
}
27 changes: 0 additions & 27 deletions beacon-chain/sync/validate_beacon_attestations_electra.go

This file was deleted.

61 changes: 0 additions & 61 deletions consensus-types/blocks/proto.go
Original file line number Diff line number Diff line change
Expand Up @@ -1132,67 +1132,6 @@ func initBlindedBlockBodyFromProtoDeneb(pb *eth.BlindedBeaconBlockBodyDeneb) (*B
return b, nil
}

func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlockBody, error) {
if pb == nil {
return nil, errNilBlockBody
}

p, err := WrappedExecutionPayloadElectra(pb.ExecutionPayload)
// We allow the payload to be nil
if err != nil && err != consensus_types.ErrNilObjectWrapped {
return nil, err
}
b := &BeaconBlockBody{
version: version.Electra,
randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal),
eth1Data: pb.Eth1Data,
graffiti: bytesutil.ToBytes32(pb.Graffiti),
proposerSlashings: pb.ProposerSlashings,
attesterSlashingsElectra: pb.AttesterSlashings,
attestationsElectra: pb.Attestations,
deposits: pb.Deposits,
voluntaryExits: pb.VoluntaryExits,
syncAggregate: pb.SyncAggregate,
executionPayload: p,
blsToExecutionChanges: pb.BlsToExecutionChanges,
blobKzgCommitments: pb.BlobKzgCommitments,
signedConsolidations: pb.Consolidations,
}
return b, nil
}

func initBlindedBlockBodyFromProtoDeneb(pb *eth.BlindedBeaconBlockBodyDeneb) (*BeaconBlockBody, error) {
if pb == nil {
return nil, errNilBlockBody
}

ph, err := WrappedExecutionPayloadHeaderDeneb(pb.ExecutionPayloadHeader)
// We allow the payload to be nil
if err != nil && err != consensus_types.ErrNilObjectWrapped {
return nil, err
}
atts := make([]interfaces.Attestation, len(pb.Attestations))
for i, att := range pb.Attestations {
atts[i] = att
}
b := &BeaconBlockBody{
version: version.Deneb,
randaoReveal: bytesutil.ToBytes96(pb.RandaoReveal),
eth1Data: pb.Eth1Data,
graffiti: bytesutil.ToBytes32(pb.Graffiti),
proposerSlashings: pb.ProposerSlashings,
attesterSlashings: pb.AttesterSlashings,
attestations: atts,
deposits: pb.Deposits,
voluntaryExits: pb.VoluntaryExits,
syncAggregate: pb.SyncAggregate,
executionPayloadHeader: ph,
blsToExecutionChanges: pb.BlsToExecutionChanges,
blobKzgCommitments: pb.BlobKzgCommitments,
}
return b, nil
}

func initBlockBodyFromProtoElectra(pb *eth.BeaconBlockBodyElectra) (*BeaconBlockBody, error) {
if pb == nil {
return nil, errNilBlockBody
Expand Down
Loading

0 comments on commit 0d98c7f

Please sign in to comment.