Skip to content

Commit 338f784

Browse files
committed
wip: update readme
1 parent 4fccaf8 commit 338f784

File tree

2 files changed

+48
-10
lines changed

2 files changed

+48
-10
lines changed

README.md

Lines changed: 47 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,23 @@
11
# The Signet Block Builder
22

3-
The Builder is responsible for transactions through the Signet rollup, from ingestion and simulation to block construction and submission to Ethereum L1.
3+
The Builder simulates bundles and transactions against the latest chain state to create valid Signet rollup blocks and submits them to the configured host chain as an [EIP-4844 transaction](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-4844.md).
4+
5+
Bundles are treated as Flashbots-style bundles, meaning that the Builder should respect transaction ordering, bundle atomicity, and the specified revertability.
46

57
---
68

79
## 🚀 System Design
810

9-
The Builder orchestrates a series of asynchronous actors that work together to:
11+
The Builder orchestrates a series of asynchronous actors that work together to build blocks for every assigned slot.
1012

1113
1. **Env** - watches the latest host and rollup blocks to monitor gas rates and block updates.
1214
2. **Cache** - polls bundle and transaction caches and adds them to the cache.
13-
3. **Simulator** - simulates transactions against rollup state and block environment to build them into a cohesive block.
14-
5. **Submit** - builds a blob transaction of the built block and sends it to Ethereum L1.
15-
6. **Metrics** - records block and tx data.
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 Ethereum L1.
17+
6. **Metrics** - records block and tx data over time.
1618

1719
```mermaid
20+
%%{ init : { "theme" : "dark" } }%%
1821
flowchart TD
1922
%% ────────────── INITIALIZATION ──────────────
2023
A0(["Start main"]) --> A1[Init tracing & logging]
@@ -30,11 +33,11 @@ flowchart TD
3033
end
3134
3235
%% ────────────── CONNECTIONS & DATA FLOW ──────────────
33-
A2_BuilderConfig --> A4_Providers["Connect Providers"]
34-
35-
A4_Providers -.host_provider.-> MetricsTaskActor
36-
A4_Providers -.host_provider.->SubmitTaskActor
37-
A4_Providers -.ru_provider.-> SimulatorTaskActor
36+
A2_BuilderConfig -.host_provider.-> MetricsTaskActor
37+
A2_BuilderConfig -.host_provider.->SubmitTaskActor
38+
A2_BuilderConfig -.ru_provider.-> SimulatorTaskActor
39+
A2_BuilderConfig -.host_provider.-> EnvTaskActor
40+
A2_BuilderConfig -.ru_provider.-> EnvTaskActor
3841
3942
EnvTaskActor ==block_env==> SimulatorTaskActor
4043
CacheSystem ==sim_cache ==> SimulatorTaskActor
@@ -73,6 +76,36 @@ The Builder is configured via environment variables. The following values are su
7376

7477
---
7578

79+
## 💾 EVM Behavior
80+
81+
### 🗿 Inherited Header Values
82+
83+
`PREVRANDAO` is set to a random byte string for each block.
84+
85+
```rust
86+
// `src/tasks/env.rs`
87+
prevrandao: Some(B256::random()),
88+
```
89+
90+
`TIMESTAMP` - Block timestamps are set to the same value as the current Ethereum block.
91+
92+
Blob gas values `excess_blob_gas` and `blob_gasprice` are also set to 0 for all Signet blocks.
93+
94+
### 🔢 Disabled Opcodes
95+
96+
`BLOBHASH` - EIP-4844 is not supported on Signet.
97+
`BLOBBASEFEE` - EIP4844 is not supported.
98+
99+
## ⛽ Transaction Submission
100+
101+
When a completed, non-empty Signet block is received by the Submit task, it prepares the block data into a blob transaction and submits it to the network.
102+
103+
If it fails, it will retry up to 3 times with a 12.5% bump on each retry.
104+
105+
The previous header's basefee is tracked through the build loop and used for gas estimation purposes in the Submit Task.
106+
107+
---
108+
76109
## 📤 Transaction Sender
77110

78111
A binary (`bin/submit-transaction.rs`) for continously sending very small transactions for testing block construction.
@@ -87,6 +120,10 @@ The following values are available for configuring the transaction sender:
87120
| `SIGNER_CHAIN_ID` | Yes | Chain ID used for signing |
88121
| `SIGNER_KEY` | Yes | Signing key used to sign the transaction |
89122

123+
The transaction submitter is located at `bin/submit_transaction.rs`.
124+
125+
Run the transaction submitter with `cargo run --bin transaction-submitter`
126+
90127
---
91128

92129
## 🛠️ Development

src/test_utils.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ pub fn setup_test_config() -> Result<BuilderConfig> {
4545
1740681556, // pecorino start timestamp as sane default
4646
0, 1,
4747
),
48+
block_confirmation_buffer: todo!(),
4849
};
4950
Ok(config)
5051
}

0 commit comments

Comments
 (0)