Skip to content

Commit

Permalink
Turn off buggy WASM metrics (#637)
Browse files Browse the repository at this point in the history
# Description

Due to buggy initialization of metrics collector, WASM causes panics when metrics are collected.
Bug is described here: CosmWasm/wasmd#1574
and fixed here: CosmWasm/wasmd#1575

Once v0.42 is released we may uncomment this code. Task has been created for this.

# Reviewers checklist:
- [ ] Try to write more meaningful comments with clear actions to be taken.
- [ ] Nit-picking should be unblocking. Focus on core issues.

# Authors checklist
- [x] Provide a concise and meaningful description
- [x] Review the code yourself first, before making the PR.
- [x] Annotate your PR in places that require explanation.
- [x] Think and try to split the PR to smaller PR if it is big.
  • Loading branch information
Superdev1010 committed Sep 7, 2023
1 parent 18a089d commit 0d7025a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ import (
ibctm "github.com/cosmos/ibc-go/v7/modules/light-clients/07-tendermint"
ibclocalhost "github.com/cosmos/ibc-go/v7/modules/light-clients/09-localhost"
"github.com/pkg/errors"
"github.com/prometheus/client_golang/prometheus"
"github.com/spf13/cast"

"github.com/CoreumFoundation/coreum/v2/app/openapi"
Expand Down Expand Up @@ -563,9 +562,14 @@ func New(
app.NFTKeeper,
)),
}
if cast.ToBool(appOpts.Get("telemetry.enabled")) {
wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
}

// FIXME (wasmd-1575): This is commented out temporarily because it causes panics in telemetry server due to buggy
// initialization of wasm vm in version v0.41 of wasmd.
// Bug has been already fixed here: https://github.com/CosmWasm/wasmd/pull/1575
// and will be released in v0.42.
// if cast.ToBool(appOpts.Get("telemetry.enabled")) {
// wasmOpts = append(wasmOpts, wasmkeeper.WithVMCacheMetrics(prometheus.DefaultRegisterer))
// }

// The last arguments can contain custom message handlers, and custom query handlers,
// if we want to allow any custom callbacks
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ require (
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway v1.16.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.16.2
github.com/prometheus/client_golang v1.16.0
github.com/samber/lo v1.38.1
github.com/spf13/cast v1.5.1
github.com/spf13/cobra v1.7.0
Expand Down Expand Up @@ -149,6 +148,7 @@ require (
github.com/petermattis/goid v0.0.0-20230317030725-371a4b8eda08 // indirect
github.com/pkg/errors v0.9.1
github.com/pmezard/go-difflib v1.0.0 // indirect
github.com/prometheus/client_golang v1.16.0 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.10.1 // indirect
Expand Down

0 comments on commit 0d7025a

Please sign in to comment.