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: ecosystem/supersim.md
+40-35Lines changed: 40 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,44 +59,49 @@ The **orchestrator** is responsible for spinning up the requested number of **an
59
59
60
60
The flow of this tool will differ depending on whether the user opts for**vanilla** mode or **forking** mode.
61
61
62
-
1. **Vanilla mode**:
62
+
#### Vanilla mode
63
63
64
-
a. Orchestrator has preset chain configs and starts chains anew.
65
-
b. Orchestrator applies genesis state via the genesis-applier.
66
-
c. Orchestrator starts op-simulator and offers an interface between anvil instances and op-simulator.
67
-
d. Orchestrator monitors status of running local anvil instances.
68
-
2. **Forking mode**:
64
+
1. Orchestrator has preset chain configs and starts chains anew.
65
+
2. Orchestrator applies genesis state via the genesis-applier.
66
+
3. Orchestrator starts op-simulator and offers an interface between anvil instances and op-simulator.
67
+
4. Orchestrator monitors status of running local anvil instances.
68
+
69
+
#### Forking mode
69
70
70
-
a. Orchestrator acquires L1 reference block to get the latest L2 height for forking using l2-fork-state-finder.
71
-
b. Orchestrator gets appropriate chain configs from the superchain registry using the chain-config-loader.
72
-
c. Orchestrator starts the requested chains at determined L2 block height.
73
-
d. Orchestrator applies genesis to each chain using the genesis-applier.
74
-
e. Orchestrator starts op-simulator and offers interface between anvil instances and op-simulator.
75
-
f. Orchestrator monitors status of running local anvil instances.
71
+
1. Orchestrator acquires L1 reference block to get the latest L2 height for forking using l2-fork-state-finder.
72
+
2. Orchestrator gets appropriate chain configs from the superchain registry using the chain-config-loader.
73
+
3. Orchestrator starts the requested chains at determined L2 block height.
74
+
4. Orchestrator applies genesis to each chain using the genesis-applier.
75
+
5. Orchestrator starts op-simulator and offers interface between anvil instances and op-simulator.
76
+
6. Orchestrator monitors status of running local anvil instances.
76
77
77
78
78
79
### Interfaces
79
80
80
-
1. **Orchestrator** interface provides the following to the developer:
81
+
#### Orchestrator interface provides the following to the developer:
81
82
82
-
a. Instance status
83
-
b. Event log
84
-
c. Mode selection
85
-
d. Control panel (in cli? Some ui option? both?): buttons/commands to start/stop/restart individual instances
86
-
e. Genesis state interface: could be a long term goal to give devs more control over what they do here. Would offer an interface for applying and managing genesis states:
83
+
1. Instance status
84
+
2. Event log
85
+
3. Mode selection
86
+
4. Control panel (in cli? Some ui option? both?): buttons/commands to start/stop/restart individual instances
87
+
5. Genesis state interface: could be a long term goal to give devs more control over what they do here. Would offer an interface for applying and managing genesis states:
87
88
88
89
i. File upload: upload genesis files
89
90
ii. Genesis history: list of applied genesis states with timestamps/details
90
91
iii. Apply button/command: apply the selected genesis state to the chosen instances.
91
92
92
-
f. Configuration loader: interface for loading and managing chain configurations from the chain-config-loader.
93
+
6. Configuration loader: interface for loading and managing chain configurations from the chain-config-loader.
93
94
94
95
i. Config list: display available configurations from the registry
95
96
ii. Download button/command for the selected configuration
96
97
iii. Apply button/command
97
98
iv. Configuration details: show detailed information about the selected configuration
98
99
99
-
2. **Op-simulator** interface checks instance status as served by orchestrator interface and listens for RPC calls that require op-simulator intervention. The purpose of this interface is to intercept RPC calls that should go to the interface rather than to anvil instances directly. This is essentially a proxy between the app's RPC calls and the op-simulator.
100
+
#### Op-simulator interface
101
+
102
+
Checks instance status as served by orchestrator interface and listens for RPC calls that require op-simulator intervention. The purpose of this interface is to intercept RPC calls that should go to the interface rather than to anvil instances directly.
103
+
104
+
This is essentially a proxy between the app's RPC calls and the op-simulator.
100
105
101
106
```mermaid
102
107
flowchart TD
@@ -155,35 +160,35 @@ Given the application flow, the following services will be part of supersim:
155
160
156
161
1. **Orchestrator**: This is the main focus and interface for developers using supersim.
157
162
158
-
a. Runs all of the other services in supersim and manages their lifecycle.
159
-
b. Provides an interface to the user
163
+
i. Runs all of the other services in supersim and manages their lifecycle.
164
+
ii. Provides an interface to the user
160
165
161
-
i. Initially a static interface.
162
-
ii. Medium-term, offer an API interface that the orchestrator exposes to make it easier to build new offchain services that hook into the runtime.
166
+
* Initially a static interface.
167
+
* Medium-term, offer an API interface that the orchestrator exposes to make it easier to build new offchain services that hook into the runtime.
163
168
164
169
2. **Anvil Instances**: Anvil instances are run by the orchestrator after initial prep work to allow them to mirror the Superchain interop environment.
165
170
166
-
a. Should be run in `--optimism` mode so the extra fields in transactions are there.
167
-
b. Orchestrator should also run an L1 instance, though L1 withdrawals won’t initially be supported.
168
-
c. Eventually supersim can be extended to be used with HardHat and other local simulation tools as well.
171
+
i. Should be run in `--optimism` mode so the extra fields in transactions are there.
172
+
ii. Orchestrator should also run an L1 instance, though L1 withdrawals won’t initially be supported.
173
+
iii. Eventually supersim can be extended to be used with HardHat and other local simulation tools as well.
169
174
170
175
3. **Genesis-applier** : The `genesis-applier` takes genesis files output by the monorepo and applies them to anvil instances.
171
176
172
-
a. The genesis files needed will differ depending on whether the user is in vanilla or forked mode, and forked mode is unlikely to need anything other than the interop contracts initially.
173
-
b. Can be multi-step: multiple genesis files can be applied idempotently, particularly in forking mode (when you fork a network that has bedrock contracts but not interop contracts, for instance).
174
-
c. Genesis-applier should work as a standalone tool: if a developer is using Anvil outside the context of the orchestrator, they should be able to use genesis-applier to apply genesis state to their instance. In the context of supersim, the `orchestrator` will use the `genesis-applier` to apply the needed genesis state to the anvil instances it is running.
177
+
i. The genesis files needed will differ depending on whether the user is in vanilla or forked mode, and forked mode is unlikely to need anything other than the interop contracts initially.
178
+
ii. Can be multi-step: multiple genesis files can be applied idempotently, particularly in forking mode (when you fork a network that has bedrock contracts but not interop contracts, for instance).
179
+
iii. Genesis-applier should work as a standalone tool: if a developer is using Anvil outside the context of the orchestrator, they should be able to use genesis-applier to apply genesis state to their instance. In the context of supersim, the `orchestrator` will use the `genesis-applier` to apply the needed genesis state to the anvil instances it is running.
175
180
176
181
4. **Chain-config-loader**: Downloads the latest chain config from the superchain registry to allow the orchestrator to apply needed configs to anvil instances. Should be a standalone tool that works with the orchestrator but could be used directly on local testing nodes.
177
182
178
183
5. **L2-fork-state-finder**: From an L1 reference block, runs an algorithm to identify the latest L2 height derived from the L1 block for each network.
179
184
180
185
6. **Op-simulator**: Proxy server in front of anvil instances that simulates op-stack services without the real derivation pipeline.
181
186
182
-
a. Simulates deposits by listening to the `optimismPortal` and forwarding deposit txs via `eth_sendRawTransaction`.
183
-
b. Implements `eth_sendRawTransaction` and first applies any necessary out-of-protocol validation such as the interop spec variants.
184
-
c. Calls `eth_getLog` on other chains to fetch event logs for invariant checks.
185
-
d. All other rpc calls are proxied by the orchestrator to the anvil instances.
186
-
e. **Withdrawal pathway to Ethereum is not supported** (at least to start)
187
+
i. Simulates deposits by listening to the `optimismPortal` and forwarding deposit txs via `eth_sendRawTransaction`.
188
+
ii. Implements `eth_sendRawTransaction` and first applies any necessary out-of-protocol validation such as the interop spec variants.
189
+
iii. Calls `eth_getLog` on other chains to fetch event logs for invariant checks.
190
+
iv. All other rpc calls are proxied by the orchestrator to the anvil instances.
191
+
v. **Withdrawal pathway to Ethereum is not supported** (at least to start)
0 commit comments