You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: sequencer-migration/README.md
+30-2Lines changed: 30 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,23 @@ The high-level flow of the transition will look like this:
21
21
6. Wait until `l2reth` has sequenced until block X or for some time
22
22
7. Turn off `l2reth` sequencing
23
23
8. Wait until `l2geth` has same block height
24
-
9. Turn on `l2geth` sequencingx
24
+
9. Turn on `l2geth` sequencing
25
+
26
+
## Usage
27
+
Make sure the `L2RETH_RPC_URL` and `L2GETH_RPC_URL` env variables are properly configured. Simply run the script and follow the instructions.
28
+
29
+
```bash
30
+
./migrate-sequencer.sh <blocks_to_produce>
31
+
./revert-l2geth-to-block.sh <block_number>
32
+
./switch-to-l2geth.sh
33
+
34
+
# make common functions available on bash
35
+
source common-functions.sh
36
+
37
+
start_l2geth_mining
38
+
get_block_info $L2GETH_RPC_URL
39
+
[...]
40
+
```
25
41
26
42
### Testing locally
27
43
To test locally run the test `docker_test_migrate_sequencer` and execute the `migrate-sequencer.sh` script.
@@ -40,5 +56,17 @@ source local.env
40
56
- To simulate the case where `l2reth` produces invalid blocks we can adjust to `--builder.gaslimit=40000000` in `launch_rollup_node_sequencer.bash`. This will produce a block with a too big jump of the gas limit and `l2geth` will reject it. In a simulation we can then "revert" `l2geth` to its latest block and start sequencing on `l2geth` again.
41
57
- Continuing on the above case we can fabricate a L2 reorg by simply resetting to any previous block. For all `l2geth` nodes the reorg will be shallow (ie before the invalid `l2reth` blocks) and for `l2reth` it will be deeper (ie all `l2reth` produced blocks + reset to previous block).
42
58
43
-
TODO: how to run with Docker
59
+
### Running with Docker
60
+
```bash
61
+
docker run -it --rm sequencer-migration:latest
62
+
63
+
# then just use the scripts as before
64
+
./migrate-sequencer.sh <blocks_to_produce>
65
+
66
+
# or call any of the common functions
67
+
start_l2geth_mining
68
+
get_block_info $L2GETH_RPC_URL
69
+
[...]
70
+
```
44
71
72
+
If running on Linux you might need to specify `-e L2GETH_RPC_URL=http://your-l2geth:8547 -e L2RETH_RPC_URL=http://your-l2reth:8545` as the default URLs might not work.
0 commit comments