Skip to content

Commit 7405f84

Browse files
committed
Change formatting
1 parent 283a9d6 commit 7405f84

File tree

1 file changed

+40
-35
lines changed

1 file changed

+40
-35
lines changed

ecosystem/supersim.md

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -59,44 +59,49 @@ The **orchestrator** is responsible for spinning up the requested number of **an
5959
6060
The flow of this tool will differ depending on whether the user opts for **vanilla** mode or **forking** mode.
6161
62-
1. **Vanilla mode**:
62+
#### Vanilla mode
6363
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
6970
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.
7677
7778
7879
### Interfaces
7980
80-
1. **Orchestrator** interface provides the following to the developer:
81+
#### Orchestrator interface provides the following to the developer:
8182
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:
8788
8889
i. File upload: upload genesis files
8990
ii. Genesis history: list of applied genesis states with timestamps/details
9091
iii. Apply button/command: apply the selected genesis state to the chosen instances.
9192
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.
9394
9495
i. Config list: display available configurations from the registry
9596
ii. Download button/command for the selected configuration
9697
iii. Apply button/command
9798
iv. Configuration details: show detailed information about the selected configuration
9899
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.
100105
101106
```mermaid
102107
flowchart TD
@@ -155,35 +160,35 @@ Given the application flow, the following services will be part of supersim:
155160
156161
1. **Orchestrator**: This is the main focus and interface for developers using supersim.
157162
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
160165
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.
163168
164169
2. **Anvil Instances**: Anvil instances are run by the orchestrator after initial prep work to allow them to mirror the Superchain interop environment.
165170
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.
169174
170175
3. **Genesis-applier** : The `genesis-applier` takes genesis files output by the monorepo and applies them to anvil instances.
171176
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.
175180
176181
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.
177182
178183
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.
179184
180185
6. **Op-simulator**: Proxy server in front of anvil instances that simulates op-stack services without the real derivation pipeline.
181186
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)
187192
188193
### Sequence Diagram
189194

0 commit comments

Comments
 (0)