I tried time traveling to the same time as the current timestamp, and it errored. However, the pending timestamp still seems to have changed.
Code that produced the error
In [2]: type(evm_backend)
Out[2]: eth_tester.backends.pyevm.main.PyEVMBackend
In [3]: current_ts = evm_backend.get_block_by_number("pending")["timestamp"]
In [4]: current_ts
Out[4]: 1722534117
In [5]: evm_backend.time_travel(current_ts)
ValidationError: timestamp must be strictly later than parent, but is 0 seconds before.
- child : 1722534116
- parent : 1722534116.
In [6]: evm_backend.get_block_by_number("pending")["timestamp"]
Out[6]: 1722534116
Full error output
File ~/virtualenvs/ape08/lib/python3.12/site-packages/eth/vm/base.py:712, in VM.validate_header(cls, header, parent_header)
710 # timestamp
711 if header.timestamp <= parent_header.timestamp:
--> 712 raise ValidationError(
713 "timestamp must be strictly later than parent, "
714 f"but is {parent_header.timestamp - header.timestamp} seconds before.\n" # noqa: E501
715 f"- child : {header.timestamp}\n"
716 f"- parent : {parent_header.timestamp}. "
717 )
ValidationError: timestamp must be strictly later than parent, but is 0 seconds before.
- child : 1722534116
- parent : 1722534116.
Fill this section in if you know how this could or should be fixed
I am not sure! Somehow revert any changes or validate sooner?
What happened?
I tried time traveling to the same time as the current timestamp, and it errored. However, the pending timestamp still seems to have changed.
Code that produced the error
Full error output
Fill this section in if you know how this could or should be fixed
I am not sure! Somehow revert any changes or validate sooner?
eth-tester Version
0.11.0b2
Python Version
3.12.2
Operating System
macOS
Output from
pip freeze