Skip to content
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

Backport: 1874 (IAVL bump). #1878

Merged
merged 3 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ linters-settings:
- github.com/stretchr/testify/assert
- github.com/stretchr/testify/suite

- github.com/cometbft/cometbft-db

- github.com/tendermint/tendermint
- github.com/tendermint/tm-db

Expand Down
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ Ref: https://keepachangelog.com/en/1.0.0/

* Allow force transfers from marker and market accounts [#1855](https://github.com/provenance-io/provenance/pull/1855).
* Add a `tourmaline-rc3` upgrade handler to set some new exchange module params related to payments [#1703](https://github.com/provenance-io/provenance/issues/1703).
* Remove the startup warning issued when disable-iavl-fastnode is true (we recommend keeping it as true if you already have it that way) [#1874](https://github.com/provenance-io/provenance/pull/1874).
* Switch to `github.com/cometbft/cometbft-db` `v0.7.0` (from `github.com/tendermint/tm-db` `v0.6.7`) [#1874](https://github.com/provenance-io/provenance/pull/1874).

### Bug Fixes

Expand All @@ -60,6 +62,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
- Bump `github.com/golang/protobuf` from 1.5.3 to 1.5.4 ([#1863](https://github.com/provenance-io/provenance/pull/1863))
- Bump `github.com/stretchr/testify` from 1.8.4 to 1.9.0 ([#1860](https://github.com/provenance-io/provenance/pull/1860))
- Bump `bufbuild/buf-setup-action` from 1.29.0 to 1.30.0 ([#1871](https://github.com/provenance-io/provenance/pull/1871))
- Bump `github.com/cosmos/cosmos-sdk` from v0.46.13-pio-3 to v0.46.13-pio-4 ([#1874](https://github.com/provenance-io/provenance/pull/1874)).
- Bump `github.com/cosmos/ibc-go/v6` from v6.2.0-pio-1 to v6.2.0-pio-2 ([#1874](https://github.com/provenance-io/provenance/pull/1874)).
- Bump `github.com/CosmWasm/wasmd` from v0.30.0-pio-6 to v0.30.0-pio-7 ([#1874](https://github.com/provenance-io/provenance/pull/1874)).
- Bump `github.com/cosmos/iavl` from v0.19.6 to v0.20.1 ([#1874](https://github.com/provenance-io/provenance/pull/1874)).

---

Expand Down
2 changes: 1 addition & 1 deletion app/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
wasmclient "github.com/CosmWasm/wasmd/x/wasm/client"
wasmkeeper "github.com/CosmWasm/wasmd/x/wasm/keeper"
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
dbm "github.com/cometbft/cometbft-db"
"github.com/gorilla/mux"
"github.com/rakyll/statik/fs"
"github.com/spf13/cast"
Expand All @@ -21,7 +22,6 @@ import (
abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmos "github.com/tendermint/tendermint/libs/os"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down
3 changes: 2 additions & 1 deletion app/app_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ import (
banktypes "github.com/cosmos/cosmos-sdk/x/bank/types"
distrtypes "github.com/cosmos/cosmos-sdk/x/distribution/types"

dbm "github.com/cometbft/cometbft-db"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

markermodule "github.com/provenance-io/provenance/x/marker"
markertypes "github.com/provenance-io/provenance/x/marker/types"
Expand Down
6 changes: 4 additions & 2 deletions app/sim_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,15 @@ import (
"testing"
"time"

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v6/types"
"github.com/stretchr/testify/require"

icqtypes "github.com/cosmos/ibc-apps/modules/async-icq/v6/types"

dbm "github.com/cometbft/cometbft-db"

abci "github.com/tendermint/tendermint/abci/types"
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/codec"
Expand Down
7 changes: 1 addition & 6 deletions app/store_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"
"time"

dbm "github.com/cometbft/cometbft-db"
"github.com/spf13/cast"

"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/server"
Expand Down Expand Up @@ -50,7 +50,6 @@ func IssueConfigWarnings(logger log.Logger, appOpts servertypes.AppOptions, slee
interval := cast.ToUint64(appOpts.Get("pruning-interval"))
txIndexer := cast.ToStringMap(appOpts.Get("tx_index"))
indexer := cast.ToString(txIndexer["indexer"])
fastNode := cast.ToBool(appOpts.Get(server.FlagDisableIAVLFastNode))
backend := server.GetAppDBBackend(appOpts)
var errs []string

Expand All @@ -62,10 +61,6 @@ func IssueConfigWarnings(logger log.Logger, appOpts servertypes.AppOptions, slee
errs = append(errs, fmt.Sprintf("indexer \"%s\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"%s\".", indexer, "null"))
}

if fastNode {
errs = append(errs, fmt.Sprintf("%s \"%v\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"%v\".", server.FlagDisableIAVLFastNode, fastNode, !fastNode))
}

if backend != dbm.GoLevelDBBackend {
errs = append(errs, fmt.Sprintf("%s IS NO LONGER SUPPORTED. MIGRATE TO %s.", backend, dbm.GoLevelDBBackend))
}
Expand Down
80 changes: 26 additions & 54 deletions app/store_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"

"github.com/cosmos/cosmos-sdk/server"
sdk "github.com/cosmos/cosmos-sdk/types"

"github.com/provenance-io/provenance/internal"
Expand Down Expand Up @@ -53,10 +52,9 @@ func (s *MockSleeper) Sleep(d time.Duration) {

// MockAppOptions is a mocked version of AppOpts that allows the developer to provide the pruning attribute.
type MockAppOptions struct {
pruning string
indexer string
db string
fastNode string
pruning string
indexer string
db string
}

// Get returns the value for the provided option.
Expand All @@ -72,8 +70,6 @@ func (m MockAppOptions) Get(opt string) interface{} {
return m.db
case "db-backend":
return m.db
case server.FlagDisableIAVLFastNode:
return m.fastNode
}

return nil
Expand All @@ -85,10 +81,9 @@ func TestValidateWrapper(t *testing.T) {
}()

recAppOpts := MockAppOptions{
pruning: "10",
db: "goleveldb",
fastNode: "false",
indexer: "null",
pruning: "10",
db: "goleveldb",
indexer: "null",
}

tests := []struct {
Expand Down Expand Up @@ -131,7 +126,7 @@ func TestValidateWrapper(t *testing.T) {
{
name: "bad config and err from store loader",
appOpts: MockAppOptions{
fastNode: "true",
db: "somethingelse",
},
expErr: "another injected error for testing",
expLogMsgs: true,
Expand All @@ -140,7 +135,7 @@ func TestValidateWrapper(t *testing.T) {
{
name: "bad config and err from store loader no sleep",
appOpts: MockAppOptions{
fastNode: "true",
db: "somethingelse",
},
pioAckWarn: true,
expErr: "another injected error for testing",
Expand Down Expand Up @@ -202,20 +197,18 @@ func TestIssueConfigWarnings(t *testing.T) {
{
name: "recommended app opts",
appOpts: MockAppOptions{
pruning: "10",
db: "goleveldb",
fastNode: "false",
indexer: "null",
pruning: "10",
db: "goleveldb",
indexer: "null",
},
expLogLines: nil,
},
{
name: "bad pruning interval",
appOpts: MockAppOptions{
pruning: "1000",
db: "goleveldb",
fastNode: "false",
indexer: "null",
pruning: "1000",
db: "goleveldb",
indexer: "null",
},
expLogLines: []string{
"ERR pruning-interval 1000 EXCEEDS 999 AND IS NOT RECOMMENDED, AS IT CAN LEAD TO MISSED BLOCKS ON VALIDATORS.",
Expand All @@ -227,10 +220,9 @@ func TestIssueConfigWarnings(t *testing.T) {
{
name: "bad indexer",
appOpts: MockAppOptions{
pruning: "10",
db: "goleveldb",
fastNode: "false",
indexer: "kv",
pruning: "10",
db: "goleveldb",
indexer: "kv",
},
expLogLines: []string{
"ERR indexer \"kv\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"null\".",
Expand All @@ -239,28 +231,12 @@ func TestIssueConfigWarnings(t *testing.T) {
},
expSleep: true,
},
{
name: "bad fastnode",
appOpts: MockAppOptions{
pruning: "10",
db: "goleveldb",
fastNode: "true",
indexer: "null",
},
expLogLines: []string{
"ERR iavl-disable-fastnode \"true\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"false\".",
sleepErr1,
sleepErr2,
},
expSleep: true,
},
{
name: "bad db",
appOpts: MockAppOptions{
pruning: "10",
db: "cleveldb",
fastNode: "false",
indexer: "null",
pruning: "10",
db: "cleveldb",
indexer: "null",
},
expLogLines: []string{
"ERR cleveldb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
Expand All @@ -272,15 +248,13 @@ func TestIssueConfigWarnings(t *testing.T) {
{
name: "all bad with sleep",
appOpts: MockAppOptions{
pruning: "1001",
db: "badgerdb",
fastNode: "true",
indexer: "psql",
pruning: "1001",
db: "badgerdb",
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 iavl-disable-fastnode \"true\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"false\".",
"ERR badgerdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
sleepErr1,
sleepErr2,
Expand All @@ -290,16 +264,14 @@ func TestIssueConfigWarnings(t *testing.T) {
{
name: "all bad no sleep",
appOpts: MockAppOptions{
pruning: "1001",
db: "badgerdb",
fastNode: "true",
indexer: "psql",
pruning: "1001",
db: "badgerdb",
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 iavl-disable-fastnode \"true\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"false\".",
"ERR badgerdb IS NO LONGER SUPPORTED. MIGRATE TO goleveldb.",
},
expSleep: false,
Expand Down
2 changes: 1 addition & 1 deletion app/test_helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"testing"
"time"

dbm "github.com/cometbft/cometbft-db"
"github.com/rs/zerolog"
"github.com/stretchr/testify/require"

Expand All @@ -20,7 +21,6 @@ import (
"github.com/tendermint/tendermint/libs/log"
tmproto "github.com/tendermint/tendermint/proto/tendermint/types"
tmtypes "github.com/tendermint/tendermint/types"
dbm "github.com/tendermint/tm-db"

sdkmath "cosmossdk.io/math"

Expand Down
2 changes: 1 addition & 1 deletion cmd/dbmigrate/utils/badgerdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package utils

import (
tmdb "github.com/tendermint/tm-db"
tmdb "github.com/cometbft/cometbft-db"
)

// This file is included when built with the badgerdb tag (which matches the tag Tendermint looks for).
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbmigrate/utils/boltdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package utils

import (
tmdb "github.com/tendermint/tm-db"
tmdb "github.com/cometbft/cometbft-db"
)

// This file is included when built with the boltdb tag (which matches the tag Tendermint looks for).
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbmigrate/utils/cleveldb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package utils

import (
tmdb "github.com/tendermint/tm-db"
tmdb "github.com/cometbft/cometbft-db"
)

// This file is included when built with the cleveldb tag (which matches the tag Tendermint looks for).
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbmigrate/utils/migrator.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ import (
"syscall"
"time"

tmdb "github.com/cometbft/cometbft-db"
copier "github.com/otiai10/copy"

tmlog "github.com/tendermint/tendermint/libs/log"
tmdb "github.com/tendermint/tm-db"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbmigrate/utils/migrator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"testing"
"time"

tmdb "github.com/cometbft/cometbft-db"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/stretchr/testify/suite"
tmdb "github.com/tendermint/tm-db"
)

type MigratorTestSuite struct {
Expand Down
2 changes: 1 addition & 1 deletion cmd/dbmigrate/utils/rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package utils

import (
tmdb "github.com/tendermint/tm-db"
tmdb "github.com/cometbft/cometbft-db"
)

// This file is included when built with the rocksdb tag (which matches the tag Tendermint looks for).
Expand Down
2 changes: 1 addition & 1 deletion cmd/provenanced/cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"path/filepath"
"time"

dbm "github.com/cometbft/cometbft-db"
"github.com/rs/zerolog"
"github.com/spf13/cast"
"github.com/spf13/cobra"
Expand All @@ -17,7 +18,6 @@ import (
tmcfg "github.com/tendermint/tendermint/config"
tmcli "github.com/tendermint/tendermint/libs/cli"
"github.com/tendermint/tendermint/libs/log"
dbm "github.com/tendermint/tm-db"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/client"
Expand Down
2 changes: 1 addition & 1 deletion cmd/provenanced/config/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ func ExtractAppConfigAndMap(cmd *cobra.Command) (*serverconfig.Config, FieldValu
func DefaultAppConfig() *serverconfig.Config {
rv := serverconfig.DefaultConfig()
rv.MinGasPrices = pioconfig.GetProvenanceConfig().ProvenanceMinGasPrices
rv.IAVLDisableFastNode = false
rv.IAVLDisableFastNode = true
return rv
}

Expand Down
Loading
Loading