`block.timestamp` value varies within block
See original GitHub issue@vzts reported this behavior in truffle 921 - there’s more detail there. In summary it’s unclear what the expected behavior is and @benjamincburns suggested we follow the other major clients, favoring static timestamps if there’s no agreement.
Have just tested intra-block time values on geth dev
and Parity POA over 4 calls at 1 second intervals: both have static timestamps.
Will send a PR fixing this at processCall - just opening here in the meantime in case this change would impact any other timing related issues or there are implementation details to consider.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (6 by maintainers)
Top Results From Across the Web
`block.timestamp` value varies within block · Issue #111 - GitHub
Just wanted to note, just encountered this while adding support for globally-available variables to the debugger. If the transaction was run ...
Read more >Can block.timestamp value change during execution?
Values such as block.timestamp and block.number are, as expected, based on the block. So one block always has the same data.
Read more >Block timestamp manipulation attack - Crypto Market Pool
Prevent block timestamp attacks If the scale of your time-dependent event can vary by 15 seconds and maintain integrity, it is safe to...
Read more >Units and Globally Available Variables - Solidity
The current block timestamp must be strictly larger than the timestamp of the last block, but the only guarantee is that it will...
Read more >What Is Timestamp Dependence? - Halborn
Block timestamps are flexible, and nodes will accept any timestamp within a certain window. This means that when a smart contract transfers ETH ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ganache CLI v6.1.8 (ganache-core: 2.2.1) this problem still persists, I’m logging timestamps via events in quite complex transaction and I’m getting different timestamps. apparently they are taken from the system clock each time
@haltman-at Sure. Will create a PR.