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

Simulation Fault: calculated final stake for delegator X greater than current stake #4088

Closed
4 tasks
alexanderbez opened this issue Apr 10, 2019 · 2 comments
Closed
4 tasks
Labels

Comments

@alexanderbez
Copy link
Contributor

alexanderbez commented Apr 10, 2019

Summary of Bug

Simulation fault

Version

v0.34.0-rc2

Steps to Reproduce

go test ./cmd/gaia/app -run TestFullGaiaSimulation -SimulationEnabled=true -SimulationNumBlocks=1000 -SimulationVerbose=true -SimulationCommit=true -SimulationSeed=2 -v -timeout 24h
Simulating... block 219/1000, operation 350/353. Panic with err
 calculated final stake for delegator cosmos1men4337plw2uxmtevh2d9m8ggxv5h6ece7y35f greater than current stake: 718214285988.826404694247171120, 718214285988.826404694247171119
goroutine 10 [running]:
runtime/debug.Stack(0x1cb84e0, 0xc0000b6000, 0xc0050d3238)
	/usr/local/go/src/runtime/debug/stack.go:24 +0x9d
github.com/cosmos/cosmos-sdk/x/simulation.SimulateFromSeed.func2(0x1cc2640, 0xc00104a7a0, 0xc00000c1e0, 0xc000112140)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/simulation/simulate.go:127 +0xd5
panic(0x18e74c0, 0xc002a16c10)
	/usr/local/go/src/runtime/panic.go:522 +0x1b5
github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper.calculateDelegationRewards(0x1cc2580, 0xc00006bcd0, 0xc00011c620, 0xc00011c620, 0x1cc2580, 0xc00006bd20, 0x1cc25c0, 0xc00006bd30, 0xc0000ef8a0, 0x5, ...)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/distribution/keeper/delegation.go:95 +0x746
github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper.withdrawDelegationRewards(0x1cc2580, 0xc00006bcd0, 0xc00011c620, 0xc00011c620, 0x1cc2580, 0xc00006bd20, 0x1cc25c0, 0xc00006bd30, 0xc0000ef8a0, 0x5, ...)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/distribution/keeper/delegation.go:114 +0x301
github.com/cosmos/cosmos-sdk/x/distribution/keeper.Keeper.WithdrawDelegationRewards(0x1cc2580, 0xc00006bcd0, 0xc00011c620, 0xc00011c620, 0x1cc2580, 0xc00006bd20, 0x1cc25c0, 0xc00006bd30, 0xc0000ef8a0, 0x5, ...)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/distribution/keeper/keeper.go:62 +0x20c
github.com/cosmos/cosmos-sdk/x/distribution/keeper.CanWithdrawInvariant.func1.1(0x1c, 0x1cdf400, 0xc0025620e0, 0xc0025620e0)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/distribution/keeper/invariants.go:84 +0x62b
github.com/cosmos/cosmos-sdk/x/staking/keeper.Keeper.IterateValidators(0x1cc2580, 0xc00006bca0, 0x1cc25c0, 0xc00006bcb0, 0xc00011c620, 0x5222280, 0xc00000c3c0, 0x1cdaec0, 0xc0000e7b00, 0xc00011c620, ...)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/staking/keeper/alias_functions.go:21 +0x1fa
github.com/cosmos/cosmos-sdk/x/distribution/keeper.CanWithdrawInvariant.func1(0x1ccec40, 0xc0041b9aa0, 0xc000ff39c0, 0xc, 0x1cc2580, 0xc00006bd20)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/distribution/keeper/invariants.go:78 +0x372
github.com/cosmos/cosmos-sdk/x/distribution/keeper.AllInvariants.func1(0x1ccec40, 0xc0041b9aa0, 0xc000ff39c0, 0xc, 0x18e5440, 0x1ca06f8)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/distribution/keeper/invariants.go:23 +0xe5
github.com/cosmos/cosmos-sdk/x/simulation.PeriodicInvariant.func1(0x1ccec40, 0xc0041b9aa0, 0xc000ff39c0, 0xc, 0x0, 0x0)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/simulation/util.go:72 +0xff
github.com/cosmos/cosmos-sdk/x/simulation.assertAllInvariants(0xc0000b4600, 0xc0001d3000, 0xc0001a64c0, 0x3, 0x3, 0x1a366da, 0x12, 0x1cc2640, 0xc00104a7a0)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/simulation/util.go:20 +0x166
github.com/cosmos/cosmos-sdk/x/simulation.SimulateFromSeed(0x1cdf360, 0xc0000b4600, 0xc0001d3000, 0x1b8d4a0, 0x2, 0xc000104380, 0xe, 0xe, 0xc0001a64c0, 0x3, ...)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/x/simulation/simulate.go:171 +0x1b90
github.com/cosmos/cosmos-sdk/cmd/gaia/app.TestFullGaiaSimulation(0xc0000b4600)
	/Users/aleksbez/go/src/github.com/cosmos/cosmos-sdk/cmd/gaia/app/sim_test.go:361 +0x317
testing.tRunner(0xc0000b4600, 0x1b8d430)
	/usr/local/go/src/testing/testing.go:865 +0xc0
created by testing.(*T).Run
	/usr/local/go/src/testing/testing.go:916 +0x35a

/cc @rigelrozanski @cwgoes


For Admin Use

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

alexanderbez commented Apr 10, 2019

718214285988.826404694247171120 - 718214285988.826404694247171119 = 1e18
Seems like a rounding error...again :-/

@alexanderbez
Copy link
Contributor Author

Debugging ref: #3788

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant