-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: Update slinky version #1768
Changes from 5 commits
3a72cb6
8e9ace0
ae42e73
ce7bfed
2fecfec
14fe18d
eab0745
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,7 +93,6 @@ import ( | |
"github.com/gorilla/mux" | ||
"github.com/rakyll/statik/fs" | ||
"github.com/spf13/cast" | ||
"go.uber.org/zap" | ||
"google.golang.org/grpc" | ||
|
||
// App | ||
|
@@ -1594,15 +1593,14 @@ func (app *App) initOracle(pricesTxDecoder process.UpdateMarketPriceTxDecoder) { | |
compression.NewDefaultVoteExtensionCodec(), | ||
compression.NewZLibCompressor(), | ||
), | ||
// We are not using the slinky PreBlocker, so there is no need to pass in PreBlocker here for | ||
// We are not using the slinky PreBlocker/PriceApplier, so there is no need to pass in PreBlocker here for | ||
// VE handler to work properly. | ||
// Currently the clob PreBlocker assumes that it will only be called during the normal ABCI | ||
// PreBlocker step. Passing in the app PreBlocker here will break that assumption by causing | ||
// the clob PreBlocker to be called unexpectedly. This to leads improperly initialized clob state | ||
// which results in the next block being committed incorrectly. | ||
func(_ sdk.Context, _ *abci.RequestFinalizeBlock) (*sdk.ResponsePreBlock, error) { | ||
return nil, nil | ||
}, | ||
// TODO we can move the UpdateMarketPrices in extend vote to this in the future. | ||
vote_extensions.NoopPriceApplier{}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider Refactoring the Vote Extension Handler Initialization The comment at line 1596 suggests that the current implementation of the Recommendation: It would be beneficial to refactor this initialization to ensure that the |
||
app.oracleMetrics, | ||
) | ||
|
||
|
@@ -1625,19 +1623,6 @@ func (app *App) initOracleMetrics(appOpts servertypes.AppOptions) { | |
if err != nil { | ||
panic(err) | ||
} | ||
// run prometheus metrics | ||
if cfg.MetricsEnabled { | ||
promLogger, err := zap.NewProduction() | ||
if err != nil { | ||
panic(err) | ||
} | ||
app.oraclePrometheusServer, err = promserver.NewPrometheusServer(cfg.PrometheusServerAddress, promLogger) | ||
if err != nil { | ||
panic(err) | ||
} | ||
// start the prometheus server | ||
go app.oraclePrometheusServer.Start() | ||
} | ||
app.oracleMetrics = oracleMetrics | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,11 +55,10 @@ func initAppConfig() (string, *DydxAppConfig) { | |
appConfig := DydxAppConfig{ | ||
Config: *srvCfg, | ||
Oracle: oracleconfig.AppConfig{ | ||
Enabled: true, | ||
OracleAddress: "localhost:8080", | ||
ClientTimeout: time.Second * 2, | ||
MetricsEnabled: false, | ||
PrometheusServerAddress: "", | ||
Enabled: true, | ||
OracleAddress: "localhost:8080", | ||
ClientTimeout: time.Second * 2, | ||
MetricsEnabled: false, | ||
Comment on lines
+58
to
+61
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ensure proper error handling for Oracle configuration. The Oracle configuration in + // TODO: Add error handling for Oracle connectivity issues.
|
||
}, | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,12 +29,12 @@ func (g *GrpcClientImpl) NewGrpcConnection( | |
ctx context.Context, | ||
socketAddress string, | ||
) (*grpc.ClientConn, error) { | ||
return grpc.DialContext( | ||
return grpc.DialContext( //nolint:staticcheck | ||
ctx, | ||
socketAddress, | ||
grpc.WithTransportCredentials(insecure.NewCredentials()), | ||
// https://github.com/grpc/grpc-go/blob/master/dialoptions.go#L264 | ||
grpc.WithBlock(), | ||
grpc.WithBlock(), //nolint:staticcheck | ||
Comment on lines
+32
to
+37
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Lack of justification for The
Please provide documentation or comments explaining why these static analysis warnings are being suppressed. Analysis chainReview of static analysis suppression annotations. The use of Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify that these suppressions are documented elsewhere in the repository.
# Test: Search for documentation on nolint usage. Expect: Documentation or comments explaining the usage.
rg "//nolint:staticcheck" -C 5
Length of output: 59316 |
||
grpc.WithContextDialer(func(ctx context.Context, addr string) (net.Conn, error) { | ||
// Create a custom `net.Dialer` in order to specify `unix` as the desired network. | ||
var dialer net.Dialer | ||
|
@@ -48,11 +48,11 @@ func (g *GrpcClientImpl) NewTcpConnection( | |
ctx context.Context, | ||
endpoint string, | ||
) (*grpc.ClientConn, error) { | ||
return grpc.DialContext( | ||
return grpc.DialContext( //nolint:staticcheck | ||
ctx, | ||
endpoint, | ||
grpc.WithTransportCredentials(insecure.NewCredentials()), | ||
grpc.WithBlock(), | ||
grpc.WithBlock(), //nolint:staticcheck | ||
Comment on lines
+51
to
+55
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tip Codebase Verification Documentation for The search results indicate multiple instances of
Please ensure that the usage of Analysis chainReview of static analysis suppression annotations in TCP connection setup. The Scripts executedThe following scripts were executed for the analysis: Script: #!/bin/bash
# Description: Verify that these suppressions are documented elsewhere in the repository.
# Test: Search for documentation on nolint usage. Expect: Documentation or comments explaining the usage.
rg "//nolint:staticcheck" -C 5
Length of output: 59316 |
||
) | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are the
PreBlocker
comments still relevant after this upgrade w.r.t slinky? Should this comment just call out the lack of use of the slinkyPriceApplier
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
PreBlocker
comment is no longer relevant (VE handler no longer depends onPreBlocker
) so I'm aligned w/ removing references toPreBlocker
in this commnetThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably not since we've moved away from using the preblocker here and have a dedicated interface now instead. Will remove.