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: README.md
+67-61Lines changed: 67 additions & 61 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,82 +8,88 @@ Bundles are treated as Flashbots-style bundles, meaning that the Builder should
8
8
9
9
## 🚀 System Design
10
10
11
-
The Builder orchestrates a set of asynchronous actors that collaborate to build and submit Signet rollup blocks for every assigned slot. The core components are:
11
+
The Builder orchestrates a series of asynchronous actors that work together to build blocks for every assigned slot.
12
12
13
-
1.**Env**— watches host and rollup chain headers and maintains the block environment used for simulation.
14
-
2.**Cache**— ingests transactions and bundles from configured sources and exposes a simulation view.
15
-
3.**Simulator**— applies transactions and bundles against the rollup state and block environment to assemble a candidate Signet block.
16
-
4.**Submit**— takes a successfully built block and routes it to the configured submission path (either a private MEV bundle relay or direct L1 broadcast via the builder helper).
17
-
5.**Metrics** — records runtime metrics, submit receipts, and block statistics.
18
-
19
-
Below is a high-level architecture diagram that shows both submission options: direct L1 submission (Builder Helper) and private MEV bundle submission (Flashbots relay).
13
+
1.**Env**- watches the latest host and rollup blocks to monitor gas rates and block updates.
14
+
2.**Cache**- polls bundle and transaction caches and adds them to the cache.
15
+
3.**Simulator**- simulates transactions and bundles against rollup state and block environment to build them into a cohesive block.
16
+
5.**Submit**- creates a blob transaction from the built block and sends it to the configured submit task.
17
+
1. Flashbots - builds a Flashbots bundle out of the Signet block which contains Signet transactions, host transactions, and host fills, and submits it to the configured Flashbots endpoint.
18
+
2. Builder Helper - builds a transaction call with the builder helper contract and submits that as a transaction.
19
+
6.**Metrics** - records block and tx data over time.
The simulation loop waits for a new block environment from the host chain, then starts a simulation window for the current slot. The Builder takes a reference to the transaction cache and computes a deadline (default: slot end minus 1.5s buffer) to stop simulating and finalize the block.
76
+
The block building loop waits until a new block environment has been received, and then kicks off the next attempt.
73
77
74
-
Transactions flow from the cache into the simulator. Applied transactions are kept and assembled into the candidate block; failing transactions are ignored. When the simulation deadline arrives, the simulator cancels remaining work, captures the built block and the block environment it was simulated against, and forwards them to the Submit task.
78
+
When the Builder receives a new block, it takes a reference to the transaction cache, calculates a simulation deadline for the current slot with a buffer of 1.5 seconds, and begins constructing a block for the current slot.
75
79
76
-
### Submit Task
80
+
Transactions enter through the cache, and then they're sent to the simulator, where they're run against the latest chain state and block environment. If they're successfully applied, they're added to the block. If a transaction fails to be applied, it is simply ignored.
77
81
78
-
The Submit task will route the built block to one of two paths, depending on configuration:
82
+
When the deadline is reached, the simulator is stopped, and all open simulation threads are cancelled. The built block is then bundled with the block environment and the previous host header that it was simulated against, and all three are passed along to the submit task.
83
+
84
+
### Submit Task
79
85
80
-
- Flashbots (private MEV relay): when `FLASHBOTS_ENDPOINT` is configured, the Submit task prepares an MEV-style bundle containing the Signet block (plus any host transactions/fills as needed) and submits it to the configured relay. The builder expects a bundle hash in the response and records it in metrics.
86
+
If Flashbots endpoint has been configured the Flashbots submit task will prepare a Flashbots bundle out of that Signet block, and then submits that bundle to the Flashbots endpoint.
81
87
82
-
- Builder Helper (direct L1 broadcast): when no Flashbots endpoint is configured, the Submit task composes a builder-helper contract call and broadcasts it to the mempool as a normal transaction. This path is intended for testing and private deployments; broadcasting raw Signet block data publicly may leak sensitive information.
88
+
If a Flashbots endpoint has _not_ been configured, the Builder will create a raw contract call and submits the transaction to the default mempool. This is only for testing on private networks and should not be used in production, since it can leak sensitive transaction data from the Signet block.
83
89
84
-
If the simulated block is empty, the Submit task will drop it and continue.
90
+
If the block received from simulation is empty, the submit task will ignore it.
85
91
86
-
If the submit path requires a signature (Quincey), the submit task requests one; on an authorization failure (e.g. 403) the submit task will skip the slot and resume on the next.
92
+
Finally, if it's non-empty, the submit task attempts to get a signature for the block, and if it fails due to a 403 error, it will skip the current slot and begin waiting for the next block.
0 commit comments