mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-10 16:08:26 -05:00
Best practice follow up - remove outdated todos (#6392)
* Addressed 30. * Remove outdated todos * Go fmt * Go fmt Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
This commit is contained in:
@@ -759,18 +759,15 @@ func VerifyIndexedAttestation(ctx context.Context, beaconState *stateTrie.Beacon
|
||||
}
|
||||
indices := indexedAtt.AttestingIndices
|
||||
pubkeys := []bls.PublicKey{}
|
||||
if len(indices) > 0 {
|
||||
for i := 0; i < len(indices); i++ {
|
||||
pubkeyAtIdx := beaconState.PubkeyAtIndex(indices[i])
|
||||
pk, err := bls.PublicKeyFromBytes(pubkeyAtIdx[:])
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not deserialize validator public key")
|
||||
}
|
||||
pubkeys = append(pubkeys, pk)
|
||||
for i := 0; i < len(indices); i++ {
|
||||
pubkeyAtIdx := beaconState.PubkeyAtIndex(indices[i])
|
||||
pk, err := bls.PublicKeyFromBytes(pubkeyAtIdx[:])
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "could not deserialize validator public key")
|
||||
}
|
||||
pubkeys = append(pubkeys, pk)
|
||||
}
|
||||
return attestationutil.VerifyIndexedAttestationSig(ctx, indexedAtt, pubkeys, domain)
|
||||
|
||||
}
|
||||
|
||||
// VerifyAttestation converts and attestation into an indexed attestation and verifies
|
||||
|
||||
@@ -10,7 +10,6 @@ import (
|
||||
func TestMain(m *testing.M) {
|
||||
prevConfig := params.BeaconConfig().Copy()
|
||||
c := params.BeaconConfig()
|
||||
// TODO(2312): remove this and use the mainnet count.
|
||||
c.MinGenesisActiveValidatorCount = 16384
|
||||
params.OverrideBeaconConfig(c)
|
||||
|
||||
|
||||
@@ -140,7 +140,6 @@ func NewService(cfg *Config) (*Service, error) {
|
||||
|
||||
s.host = h
|
||||
|
||||
// TODO(3147): Add gossip sub options
|
||||
// Gossipsub registration is done before we add in any new peers
|
||||
// due to libp2p's gossipsub implementation not taking into
|
||||
// account previously added peers when creating the gossipsub
|
||||
|
||||
@@ -328,7 +328,6 @@ func (bs *Server) StreamIndexedAttestations(
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(#5031): Instead of doing aggregation here, leverage the aggregation
|
||||
// already being done by the attestation pool in the operations service.
|
||||
func (bs *Server) collectReceivedAttestations(ctx context.Context) {
|
||||
attsByRoot := make(map[[32]byte][]*ethpb.Attestation)
|
||||
|
||||
@@ -401,7 +401,6 @@ func (vs *Server) filterAttestationsForBlockInclusion(ctx context.Context, state
|
||||
validAtts := make([]*ethpb.Attestation, 0, len(atts))
|
||||
inValidAtts := make([]*ethpb.Attestation, 0, len(atts))
|
||||
|
||||
// TODO(3916): Insert optimizations to sort out the most profitable attestations
|
||||
for i, att := range atts {
|
||||
if i == int(params.BeaconConfig().MaxAttestations) {
|
||||
break
|
||||
|
||||
@@ -1203,7 +1203,6 @@ func TestDefaultEth1Data_NoBlockExists(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO(2312): Add more tests for edge cases and better coverage.
|
||||
func TestEth1Data(t *testing.T) {
|
||||
slot := uint64(20000)
|
||||
|
||||
|
||||
@@ -78,7 +78,6 @@ func (s *Service) beaconBlocksByRangeRPCHandler(ctx context.Context, msg interfa
|
||||
return errors.New(rateLimitedError)
|
||||
}
|
||||
|
||||
// TODO(3147): Update this with reasonable constraints.
|
||||
if endSlot-startSlot > rangeLimit || m.Step == 0 || m.Count > maxRequestBlocks {
|
||||
s.writeErrorResponseToStream(responseCodeInvalidRequest, stepError, stream)
|
||||
err := errors.New(stepError)
|
||||
|
||||
Reference in New Issue
Block a user