-
Notifications
You must be signed in to change notification settings - Fork 284
Closed
Description
Describe the bug
There is non-deterministic behavior in cosmos-sdk level simulation caused by Simstate.Rand.
if we commented this line x/cronos/simulaltion/genesis.go
// if we use rand here it will cause non determinism, but if we comment this line everything is fine.
_ = simState.Rand.Intn(100)TestAppStateDeterminism could pass.
But TestAppStateDeterminism failed if we used Simstate.Rand even if the value was not used anywhere.
To Reproduce
Steps to reproduce the behavior:
-
git pull https://github.com/adu-crypto/cronos.git
-
git checkout evm-simulation-determinism
-
make test-sim-nondeterminism
- See error:
sim_test.go:339:
Error Trace: sim_test.go:339
Error: Not equal:
expected: "\xad\xa7㌵\x01\xc3bR\xfb\xb1;\xad\x13\x04\xb5d@\xdaS?\xa7;\x05`X\x90\xa5\x91\xf1M\xd2"
actual : "4\xbd\xa6\x1f\xabzY4\xfe?e\x8b\xc6\xff%\xb9\xed1u\xdc\x19G\xf7ȑVv}\xae\xe5\xcf\xd4"
Diff:
--- Expected
+++ Actual
@@ -1 +1 @@
-��㌵��bR��;����d@�S?�;�`X����M�
+4����zY4�?e���%��1u��G�ȑVv}����
Test: TestAppStateDeterminism
Messages: non-determinism in seed 3916589616287113937: 2/3, attempt: 2/5
--- FAIL: TestAppStateDeterminism (146.91s)
FAIL
FAIL github.com/crypto-org-chain/cronos/app 149.376s
FAILExpected behavior
Simstate.Rand should be deterministic with the same seed.
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: [e.g. iOS]:
macos Big Sur - Browser [e.g. chrome, safari]
- Version [e.g. 22]:
go 1.18.1
Smartphone (please complete the following information):
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
Additional context
Add any other context about the problem here.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels