Skip to content

Commit 3324ce9

Browse files
committed
increase timestamp by +12 (on mainnet) instead of +1
1 parent d7b4616 commit 3324ce9

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

docs/ethsimulatev1-notes.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Unlike `eth_call`, `eth_simulateV1`'s calls are conducted inside blocks. We don'
1515
| gasLimit | The same as the base block defined as the second parameter in the call |
1616
| hash | Calculated normally |
1717
| parentHash | Previous blocks hash |
18-
| timestamp | The timestamp of previous block + 1 |
18+
| timestamp | The timestamp of previous block + `network block time` (12s on mainnet) |
1919
| baseFeePerGas | When validation mode is true, baseFeePerGas is calculated on what it should be according to Ethereum's spec. When validation mode is false, the baseFeePerGas is set to zero |
2020
| sha3Uncles | Empty trie root |
2121
| withdrawals | Empty array |
@@ -30,8 +30,6 @@ Unlike `eth_call`, `eth_simulateV1`'s calls are conducted inside blocks. We don'
3030
| gasUsed | Calculated normally |
3131
| stateRoot | Calculated normally |
3232

33-
An interesting note here is that we decide timestamp as `previous block timestamp + 1`, while `previous block timestamp + 12` could also be an assumed default. The reasoning to use `+1` is that it's the minimum amount we have to increase the timestamp to keep them valid. While `+12` is what Mainnet uses, there are other chains that use some other values, and we didn't want to complicate the specification to consider all networks.
34-
3533
## Default values for transactions
3634
As eth_simulate is an extension to `eth_call` we want to enable the nice user experience that the user does not need to provide all required values for a transaction. We are assuming following defaults if the variable is not provided by the user:
3735
| parameter name | description |

src/schemas/execute.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ EthSimulateBlockResultInvalid:
225225
- code: -38020
226226
message: Block number in sequence did not increase
227227
- code: -38021
228-
message: Block timestamp in sequence did not increase
228+
message: Block timestamp in sequence did not increase or stay the same
229229
- code: -38022
230230
message: MovePrecompileToAddress referenced itself in replacement
231231
- code: -38023

0 commit comments

Comments
 (0)