@@ -11,13 +11,9 @@ import (
1111 "github.com/gorilla/mux"
1212 "github.com/rakyll/statik/fs"
1313 feemarketkeeper "github.com/skip-mev/feemarket/x/feemarket/keeper"
14- "github.com/spf13/cast"
15- "github.com/spf13/viper"
1614
1715 abci "github.com/cometbft/cometbft/abci/types"
18- tmcfg "github.com/cometbft/cometbft/config"
1916 tmjson "github.com/cometbft/cometbft/libs/json"
20- "github.com/cometbft/cometbft/privval"
2117 tmproto "github.com/cometbft/cometbft/proto/tendermint/types"
2218
2319 dbm "github.com/cosmos/cosmos-db"
@@ -41,7 +37,6 @@ import (
4137
4238 "github.com/cosmos/cosmos-sdk/baseapp"
4339 "github.com/cosmos/cosmos-sdk/client"
44- "github.com/cosmos/cosmos-sdk/client/flags"
4540 "github.com/cosmos/cosmos-sdk/client/grpc/cmtservice"
4641 nodeservice "github.com/cosmos/cosmos-sdk/client/grpc/node"
4742 "github.com/cosmos/cosmos-sdk/codec"
@@ -66,7 +61,6 @@ import (
6661 authtx "github.com/cosmos/cosmos-sdk/x/auth/tx"
6762 txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config"
6863 authtypes "github.com/cosmos/cosmos-sdk/x/auth/types"
69- genutiltypes "github.com/cosmos/cosmos-sdk/x/genutil/types"
7064 govkeeper "github.com/cosmos/cosmos-sdk/x/gov/keeper"
7165 govtypes "github.com/cosmos/cosmos-sdk/x/gov/types"
7266
@@ -78,8 +72,6 @@ import (
7872 "github.com/cosmos/gaia/v26/app/keepers"
7973 "github.com/cosmos/gaia/v26/app/upgrades"
8074 v260 "github.com/cosmos/gaia/v26/app/upgrades/v26_0_0"
81- gaiatelemetry "github.com/cosmos/gaia/v26/telemetry"
82- "github.com/cosmos/gaia/v26/x/telemetry"
8375)
8476
8577var (
@@ -114,8 +106,6 @@ type GaiaApp struct { //nolint: revive
114106 // simulation manager
115107 sm * module.SimulationManager
116108 configurator module.Configurator
117-
118- otelClient * gaiatelemetry.OtelClient
119109}
120110
121111func init () {
@@ -180,16 +170,6 @@ func NewGaiaApp(
180170 interfaceRegistry : interfaceRegistry ,
181171 }
182172
183- vi , err := getValidatorInfo (homePath , appOpts )
184- if err != nil {
185- logger .Debug ("failed to get validator info: unable to determine if this node is a validator" , "err" , err )
186- } else {
187- logger .Debug ("successfully determined if this node is a validator" , "moniker" , vi .Moniker )
188- }
189-
190- otelConfig := getOtelConfig (appOpts )
191- app .otelClient = gaiatelemetry .NewOtelClient (otelConfig , vi )
192-
193173 moduleAccountAddresses := app .ModuleAccountAddrs ()
194174
195175 // Setup keepers
@@ -241,7 +221,6 @@ func NewGaiaApp(
241221 app .mm .SetOrderPreBlockers (
242222 upgradetypes .ModuleName ,
243223 authtypes .ModuleName ,
244- telemetry .ModuleName ,
245224 )
246225 // During begin block slashing happens after distr.BeginBlocker so that
247226 // there is nothing left over in the validator fee pool, so as to keep the
@@ -379,15 +358,6 @@ func NewGaiaApp(
379358 }
380359 }
381360
382- if otelConfig .CollectorEndpoint != "" && ! otelConfig .Disable {
383- logger .Debug ("creating gaia app with open telemetry" )
384- if err := app .otelClient .StartExporter (logger ); err != nil {
385- panic (err )
386- }
387- } else {
388- logger .Debug ("creating gaia app without open telemetry" )
389- }
390-
391361 return app
392362}
393363
@@ -455,25 +425,6 @@ func (app *GaiaApp) BlockedModuleAccountAddrs(modAccAddrs map[string]bool) map[s
455425 return modAccAddrs
456426}
457427
458- func getOtelConfig (appOpts servertypes.AppOptions ) gaiatelemetry.OtelConfig {
459- // if appOpts.Get yields nil, this value was not set.
460- // since the user isn't making any intent to disable here, we will use the DefaultOtelConfig.
461- disableRaw := appOpts .Get ("opentelemetry.disable" )
462- if disableRaw == nil {
463- return gaiatelemetry .DefaultOtelConfig
464- }
465- // if disableRaw wasn't nil, the user is making the intent to use their config. so we will use their values.
466- otelConfig := gaiatelemetry.OtelConfig {
467- Disable : cast .ToBool (appOpts .Get ("opentelemetry.disable" )),
468- CollectorEndpoint : cast .ToString (appOpts .Get ("opentelemetry.collector-endpoint" )),
469- CollectorMetricsURLPath : cast .ToString (appOpts .Get ("opentelemetry.collector-metrics-url-path" )),
470- User : cast .ToString (appOpts .Get ("opentelemetry.user" )),
471- Token : cast .ToString (appOpts .Get ("opentelemetry.token" )),
472- PushInterval : cast .ToDuration (appOpts .Get ("opentelemetry.push-interval" )),
473- }
474- return otelConfig
475- }
476-
477428// LegacyAmino returns GaiaApp's amino codec.
478429//
479430// NOTE: This is solely to be used for testing purposes as it may be desirable
@@ -616,48 +567,6 @@ func (app *GaiaApp) AutoCliOpts() autocli.AppOptions {
616567 }
617568}
618569
619- func getValidatorInfo (homePath string , appOpts servertypes.AppOptions ) (gaiatelemetry.ValidatorInfo , error ) {
620- cfg := & tmcfg.Config {
621- BaseConfig : tmcfg.BaseConfig {},
622- RPC : & tmcfg.RPCConfig {},
623- P2P : & tmcfg.P2PConfig {},
624- Mempool : & tmcfg.MempoolConfig {},
625- StateSync : & tmcfg.StateSyncConfig {},
626- BlockSync : & tmcfg.BlockSyncConfig {},
627- Consensus : & tmcfg.ConsensusConfig {},
628- Storage : & tmcfg.StorageConfig {},
629- TxIndex : & tmcfg.TxIndexConfig {},
630- Instrumentation : & tmcfg.InstrumentationConfig {},
631- }
632- cfg .SetRoot (homePath )
633-
634- configPath := filepath .Join (homePath , "config" , "config.toml" )
635- if _ , err := os .Stat (configPath ); err == nil {
636- viper := viper .New ()
637- viper .SetConfigType ("toml" )
638- viper .SetConfigFile (configPath )
639- if err := viper .ReadInConfig (); err == nil {
640- if err := viper .Unmarshal (cfg ); err != nil {
641- return gaiatelemetry.ValidatorInfo {}, fmt .Errorf ("failed to unmarshal config file: %w" , err )
642- }
643- }
644- } else {
645- return gaiatelemetry.ValidatorInfo {}, fmt .Errorf ("unable to stat config file at %s" , configPath )
646- }
647-
648- chainID := cast .ToString (appOpts .Get (flags .FlagChainID ))
649- if chainID == "" {
650- genDocFile := filepath .Join (homePath , "config" , "genesis.json" )
651- appGenesis , err := genutiltypes .AppGenesisFromFile (genDocFile )
652- if err == nil {
653- chainID = appGenesis .ChainID
654- }
655- }
656-
657- vi , err := validatorInfoFromCometConfig (cfg , chainID )
658- return vi , err
659- }
660-
661570// TestingApp functions
662571
663572// GetBaseApp implements the TestingApp interface.
@@ -724,41 +633,3 @@ func minTxFeesChecker(ctx sdk.Context, tx sdk.Tx, feemarketKp feemarketkeeper.Ke
724633
725634 return feeTx .GetFee (), 0 , nil
726635}
727-
728- var ErrNotValidator = fmt .Errorf ("not validator" )
729-
730- func validatorInfoFromCometConfig (cfg * tmcfg.Config , chainID string ) (gaiatelemetry.ValidatorInfo , error ) {
731- vi := gaiatelemetry.ValidatorInfo {
732- ChainID : chainID ,
733- }
734- if cfg .PrivValidatorListenAddr != "" {
735- listenAddr := cfg .PrivValidatorListenAddr
736- pve , err := privval .NewSignerListener (listenAddr , nil )
737- if err != nil {
738- return vi , fmt .Errorf ("failed to start private validator: %w" , err )
739- }
740-
741- pvsc , err := privval .NewSignerClient (pve , chainID )
742- if err != nil {
743- return vi , fmt .Errorf ("failed to start private validator: %w" , err )
744- }
745-
746- pk , err := pvsc .GetPubKey ()
747- if err != nil {
748- return vi , fmt .Errorf ("cannot get pubkey from remote signer: %w" , err )
749- }
750- vi .Moniker = cfg .Moniker
751- vi .Address = pk .Address ()
752- return vi , nil
753- } else if cfg .PrivValidatorKey != "" {
754- vi .Moniker = cfg .Moniker
755- _ , err := os .Stat (cfg .PrivValidatorKeyFile ())
756- if err != nil {
757- return vi , ErrNotValidator
758- }
759- pv := privval .LoadFilePV (cfg .PrivValidatorKeyFile (), cfg .PrivValidatorStateFile ())
760- vi .Address = pv .GetAddress ()
761- return vi , nil
762- }
763- return vi , ErrNotValidator
764- }
0 commit comments