-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
Create or integrate linter to check time.Now use #10329
Comments
It should also exempt telemetry, and then we should move all |
Just to be extra clear here, You say "DONT use |
Yes, subjective time can be used anywhere except the state-machine, i.e. module business logic. |
I rephrase the description to make it easier to read. |
This pattern should be captured in https://github.com/crypto-com/cosmos-sdk-codeql/blob/main/src/system-time.ql -- it will ignore CLI, tests and telemetry. This issue can be closed after #10488 is merged. |
Summary
time.Now
is not deterministic in the network and must not be used.Problem Definition
Using
time.Now
in a context of protobuf Msg service causes consensus problems and must not be used.Proposal
Create (or find) and integrate a linter to check that we don't use
time.Now
in all Go code which is related to the state transition. We can usetime.Now
, in:**/cli/**
*_test.go
filesFor Admin Use
The text was updated successfully, but these errors were encountered: