From bc166ef3922eea62fe68f37bdb164246afe81758 Mon Sep 17 00:00:00 2001 From: "Dima K." Date: Thu, 5 Sep 2024 11:33:14 -0700 Subject: [PATCH] [Dependencies] Bump go and cosmos-sdk (#797) ## Summary Bumps golang and cosmos sdk to the latest versions. ## Issue - Discovered that the latest cosmovisor needs a newer go version in #796 ## Type of change Select one or more from the following: - [ ] New feature, functionality or library - [ ] Consensus breaking; add the `consensus-breaking` label if so. See #791 for details - [ ] Bug fix - [x] Code health or cleanup - [ ] Documentation - [ ] Other (specify) ## Testing - [ ] **Documentation**: `make docusaurus_start`; only needed if you make doc changes - [ ] **Unit Tests**: `make go_develop_and_test` - [x] **LocalNet E2E Tests**: `make test_e2e` - [x] **DevNet E2E Tests**: Add the `devnet-test-e2e` label to the PR. ## Sanity Checklist - [ ] I have tested my changes using the available tooling - [ ] I have commented my code - [ ] I have performed a self-review of my own code; both comments & source code - [ ] I create and reference any new tickets, if applicable - [ ] I have left TODOs throughout the codebase, if applicable --- .devcontainer/Dockerfile | 2 +- .github/workflows/main-build.yml | 2 +- .github/workflows/release-artifacts.yml | 2 +- .github/workflows/run-tests.yml | 2 +- .github/workflows/upload-pages-artifact.yml | 2 +- .tool-versions | 4 ++-- Dockerfile.dev | 2 +- Makefile | 2 +- Tiltfile | 2 +- go.mod | 14 +++++------ go.sum | 24 +++++++++---------- localnet/poktrolld/config/config.toml | 18 +++++++++++++- pkg/client/tx/client.go | 2 +- pkg/relayer/proxy/proxy.go | 4 ++-- x/application/types/genesis.go | 2 +- .../types/message_stake_application.go | 2 +- x/proof/keeper/proof_validation.go | 2 +- x/supplier/config/supplier_configs_reader.go | 4 ++-- x/supplier/types/genesis.go | 2 +- x/supplier/types/message_stake_supplier.go | 2 +- 20 files changed, 56 insertions(+), 40 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0e2fdbe61..52545396c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,7 @@ # This Dockerfile is used to build container image for development purposes. # It intentionally contains no security features, ships with code and troubleshooting tools. -FROM mcr.microsoft.com/devcontainers/go:1-1.22-bookworm +FROM mcr.microsoft.com/devcontainers/go:1-1.23-bookworm RUN curl https://get.ignite.com/cli | bash RUN mv ignite /usr/local/bin/ diff --git a/.github/workflows/main-build.yml b/.github/workflows/main-build.yml index c55bd8dda..72f901046 100644 --- a/.github/workflows/main-build.yml +++ b/.github/workflows/main-build.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.2" + go-version: "1.23.0" - name: Install CI dependencies run: make install_ci_deps diff --git a/.github/workflows/release-artifacts.yml b/.github/workflows/release-artifacts.yml index 3ccc64487..2f6d40b19 100644 --- a/.github/workflows/release-artifacts.yml +++ b/.github/workflows/release-artifacts.yml @@ -24,7 +24,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.2" + go-version: "1.23.0" - name: Install CI dependencies run: make install_ci_deps diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index cfc045919..70d66edb9 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -27,7 +27,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.2" + go-version: "1.23.0" - name: Install CI dependencies run: make install_ci_deps diff --git a/.github/workflows/upload-pages-artifact.yml b/.github/workflows/upload-pages-artifact.yml index be310756b..6caa01401 100644 --- a/.github/workflows/upload-pages-artifact.yml +++ b/.github/workflows/upload-pages-artifact.yml @@ -23,7 +23,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v4 with: - go-version: "1.22.2" + go-version: "1.23.0" - name: Update gov params page run: make docs_update_gov_params_page diff --git a/.tool-versions b/.tool-versions index 99b01e2e6..35e71c3bb 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,4 +1,4 @@ # Run `asdf plugin add golang` and `asdf install` to install the dependencies, # and `asdf current` to switch to the versions of dependencies listed below -golang 1.22.2 -go 1.22.2 +golang 1.23.0 +go 1.23.0 diff --git a/Dockerfile.dev b/Dockerfile.dev index cb4e3e1de..3275e057c 100644 --- a/Dockerfile.dev +++ b/Dockerfile.dev @@ -1,7 +1,7 @@ # This Dockerfile is used to build container image for development purposes. # It intentionally contains no security features, ships with code and troubleshooting tools. -FROM golang:1.22.2 as base +FROM golang:1.23.0 as base RUN apt update && \ apt-get install -y \ diff --git a/Makefile b/Makefile index ef2fc3963..91e96d6eb 100644 --- a/Makefile +++ b/Makefile @@ -81,7 +81,7 @@ endif .PHONY: install_ci_deps install_ci_deps: ## Installs `mockgen` and other go tools go install "github.com/golang/mock/mockgen@v1.6.0" && mockgen --version - go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.59.1 && golangci-lint --version + go install github.com/golangci/golangci-lint/cmd/golangci-lint@v1.60.3 && golangci-lint --version go install golang.org/x/tools/cmd/goimports@latest go install github.com/mikefarah/yq/v4@latest diff --git a/Tiltfile b/Tiltfile index e6d0e8bcf..8c339de7f 100644 --- a/Tiltfile +++ b/Tiltfile @@ -185,7 +185,7 @@ local_resource( docker_build_with_restart( "poktrolld", ".", - dockerfile_contents="""FROM golang:1.22.2 + dockerfile_contents="""FROM golang:1.23.0 RUN apt-get -q update && apt-get install -qyy curl jq less RUN go install github.com/go-delve/delve/cmd/dlv@latest COPY bin/poktrolld /usr/local/bin/poktrolld diff --git a/go.mod b/go.mod index 8680b2477..488d4265b 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/pokt-network/poktroll -go 1.22.2 +go 1.23.0 // replace ( // DEVELOPER_TIP: Uncomment to use a local copy of shannon-sdk for development purposes. @@ -18,8 +18,8 @@ replace github.com/syndtr/goleveldb => github.com/syndtr/goleveldb v1.0.1-0.2021 require ( cosmossdk.io/api v0.7.5 cosmossdk.io/client/v2 v2.0.0-beta.1 - cosmossdk.io/core v0.11.0 - cosmossdk.io/depinject v1.0.0-alpha.4 + cosmossdk.io/core v0.11.1 + cosmossdk.io/depinject v1.0.0 cosmossdk.io/errors v1.0.1 cosmossdk.io/log v1.3.1 cosmossdk.io/math v1.3.0 @@ -31,10 +31,10 @@ require ( cosmossdk.io/x/upgrade v0.1.1 github.com/athanorlabs/go-dleq v0.1.0 github.com/bufbuild/buf v1.34.0 - github.com/cometbft/cometbft v0.38.7 + github.com/cometbft/cometbft v0.38.10 github.com/cosmos/cosmos-db v1.0.2 github.com/cosmos/cosmos-proto v1.0.0-beta.5 - github.com/cosmos/cosmos-sdk v0.50.7 + github.com/cosmos/cosmos-sdk v0.50.9 github.com/cosmos/gogoproto v1.5.0 github.com/cosmos/ibc-go/modules/capability v1.0.0 github.com/cosmos/ibc-go/v8 v8.2.0 @@ -92,7 +92,7 @@ require ( connectrpc.com/connect v1.16.2 // indirect connectrpc.com/otelconnect v0.7.0 // indirect cosmossdk.io/collections v0.4.0 // indirect - cosmossdk.io/x/tx v0.13.3 // indirect + cosmossdk.io/x/tx v0.13.4 // indirect filippo.io/edwards25519 v1.0.0 // indirect github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect github.com/99designs/keyring v1.2.1 // indirect @@ -198,6 +198,7 @@ require ( github.com/hashicorp/go-safetemp v1.0.0 // indirect github.com/hashicorp/go-version v1.6.0 // indirect github.com/hashicorp/golang-lru v1.0.2 // indirect + github.com/hashicorp/golang-lru/v2 v2.0.7 // indirect github.com/hashicorp/hcl v1.0.0 // indirect github.com/hashicorp/yamux v0.1.1 // indirect github.com/hdevalence/ed25519consensus v0.1.0 // indirect @@ -213,7 +214,6 @@ require ( github.com/kr/pretty v0.3.1 // indirect github.com/kr/text v0.2.0 // indirect github.com/lib/pq v1.10.7 // indirect - github.com/libp2p/go-buffer-pool v0.1.0 // indirect github.com/linxGnu/grocksdb v1.8.14 // indirect github.com/magiconair/properties v1.8.7 // indirect github.com/manifoldco/promptui v0.9.0 // indirect diff --git a/go.sum b/go.sum index 144e24f53..b29b7b0f5 100644 --- a/go.sum +++ b/go.sum @@ -198,10 +198,10 @@ cosmossdk.io/client/v2 v2.0.0-beta.1 h1:XkHh1lhrLYIT9zKl7cIOXUXg2hdhtjTPBUfqERNA cosmossdk.io/client/v2 v2.0.0-beta.1/go.mod h1:JEUSu9moNZQ4kU3ir1DKD5eU4bllmAexrGWjmb9k8qU= cosmossdk.io/collections v0.4.0 h1:PFmwj2W8szgpD5nOd8GWH6AbYNi1f2J6akWXJ7P5t9s= cosmossdk.io/collections v0.4.0/go.mod h1:oa5lUING2dP+gdDquow+QjlF45eL1t4TJDypgGd+tv0= -cosmossdk.io/core v0.11.0 h1:vtIafqUi+1ZNAE/oxLOQQ7Oek2n4S48SWLG8h/+wdbo= -cosmossdk.io/core v0.11.0/go.mod h1:LaTtayWBSoacF5xNzoF8tmLhehqlA9z1SWiPuNC6X1w= -cosmossdk.io/depinject v1.0.0-alpha.4 h1:PLNp8ZYAMPTUKyG9IK2hsbciDWqna2z1Wsl98okJopc= -cosmossdk.io/depinject v1.0.0-alpha.4/go.mod h1:HeDk7IkR5ckZ3lMGs/o91AVUc7E596vMaOmslGFM3yU= +cosmossdk.io/core v0.11.1 h1:h9WfBey7NAiFfIcUhDVNS503I2P2HdZLebJlUIs8LPA= +cosmossdk.io/core v0.11.1/go.mod h1:OJzxcdC+RPrgGF8NJZR2uoQr56tc7gfBKhiKeDO7hH0= +cosmossdk.io/depinject v1.0.0 h1:dQaTu6+O6askNXO06+jyeUAnF2/ssKwrrszP9t5q050= +cosmossdk.io/depinject v1.0.0/go.mod h1:zxK/h3HgHoA/eJVtiSsoaRaRA2D5U4cJ5thIG4ssbB8= cosmossdk.io/errors v1.0.1 h1:bzu+Kcr0kS/1DuPBtUFdWjzLqyUuCiyHjyJB6srBV/0= cosmossdk.io/errors v1.0.1/go.mod h1:MeelVSZThMi4bEakzhhhE/CKqVv3nOJDA25bIqRDu/U= cosmossdk.io/log v1.3.1 h1:UZx8nWIkfbbNEWusZqzAx3ZGvu54TZacWib3EzUYmGI= @@ -218,8 +218,8 @@ cosmossdk.io/x/evidence v0.1.0 h1:J6OEyDl1rbykksdGynzPKG5R/zm6TacwW2fbLTW4nCk= cosmossdk.io/x/evidence v0.1.0/go.mod h1:hTaiiXsoiJ3InMz1uptgF0BnGqROllAN8mwisOMMsfw= cosmossdk.io/x/feegrant v0.1.0 h1:c7s3oAq/8/UO0EiN1H5BIjwVntujVTkYs35YPvvrdQk= cosmossdk.io/x/feegrant v0.1.0/go.mod h1:4r+FsViJRpcZif/yhTn+E0E6OFfg4n0Lx+6cCtnZElU= -cosmossdk.io/x/tx v0.13.3 h1:Ha4mNaHmxBc6RMun9aKuqul8yHiL78EKJQ8g23Zf73g= -cosmossdk.io/x/tx v0.13.3/go.mod h1:I8xaHv0rhUdIvIdptKIqzYy27+n2+zBVaxO6fscFhys= +cosmossdk.io/x/tx v0.13.4 h1:Eg0PbJgeO0gM8p5wx6xa0fKR7hIV6+8lC56UrsvSo0Y= +cosmossdk.io/x/tx v0.13.4/go.mod h1:BkFqrnGGgW50Y6cwTy+JvgAhiffbGEKW6KF9ufcDpvk= cosmossdk.io/x/upgrade v0.1.1 h1:aoPe2gNvH+Gwt/Pgq3dOxxQVU3j5P6Xf+DaUJTDZATc= cosmossdk.io/x/upgrade v0.1.1/go.mod h1:MNLptLPcIFK9CWt7Ra//8WUZAxweyRDNcbs5nkOcQy0= dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= @@ -366,8 +366,8 @@ github.com/cockroachdb/redact v1.1.5/go.mod h1:BVNblN9mBWFyMyqK1k3AAiSxhvhfK2oOZ github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06 h1:zuQyyAKVxetITBuuhv3BI9cMrmStnpT18zmgmTxunpo= github.com/cockroachdb/tokenbucket v0.0.0-20230807174530-cc333fc44b06/go.mod h1:7nc4anLGjupUW/PeY5qiNYsdNXj7zopG+eqsS7To5IQ= github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd/go.mod h1:sE/e/2PUdi/liOCUjSTXgM1o87ZssimdTWN964YiIeI= -github.com/cometbft/cometbft v0.38.7 h1:ULhIOJ9+LgSy6nLekhq9ae3juX3NnQUMMPyVdhZV6Hk= -github.com/cometbft/cometbft v0.38.7/go.mod h1:HIyf811dFMI73IE0F7RrnY/Fr+d1+HuJAgtkEpQjCMY= +github.com/cometbft/cometbft v0.38.10 h1:2ePuglchT+j0Iao+cfmt/nw5U7K2lnGDzXSUPGVdXaU= +github.com/cometbft/cometbft v0.38.10/go.mod h1:jHPx9vQpWzPHEAiYI/7EDKaB1NXhK6o3SArrrY8ExKc= github.com/cometbft/cometbft-db v0.9.1 h1:MIhVX5ja5bXNHF8EYrThkG9F7r9kSfv8BX4LWaxWJ4M= github.com/cometbft/cometbft-db v0.9.1/go.mod h1:iliyWaoV0mRwBJoizElCwwRA9Tf7jZJOURcRZF9m60U= github.com/containerd/continuity v0.4.2 h1:v3y/4Yz5jwnvqPKJJ+7Wf93fyWoCB3F5EclWG023MDM= @@ -388,8 +388,8 @@ github.com/cosmos/cosmos-db v1.0.2 h1:hwMjozuY1OlJs/uh6vddqnk9j7VamLv+0DBlbEXbAK github.com/cosmos/cosmos-db v1.0.2/go.mod h1:Z8IXcFJ9PqKK6BIsVOB3QXtkKoqUOp1vRvPT39kOXEA= github.com/cosmos/cosmos-proto v1.0.0-beta.5 h1:eNcayDLpip+zVLRLYafhzLvQlSmyab+RC5W7ZfmxJLA= github.com/cosmos/cosmos-proto v1.0.0-beta.5/go.mod h1:hQGLpiIUloJBMdQMMWb/4wRApmI9hjHH05nefC0Ojec= -github.com/cosmos/cosmos-sdk v0.50.7 h1:LsBGKxifENR/DN4E1RZaitsyL93HU44x0p8EnMHp4V4= -github.com/cosmos/cosmos-sdk v0.50.7/go.mod h1:84xDDJEHttRT7NDGwBaUOLVOMN0JNE9x7NbsYIxXs1s= +github.com/cosmos/cosmos-sdk v0.50.9 h1:gt2usjz0H0qW6KwAxWw7ZJ3XU8uDwmhN+hYG3nTLeSg= +github.com/cosmos/cosmos-sdk v0.50.9/go.mod h1:TMH6wpoYBcg7Cp5BEg8fneLr+8XloNQkf2MRNF9V6JE= github.com/cosmos/go-bip39 v1.0.0 h1:pcomnQdrdH22njcAatO0yWojsUnCO3y2tNoV1cb6hHY= github.com/cosmos/go-bip39 v1.0.0/go.mod h1:RNJv0H/pOIVgxw6KS7QeX2a0Uo0aKUlfhZ4xuwvCdJw= github.com/cosmos/gogogateway v1.2.0 h1:Ae/OivNhp8DqBi/sh2A8a1D0y638GpL3tkmLQAiKxTE= @@ -775,6 +775,8 @@ github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v1.0.2 h1:dV3g9Z/unq5DpblPpw+Oqcv4dU/1omnb4Ok8iPY6p1c= github.com/hashicorp/golang-lru v1.0.2/go.mod h1:iADmTwqILo4mZ8BN3D2Q6+9jd8WM5uGBxy+E8yxSoD4= +github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= +github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= @@ -859,8 +861,6 @@ github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q= github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4= github.com/lib/pq v1.10.7 h1:p7ZhMD+KsSRozJr34udlUrhboJwWAgCg34+/ZZNvZZw= github.com/lib/pq v1.10.7/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o= -github.com/libp2p/go-buffer-pool v0.1.0 h1:oK4mSFcQz7cTQIfqbe4MIj9gLW+mnanjyFtc6cdF0Y8= -github.com/libp2p/go-buffer-pool v0.1.0/go.mod h1:N+vh8gMqimBzdKkSMVuydVDq+UV5QTWy5HSiZacSbPg= github.com/lightstep/lightstep-tracer-common/golang/gogo v0.0.0-20190605223551-bc2310a04743/go.mod h1:qklhhLq1aX+mtWk9cPHPzaBjWImj5ULL6C7HFJtXQMM= github.com/lightstep/lightstep-tracer-go v0.18.1/go.mod h1:jlF1pusYV4pidLvZ+XD0UBX0ZE6WURAspgAczcDHrL4= github.com/linxGnu/grocksdb v1.8.14 h1:HTgyYalNwBSG/1qCQUIott44wU5b2Y9Kr3z7SK5OfGQ= diff --git a/localnet/poktrolld/config/config.toml b/localnet/poktrolld/config/config.toml index a5acb79c2..d27c9a1a7 100644 --- a/localnet/poktrolld/config/config.toml +++ b/localnet/poktrolld/config/config.toml @@ -8,7 +8,7 @@ # The version of the CometBFT binary that created or # last modified the config file. Do not modify this. -version = "0.38.7" +version = "0.38.10" ####################################################################### ### Main Base Config Options ### @@ -168,6 +168,11 @@ experimental_close_on_slow_client = false # See https://github.com/tendermint/tendermint/issues/3435 timeout_broadcast_tx_commit = "10s" +# Maximum number of requests that can be sent in a batch +# If the value is set to '0' (zero-value), then no maximum batch size will be +# enforced for a JSON-RPC batch request. +max_request_batch_size = 10 + # Maximum size of request body, in bytes max_body_bytes = 1000000 @@ -283,6 +288,17 @@ type = "flood" # you can disable rechecking. recheck = true +# recheck_timeout is the time the application has during the rechecking process +# to return CheckTx responses, once all requests have been sent. Responses that +# arrive after the timeout expires are discarded. It only applies to +# non-local ABCI clients and when recheck is enabled. +# +# The ideal value will strongly depend on the application. It could roughly be estimated as the +# average size of the mempool multiplied by the average time it takes the application to validate one +# transaction. We consider that the ABCI application runs in the same location as the CometBFT binary +# so that the recheck duration is not affected by network delays when making requests and receiving responses. +recheck_timeout = "1s" + # Broadcast (default: true) defines whether the mempool should relay # transactions to other peers. Setting this to false will stop the mempool # from relaying transactions to other peers until they are included in a diff --git a/pkg/client/tx/client.go b/pkg/client/tx/client.go index 85c8bad5e..506db3d3e 100644 --- a/pkg/client/tx/client.go +++ b/pkg/client/tx/client.go @@ -272,7 +272,7 @@ func (txnClient *txClient) SignAndBroadcast( } if txResponse.Code != 0 { - return either.SyncErr(ErrCheckTx.Wrapf(txResponse.RawLog)) + return either.SyncErr(ErrCheckTx.Wrapf("%s", txResponse.RawLog)) } return txnClient.addPendingTransactions(encoding.NormalizeTxHashHex(txResponse.TxHash), timeoutHeight) diff --git a/pkg/relayer/proxy/proxy.go b/pkg/relayer/proxy/proxy.go index 4249e1dca..0db1016f9 100644 --- a/pkg/relayer/proxy/proxy.go +++ b/pkg/relayer/proxy/proxy.go @@ -177,11 +177,11 @@ func (rp *relayerProxy) ServedRelays() relayer.RelaysObservable { // validateConfig validates the relayer proxy's configuration options and returns an error if it is invalid. // TODO_TEST: Add tests for validating these configurations. func (rp *relayerProxy) validateConfig() error { - if rp.signingKeyNames == nil || len(rp.signingKeyNames) == 0 || rp.signingKeyNames[0] == "" { + if len(rp.signingKeyNames) == 0 || rp.signingKeyNames[0] == "" { return ErrRelayerProxyUndefinedSigningKeyNames } - if rp.serverConfigs == nil || len(rp.serverConfigs) == 0 { + if len(rp.serverConfigs) == 0 { return ErrRelayerServicesConfigsUndefined } diff --git a/x/application/types/genesis.go b/x/application/types/genesis.go index f0c91d1ce..094a4205f 100644 --- a/x/application/types/genesis.go +++ b/x/application/types/genesis.go @@ -61,7 +61,7 @@ func (gs GenesisState) Validate() error { // Validate the application service configs if err := servicehelpers.ValidateAppServiceConfigs(app.ServiceConfigs); err != nil { - return ErrAppInvalidServiceConfigs.Wrapf(err.Error()) + return ErrAppInvalidServiceConfigs.Wrapf("%s", err.Error()) } } diff --git a/x/application/types/message_stake_application.go b/x/application/types/message_stake_application.go index 0692066b4..7668e73d9 100644 --- a/x/application/types/message_stake_application.go +++ b/x/application/types/message_stake_application.go @@ -50,7 +50,7 @@ func (msg *MsgStakeApplication) ValidateBasic() error { // Validate the application service configs if err := servicehelpers.ValidateAppServiceConfigs(msg.Services); err != nil { - return ErrAppInvalidServiceConfigs.Wrapf(err.Error()) + return ErrAppInvalidServiceConfigs.Wrapf("%s", err.Error()) } return nil diff --git a/x/proof/keeper/proof_validation.go b/x/proof/keeper/proof_validation.go index dd875d7aa..96ddab42a 100644 --- a/x/proof/keeper/proof_validation.go +++ b/x/proof/keeper/proof_validation.go @@ -86,7 +86,7 @@ func (k Keeper) EnsureValidProof( return err } - if proof.ClosestMerkleProof == nil || len(proof.ClosestMerkleProof) == 0 { + if len(proof.ClosestMerkleProof) == 0 { return types.ErrProofInvalidProof.Wrap("proof cannot be empty") } diff --git a/x/supplier/config/supplier_configs_reader.go b/x/supplier/config/supplier_configs_reader.go index d8adfb227..d08d34fca 100644 --- a/x/supplier/config/supplier_configs_reader.go +++ b/x/supplier/config/supplier_configs_reader.go @@ -105,7 +105,7 @@ func ParseSupplierConfigs(ctx context.Context, configContent []byte) (*SupplierS } defaultRevSharePercent := map[string]float32{} - if stakeConfig.DefaultRevSharePercent == nil || len(stakeConfig.DefaultRevSharePercent) == 0 { + if len(stakeConfig.DefaultRevSharePercent) == 0 { // Ensure that if no default rev share is provided, the owner address is set // to 100% rev share. if stakeConfig.OwnerAddress == "" { @@ -117,7 +117,7 @@ func ParseSupplierConfigs(ctx context.Context, configContent []byte) (*SupplierS } // Validate the services - if stakeConfig.Services == nil || len(stakeConfig.Services) == 0 { + if len(stakeConfig.Services) == 0 { return nil, ErrSupplierConfigInvalidServiceId.Wrap("serviceIds cannot be empty") } diff --git a/x/supplier/types/genesis.go b/x/supplier/types/genesis.go index 7c696a50f..167be1dd2 100644 --- a/x/supplier/types/genesis.go +++ b/x/supplier/types/genesis.go @@ -54,7 +54,7 @@ func (gs GenesisState) Validate() error { // Validate the application service configs if err := servicehelpers.ValidateSupplierServiceConfigs(supplier.Services); err != nil { - return ErrSupplierInvalidServiceConfig.Wrapf(err.Error()) + return ErrSupplierInvalidServiceConfig.Wrapf("%s", err.Error()) } // Validate the supplier owner address diff --git a/x/supplier/types/message_stake_supplier.go b/x/supplier/types/message_stake_supplier.go index 18cc9e03b..96a86cd39 100644 --- a/x/supplier/types/message_stake_supplier.go +++ b/x/supplier/types/message_stake_supplier.go @@ -65,7 +65,7 @@ func (msg *MsgStakeSupplier) ValidateBasic() error { // Validate the supplier service configs if err := servicehelpers.ValidateSupplierServiceConfigs(msg.Services); err != nil { - return ErrSupplierInvalidServiceConfig.Wrapf(err.Error()) + return ErrSupplierInvalidServiceConfig.Wrapf("%s", err.Error()) } return nil