From 5ed24e44d2b84c2d433bbcc1be3f02f4345cac43 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 3 Sep 2018 19:13:08 -0700 Subject: [PATCH 1/4] simulation: Minor changes Now that we properly initialize governance, a ton of governance slashing doesn't happen in the first few blocks. Because of this, we can run through blocks in the range (0,200) quite rapidly. This PR acknowledges that and increases many of the default block heights. --- Makefile | 2 +- cmd/gaia/app/sim_test.go | 9 +++++---- x/mock/simulation/random_simulate_blocks.go | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e363891e2..2f23fd54f 100644 --- a/Makefile +++ b/Makefile @@ -157,7 +157,7 @@ test_sim_gaia_nondeterminism: test_sim_gaia_fast: @echo "Running quick Gaia simulation. This may take several minutes..." - @go test ./cmd/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=50 -v -timeout 24h + @go test ./cmd/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=150 -v -timeout 24h test_sim_gaia_slow: @echo "Running full Gaia simulation. This may take awhile!" diff --git a/cmd/gaia/app/sim_test.go b/cmd/gaia/app/sim_test.go index 3878166b3..61affb261 100644 --- a/cmd/gaia/app/sim_test.go +++ b/cmd/gaia/app/sim_test.go @@ -189,7 +189,7 @@ func TestAppStateDeterminism(t *testing.T) { t.Skip("Skipping Gaia simulation") } - numSeeds := 5 + numSeeds := 3 numTimesToRunPerSeed := 5 appHashList := make([]json.RawMessage, numTimesToRunPerSeed) @@ -206,10 +206,11 @@ func TestAppStateDeterminism(t *testing.T) { testAndRunTxs(app), []simulation.RandSetup{}, []simulation.Invariant{}, - 20, - 20, - true, + 50, + 100, + false, ) + app.Commit() appHash := app.LastCommitID().Hash appHashList[j] = appHash } diff --git a/x/mock/simulation/random_simulate_blocks.go b/x/mock/simulation/random_simulate_blocks.go index fc7543280..14ca6c216 100644 --- a/x/mock/simulation/random_simulate_blocks.go +++ b/x/mock/simulation/random_simulate_blocks.go @@ -155,7 +155,7 @@ func createBlockSimulator(testingMode bool, tb testing.TB, t *testing.T, event f AssertAllInvariants(t, app, invariants, log) } if opCount%50 == 0 { - fmt.Printf("\rSimulating... block %d/%d, operation %d/%d.", header.Height, totalNumBlocks, opCount, blocksize) + fmt.Printf("\rSimulating... block %d/%d, operation %d/%d. ", header.Height, totalNumBlocks, opCount, blocksize) } } opCount++ From 9b26ccfa76e1a100ba5cb12f46ed48ae03a78881 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 3 Sep 2018 21:29:59 -0700 Subject: [PATCH 2/4] tools: Remove gocyclo We can investigate re-introducing our own fork #postlaunch. Closes #2211 --- PENDING.md | 1 + tools/Makefile | 18 +++++++++--------- tools/gometalinter.json | 2 +- 3 files changed, 11 insertions(+), 10 deletions(-) diff --git a/PENDING.md b/PENDING.md index 17616ced1..dd663564a 100644 --- a/PENDING.md +++ b/PENDING.md @@ -35,6 +35,7 @@ BREAKING CHANGES * [x/slashing] [#2122](https://github.com/cosmos/cosmos-sdk/pull/2122) - Implement slashing period * [types] \#2119 Parsed error messages and ABCI log errors to make them more human readable. * [simulation] Rename TestAndRunTx to Operation [#2153](https://github.com/cosmos/cosmos-sdk/pull/2153) + * [tools] Removed golint [#2211](https://github.com/cosmos/cosmos-sdk/issues/2211) * Tendermint diff --git a/tools/Makefile b/tools/Makefile index a11f2ec70..87544107c 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -22,7 +22,7 @@ INEFFASSIGN_CHECK := $(shell command -v ineffassign 2> /dev/null) MISSPELL_CHECK := $(shell command -v misspell 2> /dev/null) ERRCHECK_CHECK := $(shell command -v errcheck 2> /dev/null) UNPARAM_CHECK := $(shell command -v unparam 2> /dev/null) -GOCYCLO_CHECK := $(shell command -v gocyclo 2> /dev/null) +# GOCYCLO_CHECK := $(shell command -v gocyclo 2> /dev/null) check_tools: ifndef DEP_CHECK @@ -126,12 +126,12 @@ else @echo "Installing unparam" go get -v $(UNPARAM) endif -ifdef GOCYCLO_CHECK - @echo "gocyclo is already installed. Run 'make update_tools' to update." -else - @echo "Installing gocyclo" - go get -v $(GOCYCLO) -endif +# ifdef GOCYCLO_CHECK +# @echo "gocyclo is already installed. Run 'make update_tools' to update." +# else +# @echo "Installing gocyclo" +# go get -v $(GOCYCLO) +# endif update_tools: @echo "Updating dep" @@ -153,8 +153,8 @@ update_dev_tools: go get -u -v $(ERRCHECK) @echo "Updating unparam" go get -u -v $(UNPARAM) - @echo "Updating goyclo" - go get -u -v $(GOCYCLO) + # @echo "Updating goyclo" + # go get -u -v $(GOCYCLO) # To avoid unintended conflicts with file names, always add to .PHONY # unless there is a reason not to. diff --git a/tools/gometalinter.json b/tools/gometalinter.json index 124e28c14..42788714b 100644 --- a/tools/gometalinter.json +++ b/tools/gometalinter.json @@ -2,7 +2,7 @@ "Linters": { "vet": "go tool vet -composites=false :PATH:LINE:MESSAGE" }, - "Enable": ["golint", "vet", "ineffassign", "unparam", "unconvert", "misspell", "gocyclo"], + "Enable": ["golint", "vet", "ineffassign", "unparam", "unconvert", "misspell"], "Deadline": "500s", "Vendor": true, "Cyclo": 11 From ea01b91958766075b5461a5017a53ab681f33e42 Mon Sep 17 00:00:00 2001 From: ValarDragon Date: Mon, 3 Sep 2018 22:53:07 -0700 Subject: [PATCH 3/4] baseapp: Remove baseapp.SetTxDecoder() Closes #1441 --- PENDING.md | 1 + baseapp/setters.go | 6 ------ 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/PENDING.md b/PENDING.md index 17616ced1..3fcf0b3b3 100644 --- a/PENDING.md +++ b/PENDING.md @@ -35,6 +35,7 @@ BREAKING CHANGES * [x/slashing] [#2122](https://github.com/cosmos/cosmos-sdk/pull/2122) - Implement slashing period * [types] \#2119 Parsed error messages and ABCI log errors to make them more human readable. * [simulation] Rename TestAndRunTx to Operation [#2153](https://github.com/cosmos/cosmos-sdk/pull/2153) + * [baseapp] Remove `SetTxDecoder` in favor of requiring the decoder be set in baseapp initialization. [#1441](https://github.com/cosmos/cosmos-sdk/issues/1441) * Tendermint diff --git a/baseapp/setters.go b/baseapp/setters.go index a8b1591a7..28782c96d 100644 --- a/baseapp/setters.go +++ b/baseapp/setters.go @@ -26,12 +26,6 @@ func (app *BaseApp) SetCMS(cms store.CommitMultiStore) { } app.cms = cms } -func (app *BaseApp) SetTxDecoder(txDecoder sdk.TxDecoder) { - if app.sealed { - panic("SetTxDecoder() on sealed BaseApp") - } - app.txDecoder = txDecoder -} func (app *BaseApp) SetInitChainer(initChainer sdk.InitChainer) { if app.sealed { panic("SetInitChainer() on sealed BaseApp") From 43ab06678fe20e48a20d3fc7a34887e7c91f281b Mon Sep 17 00:00:00 2001 From: rigelrozanski Date: Tue, 4 Sep 2018 17:21:38 -0400 Subject: [PATCH 4/4] move WIP-lamborghini-distribution --- .../WIP-lamborghini-distribution/README.md | 0 .../WIP-lamborghini-distribution/end_block.md | 0 .../example_sheet/distribution.xlsx | Bin .../future_improvements.md | 0 .../WIP-lamborghini-distribution/overview.md | 0 .../WIP-lamborghini-distribution/state.md | 0 .../WIP-lamborghini-distribution/transactions.md | 0 .../WIP-lamborghini-distribution/triggers.md | 0 8 files changed, 0 insertions(+), 0 deletions(-) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/README.md (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/end_block.md (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/example_sheet/distribution.xlsx (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/future_improvements.md (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/overview.md (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/state.md (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/transactions.md (100%) rename docs/{spec/distribution => _attic}/WIP-lamborghini-distribution/triggers.md (100%) diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/README.md b/docs/_attic/WIP-lamborghini-distribution/README.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/README.md rename to docs/_attic/WIP-lamborghini-distribution/README.md diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/end_block.md b/docs/_attic/WIP-lamborghini-distribution/end_block.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/end_block.md rename to docs/_attic/WIP-lamborghini-distribution/end_block.md diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/example_sheet/distribution.xlsx b/docs/_attic/WIP-lamborghini-distribution/example_sheet/distribution.xlsx similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/example_sheet/distribution.xlsx rename to docs/_attic/WIP-lamborghini-distribution/example_sheet/distribution.xlsx diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/future_improvements.md b/docs/_attic/WIP-lamborghini-distribution/future_improvements.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/future_improvements.md rename to docs/_attic/WIP-lamborghini-distribution/future_improvements.md diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/overview.md b/docs/_attic/WIP-lamborghini-distribution/overview.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/overview.md rename to docs/_attic/WIP-lamborghini-distribution/overview.md diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/state.md b/docs/_attic/WIP-lamborghini-distribution/state.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/state.md rename to docs/_attic/WIP-lamborghini-distribution/state.md diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/transactions.md b/docs/_attic/WIP-lamborghini-distribution/transactions.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/transactions.md rename to docs/_attic/WIP-lamborghini-distribution/transactions.md diff --git a/docs/spec/distribution/WIP-lamborghini-distribution/triggers.md b/docs/_attic/WIP-lamborghini-distribution/triggers.md similarity index 100% rename from docs/spec/distribution/WIP-lamborghini-distribution/triggers.md rename to docs/_attic/WIP-lamborghini-distribution/triggers.md