Skip to content

Commit

Permalink
remove TODOs
Browse files Browse the repository at this point in the history
  • Loading branch information
iurii-ssv committed Oct 26, 2024
1 parent 9ca501a commit fc31f9c
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 61 deletions.
4 changes: 0 additions & 4 deletions beacon/goclient/goclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,7 @@ func (gc *GoClient) NodeClient() NodeClient {
// Healthy returns if beacon node is currently healthy: responds to requests, not in the syncing state, not optimistic
// (for optimistic see https://github.com/ethereum/consensus-specs/blob/dev/sync/optimistic.md#block-production).
func (gc *GoClient) Healthy(ctx context.Context) error {
// TODO
//startTime := time.Now()
nodeSyncingResp, err := gc.client.NodeSyncing(ctx, &api.NodeSyncingOpts{})
//endTime := time.Now()
//fmt.Printf("TODO TOOK %v\n", endTime.Sub(startTime))
if err != nil {
// TODO: get rid of global variable, pass metrics to goClient
metricsBeaconNodeStatus.Set(float64(statusUnknown))
Expand Down
9 changes: 0 additions & 9 deletions operator/keys/jemalloc_check.go

This file was deleted.

4 changes: 0 additions & 4 deletions operator/keys/rsa_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"crypto"
"crypto/rsa"
"crypto/sha256"
"fmt"
"math/big"
"sync"

Expand All @@ -27,9 +26,6 @@ type publicKey struct {
}

func init() {
// TODO
fmt.Println("LINUX RSA")

// TODO: check multiple versions of openssl
// TODO: fallback to stdlib when openssl is not available
if err := openssl.Init(); err != nil {
Expand Down
39 changes: 0 additions & 39 deletions operator/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,45 +155,6 @@ func (n *operatorNode) Start(logger *zap.Logger) error {
go n.feeRecipientCtrl.Start(logger)
go n.validatorsCtrl.UpdateValidatorMetaDataLoop()

//// TODO
//fmt.Println(fmt.Sprintf("TODO: GENERATING PRIV key"))
//privKey, err := keys.GeneratePrivateKey()
//if err != nil {
// logger.Fatal("failed to generate private key", zap.Error(err))
//}
//// msg we'll use for benchmarking.
//msg := []byte("Some message example to be hashed for benchmarking, let's make it at " +
// "least 100 bytes long so we can benchmark against somewhat real-world message size. " +
// "Although it still might be way too small. Lajfklflfaslfjsalfalsfjsla fjlajlfaslkfjaslkf" +
// "lasjflkasljfLFSJLfjsalfjaslfLKFsalfjalsfjalsfjaslfjaslfjlasflfslafasklfjsalfj;eqwfgh442")
//// msgHash is a typical sha256 hash, we use it for benchmarking because it's the most
//// common type of data we work with.
//msgHash := func() []byte {
// hash := sha256.Sum256(msg)
// return hash[:]
//}()
//result, err := privKey.Sign(msgHash)
//if err != nil {
// logger.Fatal("failed to Sign message", zap.Error(err))
//}
//fmt.Println(fmt.Sprintf("Signed message: %s", result))
//// TODO
//storedConfig, foundConfig, err := n.storage.GetConfig(nil)
//if err != nil {
// return fmt.Errorf("failed to get stored config: %w", err)
//}
//if !foundConfig {
// return fmt.Errorf("failed to get stored config: not found")
//}
//fmt.Println(fmt.Sprintf("TODO: %s", spew.Sdump(storedConfig)))
//// TODO
//result, err = privKey.Public().Encrypt(msgHash)
//if err != nil {
// logger.Fatal("failed to Encrypt message", zap.Error(err))
//}
//fmt.Println(fmt.Sprintf("Encrypted message: %s", result))
//// TODO

if err := n.dutyScheduler.Wait(); err != nil {
logger.Fatal("duty scheduler exited with error", zap.Error(err))
}
Expand Down
2 changes: 0 additions & 2 deletions storage/kv/badger.go
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ func createDB(logger *zap.Logger, options basedb.Options, inMemory bool) (*Badge
if options.GCInterval > 0 {
badgerDB.wg.Add(1)
go badgerDB.periodicallyCollectGarbage(logger, options.GCInterval)
// TODO
//go badgerDB.periodicallyCollectGarbage(logger, 10*time.Second)
}

return &badgerDB, nil
Expand Down
4 changes: 1 addition & 3 deletions storage/kv/gc.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,11 @@ func (b *BadgerDB) periodicallyCollectGarbage(logger *zap.Logger, interval time.
return
case <-time.After(interval):
start := time.Now()
// TODO
//err := b.FullGC(context.Background())
err := b.QuickGC(context.Background())
if err != nil {
logger.Error("periodic GC cycle failed", zap.Error(err))
} else {
logger.Info("periodic GC cycle completed", zap.Duration("took", time.Since(start)))
logger.Debug("periodic GC cycle completed", zap.Duration("took", time.Since(start)))
}
}
}
Expand Down

0 comments on commit fc31f9c

Please sign in to comment.