Skip to content

Simulation: Token Invariants Broken #3355

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

Closed
2 of 4 tasks
zmanian opened this issue Jan 22, 2019 · 3 comments
Closed
2 of 4 tasks

Simulation: Token Invariants Broken #3355

zmanian opened this issue Jan 22, 2019 · 3 comments

Comments

@zmanian
Copy link
Member

zmanian commented Jan 22, 2019

Reproduce with

go test ./cmd/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=400 -SimulationVerbose=true -SimulationCommit=true -SimulationSeed=9 -v -timeout 24h

For Admin Use

  • Not duplicate issue
  • Appropriate labels applied
  • Appropriate contributors tagged
  • Contributor assigned/self-assigned
@cwgoes
Copy link
Contributor

cwgoes commented Jan 23, 2019

I cannot reproduce this. For me that command fails with:

Simulating... block 2/400, operation 500/524. Panic with err
 negative coin amount: -1706

goroutine 6 [running]:
runtime/debug.Stack(0xc00243e270, 0x2, 0x2)
	/usr/lib/go/src/runtime/debug/stack.go:24 +0xa7
github.com/cosmos/cosmos-sdk/x/mock/simulation.SimulateFromSeed.func2(0xc000812020, 0xc000e0c780, 0xc0001d6e70)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/mock/simulation/simulate.go:124 +0xb6
panic(0xb783c0, 0xc00357bfa0)
	/usr/lib/go/src/runtime/panic.go:513 +0x1b9
github.com/cosmos/cosmos-sdk/types.NewCoin(0xc0032024ba, 0x5, 0xc004330460, 0xc004330201, 0x1, 0x1)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/types/coin.go:31 +0x262
github.com/cosmos/cosmos-sdk/x/auth.BaseVestingAccount.spendableCoins(0xc003b0a3c0, 0xc0043302a0, 0x1, 0x1, 0x0, 0x0, 0x0, 0xc0043303a0, 0x1, 0x1, ...)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/auth/account.go:230 +0x252
github.com/cosmos/cosmos-sdk/x/auth.DelayedVestingAccount.SpendableCoins(0xc0011b7e60, 0x0, 0x2c4953be35, 0x146c240, 0x0, 0x0, 0x0)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/auth/account.go:489 +0xbb
github.com/cosmos/cosmos-sdk/x/bank/simulation.createSingleInputSendMsg(0xc001b25da0, 0xea1a40, 0xc0018828d0, 0xc001366640, 0xc, 0xc00086b000, 0xd2, 0xd2, 0xe9b720, 0xc0001d6aa0, ...)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/bank/simulation/msgs.go:67 +0x37a
github.com/cosmos/cosmos-sdk/x/bank/simulation.SingleInputSendMsg.func1(0xc001b25da0, 0xc0001a6a00, 0xea1a40, 0xc0018828d0, 0xc001366640, 0xc, 0xc00086b000, 0xd2, 0xd2, 0xc000920000, ...)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/bank/simulation/msgs.go:42 +0x11e
github.com/cosmos/cosmos-sdk/x/mock/simulation.createBlockSimulator.func1(0xc0001dffb0, 0xc0001a6a00, 0xea1a40, 0xc0018828d0, 0xc001366640, 0xc, 0xc00086b000, 0xd2, 0xd2, 0x0, ...)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/mock/simulation/simulate.go:265 +0x553
github.com/cosmos/cosmos-sdk/x/mock/simulation.SimulateFromSeed(0xea8b80, 0xc0001a6700, 0xc0001a6a00, 0xdea830, 0x9, 0xc0001a1520, 0xd, 0xd, 0xc0001dff80, 0x5, ...)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/x/mock/simulation/simulate.go:171 +0x12d2
github.com/cosmos/cosmos-sdk/cmd/gaia/app.TestFullGaiaSimulation(0xc0001a6700)
	/home/cwgoes/working/go/src/github.com/cosmos/cosmos-sdk/cmd/gaia/app/sim_test.go:319 +0x339
testing.tRunner(0xc0001a6700, 0xdea7c8)
	/usr/lib/go/src/testing/testing.go:827 +0xbf
created by testing.(*T).Run
	/usr/lib/go/src/testing/testing.go:878 +0x35c

which looks like the known error related to vesting simulation - #3353

Did you experience this on any other seeds or try on a different machine?

@alexanderbez
Copy link
Contributor

alexanderbez commented Jan 23, 2019

This fails due to:

Simulating... block 8/400, operation 500/527. Invariants broken after StandardOperations
loose token invariance:
    pool.NotBondedTokens: 20214202
    sum of account tokens: 20144990.000000000000000000

A diff of 69,212

@alexanderbez alexanderbez changed the title Unclear why simulation halted. No stack trace Simulation: Token Invariants Broken Jan 23, 2019
@cwgoes
Copy link
Contributor

cwgoes commented Jan 23, 2019

Specifically, the invariant is broken after a TestDeductFee operation.

This was referenced Jan 23, 2019
@cwgoes cwgoes closed this as completed Jan 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants