foundry icon indicating copy to clipboard operation
foundry copied to clipboard

feat(anvil): Support mining blocks with same timestamp as previous block

Open domob1812 opened this issue 4 months ago • 1 comments

Component

Anvil

Describe the feature you would like

As far as I am aware, EVM chains can support that a block has the same timestamp as a previous block, as that is required to support sub-second block times. It seems that anvil does not allow me to mine a block with the same timestamp as the previous block's (with evm_mine), as it then complains with:

Timestamp error: 1600000100 is lower than or equal to previous block's timestamp

I think it would be helpful to support this, so that we can actually test smart contracts handle a situation like this correctly (in case there is subtle time-dependent logic contained in them).

Additional context

No response

domob1812 avatar Oct 19 '24 05:10 domob1812