Skip to content

Commit

Permalink
(NOBIDS) eth1indexer: less logging on ens
Browse files Browse the repository at this point in the history
  • Loading branch information
guybrush committed Aug 9, 2024
1 parent df602b6 commit 8762740
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions db/ens.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import (
"github.com/gobitfly/eth2-beaconchain-explorer/metrics"
"github.com/gobitfly/eth2-beaconchain-explorer/types"
"github.com/gobitfly/eth2-beaconchain-explorer/utils"
"github.com/sirupsen/logrus"

gcp_bigtable "cloud.google.com/go/bigtable"
"golang.org/x/sync/errgroup"
Expand Down Expand Up @@ -439,7 +438,7 @@ func validateEnsAddress(client *ethclient.Client, address common.Address, alread
err.Error() == "no resolution" ||
err.Error() == "execution reverted" ||
strings.HasPrefix(err.Error(), "name is not valid") {
logger.Warnf("reverse resolving address [%v] resulted in a skippable error [%s], skipping it", address, err.Error())
// logger.Warnf("reverse resolving address [%v] resulted in a skippable error [%s], skipping it", address, err.Error())
} else {
return fmt.Errorf("error could not reverse resolve address [%v]: %w", address, err)
}
Expand Down Expand Up @@ -478,7 +477,7 @@ func validateEnsName(client *ethclient.Client, name string, alreadyChecked *EnsC

nameHash, err := go_ens.NameHash(name)
if err != nil {
logger.Warnf("error could not hash name [%v]: %v -> removing ens entry", name, err)
// logger.Warnf("error could not hash name [%v]: %v -> removing ens entry", name, err)
err = removeEnsName(client, name)
if err != nil {
return fmt.Errorf("error removing ens name [%v]: %w", name, err)
Expand All @@ -496,7 +495,7 @@ func validateEnsName(client *ethclient.Client, name string, alreadyChecked *EnsC
err.Error() == "invalid jump destination" ||
err.Error() == "invalid opcode: INVALID" {
// the given name is not available anymore or resolving it did not work properly => we can remove it from the db (if it is there)
logger.WithField("error", err).WithField("name", name).Warnf("could not resolve name")
// logger.WithField("error", err).WithField("name", name).Warnf("could not resolve name")
err = removeEnsName(client, name)
if err != nil {
return fmt.Errorf("error removing ens name after resolve failed [%v]: %w", name, err)
Expand Down Expand Up @@ -532,7 +531,7 @@ func validateEnsName(client *ethclient.Client, name string, alreadyChecked *EnsC
reverseName, err := go_ens.ReverseResolve(client, addr)
if err != nil {
if err.Error() == "not a resolver" || err.Error() == "no resolution" || err.Error() == "execution reverted" {
logger.Warnf("reverse resolving address [%v] for name [%v] resulted in an error [%s], marking entry as not primary", addr, name, err.Error())
// logger.Warnf("reverse resolving address [%v] for name [%v] resulted in an error [%s], marking entry as not primary", addr, name, err.Error())
} else {
return fmt.Errorf("error could not reverse resolve address [%v]: %w", addr, err)
}
Expand Down Expand Up @@ -565,12 +564,12 @@ func validateEnsName(client *ethclient.Client, name string, alreadyChecked *EnsC
return fmt.Errorf("error writing ens data for name [%v]: %w", name, err)
}

logrus.WithFields(logrus.Fields{
"name": name,
"address": addr,
"expires": expires,
"reverseName": reverseName,
}).Infof("validated ens name")
// logrus.WithFields(logrus.Fields{
// "name": name,
// "address": addr,
// "expires": expires,
// "reverseName": reverseName,
// }).Infof("validated ens name")
return nil
}

Expand Down

0 comments on commit 8762740

Please sign in to comment.