mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 03:30:35 +00:00
Enable whitespace linter & fix findings (#12273)
* Enable whitespace linter & fix findings * Fix new finding * fix new violation --------- Co-authored-by: Radosław Kapka <rkapka@wp.pl> Co-authored-by: Preston Van Loon <preston@prysmaticlabs.com> Co-authored-by: Preston Van Loon <pvanloon@offchainlabs.com>
This commit is contained in:
parent
03f63f294b
commit
8428a79971
@ -17,6 +17,7 @@ linters:
|
||||
- errcheck
|
||||
- gosimple
|
||||
- gocognit
|
||||
- whitespace
|
||||
- misspell
|
||||
|
||||
linters-settings:
|
||||
|
@ -246,7 +246,6 @@ func (c *Client) GetHeader(ctx context.Context, slot primitives.Slot, parentHash
|
||||
default:
|
||||
return nil, fmt.Errorf("unsupported header version %s", strings.ToLower(v.Version))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// RegisterValidator encodes the SignedValidatorRegistrationV1 message to json (including hex-encoding the byte
|
||||
|
@ -60,7 +60,6 @@ func logStateTransitionData(b interfaces.ReadOnlyBeaconBlock) error {
|
||||
log = log.WithField("txCount", len(txs))
|
||||
txsPerSlotCount.Set(float64(len(txs)))
|
||||
}
|
||||
|
||||
}
|
||||
log.Info("Finished applying state transition")
|
||||
return nil
|
||||
|
@ -55,7 +55,6 @@ func (s *Service) getAttPreState(ctx context.Context, c *ethpb.Checkpoint) (stat
|
||||
return nil, errors.Wrap(err, "could not save checkpoint state to cache")
|
||||
}
|
||||
return baseState, nil
|
||||
|
||||
}
|
||||
|
||||
// verifyAttTargetEpoch validates attestation is from the current or previous epoch.
|
||||
|
@ -283,7 +283,6 @@ func (s *Service) onBlock(ctx context.Context, signed interfaces.ReadOnlySignedB
|
||||
log.WithError(err).Error("Could not insert finalized deposits.")
|
||||
}
|
||||
}()
|
||||
|
||||
}
|
||||
defer reportAttestationInclusion(b)
|
||||
if err := s.handleEpochBoundary(ctx, postState); err != nil {
|
||||
|
@ -104,7 +104,6 @@ func attestationDelta(pBal *Balance, sqrtActiveCurrentEpoch uint64, v *Validator
|
||||
} else {
|
||||
rewardNumerator := br * (pBal.PrevEpochAttested / effectiveBalanceIncrement)
|
||||
r += rewardNumerator / currentEpochBalance
|
||||
|
||||
}
|
||||
} else {
|
||||
p += br
|
||||
|
@ -874,5 +874,4 @@ func (s *Store) isStateValidatorMigrationOver() (bool, error) {
|
||||
return returnFlag, err
|
||||
}
|
||||
return returnFlag, nil
|
||||
|
||||
}
|
||||
|
@ -425,7 +425,6 @@ func (s *Service) batchRequestHeaders(startBlock, endBlock uint64) ([]*types.Hea
|
||||
Error: error(nil),
|
||||
})
|
||||
headers = append(headers, header)
|
||||
|
||||
}
|
||||
ioErr := s.rpcClient.BatchCall(elems)
|
||||
if ioErr != nil {
|
||||
|
@ -246,7 +246,6 @@ func (r *RPCClient) BatchCall(b []rpc.BatchElem) error {
|
||||
return err
|
||||
}
|
||||
*e.Result.(*types.HeaderInfo) = types.HeaderInfo{Number: h.Number, Time: h.Time, Hash: h.Hash()}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -560,7 +560,6 @@ func (f *ForkChoice) ForkChoiceDump(ctx context.Context) (*v1.ForkChoiceDump, er
|
||||
ForkChoiceNodes: nodes,
|
||||
}
|
||||
return resp, nil
|
||||
|
||||
}
|
||||
|
||||
// SetBalancesByRooter sets the balanceByRoot handler in forkchoice
|
||||
|
@ -28,7 +28,6 @@ func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig {
|
||||
}
|
||||
if enableDebugRPCEndpoints {
|
||||
v1AlphaRegistrations = append(v1AlphaRegistrations, ethpbalpha.RegisterDebugHandler)
|
||||
|
||||
}
|
||||
v1AlphaMux := gwruntime.NewServeMux(
|
||||
gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{
|
||||
@ -60,7 +59,6 @@ func DefaultConfig(enableDebugRPCEndpoints bool, httpModules string) MuxConfig {
|
||||
}
|
||||
if enableDebugRPCEndpoints {
|
||||
ethRegistrations = append(ethRegistrations, ethpbservice.RegisterBeaconDebugHandler)
|
||||
|
||||
}
|
||||
ethMux := gwruntime.NewServeMux(
|
||||
gwruntime.WithMarshalerOption(gwruntime.MIMEWildcard, &gwruntime.HTTPBodyMarshaler{
|
||||
|
@ -133,7 +133,6 @@ func (s *Service) processSlashings(blk interfaces.ReadOnlyBeaconBlock) {
|
||||
"SourceEpoch2": slashing.Attestation_2.Data.Source.Epoch,
|
||||
"TargetEpoch2": slashing.Attestation_2.Data.Target.Epoch,
|
||||
}).Info("Attester slashing was included")
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -127,7 +127,6 @@ func (p *Pool) InsertBLSToExecChange(change *ethpb.SignedBLSToExecutionChange) {
|
||||
p.m[change.Message.ValidatorIndex] = p.pending.Last()
|
||||
|
||||
blsToExecMessageInPoolTotal.Inc()
|
||||
|
||||
}
|
||||
|
||||
// MarkIncluded is used when an object has been included in a beacon block. Every block seen by this
|
||||
|
@ -887,7 +887,6 @@ func (bs *Server) GetIndividualVotes(
|
||||
val, err := st.ValidatorAtIndexReadOnly(index)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not retrieve validator: %v", err)
|
||||
|
||||
}
|
||||
pb := val.PublicKey()
|
||||
votes = append(votes, ðpb.IndividualVotesRespond_IndividualVote{
|
||||
|
@ -284,7 +284,6 @@ func (is *infostream) generateValidatorsInfo(pubKeys [][]byte) ([]*ethpb.Validat
|
||||
v, err := headState.ValidatorAtIndexReadOnly(i)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "Could not retrieve validator: %v", err)
|
||||
|
||||
}
|
||||
info, err := is.generateValidatorInfo(pubKey, v, headState, epoch)
|
||||
if err != nil {
|
||||
|
@ -229,7 +229,6 @@ func (vs *Server) GetFeeRecipientByPubKey(ctx context.Context, request *ethpb.Fe
|
||||
log.WithError(err).Error("An error occurred while retrieving validator index")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
}
|
||||
address, err := vs.BeaconDB.FeeRecipientByValidatorID(ctx, resp.GetIndex())
|
||||
if err != nil {
|
||||
|
@ -97,7 +97,6 @@ func (vs *Server) canonicalEth1Data(
|
||||
ctx context.Context,
|
||||
beaconState state.BeaconState,
|
||||
currentVote *ethpb.Eth1Data) (*ethpb.Eth1Data, *big.Int, error) {
|
||||
|
||||
var eth1BlockHash [32]byte
|
||||
|
||||
// Add in current vote, to get accurate vote tally
|
||||
|
@ -265,7 +265,6 @@ func (vs *Server) optimisticStatus(ctx context.Context) error {
|
||||
}
|
||||
|
||||
return status.Errorf(codes.Unavailable, errOptimisticMode.Error())
|
||||
|
||||
}
|
||||
|
||||
// validatorStatus searches for the requested validator's state and deposit to retrieve its inclusion estimate. Also returns the validators index.
|
||||
|
@ -84,7 +84,6 @@ func (s *Service) detectAllAttesterSlashings(
|
||||
args *chunkUpdateArgs,
|
||||
attestations []*slashertypes.IndexedAttestationWrapper,
|
||||
) ([]*ethpb.AttesterSlashing, error) {
|
||||
|
||||
// Map of updated chunks by chunk index, which will be saved at the end.
|
||||
updatedChunks := make(map[uint64]Chunker)
|
||||
groupedAtts := s.groupByChunkIndex(attestations)
|
||||
|
@ -204,7 +204,6 @@ func (s *Service) waitForChainInitialization() {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func (s *Service) waitForSync(genesisTime time.Time) {
|
||||
|
@ -79,7 +79,6 @@ func NewFieldTrie(field types.FieldIndex, dataType types.DataType, elements inte
|
||||
default:
|
||||
return nil, errors.Errorf("unrecognized data type in field map: %v", reflect.TypeOf(dataType).Name())
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// RecomputeTrie rebuilds the affected branches in the trie according to the provided
|
||||
|
@ -57,7 +57,6 @@ func (b *BeaconState) UnrealizedCheckpointBalances() (uint64, uint64, uint64, er
|
||||
}
|
||||
|
||||
return stateutil.UnrealizedCheckpointBalances(cp, pp, b.validators, currentEpoch)
|
||||
|
||||
}
|
||||
|
||||
// currentEpochParticipationVal corresponding to participation bits on the beacon chain.
|
||||
|
@ -899,7 +899,6 @@ func finalizerCleanup(b *BeaconState) {
|
||||
if b.stateFieldLeaves[field].FieldReference() != nil {
|
||||
b.stateFieldLeaves[field].FieldReference().MinusRef()
|
||||
}
|
||||
|
||||
}
|
||||
for i := range b.dirtyFields {
|
||||
delete(b.dirtyFields, i)
|
||||
|
@ -123,7 +123,6 @@ func VerifyBeaconStateValidatorByPubkey(t *testing.T, factory getState) {
|
||||
n := b.Copy()
|
||||
// Append to another state
|
||||
assert.NoError(t, n.AppendValidator(ðpb.Validator{PublicKey: key[:]}))
|
||||
|
||||
},
|
||||
exists: false,
|
||||
expectedIdx: 0,
|
||||
@ -136,7 +135,6 @@ func VerifyBeaconStateValidatorByPubkey(t *testing.T, factory getState) {
|
||||
n := b.Copy()
|
||||
// Append to another state
|
||||
assert.NoError(t, n.AppendValidator(ðpb.Validator{PublicKey: key[:]}))
|
||||
|
||||
},
|
||||
exists: false,
|
||||
expectedIdx: 0,
|
||||
|
@ -56,7 +56,6 @@ func VerifyBeaconStateBlockRootsNative(
|
||||
} else {
|
||||
want[i] = make([]byte, 32)
|
||||
}
|
||||
|
||||
}
|
||||
s, err = factoryBR(want)
|
||||
require.NoError(t, err)
|
||||
|
@ -214,7 +214,6 @@ func cliActionRequestBlocks(cliCtx *cli.Context) error {
|
||||
"timeFromSendingToProcessingResponse": end,
|
||||
"totalBlocksWithExecutionPayloads": totalExecutionBlocks,
|
||||
}).Info("Received blocks from peer")
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -76,7 +76,6 @@ func getWithdrawalMessagesFromPathFlag(c *cli.Context) ([]*apimiddleware.SignedB
|
||||
Signature: to[i].Signature,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
if len(setWithdrawalAddressJsons) == 0 {
|
||||
return setWithdrawalAddressJsons, errors.New("the list of signed requests is empty")
|
||||
|
@ -27,7 +27,6 @@ func walletWithKeymanager(c *cli.Context) (*wallet.Wallet, keymanager.IKeymanage
|
||||
return nil, nil, errors.Wrap(err, accounts.ErrCouldNotInitializeKeymanager)
|
||||
}
|
||||
return w, km, nil
|
||||
|
||||
}
|
||||
|
||||
func walletWithWeb3SignerKeymanager(c *cli.Context, config *remote_web3signer.SetupConfig) (*wallet.Wallet, keymanager.IKeymanager, error) {
|
||||
|
@ -112,7 +112,6 @@ func (b *SignedBeaconBlock) PbGenericBlock() (*eth.GenericSignedBeaconBlock, err
|
||||
default:
|
||||
return nil, errIncorrectBlockVersion
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// PbPhase0Block returns the underlying protobuf object.
|
||||
|
@ -92,7 +92,6 @@ func (p *PublicKey) Equals(p2 common.PublicKey) bool {
|
||||
|
||||
// Aggregate two public keys.
|
||||
func (p *PublicKey) Aggregate(p2 common.PublicKey) common.PublicKey {
|
||||
|
||||
agg := new(blstAggregatePublicKey)
|
||||
// No group check here since it is checked at decompression time
|
||||
agg.Add(p.p, false)
|
||||
|
@ -259,7 +259,6 @@ func kdfKey(cryptoJSON cryptoJSON, auth string) ([]byte, error) {
|
||||
r := ensureInt(cryptoJSON.KDFParams["r"])
|
||||
p := ensureInt(cryptoJSON.KDFParams["p"])
|
||||
return scrypt.Key(authArray, salt, n, r, p, dkLen)
|
||||
|
||||
} else if cryptoJSON.KDF == "pbkdf2" {
|
||||
c := ensureInt(cryptoJSON.KDFParams["c"])
|
||||
prf, ok := cryptoJSON.KDFParams["prf"].(string)
|
||||
|
@ -188,7 +188,7 @@ func Mod64(a, b uint64) (uint64, error) {
|
||||
return val, nil
|
||||
}
|
||||
|
||||
// Int returns the integer value of the uint64 argument. If there is an overlow, then an error is
|
||||
// Int returns the integer value of the uint64 argument. If there is an overflow, then an error is
|
||||
// returned.
|
||||
func Int(u uint64) (int, error) {
|
||||
if u > stdmath.MaxInt {
|
||||
@ -208,7 +208,6 @@ func AddInt(i ...int) (int, error) {
|
||||
}
|
||||
|
||||
sum += ii
|
||||
|
||||
}
|
||||
return sum, nil
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/coreos/go-systemd/journal"
|
||||
logrus "github.com/sirupsen/logrus"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
type JournalHook struct{}
|
||||
@ -52,7 +52,6 @@ func stringifyKey(key string) string {
|
||||
func stringifyEntries(data map[string]interface{}) map[string]string {
|
||||
entries := make(map[string]string)
|
||||
for k, v := range data {
|
||||
|
||||
key := stringifyKey(k)
|
||||
entries[key] = fmt.Sprint(v)
|
||||
}
|
||||
|
@ -119,7 +119,6 @@ func SendTransaction(client *rpc.Client, key *ecdsa.PrivateKey, f *filler.Filler
|
||||
err = backend.SendTransaction(context.Background(), signedTx)
|
||||
return nil
|
||||
})
|
||||
|
||||
}
|
||||
return g.Wait()
|
||||
}
|
||||
|
@ -659,7 +659,6 @@ func validatorsAreWithdrawn(ec *e2etypes.EvaluationContext, conns ...*grpc.Clien
|
||||
if bal > 1*params.BeaconConfig().GweiPerEth {
|
||||
return errors.Errorf("Validator index %d with key %#x hasn't withdrawn. Their balance is %d.", valIdx, key, bal)
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -116,7 +116,6 @@ func validatorsLoseBalance(_ *e2eTypes.EvaluationContext, conns ...*grpc.ClientC
|
||||
valResp.EffectiveBalance,
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
@ -45,7 +45,6 @@ func (s *EpochTicker) start(
|
||||
secondsPerEpoch uint64,
|
||||
since, until func(time.Time) time.Duration,
|
||||
after func(time.Duration) <-chan time.Time) {
|
||||
|
||||
d := time.Duration(secondsPerEpoch) * time.Second
|
||||
|
||||
go func() {
|
||||
|
@ -147,5 +147,4 @@ func (bb *Builder) Check(t testing.TB, c *Check) {
|
||||
got := fmt.Sprintf("%#x", bb.service.ProposerBoost())
|
||||
require.DeepEqual(t, want, got)
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -131,7 +131,6 @@ func runTest(t *testing.T, config string, fork int, basePath string) {
|
||||
}
|
||||
if step.PayloadStatus != nil {
|
||||
require.NoError(t, builder.SetPayloadStatus(step.PayloadStatus))
|
||||
|
||||
}
|
||||
if step.PowBlock != nil {
|
||||
powBlockFile, err := util.BazelFileBytes(testsFolderPath, folder.Name(), fmt.Sprint(*step.PowBlock, ".ssz_snappy"))
|
||||
|
@ -74,7 +74,6 @@ func (s *SlotTicker) start(
|
||||
secondsPerSlot uint64,
|
||||
since, until func(time.Time) time.Duration,
|
||||
after func(time.Duration) <-chan time.Time) {
|
||||
|
||||
d := time.Duration(secondsPerSlot) * time.Second
|
||||
|
||||
go func() {
|
||||
|
@ -253,7 +253,6 @@ func extractPrivateKey() *ecdsa.PrivateKey {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
} else {
|
||||
privInterfaceKey, _, err := crypto.GenerateSecp256k1Key(rand.Reader)
|
||||
if err != nil {
|
||||
|
@ -364,7 +364,6 @@ func printStates(stateC <-chan *modifiedState, doneC chan<- bool) {
|
||||
log.Infof("previous_justified_checkpoint : sizeSSZ = %s", humanize.Bytes(uint64(st.PreviousJustifiedCheckpoint().SizeSSZ())))
|
||||
log.Infof("current_justified_checkpoint : sizeSSZ = %s", humanize.Bytes(uint64(st.CurrentJustifiedCheckpoint().SizeSSZ())))
|
||||
log.Infof("finalized_checkpoint : sizeSSZ = %s", humanize.Bytes(uint64(st.FinalizedCheckpoint().SizeSSZ())))
|
||||
|
||||
}
|
||||
doneC <- true
|
||||
}
|
||||
|
@ -18,35 +18,29 @@ import (
|
||||
func mergeProfiles(p, merge *cover.Profile) {
|
||||
if p.Mode != merge.Mode {
|
||||
log.Fatalf("cannot merge profiles with different modes")
|
||||
|
||||
}
|
||||
// Since the blocks are sorted, we can keep track of where the last block
|
||||
// was inserted and only look at the blocks after that as targets for merge
|
||||
startIndex := 0
|
||||
for _, b := range merge.Blocks {
|
||||
startIndex = mergeProfileBlock(p, b, startIndex)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int) int {
|
||||
sortFunc := func(i int) bool {
|
||||
pi := p.Blocks[i+startIndex]
|
||||
return pi.StartLine >= pb.StartLine && (pi.StartLine != pb.StartLine || pi.StartCol >= pb.StartCol)
|
||||
|
||||
}
|
||||
|
||||
i := 0
|
||||
if !sortFunc(i) {
|
||||
i = sort.Search(len(p.Blocks)-startIndex, sortFunc)
|
||||
|
||||
}
|
||||
i += startIndex
|
||||
if i < len(p.Blocks) && p.Blocks[i].StartLine == pb.StartLine && p.Blocks[i].StartCol == pb.StartCol {
|
||||
if p.Blocks[i].EndLine != pb.EndLine || p.Blocks[i].EndCol != pb.EndCol {
|
||||
log.Fatalf("OVERLAP MERGE: %v %v %v", p.FileName, p.Blocks[i], pb)
|
||||
|
||||
}
|
||||
switch p.Mode {
|
||||
case "set":
|
||||
@ -55,54 +49,42 @@ func mergeProfileBlock(p *cover.Profile, pb cover.ProfileBlock, startIndex int)
|
||||
p.Blocks[i].Count += pb.Count
|
||||
default:
|
||||
log.Fatalf("unsupported covermode: '%s'", p.Mode)
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
if i > 0 {
|
||||
pa := p.Blocks[i-1]
|
||||
if pa.EndLine >= pb.EndLine && (pa.EndLine != pb.EndLine || pa.EndCol > pb.EndCol) {
|
||||
log.Fatalf("OVERLAP BEFORE: %v %v %v", p.FileName, pa, pb)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if i < len(p.Blocks)-1 {
|
||||
pa := p.Blocks[i+1]
|
||||
if pa.StartLine <= pb.StartLine && (pa.StartLine != pb.StartLine || pa.StartCol < pb.StartCol) {
|
||||
log.Fatalf("OVERLAP AFTER: %v %v %v", p.FileName, pa, pb)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
p.Blocks = append(p.Blocks, cover.ProfileBlock{})
|
||||
copy(p.Blocks[i+1:], p.Blocks[i:])
|
||||
p.Blocks[i] = pb
|
||||
|
||||
}
|
||||
return i + 1
|
||||
|
||||
}
|
||||
|
||||
func addProfile(profiles []*cover.Profile, p *cover.Profile) []*cover.Profile {
|
||||
i := sort.Search(len(profiles), func(i int) bool { return profiles[i].FileName >= p.FileName })
|
||||
if i < len(profiles) && profiles[i].FileName == p.FileName {
|
||||
mergeProfiles(profiles[i], p)
|
||||
|
||||
} else {
|
||||
profiles = append(profiles, nil)
|
||||
copy(profiles[i+1:], profiles[i:])
|
||||
profiles[i] = p
|
||||
|
||||
}
|
||||
return profiles
|
||||
|
||||
}
|
||||
|
||||
func dumpProfiles(profiles []*cover.Profile, out io.Writer) {
|
||||
if len(profiles) == 0 {
|
||||
return
|
||||
|
||||
}
|
||||
if _, err := fmt.Fprintf(out, "mode: %s\n", profiles[0].Mode); err != nil {
|
||||
panic(err)
|
||||
@ -112,11 +94,8 @@ func dumpProfiles(profiles []*cover.Profile, out io.Writer) {
|
||||
if _, err := fmt.Fprintf(out, "%s:%d.%d,%d.%d %d %d\n", p.FileName, b.StartLine, b.StartCol, b.EndLine, b.EndCol, b.NumStmt, b.Count); err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
func main() {
|
||||
@ -128,15 +107,11 @@ func main() {
|
||||
profiles, err := cover.ParseProfiles(file)
|
||||
if err != nil {
|
||||
log.WithError(err).Fatal("failed to parse profiles")
|
||||
|
||||
}
|
||||
for _, p := range profiles {
|
||||
merged = addProfile(merged, p)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dumpProfiles(merged, os.Stdout)
|
||||
|
||||
}
|
||||
|
@ -383,7 +383,6 @@ func (w *Wallet) ReadKeymanagerConfigFromDisk(_ context.Context) (io.ReadCloser,
|
||||
}
|
||||
w.configFilePath = configFilePath
|
||||
return os.Open(configFilePath) // #nosec G304
|
||||
|
||||
}
|
||||
|
||||
// WriteKeymanagerConfigToDisk takes an encoded keymanager config file
|
||||
|
@ -113,7 +113,6 @@ func (v *validator) SubmitAggregateAndProof(ctx context.Context, slot primitives
|
||||
if v.emitAccountMetrics {
|
||||
ValidatorAggSuccessVec.WithLabelValues(fmtKey).Inc()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Signs input slot with domain selection proof. This is used to create the signature for aggregator selection.
|
||||
|
@ -224,7 +224,6 @@ func (c beaconApiDutiesProvider) GetCommittees(ctx context.Context, epoch primit
|
||||
|
||||
// GetAttesterDuties retrieves the attester duties for the given epoch and validatorIndices
|
||||
func (c beaconApiDutiesProvider) GetAttesterDuties(ctx context.Context, epoch primitives.Epoch, validatorIndices []primitives.ValidatorIndex) ([]*apimiddleware.AttesterDutyJson, error) {
|
||||
|
||||
jsonValidatorIndices := make([]string, len(validatorIndices))
|
||||
for index, validatorIndex := range validatorIndices {
|
||||
jsonValidatorIndices[index] = strconv.FormatUint(uint64(validatorIndex), 10)
|
||||
|
@ -725,7 +725,6 @@ func (v *validator) RolesAt(ctx context.Context, slot primitives.Slot) (map[[fie
|
||||
if aggregator {
|
||||
roles = append(roles, iface.RoleAggregator)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Being assigned to a sync committee for a given slot means that the validator produces and
|
||||
|
@ -172,5 +172,4 @@ func (km *Keymanager) ListKeymanagerAccounts(ctx context.Context, cfg keymanager
|
||||
fmt.Println(" ")
|
||||
}
|
||||
return nil
|
||||
|
||||
}
|
||||
|
@ -277,7 +277,6 @@ func (km *Keymanager) SaveStoreAndReInitialize(ctx context.Context, store *accou
|
||||
accountsKeystore, err := CreateAccountsKeystoreRepresentation(ctx, store, km.wallet.Password())
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
}
|
||||
encodedAccounts, err := json.MarshalIndent(accountsKeystore, "", "\t")
|
||||
if err != nil {
|
||||
|
@ -348,7 +348,6 @@ func MapBeaconBlockBodyAltair(body *ethpb.BeaconBlockBodyAltair) (*BeaconBlockBo
|
||||
block.Deposits[i] = deposit
|
||||
}
|
||||
for i, exit := range body.VoluntaryExits {
|
||||
|
||||
exit, err := MapSignedVoluntaryExit(exit)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not map signed voluntary exit at index %v: %v", i, err)
|
||||
|
@ -620,7 +620,6 @@ func MockForkInfo() *v1.ForkInfo {
|
||||
},
|
||||
GenesisValidatorsRoot: make([]byte, fieldparams.RootLength),
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// MockAttestation is a mock implementation of the Attestation.
|
||||
|
@ -230,7 +230,6 @@ func (c *ValidatorClient) initializeFromCLI(cliCtx *cli.Context) error {
|
||||
"to use for your validator data",
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
if err := clearDB(cliCtx.Context, dataDir, forceClearFlag); err != nil {
|
||||
return err
|
||||
@ -314,7 +313,6 @@ func (c *ValidatorClient) initializeForWeb(cliCtx *cli.Context) error {
|
||||
"to use for your validator data",
|
||||
)
|
||||
}
|
||||
|
||||
}
|
||||
if err := clearDB(cliCtx.Context, dataDir, forceClearFlag); err != nil {
|
||||
return err
|
||||
@ -376,7 +374,6 @@ func (c *ValidatorClient) registerPrometheusService(cliCtx *cli.Context) error {
|
||||
}
|
||||
|
||||
func (c *ValidatorClient) registerValidatorService(cliCtx *cli.Context) error {
|
||||
|
||||
endpoint := c.cliCtx.String(flags.BeaconRPCProviderFlag.Name)
|
||||
dataDir := c.cliCtx.String(cmd.DataDirFlag.Name)
|
||||
logValidatorBalances := !c.cliCtx.Bool(flags.DisablePenaltyRewardLogFlag.Name)
|
||||
@ -596,7 +593,6 @@ func proposerSettings(cliCtx *cli.Context) (*validatorServiceConfig.ProposerSett
|
||||
},
|
||||
BuilderConfig: option.BuilderConfig,
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -42,7 +42,6 @@ func (s *Server) ExportSlashingProtection(ctx context.Context, _ *empty.Empty) (
|
||||
return &pb.ExportSlashingProtectionResponse{
|
||||
File: string(encoded),
|
||||
}, nil
|
||||
|
||||
}
|
||||
|
||||
// ImportSlashingProtection reads an input slashing protection EIP-3076
|
||||
|
@ -28,7 +28,6 @@ func (MockSlasher) HighestAttestations(_ context.Context, _ *eth.HighestAttestat
|
||||
func (ms MockSlasher) IsSlashableAttestation(_ context.Context, in *eth.IndexedAttestation, _ ...grpc.CallOption) (*eth.AttesterSlashingResponse, error) {
|
||||
ms.IsSlashableAttestationCalled = true // skipcq: RVV-B0006
|
||||
if ms.SlashAttestation {
|
||||
|
||||
slashingAtt, ok := proto.Clone(in).(*eth.IndexedAttestation)
|
||||
if !ok {
|
||||
return nil, errors.New("object is not of type *eth.IndexedAttestation")
|
||||
|
Loading…
Reference in New Issue
Block a user