-
Notifications
You must be signed in to change notification settings - Fork 683
block.timestamp
value varies within block
#111
Comments
from Chris:
|
Added "needs validation" because we've recently reworked some of the timekeeping logic and this may have had an impact. |
Ganache CLI v6.1.8 (ganache-core: 2.2.1) |
Just wanted to note, just encountered this while adding support for globally-available variables to the debugger. If the transaction was run with Ganache (which I assume debugger transactions often will be), the debugger may incorrectly report the value of (Note: I haven't tried upgrading Ganache, but seeing as nobody closed this, I'm assuming this is still live. I'm just commenting because I thought its impact on the debugger was worth noting.) |
I still see this issue in the ganache bundled with truffle 5.0.18. I've tried for a few hours to work around it, but so far failed. |
I've found a workaround which for me greatly reduces the probability of spurious test failures:
Code:
With this code (I'm not sure if all of it is needed, that's what I found working for me), after invoking |
…esuite/ganache#111), but I got an idea how to work around it... refs #1
I create a temporary fix.For anyone who are waiting this to be fixed, you can try to use @davidqhr/ganache-cli@6.4.3 for a while. |
@davidqhr, perhaps you should turn this into an actual PR? |
Hey, @davidqhr, were you going to PR this? It looks like you basically have this all set up to go. I haven't checked your code or anything, but if you have a fix for this it would certainly be helpful to PR it so it can make its way into the codebase. Thank you! |
@haltman-at Sure. Will create a PR. |
Thank you! |
@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.
The text was updated successfully, but these errors were encountered: