Skip to content

Commit

Permalink
Change default iavl-disable-fastnode and indexer values. (#1807)
Browse files Browse the repository at this point in the history
* Don't issue a warning on start when the indexer is the string 'null'. That's what the config file says to use.

* Set the default iavl-disable-fastnode to false and the default tx_index.indexer to 'null'.

* Add Changelog entry.

* Add unit test for no wait for an indexer of 'null'.
  • Loading branch information
SpicyLemon committed Jan 11, 2024
1 parent ce2f248 commit d01924b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
* Add StoreLoader wrapper to check configuration settings [#1792](https://github.com/provenance-io/provenance/pull/1792).
* Create a default market in `make run`, `localnet`, `devnet` and the `provenanced testnet` command [#1757](https://github.com/provenance-io/provenance/issues/1757).
* Updated documentation for each module to work with docusaurus [PR 1763](https://github.com/provenance-io/provenance/pull/1763)
* Set the default `iavl-disable-fastnode` value to `false` and the default `tx_index.indexer` value to `"null"` [#1807](https://github.com/provenance-io/provenance/pull/1807).

### Bug Fixes

Expand Down
4 changes: 2 additions & 2 deletions app/store_loader.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func ValidateWrapper(logger log.Logger, appOpts servertypes.AppOptions, storeLoa
errs = append(errs, fmt.Sprintf("pruning-interval %d EXCEEDS %d AND IS NOT RECOMMENDED, AS IT CAN LEAD TO MISSED BLOCKS ON VALIDATORS", interval, MaxPruningInterval))
}

if indexer != "" {
errs = append(errs, fmt.Sprintf("indexer \"%s\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"%s\"", indexer, ""))
if indexer != "" && indexer != "null" {
errs = append(errs, fmt.Sprintf("indexer \"%s\" IS NOT RECOMMENDED, AND IT IS RECOMMENDED TO USE \"%s\"", indexer, "null"))
}

if fastNode {
Expand Down
18 changes: 15 additions & 3 deletions app/store_loader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,14 @@ import (
"testing"
"time"

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/store/rootmulti"
sdk "github.com/cosmos/cosmos-sdk/types"
"github.com/stretchr/testify/assert"

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

"github.com/cosmos/cosmos-sdk/baseapp"
"github.com/cosmos/cosmos-sdk/store/rootmulti"
sdk "github.com/cosmos/cosmos-sdk/types"
)

func TestWrapStoreLoader(t *testing.T) {
Expand Down Expand Up @@ -67,6 +69,16 @@ func TestValidateWrapper(t *testing.T) {
}{
{
name: "recommended pruning, indexer, db, and fastnode should not wait",
appOpts: MockAppOptions{
pruning: "13",
db: "goleveldb",
fastNode: "false",
indexer: "null",
},
delta: 0,
},
{
name: "recommended pruning, db, and fastnode and empty indexer should not wait",
appOpts: MockAppOptions{
pruning: "13",
db: "goleveldb",
Expand Down
2 changes: 2 additions & 0 deletions cmd/provenanced/config/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +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
return rv
}

Expand Down Expand Up @@ -125,6 +126,7 @@ func ExtractTmConfigAndMap(cmd *cobra.Command) (*tmconfig.Config, FieldValueMap,
func DefaultTmConfig() *tmconfig.Config {
rv := tmconfig.DefaultConfig()
rv.Consensus.TimeoutCommit = DefaultConsensusTimeoutCommit
rv.TxIndex.Indexer = "null"
return rv
}

Expand Down

0 comments on commit d01924b

Please sign in to comment.