Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/go_modules/cosmossdk.io/x/tx-0.13.3
Browse files Browse the repository at this point in the history
  • Loading branch information
SpicyLemon authored Apr 25, 2024
2 parents 980d928 + d66b340 commit 8c80ea0
Show file tree
Hide file tree
Showing 107 changed files with 2,995 additions and 2,779 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
if: env.GIT_DIFF
with:
go-version: '1.21'
- uses: golangci/golangci-lint-action@v4
- uses: golangci/golangci-lint-action@v5
if: env.GIT_DIFF
with:
# If you change this version, be sure to also change it in contrib/devtools/Makefile.
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto-registry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Buf setup action
uses: bufbuild/buf-setup-action@v1.30.1
uses: bufbuild/buf-setup-action@v1.31.0
- name: Buf push 'third_party/proto'
uses: bufbuild/buf-push-action@v1
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/proto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
fi
echo "Setting output: base-branch=$branch"
echo "base-branch=$branch" >> "$GITHUB_OUTPUT"
- uses: bufbuild/buf-setup-action@v1.30.1
- uses: bufbuild/buf-setup-action@v1.31.0
- uses: bufbuild/[email protected]
if: always()
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Buf setup action
uses: bufbuild/buf-setup-action@v1.30.1
uses: bufbuild/buf-setup-action@v1.31.0
- name: Buf push 'proto/'
uses: bufbuild/buf-push-action@v1
with:
Expand Down
22 changes: 20 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,28 @@ jobs:
# The next longest running is x/metadata/client/cli at 2.5ish minutes.
# So take x/marker/simulation out of the list, split the list into 3 parts and create a 4th part
# with just the x/marker/simulation test.
# Temporarily, several tests are known to still fail, so we make them all part 3, and split the rest among 0-2.
# TODO[1760]: Re-analyze how long tests tests take and change the splitting back to be based on speed.
run: |
grep -vF -e 'github.com/provenance-io/provenance/x/marker/simulation' pkgs.txt > pkgs.txt.tmp
grep -vF \
-e 'github.com/provenance-io/provenance/app' \
-e 'github.com/provenance-io/provenance/cmd/provenanced/cmd' \
-e 'github.com/provenance-io/provenance/internal/antewrapper' \
-e 'github.com/provenance-io/provenance/x/ibchooks' \
-e 'github.com/provenance-io/provenance/x/ibcratelimit/module' \
-e 'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \
-e 'github.com/provenance-io/provenance/x/oracle/simulation' \
pkgs.txt > pkgs.txt.tmp
split -d -n l/3 pkgs.txt.tmp pkgs.txt.part.
printf 'github.com/provenance-io/provenance/x/marker/simulation\n' > pkgs.txt.part.03
printf '%s\n' \
'github.com/provenance-io/provenance/app' \
'github.com/provenance-io/provenance/cmd/provenanced/cmd' \
'github.com/provenance-io/provenance/internal/antewrapper' \
'github.com/provenance-io/provenance/x/ibchooks' \
'github.com/provenance-io/provenance/x/ibcratelimit/module' \
'github.com/provenance-io/provenance/x/ibcratelimit/simulation' \
'github.com/provenance-io/provenance/x/oracle/simulation' \
> pkgs.txt.part.03
- uses: actions/upload-artifact@v4
with:
name: "${{ steps.def-vars.outputs.file-prefix }}-pkgs.txt.part.00"
Expand Down
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add PreBlocker support for sdk v0.50 [#1760](https://github.com/provenance-io/provenance/issues/1760).
* Add the Sanction module back in [#1922](https://github.com/provenance-io/provenance/pull/1922).
* Add the Quarantine module back in [#1926](https://github.com/provenance-io/provenance/pull/1926).
* Bump wasmd to `v0.50.0` [#1760](https://github.com/provenance-io/provenance/issues/1760).

### Improvements

Expand All @@ -68,18 +69,22 @@ 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).
* Fix most of the failing unit tests [#1943](https://github.com/provenance-io/provenance/pull/1943)

### Dependencies

- Bump `github.com/cosmos/ibc-go/v8` from 8.0.0 to 8.2.0 ([#1910](https://github.com/provenance-io/provenance/pull/1910))
- Bump `google.golang.org/grpc` from 1.62.1 to 1.63.2 ([#1903](https://github.com/provenance-io/provenance/pull/1903), [#1918](https://github.com/provenance-io/provenance/pull/1918))
- Bump `bufbuild/buf-breaking-action` from 1.1.3 to 1.1.4 ([#1894](https://github.com/provenance-io/provenance/pull/1894))
- Bump `bufbuild/buf-lint-action` from 1.1.0 to 1.1.1 ([#1895](https://github.com/provenance-io/provenance/pull/1895))
- Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.30.1 ([#1904](https://github.com/provenance-io/provenance/pull/1904))
- Bump `bufbuild/buf-setup-action` from 1.30.0 to 1.31.0 ([#1904](https://github.com/provenance-io/provenance/pull/1904), [#1949](https://github.com/provenance-io/provenance/pull/1949))
- Bump `github.com/cometbft/cometbft` from 0.38.5 to 0.38.6 ([#1912](https://github.com/provenance-io/provenance/pull/1912))
- Bump `cosmossdk.io/x/upgrade` from 0.1.0 to 0.1.1 ([#1913](https://github.com/provenance-io/provenance/pull/1913))
- Bump `github.com/hashicorp/go-metrics` from 0.5.2 to 0.5.3 ([#1914](https://github.com/provenance-io/provenance/pull/1914))
- Bump `peter-evans/create-pull-request` from 6.0.2 to 6.0.4 ([#1929](https://github.com/provenance-io/provenance/pull/1929), [#1940](https://github.com/provenance-io/provenance/pull/1940))
- Bump `cosmossdk.io/x/tx` from 0.13.1 to 0.13.2 ([#1928](https://github.com/provenance-io/provenance/pull/1928))
- 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 `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))

---
Expand Down
25 changes: 14 additions & 11 deletions app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,16 +326,18 @@ func New(
homePath string, invCheckPeriod uint,
appOpts servertypes.AppOptions, baseAppOptions ...func(*baseapp.BaseApp),
) *App {
interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
SigningOptions: signing.Options{
AddressCodec: address.Bech32Codec{
Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(),
},
ValidatorAddressCodec: address.Bech32Codec{
Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(),
},
signingOptions := signing.Options{
AddressCodec: address.Bech32Codec{
Bech32Prefix: sdk.GetConfig().GetBech32AccountAddrPrefix(),
},
ValidatorAddressCodec: address.Bech32Codec{
Bech32Prefix: sdk.GetConfig().GetBech32ValidatorAddrPrefix(),
},
}
exchange.DefineCustomGetSigners(&signingOptions)
interfaceRegistry, _ := types.NewInterfaceRegistryWithOptions(types.InterfaceRegistryOptions{
ProtoFiles: proto.HybridResolver,
SigningOptions: signingOptions,
})
appCodec := codec.NewProtoCodec(interfaceRegistry)
legacyAmino := codec.NewLegacyAmino()
Expand Down Expand Up @@ -694,7 +696,7 @@ func New(
govRouter.AddRoute(govtypes.RouterKey, govtypesv1beta1.ProposalHandler).
AddRoute(paramproposal.RouterKey, params.NewParamChangeProposalHandler(app.ParamsKeeper)).
AddRoute(ibcclienttypes.RouterKey, ibcclient.NewClientProposalHandler(app.IBCKeeper.ClientKeeper)).
// AddRoute(wasm.RouterKey, wasm.NewWasmProposalHandler(app.WasmKeeper, wasm.EnableAllProposals)). // TODO[1760]: wasm
AddRoute(wasm.RouterKey, wasmkeeper.NewLegacyWasmProposalHandler(app.WasmKeeper, wasmtypes.EnableAllProposals)). // TODO[1760]: gov: Can probably remove with gov v1
AddRoute(nametypes.ModuleName, name.NewProposalHandler(app.NameKeeper)).
AddRoute(markertypes.ModuleName, marker.NewProposalHandler(app.MarkerKeeper)).
AddRoute(msgfeestypes.ModuleName, msgfees.NewProposalHandler(app.MsgFeesKeeper, app.InterfaceRegistry()))
Expand Down Expand Up @@ -1016,7 +1018,7 @@ func New(
oraclemodule.NewAppModule(appCodec, app.OracleKeeper, app.AccountKeeper, app.BankKeeper, app.IBCKeeper.ChannelKeeper),
holdmodule.NewAppModule(appCodec, app.HoldKeeper),
exchangemodule.NewAppModule(appCodec, app.ExchangeKeeper),
provwasm.NewWrapper(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper, nil, app.GetSubspace(wasmtypes.ModuleName)), // TODO[1760]: Need to pass router instead of nil
provwasm.NewWrapper(appCodec, app.WasmKeeper, app.StakingKeeper, app.AccountKeeper, app.BankKeeper, app.NameKeeper, pioMessageRouter, app.GetSubspace(wasmtypes.ModuleName)),

// IBC
ibc.NewAppModule(app.IBCKeeper),
Expand Down Expand Up @@ -1118,6 +1120,7 @@ func New(
app.ScopedICQKeeper = scopedICQKeeper
app.ScopedICAHostKeeper = scopedICAHostKeeper

simappparams.AppEncodingConfig = app.GetEncodingConfig()
return app
}

Expand Down
19 changes: 0 additions & 19 deletions app/params/doc.go

This file was deleted.

4 changes: 4 additions & 0 deletions app/params/encoding.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,7 @@ type EncodingConfig struct {
TxConfig client.TxConfig
Amino *codec.LegacyAmino
}

// AppEncodingConfig is a global encoding config made available for areas where we don't otherwise have access to it.
// It's set (and updated) during app.New.
var AppEncodingConfig EncodingConfig
7 changes: 0 additions & 7 deletions app/params/params.go

This file was deleted.

16 changes: 8 additions & 8 deletions app/store_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,15 +104,15 @@ func TestValidateWrapper(t *testing.T) {
{
name: "bad config",
appOpts: MockAppOptions{
db: "cleveldb",
pruning: "10000",
},
expLogMsgs: true,
expSleep: true,
},
{
name: "bad config no sleep",
appOpts: MockAppOptions{
db: "cleveldb",
pruning: "10000",
},
pioAckWarn: true,
expLogMsgs: true,
Expand Down Expand Up @@ -235,11 +235,11 @@ func TestIssueConfigWarnings(t *testing.T) {
name: "bad db",
appOpts: MockAppOptions{
pruning: "10",
db: "cleveldb",
db: "otherdb",
indexer: "null",
},
expLogLines: []string{
"ERR cleveldb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
"ERR otherdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
sleepErr1,
sleepErr2,
},
Expand All @@ -249,13 +249,13 @@ func TestIssueConfigWarnings(t *testing.T) {
name: "all bad with sleep",
appOpts: MockAppOptions{
pruning: "1001",
db: "badgerdb",
db: "thisdb",
indexer: "psql",
},
expLogLines: []string{
"ERR pruning-interval 1001 EXCEEDS 999 AND IS NOT RECOMMENDED, AS IT CAN LEAD TO MISSED BLOCKS ON VALIDATORS.",
"ERR indexer \"psql\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"null\".",
"ERR badgerdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
"ERR thisdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
sleepErr1,
sleepErr2,
},
Expand All @@ -265,14 +265,14 @@ func TestIssueConfigWarnings(t *testing.T) {
name: "all bad no sleep",
appOpts: MockAppOptions{
pruning: "1001",
db: "badgerdb",
db: "thatdb",
indexer: "psql",
},
pioAckWarn: "1",
expLogLines: []string{
"ERR pruning-interval 1001 EXCEEDS 999 AND IS NOT RECOMMENDED, AS IT CAN LEAD TO MISSED BLOCKS ON VALIDATORS.",
"ERR indexer \"psql\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"null\".",
"ERR badgerdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
"ERR thatdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
},
expSleep: false,
},
Expand Down
30 changes: 13 additions & 17 deletions app/upgrades_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func TestUpgradeTestSuite(t *testing.T) {
suite.Run(t, new(UpgradeTestSuite))
}

func (s *UpgradeTestSuite) SetupSuite() {
func (s *UpgradeTestSuite) SetupTest() {
// Alert: This function is SetupSuite. That means all tests in here
// will use the same app with the same store and data.
defer SetLoggerMaker(SetLoggerMaker(BufferedInfoLoggerMaker(&s.logBuffer)))
Expand Down Expand Up @@ -315,16 +315,6 @@ func (s *UpgradeTestSuite) TestKeysInHandlersMap() {
}
})

s.Run("two or more colors exist", func() {
// We always need the colors currently in use on mainnet and testnet.
// The ones before that shouldn't be removed until we add new ones.
// It's okay to not clean the old ones up immediately, though.
// So we always want at least 2 different colors in there.
s.Assert().GreaterOrEqual(len(colors), 2, "number of distinct colors: %q in %q", colors, handlerKeys)
// If there are more than 3, we need to do some cleanup though.
s.Assert().LessOrEqual(len(colors), 3, "number of distinct colors: %q in %q", colors, handlerKeys)
})

s.Run("no two colors start with same character", func() {
// Little tricky here. i will go from 0 to len(colors) - 2 and the color will go from the 2nd to last.
// So colors[i] in here will be the entry just before color.
Expand Down Expand Up @@ -452,7 +442,8 @@ func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
s.Require().Len(validators, 1, "GetAllValidators after setup")

expectedLogLines := []string{
"INF Removing all delegations from validators that have been inactive (unbonded) for 21 days.",
"INF Removing inactive validator delegations.",
"INF Threshold: 21 days",
"INF A total of 0 inactive (unbonded) validators have had all their delegators removed.",
}
s.ExecuteAndAssertLogs(runner, expectedLogLines, nil, true, runnerName)
Expand All @@ -474,7 +465,8 @@ func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
s.Require().Len(validators, 2, "Setup: GetAllValidators should have: 1 bonded, 1 unbonded")

expectedLogLines := []string{
"INF Removing all delegations from validators that have been inactive (unbonded) for 21 days.",
"INF Removing inactive validator delegations.",
"INF Threshold: 21 days",
fmt.Sprintf("INF Validator %v has been inactive (unbonded) for %d days and will be removed.", unbondedVal1.OperatorAddress, 30),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr1.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
"INF A total of 1 inactive (unbonded) validators have had all their delegators removed.",
Expand Down Expand Up @@ -510,7 +502,8 @@ func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
s.Require().Len(validators, 2, "Setup: GetAllValidators should have: 1 bonded, 1 unbonded")

expectedLogLines := []string{
"INF Removing all delegations from validators that have been inactive (unbonded) for 21 days.",
"INF Removing inactive validator delegations.",
"INF Threshold: 21 days",
fmt.Sprintf("INF Validator %v has been inactive (unbonded) for %d days and will be removed.", unbondedVal1.OperatorAddress, 30),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr1.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr2.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
Expand Down Expand Up @@ -556,7 +549,8 @@ func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
s.Require().Len(validators, 3, "Setup: GetAllValidators should have: 1 bonded, 2 unbonded")

expectedLogLines := []string{
"INF Removing all delegations from validators that have been inactive (unbonded) for 21 days.",
"INF Removing inactive validator delegations.",
"INF Threshold: 21 days",
fmt.Sprintf("INF Validator %v has been inactive (unbonded) for %d days and will be removed.", unbondedVal1.OperatorAddress, 30),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr1.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr2.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
Expand Down Expand Up @@ -604,7 +598,8 @@ func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
s.Require().Len(validators, 3, "Setup: GetAllValidators should have: 1 bonded, 1 recently unbonded, 1 old unbonded")

expectedLogLines := []string{
"INF Removing all delegations from validators that have been inactive (unbonded) for 21 days.",
"INF Removing inactive validator delegations.",
"INF Threshold: 21 days",
fmt.Sprintf("INF Validator %v has been inactive (unbonded) for %d days and will be removed.", unbondedVal1.OperatorAddress, 30),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr1.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
fmt.Sprintf("INF Undelegate delegator %v from validator %v of all shares (%v).", addr2.String(), unbondedVal1.OperatorAddress, delegationCoinAmt),
Expand Down Expand Up @@ -640,7 +635,8 @@ func (s *UpgradeTestSuite) TestRemoveInactiveValidatorDelegations() {
s.Require().Len(validators, 3, "Setup: GetAllValidators should have: 1 bonded, 1 recently unbonded, 1 empty unbonded")

expectedLogLines := []string{
"INF Removing all delegations from validators that have been inactive (unbonded) for 21 days.",
"INF Removing inactive validator delegations.",
"INF Threshold: 21 days",
fmt.Sprintf("INF Validator %v has been inactive (unbonded) for %d days and will be removed.", unbondedVal1.OperatorAddress, 30),
"INF A total of 1 inactive (unbonded) validators have had all their delegators removed.",
}
Expand Down
2 changes: 2 additions & 0 deletions cmd/provenanced/cmd/addresses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,7 @@ func (s *MetaaddressTestSuite) TestAddMetaAddressDecoder() {
command.SetArgs(tc.args)
b := bytes.NewBufferString("")
command.SetOut(b)
command.SetErr(b)
err := command.Execute()
if len(tc.err) > 0 {
require.EqualErrorf(t, err, tc.err, "%s - expected error", command.Name())
Expand Down Expand Up @@ -369,6 +370,7 @@ func (s *MetaaddressTestSuite) TestAddMetaAddressEncoder() {
command.SetArgs(tc.args)
b := bytes.NewBufferString("")
command.SetOut(b)
command.SetErr(b)
err := command.Execute()
if len(tc.err) > 0 {
require.EqualErrorf(t, err, tc.err, "%s - expected error", command.Name())
Expand Down
6 changes: 6 additions & 0 deletions cmd/provenanced/cmd/cmd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd_test

import (
"fmt"
"io"
"testing"

"github.com/stretchr/testify/require"
Expand All @@ -21,6 +22,8 @@ func TestInitCmd(t *testing.T) {
"simapp-test", // Moniker
fmt.Sprintf("--%s=%s", cli.FlagOverwrite, "true"), // Overwrite genesis.json, in case it already exists
})
rootCmd.SetOut(io.Discard)
rootCmd.SetErr(io.Discard)

err := cmd.Execute(rootCmd)
require.NoError(t, err)
Expand Down Expand Up @@ -73,6 +76,9 @@ func TestGenAutoCompleteCmd(t *testing.T) {

rootCmd, _ := cmd.NewRootCmd(false)
rootCmd.SetArgs(args)
rootCmd.SetOut(io.Discard)
rootCmd.SetErr(io.Discard)

err := cmd.Execute(rootCmd)
assertions.AssertErrorValue(t, err, tc.err, "should have the correct output value")
})
Expand Down
Loading

0 comments on commit 8c80ea0

Please sign in to comment.