Commit ce968e2
authored
fix: allow alternative timestamp syncs for L1 and L2 (#298)
<!--
🚨 ATTENTION! 🚨
This PR template is REQUIRED. PRs not following this format will be
closed without review.
Requirements:
- PR title must follow commit conventions:
https://www.conventionalcommits.org/en/v1.0.0/
- Label your PR with the correct type (e.g., 🐛 Bug, ✨ Enhancement, 🧪
Test, etc.)
- Provide clear and specific details in each section
-->
**Motivation:**
<!--
Explain here the context, and why you're making that change. What is the
problem you're trying to solve.
-->
As a devkit user forking from a chain with out of sync block timestamps,
I want the syncing process to move to the required timestamp directly,
falling back to syncing one block at a time when required.
**Modifications:**
<!--
Describe the modifications you've done from a high level. What are the
key technical decisions and why were they made?
-->
- Adds `evm_setNextBlockTimestamp`, `evm_mine` and `evm_increaseTime`
RPC calls (attempted in that order) to move to a timestamp directly
without depending on `anvil_mine` (1 block at a time) syncing (which is
used as a fallback if all others fail).
- Adds a ts buffer (12s) so that timestamps don't have to match exactly.
**Result:**
<!--
*After your change, what will change.
-->
- Faster syncing of the L1 and L2 chains
**Testing:**
<!--
*List testing procedures taken and useful artifacts.
-->
- Tested locally (on anvil)1 parent 906bcb6 commit ce968e2
1 file changed
+32
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
| 239 | + | |
| 240 | + | |
239 | 241 | | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
240 | 267 | | |
241 | 268 | | |
242 | 269 | | |
| |||
268 | 295 | | |
269 | 296 | | |
270 | 297 | | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
271 | 301 | | |
272 | 302 | | |
273 | 303 | | |
| |||
293 | 323 | | |
294 | 324 | | |
295 | 325 | | |
296 | | - | |
| 326 | + | |
297 | 327 | | |
298 | | - | |
| 328 | + | |
299 | 329 | | |
300 | 330 | | |
301 | 331 | | |
| |||
0 commit comments