diff --git a/cmd/feeder_tool.go b/cmd/feeder_tool.go index c668666..512fdaa 100644 --- a/cmd/feeder_tool.go +++ b/cmd/feeder_tool.go @@ -186,12 +186,10 @@ func initComponents(logger types.LoggerInf, conf types.Config, standalone bool) } ec, _ := exoclient.GetClient() - _, err = ec.GetParams() - for err != nil { - // retry forever until be interrupted manually - logger.Info("failed to get oracle params on start, retrying...", "error", err) - time.Sleep(2 * time.Second) - _, err = ec.GetParams() + + _, err = getOracleParamsWithMaxRetry(DefaultRetryConfig.MaxAttempts, ec, logger) + if err != nil { + return fmt.Errorf("failed to get oracle params on start, error:%w", err) } // init native stakerlist for nstETH(beaconchain) diff --git a/exoclient/types.go b/exoclient/types.go index 9c1b239..4b43d81 100644 --- a/exoclient/types.go +++ b/exoclient/types.go @@ -151,16 +151,13 @@ func (s *SubscribeResult) GetEventUpdateNST() (*EventUpdateNST, error) { } parsed := strings.Split(nstChange, "_") if len(parsed) != 4 { - return nil, fmt.Errorf("failed to parse nstChange due to length is not expected 4 from event_txUPdatedNST response", "nstChange_str", nstChange) + return nil, fmt.Errorf("failed to parse nstChange: expected 4 parts but got %d, nstChange: %s", len(parsed), nstChange) } deposit := parsed[0] == "deposit" stakerID, err := strconv.ParseInt(parsed[1], 10, 64) if err != nil { return nil, fmt.Errorf("failed to parse stakerID in nstChange from evetn_txUpdateNST response, error:%w", err) } - if err != nil { - return nil, fmt.Errorf("failed to parse beaconchain_valdiatorIndex in nstChange from event_txUpdateNST response, error:%w", err) - } index, err := strconv.ParseInt(parsed[3], 10, 64) if err != nil { return nil, fmt.Errorf("failed to parse beaconchain_sync_index in nstChange from event_txUpdateNST response, error:%w", err) diff --git a/fetcher/chainlink/chainlink.go b/fetcher/chainlink/chainlink.go index 16894e4..af883f9 100644 --- a/fetcher/chainlink/chainlink.go +++ b/fetcher/chainlink/chainlink.go @@ -19,7 +19,7 @@ import ( func (s *source) fetch(token string) (*fetchertypes.PriceInfo, error) { chainlinkPriceFeedProxy, ok := s.chainlinkProxy.get(token) if !ok { - return nil, feedertypes.ErrSourceTokenNotConfigured.Wrap(fmt.Sprintf("failed to get chainlinkProxy for token:%s for not set", token)) + return nil, feedertypes.ErrSourceTokenNotConfigured.Wrap(fmt.Sprintf("chainlinkProxy not configured for token: %s", token)) } roundData, err := chainlinkPriceFeedProxy.LatestRoundData(&bind.CallOpts{}) @@ -85,5 +85,5 @@ func (s *source) reload(cfgPath string, token string) error { return nil } } - return errors.New("token not found in reloaded config filed") + return errors.New("token not found in reloaded config file") }