Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

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).

Bundles are treated as Flashbots-style bundles, meaning that the Builder should respect transaction ordering, bundle atomicity, and the specified revertability.
Bundles are treated as MEV-style bundles, meaning that the Builder should respect transaction ordering, bundle atomicity, and the specified revertability.

--------------------------------------------------------------------------------

Expand All @@ -16,7 +16,7 @@ The Builder orchestrates a series of asynchronous actors that work together to b
1. **Env** - watches the latest host and rollup blocks to monitor gas rates and block updates.
2. **Cache** - polls bundle and transaction caches and adds them to the cache.
3. **Simulator** - simulates transactions and bundles against rollup state and block environment to build them into a cohesive block.
4. **FlashbotsSubmit** - handles preparing and submitting the simulated block to a private Flashbots relay.
4. **Submit** - handles preparing and submitting the simulated block to all configured MEV relay/builder endpoints concurrently.
5. **Metrics** - records block and tx data over time.

```mermaid
Expand All @@ -36,32 +36,32 @@ flowchart TD
Cache["🪏 Cache Task"]
Simulator["💾 Simulator Task"]
Metrics["📏 Metrics Task"]
FlashbotsSubmit["📥 Flashbots Submit Task"]
SubmitTask["📥 Submit Task"]
end

%% Signing
FlashbotsSubmit --hash--> Quincey
Quincey -- signature --> FlashbotsSubmit
SubmitTask --hash--> Quincey
Quincey -- signature --> SubmitTask

%% Config wiring
Config -.rollup rpc.-> Env
Config -.host rpc.-> Env
Config -.host rpc.-> Simulator
Config -.rollup rpc.-> Simulator
Config -.host rpc.-> Metrics
Config -.host rpc.-> FlashbotsSubmit
Config -.host rpc.-> SubmitTask

%% Core flow
Env ==block env==> Simulator
Cache ==sim cache==> Simulator
Simulator ==built block==> FlashbotsSubmit
Simulator ==built block==> SubmitTask

%% Network submission
FlashbotsSubmit ==>|"tx bundle"| FlashbotsRelay["🛡️ Flashbots Relay"]
FlashbotsRelay ==> Ethereum
SubmitTask ==>|"tx bundle"| Relays["🛡️ MEV Relays / Builders"]
Relays ==> Ethereum

%% Metrics
FlashbotsSubmit ==rollup block tx hash==> Metrics
SubmitTask ==rollup block tx hash==> Metrics
```

### 💾 Simulation Task
Expand All @@ -76,11 +76,11 @@ When the deadline is reached, the simulator is stopped, and all open simulation

### ✨ Submit Task

The Flashbots submit task prepares a Flashbots bundle out of the Signet block and its host transactions and then submits that bundle to the Flashbots endpoint. It sends the hash of the rollup block transaction for to the Metrics task for further tracking.
The submit task prepares a MEV bundle from the Signet block and its host transactions, then fans it out to all configured relay/builder endpoints concurrently (`SUBMIT_ENDPOINTS`). At least one successful relay acceptance is required; individual relay failures are tolerated and logged. The blob sidecar is always forwarded to Pylon regardless of relay outcome.

If the block received from simulation is empty, the submit task will ignore it.

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.
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.

--------------------------------------------------------------------------------

Expand All @@ -97,7 +97,7 @@ The Builder is configured via environment variables. The following values are su
| `QUINCEY_URL` | Yes | Remote sequencer signing endpoint |
| `SEQUENCER_KEY` | No | AWS Key ID _OR_ local private key for the Sequencer; set IFF using local Sequencer signing instead of remote (via `QUINCEY_URL`) Quincey signing |
| `TX_POOL_URL` | Yes | Transaction pool URL |
| `FLASHBOTS_ENDPOINT` | No | Flashbots API to submit blocks to |
| `SUBMIT_ENDPOINTS` | Yes | Comma-separated list of MEV relay/builder RPC endpoints for bundle submission (e.g. `https://rpc.flashbots.net,https://rpc.titanbuilder.xyz`) |
| `ROLLUP_BLOCK_GAS_LIMIT` | No | Override for rollup block gas limit |
| `MAX_HOST_GAS_COEFFICIENT` | No | Optional maximum host gas coefficient, as a percentage, to use when building blocks |
| `BUILDER_KEY` | Yes | AWS KMS key ID _or_ local private key for builder signing |
Expand Down
4 changes: 2 additions & 2 deletions bin/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use builder::{
service::serve_builder,
tasks::{
block::sim::SimulatorTask, cache::CacheTasks, env::EnvTask, metrics::MetricsTask,
submit::FlashbotsTask,
submit::SubmitTask,
},
};
use eyre::bail;
Expand Down Expand Up @@ -80,7 +80,7 @@ async fn main() -> eyre::Result<()> {
// Set up the cache, submit, and simulator tasks
let cache_tasks = CacheTasks::new(block_env.clone());
let (submit_task, simulator_task) =
tokio::try_join!(FlashbotsTask::new(tx_channel.clone()), SimulatorTask::new(block_env),)?;
tokio::try_join!(SubmitTask::new(tx_channel.clone()), SimulatorTask::new(block_env),)?;

// Spawn the cache, submit, and simulator tasks
let cache_system = cache_tasks.spawn();
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ pub struct BuilderConfig {
)]
pub block_query_cutoff_buffer: OptionalU64WithDefault<3000>,

/// Number of milliseconds before the end of the slot by which bundle submission to Flashbots must complete.
/// Number of milliseconds before the end of the slot by which bundle submission must complete.
/// If submission completes after this deadline, a warning is logged.
#[from_env(
var = "SUBMIT_DEADLINE_BUFFER",
Expand Down
6 changes: 3 additions & 3 deletions src/tasks/submit/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/// Submission logic for Flashbots
pub mod flashbots;
pub use flashbots::FlashbotsTask;
/// Bundle submission to MEV relay/builder endpoints.
pub mod task;
pub use task::SubmitTask;

mod prep;
pub use prep::{Bumpable, SubmitPrep};
Expand Down
4 changes: 2 additions & 2 deletions src/tasks/submit/prep.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ use signet_zenith::Zenith;
use tokio::try_join;
use tracing::{Instrument, debug, error, instrument, warn};

/// Preparation logic for transactions issued to the host chain by the [`FlashbotsTask`].
/// Preparation logic for transactions issued to the host chain by the [`SubmitTask`].
///
/// [`FlashbotsTask`]: crate::tasks::submit::FlashbotsTask
/// [`SubmitTask`]: crate::tasks::submit::SubmitTask
#[derive(Debug, Clone)]
pub struct SubmitPrep<'a> {
// The block we are preparing a transaction for
Expand Down
Loading
Loading