Skip to content
This repository was archived by the owner on Apr 4, 2024. It is now read-only.

Commit a5c927b

Browse files
VvaradinovHuangYi
andauthored
Remove simulation checks (#1507)
* Add cli rollback command it's useful in app-hash mismatch situation. * Update CHANGELOG.md * (refactor): removed old sim tests logic * (fix): removed tests from CI * (fix): fix test.yml * (fix): format and lint * (fix): fix linter issue * (fix): fix linter issues v2 * (fix): linter * (fix): removed sim-test references * Applied changes from code review Co-authored-by: HuangYi <huang@crypto.com>
1 parent 831588c commit a5c927b

18 files changed

Lines changed: 21 additions & 1411 deletions

File tree

.github/workflows/test.yml

Lines changed: 1 addition & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -127,84 +127,4 @@ jobs:
127127
name: ethermint
128128
signingKey: "${{ secrets.CACHIX_SIGNING_KEY }}"
129129
- name: 'instantiate integration test env'
130-
run: nix-store -r $(nix-instantiate tests/integration_tests/shell.nix)
131-
132-
test-sim-nondeterminism:
133-
runs-on: ubuntu-latest
134-
timeout-minutes: 25
135-
steps:
136-
- uses: actions/setup-go@v3
137-
with:
138-
go-version: 1.19
139-
check-latest: true
140-
- uses: actions/checkout@v3
141-
- uses: technote-space/get-diff-action@v6.1.1
142-
with:
143-
PATTERNS: |
144-
**/**.go
145-
go.mod
146-
go.sum
147-
- name: Test simulation nondeterminism
148-
run: |
149-
make test-sim-nondeterminism
150-
if: env.GIT_DIFF
151-
152-
test-sim-random-genesis-fast:
153-
runs-on: ubuntu-latest
154-
timeout-minutes: 25
155-
steps:
156-
- uses: actions/setup-go@v3
157-
with:
158-
go-version: 1.19
159-
check-latest: true
160-
- uses: actions/checkout@v3
161-
- uses: technote-space/get-diff-action@v6.1.1
162-
with:
163-
PATTERNS: |
164-
**/**.go
165-
go.mod
166-
go.sum
167-
- name: Test simulation with random genesis
168-
run: |
169-
make test-sim-random-genesis-fast
170-
if: env.GIT_DIFF
171-
172-
test-sim-import-export:
173-
runs-on: ubuntu-latest
174-
timeout-minutes: 25
175-
steps:
176-
- uses: actions/setup-go@v3
177-
with:
178-
go-version: 1.19
179-
check-latest: true
180-
- uses: actions/checkout@v3
181-
- uses: technote-space/get-diff-action@v6.1.1
182-
with:
183-
PATTERNS: |
184-
**/**.go
185-
go.mod
186-
go.sum
187-
- name: Simulation of import and export genesis
188-
run: |
189-
make test-sim-import-export
190-
if: env.GIT_DIFF
191-
192-
test-sim-after-import:
193-
runs-on: ubuntu-latest
194-
timeout-minutes: 25
195-
steps:
196-
- uses: actions/setup-go@v3
197-
with:
198-
go-version: 1.19
199-
check-latest: true
200-
- uses: actions/checkout@v3
201-
- uses: technote-space/get-diff-action@v6.1.1
202-
with:
203-
PATTERNS: |
204-
**/**.go
205-
go.mod
206-
go.sum
207-
- name: Test simulation after import
208-
run: |
209-
make test-sim-after-import
210-
if: env.GIT_DIFF
130+
run: nix-store -r "$(nix-instantiate tests/integration_tests/shell.nix)"

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ Ref: https://keepachangelog.com/en/1.0.0/
6262

6363
### Improvements
6464

65+
* (tests) [#1507](https://github.com/evmos/ethermint/pull/1507) Remove legacy sim tests
6566
* (feemarket) [#1508](https://github.com/evmos/ethermint/pull/1508) Remove old x/params migration logic
6667
* (evm) [#1499](https://github.com/evmos/ethermint/pull/1499) Add Shanghai and Cancun block
6768
* (ante) [#1455](https://github.com/evmos/ethermint/pull/1455) Refactor `AnteHandler` logic

Makefile

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -343,51 +343,6 @@ test-solidity:
343343

344344
.PHONY: run-tests test test-all test-import test-rpc test-contract test-solidity $(TEST_TARGETS)
345345

346-
test-sim-nondeterminism:
347-
@echo "Running non-determinism test..."
348-
@go test -mod=readonly $(SIMAPP) -run TestAppStateDeterminism -Enabled=true \
349-
-NumBlocks=100 -BlockSize=200 -Commit=true -Period=0 -v -timeout 24h
350-
351-
test-sim-random-genesis-fast:
352-
@echo "Running random genesis simulation..."
353-
@go test -mod=readonly $(SIMAPP) -run TestFullAppSimulation \
354-
-Enabled=true -NumBlocks=100 -BlockSize=200 -Commit=true -Seed=99 -Period=5 -v -timeout 24h
355-
356-
test-sim-import-export: runsim
357-
@echo "Running application import/export simulation. This may take several minutes..."
358-
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppImportExport
359-
360-
test-sim-after-import: runsim
361-
@echo "Running application simulation-after-import. This may take several minutes..."
362-
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 5 TestAppSimulationAfterImport
363-
364-
test-sim-random-genesis-multi-seed: runsim
365-
@echo "Running multi-seed custom genesis simulation..."
366-
@$(BINDIR)/runsim -SimAppPkg=$(SIMAPP) -ExitOnFail 400 5 TestFullAppSimulation
367-
368-
test-sim-multi-seed-long: runsim
369-
@echo "Running long multi-seed application simulation. This may take awhile!"
370-
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 500 50 TestFullAppSimulation
371-
372-
test-sim-multi-seed-short: runsim
373-
@echo "Running short multi-seed application simulation. This may take awhile!"
374-
@$(BINDIR)/runsim -Jobs=4 -SimAppPkg=$(SIMAPP) -ExitOnFail 50 10 TestFullAppSimulation
375-
376-
test-sim-benchmark-invariants:
377-
@echo "Running simulation invariant benchmarks..."
378-
@go test -mod=readonly $(SIMAPP) -benchmem -bench=BenchmarkInvariants -run=^$ \
379-
-Enabled=true -NumBlocks=1000 -BlockSize=200 \
380-
-Period=1 -Commit=true -Seed=57 -v -timeout 24h
381-
382-
.PHONY: \
383-
test-sim-nondeterminism \
384-
test-sim-custom-genesis-fast \
385-
test-sim-import-export \
386-
test-sim-after-import \
387-
test-sim-custom-genesis-multi-seed \
388-
test-sim-multi-seed-short \
389-
test-sim-multi-seed-long \
390-
test-sim-benchmark-invariants
391346

392347
benchmark:
393348
@go test -mod=readonly -bench=. $(PACKAGES_NOSIMULATION)

app/ante/signverify_test.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import (
1010
evmtypes "github.com/evmos/ethermint/x/evm/types"
1111
)
1212

13-
1413
func (suite AnteTestSuite) TestEthSigVerificationDecorator() {
1514
addr, privKey := tests.NewAddrKey()
1615

app/app.go

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,6 @@ var (
182182
}
183183
)
184184

185-
var _ simapp.App = (*EthermintApp)(nil)
186-
187185
// var _ server.Application (*EthermintApp)(nil)
188186

189187
// EthermintApp implements an extended ABCI application. It is an application
@@ -233,9 +231,6 @@ type EthermintApp struct {
233231
// the module manager
234232
mm *module.Manager
235233

236-
// simulation manager
237-
sm *module.SimulationManager
238-
239234
// the configurator
240235
configurator module.Configurator
241236
}
@@ -600,17 +595,6 @@ func NewEthermintApp(
600595
// add test gRPC service for testing gRPC queries in isolation
601596
// testdata.RegisterTestServiceServer(app.GRPCQueryRouter(), testdata.TestServiceImpl{})
602597

603-
// create the simulation manager and define the order of the modules for deterministic simulations
604-
//
605-
// NOTE: this is not required apps that don't use the simulator for fuzz testing
606-
// transactions
607-
overrideModules := map[string]module.AppModuleSimulation{
608-
authtypes.ModuleName: auth.NewAppModule(app.appCodec, app.AccountKeeper, authsims.RandomGenesisAccounts),
609-
}
610-
app.sm = module.NewSimulationManagerFromAppModules(app.mm.Modules, overrideModules)
611-
612-
app.sm.RegisterStoreDecoders()
613-
614598
// initialize stores
615599
app.MountKVStores(keys)
616600
app.MountTransientStores(tkeys)
@@ -780,11 +764,6 @@ func (app *EthermintApp) GetSubspace(moduleName string) paramstypes.Subspace {
780764
return subspace
781765
}
782766

783-
// SimulationManager implements the SimulationApp interface
784-
func (app *EthermintApp) SimulationManager() *module.SimulationManager {
785-
return app.sm
786-
}
787-
788767
// RegisterAPIRoutes registers all application module routes with the provided
789768
// API server.
790769
func (app *EthermintApp) RegisterAPIRoutes(apiSvr *api.Server, apiConfig config.APIConfig) {

0 commit comments

Comments
 (0)