-
Notifications
You must be signed in to change notification settings - Fork 209
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
simplify slinky integration by only allowing out process
- Loading branch information
Showing
5 changed files
with
77 additions
and
419 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -158,7 +158,6 @@ import ( | |
compression "github.com/skip-mev/slinky/abci/strategies/codec" | ||
Check failure on line 158 in app/app.go
|
||
"github.com/skip-mev/slinky/abci/strategies/currencypair" | ||
Check failure on line 159 in app/app.go
|
||
"github.com/skip-mev/slinky/abci/ve" | ||
Check failure on line 160 in app/app.go
|
||
"github.com/skip-mev/slinky/aggregator" | ||
oraclemetrics "github.com/skip-mev/slinky/oracle/metrics" | ||
oracleservice "github.com/skip-mev/slinky/service" | ||
serviceclient "github.com/skip-mev/slinky/service/client" | ||
|
@@ -987,41 +986,37 @@ func NewInitiaApp( | |
panic(err) | ||
} | ||
|
||
oracleCfg, metricsCfg := wrappedOracleConfig.GetConfigs() | ||
metrics, consAddress, err := servicemetrics.NewServiceMetricsFromConfig(metricsCfg.AppMetrics) | ||
metrics, consAddress, err := servicemetrics.NewServiceMetricsFromConfig( | ||
wrappedOracleConfig.MetricsConfig.ToAppMetricConfig(), | ||
) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
var zapLogger *zap.Logger | ||
if oracleCfg.Production { | ||
if wrappedOracleConfig.Production { | ||
zapLogger, err = zap.NewProduction() | ||
if err != nil { | ||
panic(err) | ||
} | ||
} else { | ||
zapLogger, err = zap.NewDevelopment() | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
app.OracleService, err = serviceclient.NewOracleService( | ||
zapLogger, | ||
oracleCfg, | ||
metricsCfg, | ||
apporacle.DefaultAPIProviderFactory(wrappedOracleConfig), | ||
aggregator.ComputeMedian(), | ||
) | ||
app.OracleService, err = apporacle.NewOracleService(wrappedOracleConfig) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// If app level instrumentation is enabled, then wrap the oracle service with a metrics client | ||
// to get metrics on the oracle service (for ABCI++). This will allow the instrumentation to track | ||
// latency in VerifyVoteExtension requests and more. | ||
if metricsCfg.AppMetrics.Enabled { | ||
if wrappedOracleConfig.MetricsConfig.Enabled { | ||
app.OracleService = serviceclient.NewMetricsClient(app.Logger(), app.OracleService, metrics) | ||
app.OraclePrometheusServer, err = oraclemetrics.NewPrometheusServer(wrappedOracleConfig.MetricsConfig.PrometheusServerAddress, zapLogger) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
app.oraclePreBlockHandler = oraclepreblock.NewOraclePreBlockHandler( | ||
|
@@ -1057,14 +1052,6 @@ func NewInitiaApp( | |
app.SetExtendVoteHandler(voteExtensionsHandler.ExtendVoteHandler()) | ||
app.SetVerifyVoteExtensionHandler(voteExtensionsHandler.VerifyVoteExtensionHandler()) | ||
|
||
// start the prometheus server if required | ||
if metricsCfg.AppMetrics.Enabled || metricsCfg.OracleMetrics.Enabled { | ||
app.OraclePrometheusServer, err = oraclemetrics.NewPrometheusServer(metricsCfg.PrometheusServerAddress, zapLogger) | ||
if err != nil { | ||
panic(err) | ||
} | ||
} | ||
|
||
////////////////// | ||
/// oracle end /// | ||
////////////////// | ||
|
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.