diff --git a/cmd/misc/main.go b/cmd/misc/main.go index 021bd84d7d..dadf581d4f 100644 --- a/cmd/misc/main.go +++ b/cmd/misc/main.go @@ -51,7 +51,7 @@ var opts = struct { func main() { configPath := flag.String("config", "config/default.config.yml", "Path to the config file") - flag.StringVar(&opts.Command, "command", "", "command to run, available: updateAPIKey, applyDbSchema, initBigtableSchema, epoch-export, debug-rewards, clear-bigtable, index-old-eth1-blocks, update-aggregation-bits, historic-prices-export, index-missing-blocks, export-epoch-missed-slots, migrate-last-attestation-slot-bigtable, generate-config-from-testnet-stub, export-genesis-validators") + flag.StringVar(&opts.Command, "command", "", "command to run, available: updateAPIKey, applyDbSchema, initBigtableSchema, epoch-export, debug-rewards, debug-blocks, clear-bigtable, index-old-eth1-blocks, update-aggregation-bits, historic-prices-export, index-missing-blocks, export-epoch-missed-slots, migrate-last-attestation-slot-bigtable, export-genesis-validators, update-block-finalization-sequentially, nameValidatorsByRanges") flag.Uint64Var(&opts.StartEpoch, "start-epoch", 0, "start epoch") flag.Uint64Var(&opts.EndEpoch, "end-epoch", 0, "end epoch") flag.Uint64Var(&opts.User, "user", 0, "user id") diff --git a/db/bigtable_eth1.go b/db/bigtable_eth1.go index 648e39b0f7..667ce01405 100644 --- a/db/bigtable_eth1.go +++ b/db/bigtable_eth1.go @@ -3425,6 +3425,8 @@ func (bigtable *Bigtable) GetERC20MetadataForAddress(address []byte) (*types.ERC // } if row == nil { // Retrieve token metadata from Ethplorer and store it for later usage + logger.Infof("retrieving metadata for token %x via rpc", address) + metadata, err := rpc.CurrentGethClient.GetERC20TokenMetadata(address) if err != nil { logger.Warnf("error retrieving metadata for token %x: %v", address, err) diff --git a/db/statistics.go b/db/statistics.go index ca03714b88..6a0b3d653e 100644 --- a/db/statistics.go +++ b/db/statistics.go @@ -1712,8 +1712,8 @@ func WriteExecutionChartSeriesForDay(day int64) error { switch utils.Config.Chain.ClConfig.DepositChainID { case 1: crowdSale := 72009990.50 - logger.Infof("Exporting MARKET_CAP: %v", newEmission.Div(decimal.NewFromInt(1e18)).Add(decimal.NewFromFloat(crowdSale)).Mul(decimal.NewFromFloat(price.GetPrice("ETH", "USD"))).String()) - err = SaveChartSeriesPoint(dateTrunc, "MARKET_CAP", newEmission.Div(decimal.NewFromInt(1e18)).Add(decimal.NewFromFloat(crowdSale)).Mul(decimal.NewFromFloat(price.GetPrice("ETH", "USD"))).String()) + logger.Infof("Exporting MARKET_CAP: %v", newEmission.Div(decimal.NewFromInt(1e18)).Add(decimal.NewFromFloat(crowdSale)).Mul(decimal.NewFromFloat(price.GetPrice(utils.Config.Frontend.MainCurrency, "USD"))).String()) + err = SaveChartSeriesPoint(dateTrunc, "MARKET_CAP", newEmission.Div(decimal.NewFromInt(1e18)).Add(decimal.NewFromFloat(crowdSale)).Mul(decimal.NewFromFloat(price.GetPrice(utils.Config.Frontend.MainCurrency, "USD"))).String()) if err != nil { return fmt.Errorf("error calculating MARKET_CAP chart_series: %w", err) } diff --git a/price/price.go b/price/price.go index fca2079426..37bea3fbc4 100644 --- a/price/price.go +++ b/price/price.go @@ -243,7 +243,7 @@ func getPriceFromFeed(feed *chainlink_feed.Feed) (float64, error) { decimals := decimal.NewFromInt(1e8) // 8 decimal places for the Chainlink feeds res, err := feed.LatestRoundData(&bind.CallOpts{}) if err != nil { - return 0, fmt.Errorf("failed to fetch latest chainlink eth/usd price feed data: %v", err) + return 0, fmt.Errorf("failed to fetch latest chainlink eth/usd price feed data: %w", err) } return decimal.NewFromBigInt(res.Answer, 0).Div(decimals).InexactFloat64(), nil } @@ -276,8 +276,3 @@ func GetCurrencySymbol(currency string) string { } return x.Symbol } - -func GetEthRoundPrice(currency float64) uint64 { - ethRoundPrice := uint64(currency) - return ethRoundPrice -} diff --git a/services/services.go b/services/services.go index 0e57bf10ce..ed2ed5c6a6 100644 --- a/services/services.go +++ b/services/services.go @@ -1065,42 +1065,8 @@ func LatestIndexPageData() *types.IndexPageData { } else { logger.Errorf("error retrieving indexPageData from cache: %v", err) } - return &types.IndexPageData{ - NetworkName: "", - DepositContract: "", - ShowSyncingMessage: false, - CurrentEpoch: 0, - CurrentFinalizedEpoch: 0, - CurrentSlot: 0, - ScheduledCount: 0, - FinalityDelay: 0, - ActiveValidators: 0, - EnteringValidators: 0, - ExitingValidators: 0, - StakedEther: "", - AverageBalance: "", - DepositedTotal: 0, - DepositThreshold: 0, - ValidatorsRemaining: 0, - NetworkStartTs: 0, - MinGenesisTime: 0, - Blocks: []*types.IndexPageDataBlocks{}, - Epochs: []*types.IndexPageDataEpochs{}, - StakedEtherChartData: [][]float64{}, - ActiveValidatorsChartData: [][]float64{}, - Title: "", - Subtitle: "", - Genesis: false, - GenesisPeriod: false, - Mainnet: false, - DepositChart: &types.ChartsPageDataChart{}, - DepositDistribution: &types.ChartsPageDataChart{}, - Countdown: nil, - SlotVizData: nil, - ValidatorsPerEpoch: 0, - ValidatorsPerDay: 0, - NewDepositProcessAfter: "", - } + + return &types.IndexPageData{} } // LatestPoolsPageData returns the latest pools page data diff --git a/templates/index/depositDistribution.html b/templates/index/depositDistribution.html index 876cb5d2e7..ff5bd26801 100644 --- a/templates/index/depositDistribution.html +++ b/templates/index/depositDistribution.html @@ -136,7 +136,7 @@