Skip to content
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

Improve timestamp updates #783

Merged
merged 10 commits into from
May 7, 2020
Merged

Improve timestamp updates #783

merged 10 commits into from
May 7, 2020

Conversation

gtrepta
Copy link
Contributor

@gtrepta gtrepta commented Apr 30, 2020

fixes: https://github.com/runtimeverification/firefly/issues/822

This PR introduces a <lastMineTime> cell, which helps to track the passage of time from the last mining of a block. This is necessary because <timestamp> can be manipulated in ways such as custom initialization, evm_revert and evm_increaseTime, which makes just updating the cell with #time() incorrect.

@gtrepta gtrepta requested a review from ehildenb April 30, 2020 18:28
@gtrepta gtrepta marked this pull request as ready for review April 30, 2020 20:03
web3.md Outdated Show resolved Hide resolved
web3.md Outdated Show resolved Hide resolved
@ehildenb
Copy link
Member

ehildenb commented May 4, 2020

I'm somewhat skeptical of all the places we've added updates to the <lastMineTime> cell. Are we sure it's necessary in all of them, and not just when we're mining a block?

It may only actually be needed at the beginning of execution (by putting #time() in the initial configuration), and when we actually use the cell (the only place being where we say <lastMineTime> LASTTIME => #time() </lastMineTime>).

web3.md Outdated Show resolved Hide resolved
web3.md Show resolved Hide resolved
@ehildenb
Copy link
Member

ehildenb commented May 5, 2020

Let's add just an evm_increaseTime test which demonstrates the same failure we see on CI.

@gtrepta gtrepta requested a review from ehildenb May 6, 2020 18:50
@rv-jenkins rv-jenkins merged commit 8bc89ee into master May 7, 2020
@rv-jenkins rv-jenkins deleted the web3_timestamp_improvements branch May 7, 2020 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants