From c15c668fc3e70c9d4b9a8b4a6c301d373e6aee3f Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 10:23:33 -0600 Subject: [PATCH 1/4] Bump google.golang.org/protobuf from 1.34.0 to 1.34.1 (#1966) * Bump google.golang.org/protobuf from 1.34.0 to 1.34.1 Bumps google.golang.org/protobuf from 1.34.0 to 1.34.1. --- updated-dependencies: - dependency-name: google.golang.org/protobuf dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] * Updated Changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] --- CHANGELOG.md | 2 +- go.mod | 2 +- go.sum | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index deebb8f6f8..6231d76a3a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -85,7 +85,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ - Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944)) - Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950)) - Bump `golangci/golangci-lint-action` from 4 to 5 ([#1951](https://github.com/provenance-io/provenance/pull/1951)) -- Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.0 ([#1960](https://github.com/provenance-io/provenance/pull/1960)) +- Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966)) - Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958)) - Bump `golang.org/x/text` from 0.14.0 to 0.15.0 ([#1964](https://github.com/provenance-io/provenance/pull/1964)) diff --git a/go.mod b/go.mod index 4f485ad476..dd2fc86973 100644 --- a/go.mod +++ b/go.mod @@ -43,7 +43,7 @@ require ( golang.org/x/text v0.15.0 google.golang.org/genproto/googleapis/api v0.0.0-20240227224415-6ceb2ff114de google.golang.org/grpc v1.63.2 - google.golang.org/protobuf v1.34.0 + google.golang.org/protobuf v1.34.1 gopkg.in/yaml.v2 v2.4.0 ) diff --git a/go.sum b/go.sum index fca1979c51..81dfd658e2 100644 --- a/go.sum +++ b/go.sum @@ -1683,8 +1683,8 @@ google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQ google.golang.org/protobuf v1.28.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I= -google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= -google.golang.org/protobuf v1.34.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= +google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg= +google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= From 2ea94402ac4e758c5a3402dca542ee57a3b565f3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 May 2024 13:21:43 -0400 Subject: [PATCH 2/4] Bump golangci/golangci-lint-action from 5 to 6 (#1965) * Bump golangci/golangci-lint-action from 5 to 6 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 5 to 6. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](https://github.com/golangci/golangci-lint-action/compare/v5...v6) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] * Updated Changelog * Updated Changelog --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Carlton N Hanna Co-authored-by: nullpointer0x00 --- .github/workflows/lint.yml | 2 +- CHANGELOG.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bb414d58be..aad066fb05 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -29,7 +29,7 @@ jobs: if: env.GIT_DIFF with: go-version: '1.21' - - uses: golangci/golangci-lint-action@v5 + - uses: golangci/golangci-lint-action@v6 if: env.GIT_DIFF with: # If you change this version, be sure to also change it in contrib/devtools/Makefile. diff --git a/CHANGELOG.md b/CHANGELOG.md index 6231d76a3a..6beebeb12d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -84,7 +84,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ - Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.5 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940), [#1955](https://github.com/provenance-io/provenance/pull/1955)) - Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.3 ([#1928](https://github.com/provenance-io/provenance/pull/1928), [#1944](https://github.com/provenance-io/provenance/pull/1944)) - Bump `cosmwasm-std` from 1.4.1 to 1.4.4 ([#1950](https://github.com/provenance-io/provenance/pull/1950)) -- Bump `golangci/golangci-lint-action` from 4 to 5 ([#1951](https://github.com/provenance-io/provenance/pull/1951)) +- Bump `golangci/golangci-lint-action` from 4 to 6 ([#1951](https://github.com/provenance-io/provenance/pull/1951), [#1965](https://github.com/provenance-io/provenance/pull/1965)) - Bump `google.golang.org/protobuf` from 1.33.0 to 1.34.1 ([#1960](https://github.com/provenance-io/provenance/pull/1960), [#1966](https://github.com/provenance-io/provenance/pull/1966)) - Bump `github.com/hashicorp/go-getter` from 1.7.3 to 1.7.4 ([#1958](https://github.com/provenance-io/provenance/pull/1958)) - Bump `golang.org/x/text` from 0.14.0 to 0.15.0 ([#1964](https://github.com/provenance-io/provenance/pull/1964)) From f58633d4c3bbcd6aa14a1be6ab0b6993f2e60104 Mon Sep 17 00:00:00 2001 From: Matt Witkowski Date: Tue, 7 May 2024 13:30:41 -0400 Subject: [PATCH 3/4] Removes sync-info command (#1952) * Update changelog. * First attempt at state-sync. * Temporary commit with changes. * Update changelog. * Revert to what is in main. * Remove sync-info. --- CHANGELOG.md | 1 + app/app.go | 4 ---- internal/statesync/statesync.go | 35 --------------------------------- 3 files changed, 1 insertion(+), 39 deletions(-) delete mode 100644 internal/statesync/statesync.go diff --git a/CHANGELOG.md b/CHANGELOG.md index 6beebeb12d..9f08ec06a9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -69,6 +69,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Restore gov-prop cli commands and fix next key decoding [#1930](https://github.com/provenance-io/provenance/pull/1930). * Switch to InputOutputCoinsProv for exchange transfers [#1930](https://github.com/provenance-io/provenance/pull/1930). * Use fields of the SimulationState for the encoders needed for simulations [#1931](https://github.com/provenance-io/provenance/pull/1931). +* Removes sync-info code for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760). * Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943) ### Dependencies diff --git a/app/app.go b/app/app.go index ca045c2a13..0a7d688a05 100644 --- a/app/app.go +++ b/app/app.go @@ -129,7 +129,6 @@ import ( piohandlers "github.com/provenance-io/provenance/internal/handlers" "github.com/provenance-io/provenance/internal/pioconfig" "github.com/provenance-io/provenance/internal/provwasm" - "github.com/provenance-io/provenance/internal/statesync" "github.com/provenance-io/provenance/x/attribute" attributekeeper "github.com/provenance-io/provenance/x/attribute/keeper" attributetypes "github.com/provenance-io/provenance/x/attribute/types" @@ -402,9 +401,6 @@ func New( os.Exit(1) } - // Register helpers for state-sync status. - statesync.RegisterSyncStatus() - app.ParamsKeeper = initParamsKeeper(appCodec, legacyAmino, keys[paramstypes.StoreKey], tkeys[paramstypes.TStoreKey]) // set the BaseApp's parameter store diff --git a/internal/statesync/statesync.go b/internal/statesync/statesync.go deleted file mode 100644 index 08b02fc923..0000000000 --- a/internal/statesync/statesync.go +++ /dev/null @@ -1,35 +0,0 @@ -package statesync - -import ( - // cmtrpccore "github.com/cometbft/cometbft/rpc/core" // TODO[1760]: sync-info - // cmtrpc "github.com/cometbft/cometbft/rpc/jsonrpc/server" // TODO[1760]: sync-info - cmtrpctypes "github.com/cometbft/cometbft/rpc/jsonrpc/types" - - "github.com/cosmos/cosmos-sdk/version" -) - -func RegisterSyncStatus() { - // TODO[1760]: sync-info: Figure out how to still set a custom route. - // cmtrpccore.Routes["sync_info"] = cmtrpc.NewRPCFunc(GetSyncInfoAtBlock, "height") -} - -func GetSyncInfoAtBlock(ctx *cmtrpctypes.Context, height *int64) (*GetSyncInfo, error) { - // TODO[1760]: sync-info: Figure out the new way to get the current block. - // block, err := cmtrpccore.Block(ctx, height) - // if err != nil { - // return nil, err - // } - versionInfo := version.NewInfo() - si := &GetSyncInfo{ - BlockHeight: 123, // block.Block.Header.Height, // TODO[1760]: sync-info - BlockHash: "finishme", // block.Block.Header.Hash().String(), // TODO[1760]: sync-info - Version: versionInfo.Version, - } - return si, nil -} - -type GetSyncInfo struct { - BlockHeight int64 `json:"block_height"` - BlockHash string `json:"block_hash"` - Version string `json:"version"` -} From 6b3638a2b9c941d4fd0bd664f7cccf01111095b6 Mon Sep 17 00:00:00 2001 From: Matt Witkowski Date: Tue, 7 May 2024 13:38:09 -0400 Subject: [PATCH 4/4] Cleanup client config (#1962) * Remove ReadFromClientConfig since we already do this, and move the sign mode textual after this logic. * Update changelog. --- CHANGELOG.md | 1 + cmd/provenanced/cmd/root.go | 31 ------------------------------- cmd/provenanced/config/client.go | 24 ++++++++++++++++++++++++ 3 files changed, 25 insertions(+), 31 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f08ec06a9..61391afeaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -71,6 +71,7 @@ Ref: https://keepachangelog.com/en/1.0.0/ * Use fields of the SimulationState for the encoders needed for simulations [#1931](https://github.com/provenance-io/provenance/pull/1931). * Removes sync-info code for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760). * Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943) +* Clean up ReadFromClient [#1760](https://github.com/provenance-io/provenance/issues/1760). ### Dependencies diff --git a/cmd/provenanced/cmd/root.go b/cmd/provenanced/cmd/root.go index f59990f864..138cbbd941 100644 --- a/cmd/provenanced/cmd/root.go +++ b/cmd/provenanced/cmd/root.go @@ -26,7 +26,6 @@ import ( dbm "github.com/cosmos/cosmos-db" "github.com/cosmos/cosmos-sdk/baseapp" "github.com/cosmos/cosmos-sdk/client" - clientconfig "github.com/cosmos/cosmos-sdk/client/config" "github.com/cosmos/cosmos-sdk/client/debug" "github.com/cosmos/cosmos-sdk/client/flags" "github.com/cosmos/cosmos-sdk/client/keys" @@ -39,10 +38,7 @@ import ( simtestutil "github.com/cosmos/cosmos-sdk/testutil/sims" sdk "github.com/cosmos/cosmos-sdk/types" "github.com/cosmos/cosmos-sdk/types/module" - "github.com/cosmos/cosmos-sdk/types/tx/signing" authcmd "github.com/cosmos/cosmos-sdk/x/auth/client/cli" - "github.com/cosmos/cosmos-sdk/x/auth/tx" - txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" "github.com/cosmos/cosmos-sdk/x/auth/types" banktypes "github.com/cosmos/cosmos-sdk/x/bank/types" "github.com/cosmos/cosmos-sdk/x/crisis" @@ -109,33 +105,6 @@ func NewRootCmd(sealConfig bool) (*cobra.Command, params.EncodingConfig) { return err } - // TODO[1760]: client: Check impact that this has on our custom client config. - initClientCtx, err = clientconfig.ReadFromClientConfig(initClientCtx) - if err != nil { - return err - } - - // This needs to go after ReadFromClientConfig, as that function - // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode - // is only available if the client is online. - if !initClientCtx.Offline { - enabledSignModes := tx.DefaultSignModes - enabledSignModes = append(enabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) - txConfigOpts := tx.ConfigOptions{ - EnabledSignModes: enabledSignModes, - TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(initClientCtx), - } - txConfig, err := tx.NewTxConfigWithOptions( - initClientCtx.Codec, - txConfigOpts, - ) - if err != nil { - return err - } - - initClientCtx = initClientCtx.WithTxConfig(txConfig) - } - if err := client.SetCmdClientContext(cmd, initClientCtx); err != nil { return err } diff --git a/cmd/provenanced/config/client.go b/cmd/provenanced/config/client.go index 07e4da7b2f..244cab7e6f 100644 --- a/cmd/provenanced/config/client.go +++ b/cmd/provenanced/config/client.go @@ -5,6 +5,9 @@ import ( "fmt" "github.com/cosmos/cosmos-sdk/client" + "github.com/cosmos/cosmos-sdk/types/tx/signing" + "github.com/cosmos/cosmos-sdk/x/auth/tx" + txmodule "github.com/cosmos/cosmos-sdk/x/auth/tx/config" ) // Default constants @@ -92,5 +95,26 @@ func ApplyClientConfigToContext(ctx client.Context, config *ClientConfig) (clien WithClient(clnt). WithBroadcastMode(config.BroadcastMode) + // This needs to go after ReadFromClientConfig, as that function + // sets the RPC client needed for SIGN_MODE_TEXTUAL. This sign mode + // is only available if the client is online. + if !ctx.Offline { + enabledSignModes := tx.DefaultSignModes + enabledSignModes = append(enabledSignModes, signing.SignMode_SIGN_MODE_TEXTUAL) + txConfigOpts := tx.ConfigOptions{ + EnabledSignModes: enabledSignModes, + TextualCoinMetadataQueryFn: txmodule.NewGRPCCoinMetadataQueryFn(ctx), + } + txConfig, err := tx.NewTxConfigWithOptions( + ctx.Codec, + txConfigOpts, + ) + if err != nil { + return ctx, err + } + + ctx = ctx.WithTxConfig(txConfig) + } + return ctx, nil }