Introduce
In the following code, the project use Time.now to do some validate process. this validate may perform different in each node which could been called as non_determinism. It will cause the consensus to fail.
|
if vestingAcc.GetEndTime() > time.Now().UTC().Unix() { |
|
reason = "unexpired vesting account is not suitable for destroying" |
|
return |
|
} |
|
} |
|
|
|
if vestingAcc, ok := account.(vesting.VestingAccount); ok { |
|
if vestingAcc.GetEndTime() > time.Now().UTC().Unix() { |
Ref
https://github.com/crytic/building-secure-contracts/tree/master/not-so-smart-contracts/cosmos/non_determinism
Recommand
Don't use Time.now in your project
Introduce
In the following code, the project use
Time.nowto do some validate process. this validate may perform different in each node which could been called as non_determinism. It will cause the consensus to fail.evermint/x/evm/utils/validation.go
Lines 28 to 35 in 74c1675
Ref
https://github.com/crytic/building-secure-contracts/tree/master/not-so-smart-contracts/cosmos/non_determinism
Recommand
Don't use Time.now in your project